diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-11-30 14:56:00 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-11-30 14:56:00 +0100 |
commit | 7f3659e78f83a59badebeae6414b9b3cd89d7a58 (patch) | |
tree | f7d3b4c1efbc4e8ecc14ee6201563db3152012a2 /sys/src/9/port/ucallocb.c | |
parent | 254031cf7020f1b185c6d0af89c653a271e0ed01 (diff) |
kernel: cleanup exit()/shutdown()/reboot() code
introduce cpushutdown() function that does the common
operation of initiating shutdown, returning once all
cpu's got the message and are about to shutdown. this
avoids duplicated code which isnt really machine specific.
automatic reboot on panic only when *debug= is not set
and the machine is a cpu server or has no display,
otherwise just hang.
Diffstat (limited to 'sys/src/9/port/ucallocb.c')
-rw-r--r-- | sys/src/9/port/ucallocb.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/src/9/port/ucallocb.c b/sys/src/9/port/ucallocb.c index 126733d9a..410aa62e8 100644 --- a/sys/src/9/port/ucallocb.c +++ b/sys/src/9/port/ucallocb.c @@ -78,24 +78,10 @@ uciallocb(int size) Block *b; static int m1, m2, mp; - if(0 && ucialloc.bytes > conf.ialloc){ - if((m1++%10000)==0){ - if(mp++ > 1000){ - active.exiting = 1; - exit(0); - } - iprint("uciallocb: limited %lud/%lud\n", - ucialloc.bytes, conf.ialloc); - } - return nil; - } - if((b = _ucallocb(size)) == nil){ if(0 && (m2++%10000)==0){ - if(mp++ > 1000){ - active.exiting = 1; - exit(0); - } + if(mp++ > 1000) + panic("uciallocb: out of memory"); iprint("uciallocb: no memory %lud/%lud\n", ucialloc.bytes, conf.ialloc); } |