[Denali] Add a simpler command method and use it to send identify.
This commit is contained in:
parent
e71017070f
commit
3e1da2bc90
4 changed files with 76 additions and 48 deletions
|
|
@ -8,6 +8,13 @@
|
|||
|
||||
class AhciPort;
|
||||
|
||||
struct CommandInfo {
|
||||
uint8_t command;
|
||||
uint64_t lba;
|
||||
uint16_t sectors;
|
||||
uint64_t paddr;
|
||||
};
|
||||
|
||||
class Command {
|
||||
public:
|
||||
Command() = default;
|
||||
|
|
@ -16,21 +23,6 @@ class Command {
|
|||
virtual void PopulatePrdt(PhysicalRegionDescriptor* prdt) const = 0;
|
||||
};
|
||||
|
||||
class IdentifyDeviceCommand : public Command {
|
||||
public:
|
||||
IdentifyDeviceCommand(AhciPort* port) : port_(port) {}
|
||||
virtual void PopulateFis(uint8_t* command_fis) const override;
|
||||
virtual void PopulatePrdt(PhysicalRegionDescriptor* prdt) const override;
|
||||
|
||||
void OnComplete();
|
||||
|
||||
private:
|
||||
AhciPort* port_;
|
||||
uint64_t paddr_;
|
||||
mmth::OwnedMemoryRegion identify_ =
|
||||
mmth::OwnedMemoryRegion::ContiguousPhysical(0x200, &paddr_);
|
||||
};
|
||||
|
||||
class DmaReadCommand : public Command {
|
||||
public:
|
||||
DmaReadCommand(uint64_t lba, uint64_t sector_cnt, uint64_t dest_paddr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue