Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/dev Use M_WAITOK instead of M_NOWAIT for t...



details:   https://anonhg.NetBSD.org/src/rev/90ed75d743e9
branches:  trunk
changeset: 772422:90ed75d743e9
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Tue Jan 03 12:10:04 2012 +0000

description:
Use M_WAITOK instead of M_NOWAIT for the stack allocations

diffstat:

 sys/arch/usermode/dev/cpu.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 8611d843ae8d -r 90ed75d743e9 sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Tue Jan 03 12:05:00 2012 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Tue Jan 03 12:10:04 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.58 2012/01/03 12:05:01 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.59 2012/01/03 12:10:04 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_hz.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.58 2012/01/03 12:05:01 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.59 2012/01/03 12:10:04 reinoud Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -333,9 +333,9 @@
        memcpy(pcb2, pcb1, sizeof(struct pcb));
 
        stacksize = 2*PAGE_SIZE;
-       stack_ucp           = malloc(stacksize, M_TEMP, M_NOWAIT);
-       stack_syscall_ucp   = malloc(stacksize, M_TEMP, M_NOWAIT);
-       stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_NOWAIT);
+       stack_ucp           = malloc(stacksize, M_TEMP, M_WAITOK);
+       stack_syscall_ucp   = malloc(stacksize, M_TEMP, M_WAITOK);
+       stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_WAITOK);
        pcb2->pcb_needfree = true;
 
        KASSERT(stack_ucp);
@@ -414,8 +414,8 @@
        memcpy(&lwp0pcb.pcb_trapret_ucp,   &lwp0pcb.pcb_ucp, sizeof(ucontext_t));
 
        /* set up the ucontext for the pagefault */
-       stacksize = 16*PAGE_SIZE;
-       stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_NOWAIT);
+       stacksize = 8*PAGE_SIZE;
+       stack_pagefault_ucp = malloc(stacksize, M_TEMP, M_WAITOK);
 
        lwp0pcb.pcb_pagefault_ucp.uc_stack.ss_sp = stack_pagefault_ucp;
        lwp0pcb.pcb_pagefault_ucp.uc_stack.ss_size = stacksize;



Home | Main Index | Thread Index | Old Index