[Mammoth] Get rid of last uses of MappedMemoryRegion.
This commit is contained in:
parent
d41a565721
commit
344e84c313
6 changed files with 20 additions and 56 deletions
|
|
@ -192,7 +192,7 @@ glcr::ErrorCode AhciDriver::RegisterIrq() {
|
|||
|
||||
glcr::ErrorCode AhciDriver::LoadHbaRegisters() {
|
||||
ahci_region_ =
|
||||
MappedMemoryRegion::DirectPhysical(pci_device_header_->abar, 0x1100);
|
||||
OwnedMemoryRegion ::DirectPhysical(pci_device_header_->abar, 0x1100);
|
||||
ahci_hba_ = reinterpret_cast<AhciHba*>(ahci_region_.vaddr());
|
||||
num_ports_ = (ahci_hba_->capabilities & 0x1F) + 1;
|
||||
num_commands_ = ((ahci_hba_->capabilities & 0x1F00) >> 8) + 1;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class AhciDriver {
|
|||
private:
|
||||
OwnedMemoryRegion pci_region_;
|
||||
PciDeviceHeader* pci_device_header_ = nullptr;
|
||||
MappedMemoryRegion ahci_region_;
|
||||
OwnedMemoryRegion ahci_region_;
|
||||
AhciHba* ahci_hba_ = nullptr;
|
||||
|
||||
// TODO: Allocate these dynamically.
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
#include "framebuffer/framebuffer.h"
|
||||
|
||||
#include <mammoth/memory_region.h>
|
||||
|
||||
Framebuffer::Framebuffer(const FramebufferInfo& info) : fb_info_(info) {
|
||||
uint64_t buff_size_bytes = fb_info_.height() * fb_info_.pitch();
|
||||
MappedMemoryRegion region = MappedMemoryRegion::DirectPhysical(
|
||||
fb_info_.address_phys(), buff_size_bytes);
|
||||
fb_ = reinterpret_cast<uint32_t*>(region.vaddr());
|
||||
fb_memory_ = OwnedMemoryRegion::DirectPhysical(fb_info_.address_phys(),
|
||||
buff_size_bytes);
|
||||
fb_ = reinterpret_cast<uint32_t*>(fb_memory_.vaddr());
|
||||
}
|
||||
|
||||
void Framebuffer::DrawPixel(uint32_t row, uint32_t col, uint32_t pixel) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <mammoth/memory_region.h>
|
||||
#include <yellowstone/yellowstone.yunq.h>
|
||||
|
||||
class Framebuffer {
|
||||
|
|
@ -12,5 +13,7 @@ class Framebuffer {
|
|||
// FIXME: Implement Yunq copy or move so we
|
||||
// don't have to store a reference here.
|
||||
const FramebufferInfo& fb_info_;
|
||||
|
||||
OwnedMemoryRegion fb_memory_;
|
||||
uint32_t* fb_;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue