summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys/mmixware/setjmp.S
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2001-11-13 02:49:12 +0000
committerHans-Peter Nilsson <hp@axis.com>2001-11-13 02:49:12 +0000
commit4cede8c4ce75127a528ab2dfb33fa5bf925a2d05 (patch)
treeb97549d3e0575500385db31e6e32fd279786b956 /newlib/libc/sys/mmixware/setjmp.S
parentf513298e1801560b0b2af19be879356874d60aa7 (diff)
downloadcygnal-4cede8c4ce75127a528ab2dfb33fa5bf925a2d05.tar.gz
cygnal-4cede8c4ce75127a528ab2dfb33fa5bf925a2d05.tar.bz2
cygnal-4cede8c4ce75127a528ab2dfb33fa5bf925a2d05.zip
* libc/sys/mmixware/*: Correct spacing in all source files.
* libc/sys/mmixware/syscall.h: Move misplaced file... * libc/sys/mmixware/sys/syscall.h: ...here.
Diffstat (limited to 'newlib/libc/sys/mmixware/setjmp.S')
-rw-r--r--newlib/libc/sys/mmixware/setjmp.S77
1 files changed, 38 insertions, 39 deletions
diff --git a/newlib/libc/sys/mmixware/setjmp.S b/newlib/libc/sys/mmixware/setjmp.S
index e5f043155..17d9ea841 100644
--- a/newlib/libc/sys/mmixware/setjmp.S
+++ b/newlib/libc/sys/mmixware/setjmp.S
@@ -1,7 +1,6 @@
/* Setjmp and longjmp for mmix.
Copyright (C) 2001 Hans-Peter Nilsson.
-
Permission to use, copy, modify, and distribute this software is freely
granted, provided that this notice is preserved with no changes.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
@@ -10,11 +9,11 @@
PURPOSE.
jmp_buf[5]:
- 0: fp
- 1: rJ (return-address)
- 2: sp
- 3: rO *before* the setjmp call.
- 4: temporary storage. Reserved between setjmp and longjmp. */
+ 0: fp
+ 1: rJ (return-address)
+ 2: sp
+ 3: rO *before* the setjmp call.
+ 4: temporary storage. Reserved between setjmp and longjmp. */
#ifdef __MMIX_ABI_GNU__
#define arg1 $231
@@ -28,38 +27,38 @@
#define popval 1
#endif
- .section .text.setjmp,"ax",@progbits
- .global setjmp
+ .section .text.setjmp,"ax",@progbits
+ .global setjmp
setjmp:
% Store fp, sp and return address. Recycle the static-chain and
% structure-return registers as temporary register, since we need to keep
% the jmp_buf (parameter 1) and the return address across a "POP".
- SET $251,arg1
- STOU $253,$251,0
- GET $252,rJ
- STOU $252,$251,8
- STOU $254,$251,16
- SETL outret,0
+ SET $251,arg1
+ STOU $253,$251,0
+ GET $252,rJ
+ STOU $252,$251,8
+ STOU $254,$251,16
+ SETL outret,0
% Jump through hoops to get the value of rO *before* the setjmp call.
- GETA $255,0f
- PUT rJ,$255
- POP popval,0
+ GETA $255,0f
+ PUT rJ,$255
+ POP popval,0
0:
- GET $255,rO
- STOU $255,$251,24
- GO $255,$252,0
- .size setjmp,.-setjmp
+ GET $255,rO
+ STOU $255,$251,24
+ GO $255,$252,0
+ .size setjmp,.-setjmp
- .section .text.longjmp,"ax",@progbits
- .global longjmp
+ .section .text.longjmp,"ax",@progbits
+ .global longjmp
longjmp:
% Reset arg2 to 1 if it is 0 (see longjmp(2)) and store it in jmp_buf.
% Save arg1 in a global register, since it will be destroyed by the POPs
% (in the mmixware ABI).
- CSZ arg2,arg2,1
- STOU arg2,arg1,32
- SET $251,arg1
+ CSZ arg2,arg2,1
+ STOU arg2,arg1,32
+ SET $251,arg1
% Loop and "POP 0,0" until rO is the expected value, like
% the expansion of nonlocal_goto_receiver, except that we put the return
@@ -68,18 +67,18 @@ longjmp:
% GNU ABI, it is unnecessary to do this in the loop and perhaps the memory
% access can be hoisted outside the loop, but this is safe and simple and
% I see no need to optimize longjmps.
- GETA $255,0f
- PUT rJ,$255
- LDOU $255,$251,24
+ GETA $255,0f
+ PUT rJ,$255
+ LDOU $255,$251,24
0:
- GET $252,rO
- CMPU $252,$252,$255
- BNP $252,1f
- LDOU outret,$251,32
- POP popval,0
+ GET $252,rO
+ CMPU $252,$252,$255
+ BNP $252,1f
+ LDOU outret,$251,32
+ POP popval,0
1:
- LDOU $253,$251,0
- LDOU $255,$251,8
- LDOU $254,$251,16
- GO $255,$255,0
- .size longjmp,.-longjmp
+ LDOU $253,$251,0
+ LDOU $255,$251,8
+ LDOU $254,$251,16
+ GO $255,$255,0
+ .size longjmp,.-longjmp