From 32f67ec6ff30838169d7ded39dcfd6a7706b36d7 Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Sun, 10 Jun 2007 12:54:35 +0000 Subject: * libc/sys/mmixware/access.c (access): Do not try to use a magic file-handle and a direct syscall, just use _open. * libc/sys/mmixware/sys/syscall.h (TMPFNO): Remove this magic file-handle. * libc/sys/mmixware/_exit.c (_exit): Update comment about passing on the exit value. --- newlib/libc/sys/mmixware/_exit.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'newlib/libc/sys/mmixware/_exit.c') diff --git a/newlib/libc/sys/mmixware/_exit.c b/newlib/libc/sys/mmixware/_exit.c index 127bda75d..2f70154f2 100644 --- a/newlib/libc/sys/mmixware/_exit.c +++ b/newlib/libc/sys/mmixware/_exit.c @@ -18,9 +18,11 @@ void _exit (int n) { - /* Unfortunately, the return status is not returned by Knuth's mmix - simulator, so it seems in effect ineffective. We set it anyway; - there may be a purpose. */ + /* The return status is passed on at exit from the simulator by all + but the oldest versions of Knuth's mmixware simulator. Beware, + "TRAP 0,0,0" is the instruction corresponding to (int32_t) 0 and + the value 0 in $255 is common enough that a program crash jumping + to e.g. uninitialized memory will look like "exit (0)". */ __asm__ ("SET $255,%0\n\tTRAP 0,0,0" : /* No outputs. */ : "r" (n) -- cgit v1.2.3