[Voyageurs] Create an abstraction for managing TRBs.
This commit is contained in:
parent
2228b5b52e
commit
b41784b938
8 changed files with 78 additions and 40 deletions
26
sys/voyageurs/xhci/trb_ring.h
Normal file
26
sys/voyageurs/xhci/trb_ring.h
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/container/array_view.h>
|
||||
#include <mammoth/util/memory_region.h>
|
||||
|
||||
#include "xhci/xhci.h"
|
||||
|
||||
class TrbRing {
|
||||
public:
|
||||
TrbRing();
|
||||
|
||||
uint64_t PhysicalAddress() { return phys_address_; }
|
||||
|
||||
protected:
|
||||
uint64_t phys_address_;
|
||||
mmth::OwnedMemoryRegion page_;
|
||||
glcr::ArrayView<XhciTrb> trb_list_;
|
||||
};
|
||||
|
||||
class TrbRingWriter : public TrbRing {
|
||||
public:
|
||||
void EnqueueTrb(const XhciTrb& trb);
|
||||
|
||||
private:
|
||||
uint64_t enqueue_ptr_ = 0;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue