Working AHCI DMA IPC from yellowstone to denali.

We have a weird bug in context switching where a process's rsp0 ends up
pointing at the wrong value sometimes which crashes the OS.
This commit is contained in:
Drew Galbraith 2023-06-16 01:31:23 -07:00
parent ccfe1b15ab
commit e5da93757a
11 changed files with 171 additions and 84 deletions

View file

@ -4,6 +4,7 @@
#include <zerrors.h>
#include "ahci/ahci.h"
#include "ahci/command.h"
class AhciDevice {
public:
@ -15,11 +16,13 @@ class AhciDevice {
bool IsInit() { return port_struct_ != nullptr && command_structures_; }
z_err_t SendIdentify();
void HandleIdentify();
z_err_t IssueCommand(Command* command);
void HandleIrq();
AhciDevice(const AhciDevice&) = delete;
AhciDevice& operator=(const AhciDevice&) = delete;
private:
AhciPort* port_struct_ = nullptr;
MappedMemoryRegion command_structures_;
@ -28,10 +31,6 @@ class AhciDevice {
ReceivedFis* received_fis_ = nullptr;
CommandTable* command_table_ = nullptr;
struct Command {
MappedMemoryRegion region;
// std::function<void(MappedMemoryRegion)> callback;
};
Command commands_[32];
uint32_t commands_issued_ = 0;
Command* commands_[32];
volatile uint32_t commands_issued_ = 0;
};