* Changed the meaning of the {KERNEL,USER}_STACK_SIZE macros to not
include the guard pages. Adjusted the kernel and boot loader code accordingly -- the guard pages size is added/not removed respectively. The stack size passed to _kern_spawn_thread() is now the actually usable size, and it is no longer possible to specify a size smaller than or equal to the guard pages size. * vm_create_anonymous_area(): Precommit two pages maximum -- a stack with only one page usable size obviously doesn't need two pages. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26819 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,12 +27,13 @@
|
|||||||
// At least, you then know that the stack overflows in this case :)
|
// At least, you then know that the stack overflows in this case :)
|
||||||
|
|
||||||
/** Size of the kernel stack */
|
/** Size of the kernel stack */
|
||||||
#ifndef DEBUG_KERNEL_STACKS
|
|
||||||
#define KERNEL_STACK_SIZE (B_PAGE_SIZE * 3) // 12 kB
|
#define KERNEL_STACK_SIZE (B_PAGE_SIZE * 3) // 12 kB
|
||||||
#else
|
|
||||||
# define KERNEL_STACK_SIZE (B_PAGE_SIZE * 4) // 12 kB + one guard page
|
#ifdef DEBUG_KERNEL_STACKS
|
||||||
#endif
|
|
||||||
# define KERNEL_STACK_GUARD_PAGES 1
|
# define KERNEL_STACK_GUARD_PAGES 1
|
||||||
|
#else
|
||||||
|
# define KERNEL_STACK_GUARD_PAGES 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Size of the environmental variables space for a process */
|
/** Size of the environmental variables space for a process */
|
||||||
#define ENV_SIZE (B_PAGE_SIZE * 8)
|
#define ENV_SIZE (B_PAGE_SIZE * 8)
|
||||||
|
|||||||
@@ -14,11 +14,14 @@
|
|||||||
#define THREAD_CONTINUED 0x4
|
#define THREAD_CONTINUED 0x4
|
||||||
|
|
||||||
/** Size of the stack given to teams in user space */
|
/** Size of the stack given to teams in user space */
|
||||||
#define USER_MAIN_THREAD_STACK_SIZE (16 * 1024 * 1024) // 16 MB
|
|
||||||
#define USER_STACK_SIZE (256 * 1024) // 256 kB
|
|
||||||
#define MIN_USER_STACK_SIZE (4 * 1024) // 4 KB
|
|
||||||
#define MAX_USER_STACK_SIZE (16 * 1024 * 1024) // 16 MB
|
|
||||||
#define USER_STACK_GUARD_PAGES 4 // 16 kB
|
#define USER_STACK_GUARD_PAGES 4 // 16 kB
|
||||||
|
#define USER_MAIN_THREAD_STACK_SIZE (16 * 1024 * 1024 \
|
||||||
|
- USER_STACK_GUARD_PAGES * B_PAGE_SIZE) // 16 MB
|
||||||
|
#define USER_STACK_SIZE (256 * 1024 \
|
||||||
|
- USER_STACK_GUARD_PAGES * B_PAGE_SIZE) // 256 kB
|
||||||
|
#define MIN_USER_STACK_SIZE (4 * 1024) // 4 KB
|
||||||
|
#define MAX_USER_STACK_SIZE (16 * 1024 * 1024 \
|
||||||
|
- USER_STACK_GUARD_PAGES * B_PAGE_SIZE) // 16 MB
|
||||||
|
|
||||||
|
|
||||||
struct thread_creation_attributes {
|
struct thread_creation_attributes {
|
||||||
|
|||||||
@@ -615,8 +615,10 @@ mmu_init(void)
|
|||||||
+ VBR_PAGE_OFFSET;
|
+ VBR_PAGE_OFFSET;
|
||||||
|
|
||||||
// map in a kernel stack
|
// map in a kernel stack
|
||||||
gKernelArgs.cpu_kstack[0].start = (addr_t)mmu_allocate(NULL, KERNEL_STACK_SIZE);
|
gKernelArgs.cpu_kstack[0].start = (addr_t)mmu_allocate(NULL,
|
||||||
gKernelArgs.cpu_kstack[0].size = KERNEL_STACK_SIZE;
|
KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
||||||
|
gKernelArgs.cpu_kstack[0].size = KERNEL_STACK_SIZE
|
||||||
|
+ KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
|
|
||||||
TRACE(("kernel stack at 0x%lx to 0x%lx\n", gKernelArgs.cpu_kstack[0].start,
|
TRACE(("kernel stack at 0x%lx to 0x%lx\n", gKernelArgs.cpu_kstack[0].start,
|
||||||
gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size));
|
gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size));
|
||||||
|
|||||||
@@ -606,8 +606,9 @@ mmu_init(void)
|
|||||||
|
|
||||||
// map in a kernel stack
|
// map in a kernel stack
|
||||||
gKernelArgs.cpu_kstack[0].start = (addr_t)mmu_allocate(NULL,
|
gKernelArgs.cpu_kstack[0].start = (addr_t)mmu_allocate(NULL,
|
||||||
KERNEL_STACK_SIZE);
|
KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
||||||
gKernelArgs.cpu_kstack[0].size = KERNEL_STACK_SIZE;
|
gKernelArgs.cpu_kstack[0].size = KERNEL_STACK_SIZE
|
||||||
|
+ KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
|
|
||||||
TRACE(("kernel stack at 0x%lx to 0x%lx\n", gKernelArgs.cpu_kstack[0].start,
|
TRACE(("kernel stack at 0x%lx to 0x%lx\n", gKernelArgs.cpu_kstack[0].start,
|
||||||
gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size));
|
gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size));
|
||||||
|
|||||||
@@ -396,8 +396,10 @@ smp_init_other_cpus(void)
|
|||||||
|
|
||||||
for (uint32 i = 1; i < gKernelArgs.num_cpus; i++) {
|
for (uint32 i = 1; i < gKernelArgs.num_cpus; i++) {
|
||||||
// create a final stack the trampoline code will put the ap processor on
|
// create a final stack the trampoline code will put the ap processor on
|
||||||
gKernelArgs.cpu_kstack[i].start = (addr_t)mmu_allocate(NULL, KERNEL_STACK_SIZE);
|
gKernelArgs.cpu_kstack[i].start = (addr_t)mmu_allocate(NULL,
|
||||||
gKernelArgs.cpu_kstack[i].size = KERNEL_STACK_SIZE;
|
KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
||||||
|
gKernelArgs.cpu_kstack[i].size = KERNEL_STACK_SIZE
|
||||||
|
+ KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -438,14 +440,18 @@ smp_boot_other_cpus(void)
|
|||||||
|
|
||||||
// set this stack up
|
// set this stack up
|
||||||
finalStack = (uint32 *)gKernelArgs.cpu_kstack[i].start;
|
finalStack = (uint32 *)gKernelArgs.cpu_kstack[i].start;
|
||||||
memset(finalStack, 0, KERNEL_STACK_SIZE);
|
memset((uint8*)finalStack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE, 0,
|
||||||
tempStack = (finalStack + KERNEL_STACK_SIZE / sizeof(uint32)) - 1;
|
KERNEL_STACK_SIZE);
|
||||||
|
tempStack = (finalStack
|
||||||
|
+ (KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE)
|
||||||
|
/ sizeof(uint32)) - 1;
|
||||||
*tempStack = (uint32)&smp_cpu_ready;
|
*tempStack = (uint32)&smp_cpu_ready;
|
||||||
|
|
||||||
// set the trampoline stack up
|
// set the trampoline stack up
|
||||||
tempStack = (uint32 *)(trampolineStack + B_PAGE_SIZE - 4);
|
tempStack = (uint32 *)(trampolineStack + B_PAGE_SIZE - 4);
|
||||||
// final location of the stack
|
// final location of the stack
|
||||||
*tempStack = ((uint32)finalStack) + KERNEL_STACK_SIZE - sizeof(uint32);
|
*tempStack = ((uint32)finalStack) + KERNEL_STACK_SIZE
|
||||||
|
+ KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE - sizeof(uint32);
|
||||||
tempStack--;
|
tempStack--;
|
||||||
// page dir
|
// page dir
|
||||||
*tempStack = gKernelArgs.arch_args.phys_pgdir;
|
*tempStack = gKernelArgs.arch_args.phys_pgdir;
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ boot_arch_cpu_init(void)
|
|||||||
// allocate the kernel stacks (the memory stuff is already initialized
|
// allocate the kernel stacks (the memory stuff is already initialized
|
||||||
// at this point)
|
// at this point)
|
||||||
addr_t stack = (addr_t)arch_mmu_allocate((void*)0x80000000,
|
addr_t stack = (addr_t)arch_mmu_allocate((void*)0x80000000,
|
||||||
cpuCount * KERNEL_STACK_SIZE, B_READ_AREA | B_WRITE_AREA, false);
|
cpuCount * (KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE),
|
||||||
|
B_READ_AREA | B_WRITE_AREA, false);
|
||||||
if (!stack) {
|
if (!stack) {
|
||||||
printf("boot_arch_cpu_init(): Failed to allocate kernel stack(s)!\n");
|
printf("boot_arch_cpu_init(): Failed to allocate kernel stack(s)!\n");
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -103,8 +104,9 @@ boot_arch_cpu_init(void)
|
|||||||
|
|
||||||
for (int i = 0; i < cpuCount; i++) {
|
for (int i = 0; i < cpuCount; i++) {
|
||||||
gKernelArgs.cpu_kstack[i].start = stack;
|
gKernelArgs.cpu_kstack[i].start = stack;
|
||||||
gKernelArgs.cpu_kstack[i].size = KERNEL_STACK_SIZE;
|
gKernelArgs.cpu_kstack[i].size = KERNEL_STACK_SIZE
|
||||||
stack += KERNEL_STACK_SIZE;
|
+ KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
|
stack += KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ return 0;
|
|||||||
|
|
||||||
kprintf(" kernel stack: %p to %p\n",
|
kprintf(" kernel stack: %p to %p\n",
|
||||||
(void *)thread->kernel_stack_base,
|
(void *)thread->kernel_stack_base,
|
||||||
(void *)(thread->kernel_stack_base + KERNEL_STACK_SIZE));
|
(void *)(thread->kernel_stack_top));
|
||||||
if (thread->user_stack_base != 0) {
|
if (thread->user_stack_base != 0) {
|
||||||
kprintf(" user stack: %p to %p\n",
|
kprintf(" user stack: %p to %p\n",
|
||||||
(void *)thread->user_stack_base,
|
(void *)thread->user_stack_base,
|
||||||
|
|||||||
@@ -150,15 +150,15 @@ arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void),
|
|||||||
void (*entry_func)(void), void (*exit_func)(void))
|
void (*entry_func)(void), void (*exit_func)(void))
|
||||||
{
|
{
|
||||||
addr_t *kstack = (addr_t *)t->kernel_stack_base;
|
addr_t *kstack = (addr_t *)t->kernel_stack_base;
|
||||||
addr_t *kstackTop = kstack + KERNEL_STACK_SIZE / sizeof(addr_t);
|
addr_t *kstackTop = (addr_t *)t->kernel_stack_base;
|
||||||
|
|
||||||
// clear the kernel stack
|
// clear the kernel stack
|
||||||
#ifdef DEBUG_KERNEL_STACKS
|
#ifdef DEBUG_KERNEL_STACKS
|
||||||
# ifdef STACK_GROWS_DOWNWARDS
|
# ifdef STACK_GROWS_DOWNWARDS
|
||||||
memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE), 0,
|
memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE), 0,
|
||||||
KERNEL_STACK_SIZE - KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
KERNEL_STACK_SIZE);
|
||||||
# else
|
# else
|
||||||
memset(kstack, 0, KERNEL_STACK_SIZE - KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
memset(kstack, 0, KERNEL_STACK_SIZE);
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
memset(kstack, 0, KERNEL_STACK_SIZE);
|
memset(kstack, 0, KERNEL_STACK_SIZE);
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ return 0;
|
|||||||
|
|
||||||
kprintf(" kernel stack: %p to %p\n",
|
kprintf(" kernel stack: %p to %p\n",
|
||||||
(void *)thread->kernel_stack_base,
|
(void *)thread->kernel_stack_base,
|
||||||
(void *)(thread->kernel_stack_base + KERNEL_STACK_SIZE));
|
(void *)(thread->kernel_stack_top));
|
||||||
if (thread->user_stack_base != 0) {
|
if (thread->user_stack_base != 0) {
|
||||||
kprintf(" user stack: %p to %p\n",
|
kprintf(" user stack: %p to %p\n",
|
||||||
(void *)thread->user_stack_base,
|
(void *)thread->user_stack_base,
|
||||||
|
|||||||
@@ -122,15 +122,15 @@ arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void),
|
|||||||
void (*entry_func)(void), void (*exit_func)(void))
|
void (*entry_func)(void), void (*exit_func)(void))
|
||||||
{
|
{
|
||||||
addr_t *kstack = (addr_t *)t->kernel_stack_base;
|
addr_t *kstack = (addr_t *)t->kernel_stack_base;
|
||||||
addr_t *kstackTop = kstack + KERNEL_STACK_SIZE / sizeof(addr_t);
|
addr_t *kstackTop = (addr_t *)t->kernel_stack_top;
|
||||||
|
|
||||||
// clear the kernel stack
|
// clear the kernel stack
|
||||||
#ifdef DEBUG_KERNEL_STACKS
|
#ifdef DEBUG_KERNEL_STACKS
|
||||||
# ifdef STACK_GROWS_DOWNWARDS
|
# ifdef STACK_GROWS_DOWNWARDS
|
||||||
memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE), 0,
|
memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE), 0,
|
||||||
KERNEL_STACK_SIZE - KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
KERNEL_STACK_SIZE);
|
||||||
# else
|
# else
|
||||||
memset(kstack, 0, KERNEL_STACK_SIZE - KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
memset(kstack, 0, KERNEL_STACK_SIZE);
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
memset(kstack, 0, KERNEL_STACK_SIZE);
|
memset(kstack, 0, KERNEL_STACK_SIZE);
|
||||||
@@ -182,7 +182,7 @@ arch_thread_context_switch(struct thread *t_from, struct thread *t_to)
|
|||||||
// set the new kernel stack in the EAR register.
|
// set the new kernel stack in the EAR register.
|
||||||
// this is used in the exception handler code to decide what kernel stack to
|
// this is used in the exception handler code to decide what kernel stack to
|
||||||
// switch to if the exception had happened when the processor was in user mode
|
// switch to if the exception had happened when the processor was in user mode
|
||||||
asm("mtear %0" :: "g"(t_to->kernel_stack_base + KERNEL_STACK_SIZE - 8));
|
asm("mtear %0" :: "g"(t_to->kernel_stack_top - 8));
|
||||||
|
|
||||||
// switch the asids if we need to
|
// switch the asids if we need to
|
||||||
if (t_to->team->address_space != NULL) {
|
if (t_to->team->address_space != NULL) {
|
||||||
|
|||||||
@@ -261,9 +261,9 @@ arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void),
|
|||||||
#ifdef DEBUG_KERNEL_STACKS
|
#ifdef DEBUG_KERNEL_STACKS
|
||||||
# ifdef STACK_GROWS_DOWNWARDS
|
# ifdef STACK_GROWS_DOWNWARDS
|
||||||
memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE), 0,
|
memset((void *)((addr_t)kstack + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE), 0,
|
||||||
KERNEL_STACK_SIZE - KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
KERNEL_STACK_SIZE);
|
||||||
# else
|
# else
|
||||||
memset(kstack, 0, KERNEL_STACK_SIZE - KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE);
|
memset(kstack, 0, KERNEL_STACK_SIZE);
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
memset(kstack, 0, KERNEL_STACK_SIZE);
|
memset(kstack, 0, KERNEL_STACK_SIZE);
|
||||||
|
|||||||
@@ -985,10 +985,12 @@ team_create_thread_start(void *args)
|
|||||||
// ToDo: ENV_SIZE is a) limited, and b) not used after libroot copied it to the heap
|
// ToDo: ENV_SIZE is a) limited, and b) not used after libroot copied it to the heap
|
||||||
// ToDo: we could reserve the whole USER_STACK_REGION upfront...
|
// ToDo: we could reserve the whole USER_STACK_REGION upfront...
|
||||||
|
|
||||||
sizeLeft = PAGE_ALIGN(USER_MAIN_THREAD_STACK_SIZE + TLS_SIZE
|
sizeLeft = PAGE_ALIGN(USER_MAIN_THREAD_STACK_SIZE
|
||||||
|
+ USER_STACK_GUARD_PAGES * B_PAGE_SIZE + TLS_SIZE
|
||||||
+ sizeof(struct user_space_program_args) + teamArgs->flat_args_size);
|
+ sizeof(struct user_space_program_args) + teamArgs->flat_args_size);
|
||||||
t->user_stack_base = USER_STACK_REGION + USER_STACK_REGION_SIZE - sizeLeft;
|
t->user_stack_base = USER_STACK_REGION + USER_STACK_REGION_SIZE - sizeLeft;
|
||||||
t->user_stack_size = USER_MAIN_THREAD_STACK_SIZE;
|
t->user_stack_size = USER_MAIN_THREAD_STACK_SIZE
|
||||||
|
+ USER_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
// the exact location at the end of the user stack area
|
// the exact location at the end of the user stack area
|
||||||
|
|
||||||
sprintf(ustack_name, "%s_main_stack", team->name);
|
sprintf(ustack_name, "%s_main_stack", team->name);
|
||||||
|
|||||||
@@ -391,7 +391,8 @@ create_thread(thread_creation_attributes& attributes, bool kernel)
|
|||||||
thread->id);
|
thread->id);
|
||||||
thread->kernel_stack_area = create_area(stack_name,
|
thread->kernel_stack_area = create_area(stack_name,
|
||||||
(void **)&thread->kernel_stack_base, B_ANY_KERNEL_ADDRESS,
|
(void **)&thread->kernel_stack_base, B_ANY_KERNEL_ADDRESS,
|
||||||
KERNEL_STACK_SIZE, B_FULL_LOCK,
|
KERNEL_STACK_SIZE + KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE,
|
||||||
|
B_FULL_LOCK,
|
||||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_KERNEL_STACK_AREA);
|
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA | B_KERNEL_STACK_AREA);
|
||||||
|
|
||||||
if (thread->kernel_stack_area < 0) {
|
if (thread->kernel_stack_area < 0) {
|
||||||
@@ -405,7 +406,8 @@ create_thread(thread_creation_attributes& attributes, bool kernel)
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
thread->kernel_stack_top = thread->kernel_stack_base + KERNEL_STACK_SIZE;
|
thread->kernel_stack_top = thread->kernel_stack_base + KERNEL_STACK_SIZE
|
||||||
|
+ KERNEL_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
|
|
||||||
state = disable_interrupts();
|
state = disable_interrupts();
|
||||||
GRAB_THREAD_LOCK();
|
GRAB_THREAD_LOCK();
|
||||||
@@ -499,6 +501,7 @@ create_thread(thread_creation_attributes& attributes, bool kernel)
|
|||||||
thread->user_stack_size = USER_STACK_SIZE;
|
thread->user_stack_size = USER_STACK_SIZE;
|
||||||
else
|
else
|
||||||
thread->user_stack_size = PAGE_ALIGN(attributes.stack_size);
|
thread->user_stack_size = PAGE_ALIGN(attributes.stack_size);
|
||||||
|
thread->user_stack_size += USER_STACK_GUARD_PAGES * B_PAGE_SIZE;
|
||||||
|
|
||||||
snprintf(stack_name, B_OS_NAME_LENGTH, "%s_%ld_stack",
|
snprintf(stack_name, B_OS_NAME_LENGTH, "%s_%ld_stack",
|
||||||
attributes.name, thread->id);
|
attributes.name, thread->id);
|
||||||
|
|||||||
@@ -1576,6 +1576,7 @@ vm_create_anonymous_area(team_id team, const char *name, void **address,
|
|||||||
vm_cache *cache;
|
vm_cache *cache;
|
||||||
vm_page *page = NULL;
|
vm_page *page = NULL;
|
||||||
bool isStack = (protection & B_STACK_AREA) != 0;
|
bool isStack = (protection & B_STACK_AREA) != 0;
|
||||||
|
page_num_t guardPages;
|
||||||
bool canOvercommit = false;
|
bool canOvercommit = false;
|
||||||
addr_t physicalBase = 0;
|
addr_t physicalBase = 0;
|
||||||
|
|
||||||
@@ -1693,10 +1694,10 @@ vm_create_anonymous_area(team_id team, const char *name, void **address,
|
|||||||
|
|
||||||
// create an anonymous cache
|
// create an anonymous cache
|
||||||
// if it's a stack, make sure that two pages are available at least
|
// if it's a stack, make sure that two pages are available at least
|
||||||
status = VMCacheFactory::CreateAnonymousCache(cache,
|
guardPages = isStack ? ((protection & B_USER_PROTECTION) != 0
|
||||||
canOvercommit, isStack ? 2 : 0,
|
? USER_STACK_GUARD_PAGES : KERNEL_STACK_GUARD_PAGES) : 0;
|
||||||
isStack ? ((protection & B_USER_PROTECTION) != 0 ?
|
status = VMCacheFactory::CreateAnonymousCache(cache, canOvercommit,
|
||||||
USER_STACK_GUARD_PAGES : KERNEL_STACK_GUARD_PAGES) : 0,
|
isStack ? (min_c(2, size / B_PAGE_SIZE - guardPages)) : 0, guardPages,
|
||||||
wiring == B_NO_LOCK);
|
wiring == B_NO_LOCK);
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
goto err1;
|
goto err1;
|
||||||
|
|||||||
Reference in New Issue
Block a user