diff options
author | obrien <obrien@FreeBSD.org> | 2000-10-10 13:11:47 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-10-10 13:11:47 +0000 |
commit | ef62f71c02280662d1a633bf32a37b6323acf3c0 (patch) | |
tree | 9f80d1cea73079751d0e8a27590a8d7d49db9ae8 /lib/libstand | |
parent | ebcd791ed808b28f8ac489d9bbb8da550d6262e4 (diff) | |
download | FreeBSD-src-ef62f71c02280662d1a633bf32a37b6323acf3c0.zip FreeBSD-src-ef62f71c02280662d1a633bf32a37b6323acf3c0.tar.gz |
Architecture-specific setjump()/longjmp() bits for the PowerPC
needed by the loader.
Submitted by: Benno Rice <benno@jeamland.net>
Obtained from: NetBSD (Wolfgang Solfrank <ws@@tools.de>)
Diffstat (limited to 'lib/libstand')
-rw-r--r-- | lib/libstand/powerpc/_setjmp.S | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/libstand/powerpc/_setjmp.S b/lib/libstand/powerpc/_setjmp.S new file mode 100644 index 0000000..50a39b0 --- /dev/null +++ b/lib/libstand/powerpc/_setjmp.S @@ -0,0 +1,39 @@ +/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */ +/* $FreeBSD$ */ + +#include <machine/asm.h> + +#if defined(LIBC_SCCS) + .text + .asciz "$NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $" +#endif + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v?v:1)" from the last call to + * _setjmp(a) + * by restoring registers from the stack. + * The previous signal state is NOT restored. + */ + +ENTRY(_setjmp) + mflr 11 + mfcr 12 + mr 10,1 + mr 9,2 + stmw 9,8(3) + li 3,0 + blr + +ENTRY(_longjmp) + lmw 9,8(3) + mtlr 11 + mtcr 12 + mr 2,9 + mr 1,10 + or. 3,4,4 + bnelr + li 3,1 + blr |