* During early kernel startup, we must not create areas without the

CREATE_AREA_DONT_WAIT flag; waiting at this point is not allowed.
* I hope I found all occurences, but there might be some areas left (note,
  only those that don't use B_ALREADY_WIRED are problematic).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36624 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-05-05 13:12:07 +00:00
parent 8c8fcd770a
commit 7198f76564
8 changed files with 32 additions and 25 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@ -691,9 +691,10 @@ arch_cpu_init_post_vm(kernel_args *args)
//i386_selector_init(gGDT); // pass the new gdt
// allocate an area for the double fault stacks
create_area("double fault stacks", (void**)&sDoubleFaultStacks,
B_ANY_KERNEL_ADDRESS, kDoubleFaultStackSize * smp_get_num_cpus(),
B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
create_area_etc(B_SYSTEM_TEAM, "double fault stacks",
(void**)&sDoubleFaultStacks, B_ANY_KERNEL_ADDRESS,
kDoubleFaultStackSize * smp_get_num_cpus(), B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
vm_translation_map_arch_info* kernelArchTranslationMap
= static_cast<X86VMTranslationMap*>(

View File

@ -1371,8 +1371,9 @@ arch_int_init_post_vm(struct kernel_args *args)
if (cpuCount > 0) {
size_t areaSize = ROUNDUP(cpuCount * idtSize, B_PAGE_SIZE);
desc_table* idt;
area = create_area("idt", (void**)&idt, B_ANY_KERNEL_ADDRESS,
areaSize, B_CONTIGUOUS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
area = create_area_etc(B_SYSTEM_TEAM, "idt", (void**)&idt,
B_ANY_KERNEL_ADDRESS, areaSize, B_CONTIGUOUS,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (area < 0)
return area;

View File

@ -3,7 +3,8 @@
* Distributed under the terms of the MIT License.
*/
/* Implementation of a physical page mapping strategy (PhysicalPageMapper,
/*! Implementation of a physical page mapping strategy (PhysicalPageMapper,
TranslationMapPhysicalPageMapper) suitable for machines with a lot of
memory, i.e. more than we can afford to completely map into the kernel
address space.
@ -866,9 +867,9 @@ LargeMemoryPhysicalPageMapper::_AllocatePool(PhysicalPageSlotPool*& _pool)
// structures
size_t areaSize = B_PAGE_SIZE + sizeof(PhysicalPageSlot[1024]);
void* data;
area_id dataArea = create_area("physical page pool", &data,
B_ANY_KERNEL_ADDRESS, PAGE_ALIGN(areaSize), B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
area_id dataArea = create_area_etc(B_SYSTEM_TEAM, "physical page pool",
&data, B_ANY_KERNEL_ADDRESS, PAGE_ALIGN(areaSize), B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (dataArea < 0)
return dataArea;

View File

@ -3,11 +3,13 @@
* Distributed under the terms of the MIT License.
*/
#include <debug_heap.h>
#include <new>
#include <util/AutoLock.h>
#include <vm/vm.h>
#define INITIAL_HEAP_SIZE B_PAGE_SIZE
@ -289,9 +291,9 @@ debug_heap_init()
{
// create the heap area
void* base;
area_id area = create_area("kdebug heap", (void**)&base,
area_id area = create_area_etc(B_SYSTEM_TEAM, "kdebug heap", (void**)&base,
B_ANY_KERNEL_ADDRESS, KDEBUG_HEAP, B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (area < 0)
return;

View File

@ -369,10 +369,10 @@ TracingMetaData::Create(TracingMetaData*& _metaData)
if (error != B_OK)
return error;
area = create_area("tracing log",
area = create_area_etc(B_SYSTEM_TEAM, "tracing log",
(void**)&metaData->fTraceOutputBuffer, B_ANY_KERNEL_ADDRESS,
kTraceOutputBufferSize + MAX_TRACE_SIZE, B_CONTIGUOUS,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (area < 0)
return area;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*
* Copyright 2001, Mark-Jan Bastian. All rights reserved.
@ -29,6 +29,7 @@
#include <tracing.h>
#include <util/AutoLock.h>
#include <util/list.h>
#include <vm/vm.h>
#include <wait_for_objects.h>
@ -644,9 +645,9 @@ port_init(kernel_args *args)
size_t size = sizeof(struct port_entry) * sMaxPorts;
// create and initialize ports table
sPortArea = create_area("port_table",
(void**)&sPorts, B_ANY_KERNEL_ADDRESS, size, B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
sPortArea = create_area_etc(B_SYSTEM_TEAM, "port_table", (void**)&sPorts,
B_ANY_KERNEL_ADDRESS, size, B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (sPortArea < 0) {
panic("unable to allocate kernel port table!\n");
return sPortArea;

View File

@ -1,6 +1,6 @@
/*
* Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
* Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de.
* Distributed under the terms of the MIT License.
*
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
@ -417,9 +417,9 @@ haiku_sem_init(kernel_args *args)
sMaxSems <<= 1;
// create and initialize semaphore table
area = create_area("sem_table", (void **)&sSems, B_ANY_KERNEL_ADDRESS,
sizeof(struct sem_entry) * sMaxSems, B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
area = create_area_etc(B_SYSTEM_TEAM, "sem_table", (void **)&sSems,
B_ANY_KERNEL_ADDRESS, sizeof(struct sem_entry) * sMaxSems, B_FULL_LOCK,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (area < 0)
panic("unable to allocate semaphore table!\n");

View File

@ -3652,10 +3652,11 @@ vm_init(kernel_args* args)
object_cache_set_minimum_reserve(gPageMappingsObjectCache, 1024);
#if DEBUG_CACHE_LIST
create_area("cache info table", (void**)&sCacheInfoTable,
B_ANY_KERNEL_ADDRESS,
create_area_etc(VMAddressSpace::KernelID(), "cache info table",
(void**)&sCacheInfoTable, B_ANY_KERNEL_ADDRESS,
ROUNDUP(kCacheInfoTableCount * sizeof(cache_info), B_PAGE_SIZE),
B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA);
B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0,
CREATE_AREA_DONT_WAIT);
#endif // DEBUG_CACHE_LIST
// add some debugger commands