summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys/mmixware/_exit.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2007-06-10 12:54:35 +0000
committerHans-Peter Nilsson <hp@axis.com>2007-06-10 12:54:35 +0000
commit32f67ec6ff30838169d7ded39dcfd6a7706b36d7 (patch)
tree7166256990adaee6c00505600b132780df42193a /newlib/libc/sys/mmixware/_exit.c
parent6fb374754dff1fbbe28b513b57caedc62e9a7cee (diff)
downloadcygnal-32f67ec6ff30838169d7ded39dcfd6a7706b36d7.tar.gz
cygnal-32f67ec6ff30838169d7ded39dcfd6a7706b36d7.tar.bz2
cygnal-32f67ec6ff30838169d7ded39dcfd6a7706b36d7.zip
* 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.
Diffstat (limited to 'newlib/libc/sys/mmixware/_exit.c')
-rw-r--r--newlib/libc/sys/mmixware/_exit.c8
1 files changed, 5 insertions, 3 deletions
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)