Small hack to get create_area() to create valid r/w areas in the kernel

(in BeOS, all kernel areas are r/w).
If you use B_READ_AREA/B_WRITE_AREA flags, you make the area readable
or even writeable from userland!


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7700 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-05-31 21:43:57 +00:00
parent 9d9a07acd8
commit 73e40f2d6e

View File

@ -2385,7 +2385,7 @@ map_physical_memory(const char *name, void *physicalAddress, size_t numBytes,
if (convertAddressSpec(&addressSpec) < B_OK)
return B_BAD_VALUE;
protection = PROTECTION_TO_LOCK(protection) | LOCK_KERNEL;
protection = PROTECTION_TO_LOCK(protection) | LOCK_KERNEL | LOCK_RW;
return vm_map_physical_memory(vm_get_kernel_aspace_id(), name, _virtualAddress,
addressSpec, numBytes, protection, (addr)physicalAddress);
@ -2433,7 +2433,7 @@ create_area(const char *name, void **address, uint32 addressSpec, size_t size, u
case B_ANY_KERNEL_ADDRESS:
case B_EXACT_KERNEL_ADDRESS:
areaSpace = vm_get_kernel_aspace_id();
protection |= LOCK_KERNEL;
protection |= LOCK_KERNEL | LOCK_RW;
// That's required for BeOS compatibility...
// create_area_etc() doesn't do this, though
break;