Allow mapping the PCI Config so Yellowstone can map it.

This is a temp system call. Evemtually we should probably supply the
root process with all of the system physical memory objects.
This commit is contained in:
Drew Galbraith 2023-06-07 22:45:42 -07:00
parent 71a601362d
commit 56789400d7
9 changed files with 126 additions and 2 deletions

View file

@ -20,11 +20,28 @@ class MemoryObject : public KernelObject {
void CopyBytesToObject(uint64_t source, uint64_t length);
protected:
// Hacky to avoid linked_list creation.
MemoryObject(uint64_t size, bool) : size_(size) {}
private:
// Always stores the full page-aligned size.
uint64_t size_;
uint64_t PageNumberToPhysAddr(uint64_t page_num);
virtual uint64_t PageNumberToPhysAddr(uint64_t page_num);
LinkedList<uint64_t> phys_page_list_;
};
class FixedMemoryObject : public MemoryObject {
public:
FixedMemoryObject(uint64_t physical_addr, uint64_t size)
: MemoryObject(size, true), physical_addr_(physical_addr) {}
private:
uint64_t physical_addr_;
uint64_t PageNumberToPhysAddr(uint64_t page_num) override {
return physical_addr_ + (0x1000 * page_num);
}
};