Replaced some more vm_*() calls with BeOS compatible ones.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4355 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
0fd7b49819
commit
8655936935
@ -622,11 +622,8 @@ elf_load_uspace(const char *path, struct team *p, int flags, addr *entry)
|
||||
sprintf(regionName, "%s_bss%d", baseName, 'X');
|
||||
|
||||
regionAddress += fileUpperBound;
|
||||
id = vm_create_anonymous_region(p->_aspace_id, regionName,
|
||||
(void **)®ionAddress,
|
||||
REGION_ADDR_EXACT_ADDRESS,
|
||||
bss_size,
|
||||
REGION_WIRING_LAZY, LOCK_RW);
|
||||
id = create_area_etc(p, regionName, (void **)®ionAddress,
|
||||
B_EXACT_ADDRESS, bss_size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
|
||||
if (id < 0) {
|
||||
dprintf("error allocating bss region: %s!\n", strerror(id));
|
||||
err = ERR_INVALID_BINARY;
|
||||
@ -963,7 +960,7 @@ error0:
|
||||
int
|
||||
elf_init(kernel_args *ka)
|
||||
{
|
||||
vm_region_info rinfo;
|
||||
area_info areaInfo;
|
||||
|
||||
mutex_init(&image_lock, "kimages_lock");
|
||||
mutex_init(&image_load_lock, "kimages_load_lock");
|
||||
@ -974,20 +971,22 @@ elf_init(kernel_args *ka)
|
||||
kernel_image->name = strdup("kernel");
|
||||
|
||||
// text segment
|
||||
kernel_image->regions[0].id = vm_find_region_by_name(vm_get_kernel_aspace_id(), "kernel_ro");
|
||||
if(kernel_image->regions[0].id < 0)
|
||||
kernel_image->regions[0].id = find_area("kernel_ro");
|
||||
if (kernel_image->regions[0].id < 0)
|
||||
panic("elf_init: could not look up kernel text segment region\n");
|
||||
vm_get_region_info(kernel_image->regions[0].id, &rinfo);
|
||||
kernel_image->regions[0].start = rinfo.base;
|
||||
kernel_image->regions[0].size = rinfo.size;
|
||||
|
||||
get_area_info(kernel_image->regions[0].id, &areaInfo);
|
||||
kernel_image->regions[0].start = areaInfo.address;
|
||||
kernel_image->regions[0].size = areaInfo.size;
|
||||
|
||||
// data segment
|
||||
kernel_image->regions[1].id = vm_find_region_by_name(vm_get_kernel_aspace_id(), "kernel_rw");
|
||||
if(kernel_image->regions[1].id < 0)
|
||||
kernel_image->regions[1].id = find_area("kernel_rw");
|
||||
if (kernel_image->regions[1].id < 0)
|
||||
panic("elf_init: could not look up kernel data segment region\n");
|
||||
vm_get_region_info(kernel_image->regions[1].id, &rinfo);
|
||||
kernel_image->regions[1].start = rinfo.base;
|
||||
kernel_image->regions[1].size = rinfo.size;
|
||||
|
||||
get_area_info(kernel_image->regions[1].id, &areaInfo);
|
||||
kernel_image->regions[1].start = areaInfo.address;
|
||||
kernel_image->regions[1].size = areaInfo.size;
|
||||
|
||||
// we know where the dynamic section is
|
||||
kernel_image->dynamic_ptr = (addr)ka->kernel_dynamic_section_addr.start;
|
||||
|
@ -1064,22 +1064,22 @@ static struct fs_ops bootfs_ops = {
|
||||
status_t
|
||||
bootstrap_bootfs(void)
|
||||
{
|
||||
region_id rid;
|
||||
vm_region_info rinfo;
|
||||
area_id area;
|
||||
area_info areaInfo;
|
||||
|
||||
dprintf("bootstrap_bootfs: entry\n");
|
||||
TRACE(("bootstrap_bootfs: entry\n"));
|
||||
|
||||
// find the bootdir and set it up
|
||||
rid = vm_find_region_by_name(vm_get_kernel_aspace_id(), "bootdir");
|
||||
if (rid < 0)
|
||||
area = find_area("bootdir");
|
||||
if (area < 0)
|
||||
panic("bootstrap_bootfs: no bootdir area found!\n");
|
||||
|
||||
vm_get_region_info(rid, &rinfo);
|
||||
bootdir = (char *)rinfo.base;
|
||||
bootdir_len = rinfo.size;
|
||||
bootdir_region = rinfo.id;
|
||||
get_area_info(area, &areaInfo);
|
||||
bootdir = (char *)areaInfo.address;
|
||||
bootdir_len = areaInfo.size;
|
||||
bootdir_region = areaInfo.area;
|
||||
|
||||
dprintf("bootstrap_bootfs: found bootdir at %p\n", bootdir);
|
||||
TRACE(("bootstrap_bootfs: found bootdir at %p\n", bootdir));
|
||||
|
||||
return vfs_register_filesystem("bootfs", &bootfs_ops);
|
||||
}
|
||||
|
@ -1059,7 +1059,7 @@ thread_init(kernel_args *ka)
|
||||
t->state = B_THREAD_RUNNING;
|
||||
t->next_state = B_THREAD_READY;
|
||||
sprintf(temp, "idle_thread%d_kstack", i);
|
||||
t->kernel_stack_region_id = vm_find_region_by_name(vm_get_kernel_aspace_id(), temp);
|
||||
t->kernel_stack_region_id = find_area(temp);
|
||||
region = vm_get_region_by_id(t->kernel_stack_region_id);
|
||||
if (!region)
|
||||
panic("error finding idle kstack region\n");
|
||||
|
Loading…
Reference in New Issue
Block a user