Now uses the new BeOS compatible area calls.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4316 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
5d4b10645c
commit
beb1a1b992
@ -504,27 +504,23 @@ map_image(int fd, char const *path, image_t *image, bool fixed)
|
||||
* but only the first segment gets a free ride
|
||||
*/
|
||||
load_address = 0;
|
||||
addr_specifier = REGION_ADDR_ANY_ADDRESS;
|
||||
addr_specifier = B_ANY_ADDRESS;
|
||||
} else {
|
||||
load_address = image->regions[i].vmstart + image->regions[i-1].delta;
|
||||
addr_specifier = REGION_ADDR_EXACT_ADDRESS;
|
||||
addr_specifier = B_EXACT_ADDRESS;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* not relocatable, put it where it asks or die trying
|
||||
*/
|
||||
load_address = image->regions[i].vmstart;
|
||||
addr_specifier = REGION_ADDR_EXACT_ADDRESS;
|
||||
addr_specifier = B_EXACT_ADDRESS;
|
||||
}
|
||||
|
||||
if (image->regions[i].flags & RFLAG_ANON) {
|
||||
image->regions[i].id = sys_vm_create_anonymous_region(
|
||||
region_name,
|
||||
(void **)&load_address,
|
||||
addr_specifier,
|
||||
image->regions[i].vmsize,
|
||||
REGION_WIRING_LAZY,
|
||||
LOCK_RW);
|
||||
image->regions[i].id = _kern_create_area(region_name, (void **)&load_address,
|
||||
addr_specifier, image->regions[i].vmsize, B_NO_LOCK,
|
||||
B_READ_AREA | B_WRITE_AREA);
|
||||
|
||||
if (image->regions[i].id < 0)
|
||||
goto error;
|
||||
@ -582,7 +578,7 @@ unmap_image(image_t *image)
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < image->num_regions; i++) {
|
||||
sys_vm_delete_region(image->regions[i].id);
|
||||
_kern_delete_area(image->regions[i].id);
|
||||
|
||||
image->regions[i].id = -1;
|
||||
}
|
||||
|
@ -35,13 +35,9 @@ static char *rld_ptr;
|
||||
void
|
||||
rldheap_init(void)
|
||||
{
|
||||
rld_region = sys_vm_create_anonymous_region(
|
||||
(char *)names[sys_get_current_team_id() % (sizeof(names) / sizeof(names[0]))],
|
||||
(void **)&rld_base,
|
||||
REGION_ADDR_ANY_ADDRESS,
|
||||
RLD_SCRATCH_SIZE,
|
||||
REGION_WIRING_LAZY,
|
||||
LOCK_RW);
|
||||
rld_region = _kern_create_area((char *)names[sys_get_current_team_id() % (sizeof(names) / sizeof(names[0]))],
|
||||
(void **)&rld_base, B_ANY_ADDRESS, RLD_SCRATCH_SIZE,
|
||||
B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
|
||||
|
||||
/*
|
||||
* Fill in the gap upto RLD_PROGRAM_BASE,
|
||||
@ -51,12 +47,9 @@ rldheap_init(void)
|
||||
* Not doing these leads to some funny troubles with some
|
||||
* libraries.
|
||||
*/
|
||||
rld_region_2 = sys_vm_create_anonymous_region("RLD_padding",
|
||||
(void **)&rld_base_2,
|
||||
REGION_ADDR_ANY_ADDRESS,
|
||||
RLD_PROGRAM_BASE - (uint32)(rld_base + RLD_SCRATCH_SIZE),
|
||||
REGION_WIRING_LAZY,
|
||||
LOCK_RW);
|
||||
rld_region_2 = _kern_create_area("RLD_padding", (void **)&rld_base_2,
|
||||
B_ANY_ADDRESS, RLD_PROGRAM_BASE - (uint32)(rld_base + RLD_SCRATCH_SIZE),
|
||||
B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
|
||||
|
||||
rld_ptr = rld_base;
|
||||
}
|
||||
|
@ -78,12 +78,13 @@ int hoardGetNumProcessors (void)
|
||||
static region_id heap_region = -1;
|
||||
static addr brk;
|
||||
|
||||
int __heap_init()
|
||||
int
|
||||
__heap_init()
|
||||
{
|
||||
// XXX do something better here
|
||||
if(heap_region < 0) {
|
||||
heap_region = sys_vm_create_anonymous_region("heap", (void **)&brk,
|
||||
REGION_ADDR_ANY_ADDRESS, 4*1024*1024, REGION_WIRING_LAZY, LOCK_RW);
|
||||
if (heap_region < 0) {
|
||||
heap_region = create_area("heap", (void **)&brk,
|
||||
B_ANY_ADDRESS, 4*1024*1024, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user