mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:17:34 +00:00
Kernel: Pass 'prot' argument to File::mmap() and act on it.
Nothing crazy, this just means that PROT_READ allocates readable regions, and that PROT_WRITE allocates writable ones.
This commit is contained in:
parent
004a630bfe
commit
66c1a9be3b
7 changed files with 11 additions and 9 deletions
|
@ -84,7 +84,7 @@ dword BXVGADevice::find_framebuffer_address()
|
|||
return framebuffer_address;
|
||||
}
|
||||
|
||||
KResultOr<Region*> BXVGADevice::mmap(Process& process, LinearAddress preferred_laddr, size_t offset, size_t size)
|
||||
KResultOr<Region*> BXVGADevice::mmap(Process& process, LinearAddress preferred_laddr, size_t offset, size_t size, int prot)
|
||||
{
|
||||
ASSERT(offset == 0);
|
||||
ASSERT(size == framebuffer_size_in_bytes());
|
||||
|
@ -95,7 +95,9 @@ KResultOr<Region*> BXVGADevice::mmap(Process& process, LinearAddress preferred_l
|
|||
move(vmo),
|
||||
0,
|
||||
"BXVGA Framebuffer",
|
||||
true, true);
|
||||
prot & PROT_READ,
|
||||
prot & PROT_WRITE
|
||||
);
|
||||
kprintf("BXVGA: %s(%u) created Region{%p} with size %u for framebuffer P%x with laddr L%x\n",
|
||||
process.name().characters(), process.pid(),
|
||||
region, region->size(), framebuffer_address().as_ptr(), region->laddr().get());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue