* 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
+5 -4
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2009, Axel Dörfler, [email protected]. * Copyright 2002-2010, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. * 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 //i386_selector_init(gGDT); // pass the new gdt
// allocate an area for the double fault stacks // allocate an area for the double fault stacks
create_area("double fault stacks", (void**)&sDoubleFaultStacks, create_area_etc(B_SYSTEM_TEAM, "double fault stacks",
B_ANY_KERNEL_ADDRESS, kDoubleFaultStackSize * smp_get_num_cpus(), (void**)&sDoubleFaultStacks, B_ANY_KERNEL_ADDRESS,
B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA); 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 vm_translation_map_arch_info* kernelArchTranslationMap
= static_cast<X86VMTranslationMap*>( = static_cast<X86VMTranslationMap*>(
+3 -2
View File
@@ -1371,8 +1371,9 @@ arch_int_init_post_vm(struct kernel_args *args)
if (cpuCount > 0) { if (cpuCount > 0) {
size_t areaSize = ROUNDUP(cpuCount * idtSize, B_PAGE_SIZE); size_t areaSize = ROUNDUP(cpuCount * idtSize, B_PAGE_SIZE);
desc_table* idt; desc_table* idt;
area = create_area("idt", (void**)&idt, B_ANY_KERNEL_ADDRESS, area = create_area_etc(B_SYSTEM_TEAM, "idt", (void**)&idt,
areaSize, B_CONTIGUOUS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA); B_ANY_KERNEL_ADDRESS, areaSize, B_CONTIGUOUS,
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
if (area < 0) if (area < 0)
return area; return area;
@@ -3,7 +3,8 @@
* Distributed under the terms of the MIT License. * 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 TranslationMapPhysicalPageMapper) suitable for machines with a lot of
memory, i.e. more than we can afford to completely map into the kernel memory, i.e. more than we can afford to completely map into the kernel
address space. address space.
@@ -866,9 +867,9 @@ LargeMemoryPhysicalPageMapper::_AllocatePool(PhysicalPageSlotPool*& _pool)
// structures // structures
size_t areaSize = B_PAGE_SIZE + sizeof(PhysicalPageSlot[1024]); size_t areaSize = B_PAGE_SIZE + sizeof(PhysicalPageSlot[1024]);
void* data; void* data;
area_id dataArea = create_area("physical page pool", &data, area_id dataArea = create_area_etc(B_SYSTEM_TEAM, "physical page pool",
B_ANY_KERNEL_ADDRESS, PAGE_ALIGN(areaSize), B_FULL_LOCK, &data, B_ANY_KERNEL_ADDRESS, PAGE_ALIGN(areaSize), 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 (dataArea < 0) if (dataArea < 0)
return dataArea; return dataArea;
+4 -2
View File
@@ -3,11 +3,13 @@
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#include <debug_heap.h> #include <debug_heap.h>
#include <new> #include <new>
#include <util/AutoLock.h> #include <util/AutoLock.h>
#include <vm/vm.h>
#define INITIAL_HEAP_SIZE B_PAGE_SIZE #define INITIAL_HEAP_SIZE B_PAGE_SIZE
@@ -289,9 +291,9 @@ debug_heap_init()
{ {
// create the heap area // create the heap area
void* base; 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_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) if (area < 0)
return; return;
+2 -2
View File
@@ -369,10 +369,10 @@ TracingMetaData::Create(TracingMetaData*& _metaData)
if (error != B_OK) if (error != B_OK)
return error; return error;
area = create_area("tracing log", area = create_area_etc(B_SYSTEM_TEAM, "tracing log",
(void**)&metaData->fTraceOutputBuffer, B_ANY_KERNEL_ADDRESS, (void**)&metaData->fTraceOutputBuffer, B_ANY_KERNEL_ADDRESS,
kTraceOutputBufferSize + MAX_TRACE_SIZE, B_CONTIGUOUS, 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) if (area < 0)
return area; return area;
+5 -4
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. * Distributed under the terms of the MIT License.
* *
* Copyright 2001, Mark-Jan Bastian. All rights reserved. * Copyright 2001, Mark-Jan Bastian. All rights reserved.
@@ -29,6 +29,7 @@
#include <tracing.h> #include <tracing.h>
#include <util/AutoLock.h> #include <util/AutoLock.h>
#include <util/list.h> #include <util/list.h>
#include <vm/vm.h>
#include <wait_for_objects.h> #include <wait_for_objects.h>
@@ -644,9 +645,9 @@ port_init(kernel_args *args)
size_t size = sizeof(struct port_entry) * sMaxPorts; size_t size = sizeof(struct port_entry) * sMaxPorts;
// create and initialize ports table // create and initialize ports table
sPortArea = create_area("port_table", sPortArea = create_area_etc(B_SYSTEM_TEAM, "port_table", (void**)&sPorts,
(void**)&sPorts, B_ANY_KERNEL_ADDRESS, size, B_FULL_LOCK, B_ANY_KERNEL_ADDRESS, size, 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 (sPortArea < 0) { if (sPortArea < 0) {
panic("unable to allocate kernel port table!\n"); panic("unable to allocate kernel port table!\n");
return sPortArea; return sPortArea;
+4 -4
View File
@@ -1,6 +1,6 @@
/* /*
* Copyright 2008-2009, Ingo Weinhold, ingo_weinhold@gmx.de. * 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. * Distributed under the terms of the MIT License.
* *
* Copyright 2001, Travis Geiselbrecht. All rights reserved. * Copyright 2001, Travis Geiselbrecht. All rights reserved.
@@ -417,9 +417,9 @@ haiku_sem_init(kernel_args *args)
sMaxSems <<= 1; sMaxSems <<= 1;
// create and initialize semaphore table // create and initialize semaphore table
area = create_area("sem_table", (void **)&sSems, B_ANY_KERNEL_ADDRESS, area = create_area_etc(B_SYSTEM_TEAM, "sem_table", (void **)&sSems,
sizeof(struct sem_entry) * sMaxSems, B_FULL_LOCK, B_ANY_KERNEL_ADDRESS, sizeof(struct sem_entry) * sMaxSems, 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) if (area < 0)
panic("unable to allocate semaphore table!\n"); panic("unable to allocate semaphore table!\n");
+4 -3
View File
@@ -3652,10 +3652,11 @@ vm_init(kernel_args* args)
object_cache_set_minimum_reserve(gPageMappingsObjectCache, 1024); object_cache_set_minimum_reserve(gPageMappingsObjectCache, 1024);
#if DEBUG_CACHE_LIST #if DEBUG_CACHE_LIST
create_area("cache info table", (void**)&sCacheInfoTable, create_area_etc(VMAddressSpace::KernelID(), "cache info table",
B_ANY_KERNEL_ADDRESS, (void**)&sCacheInfoTable, B_ANY_KERNEL_ADDRESS,
ROUNDUP(kCacheInfoTableCount * sizeof(cache_info), B_PAGE_SIZE), 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 #endif // DEBUG_CACHE_LIST
// add some debugger commands // add some debugger commands