mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
Kernel: Add Region helpers for accessing underlying physical pages
Since a Region is basically a view into a potentially larger VMObject, it was always necessary to include the Region starting offset when accessing its underlying physical pages. Until now, you had to do that manually, but this patch adds a simple Region::physical_page() for read-only access and a physical_page_slot() when you want a mutable reference to the RefPtr<PhysicalPage> itself. A lot of code is simplified by making use of this.
This commit is contained in:
parent
8a417c311f
commit
9c856811b2
8 changed files with 64 additions and 48 deletions
|
@ -179,7 +179,7 @@ ssize_t SB16::read(FileDescription&, size_t, u8*, ssize_t)
|
|||
|
||||
void SB16::dma_start(uint32_t length)
|
||||
{
|
||||
const auto addr = m_dma_region->vmobject().physical_pages()[0]->paddr().get();
|
||||
const auto addr = m_dma_region->physical_page(0)->paddr().get();
|
||||
const u8 channel = 5; // 16-bit samples use DMA channel 5 (on the master DMA controller)
|
||||
const u8 mode = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue