Sync usage with man page.
[netbsd-mini2440.git] / lib / libc / pc532 / gen / _setjmp.s
blobdfc5735bb4857ed214838d08378e130c50c308a7
1 /*
2 * Copyright (c) 1992 Helsinki University of Technology
3 * All Rights Reserved.
4 *
5 * Permission to use, copy, modify and distribute this software and its
6 * documentation is hereby granted, provided that both the copyright
7 * notice and this permission notice appear in all copies of the
8 * software, derivative works or modified versions, and any portions
9 * thereof, and that both notices appear in supporting documentation.
11 * HELSINKI UNIVERSITY OF TECHNOLOGY ALLOWS FREE USE OF THIS SOFTWARE IN
12 * ITS "AS IS" CONDITION. HELSINKI UNIVERSITY OF TECHNOLOGY DISCLAIMS ANY
13 * LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE
14 * USE OF THIS SOFTWARE.
17 * HISTORY
18 * 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
19 * Created.
21 * $Id: _setjmp.s,v 1.1 1993/09/17 18:43:46 phil Exp $
25 #include <machine/asm.h>
26 #include <machine/jmpbuf.h>
28 ENTRY(_setjmp)
29 movd 4(sp), r2 /* jmp_buf */
30 movd 0(sp), JMP_BUF_PC(r2) /* pc of caller */
32 sprd sp, JMP_BUF_SP(r2)
33 sprd fp, JMP_BUF_FP(r2)
34 sprd sb, JMP_BUF_SB(r2)
35 movd r3, JMP_BUF_R3(r2) /* save registers r3-r7 */
36 movd r4, JMP_BUF_R4(r2)
37 movd r5, JMP_BUF_R5(r2)
38 movd r6, JMP_BUF_R6(r2)
39 movd r7, JMP_BUF_R7(r2)
41 movqd 0, r0
42 ret 0
44 ENTRY(_longjmp)
45 movd 4(sp), r2 /* jmp_buf */
46 movd 8(sp), r0 /* value */
48 lprd sp, JMP_BUF_SP(r2)
49 lprd fp, JMP_BUF_FP(r2)
50 lprd sb, JMP_BUF_SB(r2)
51 movd JMP_BUF_R3(r2), r3 /* load registers r3-r7 */
52 movd JMP_BUF_R4(r2), r4
53 movd JMP_BUF_R5(r2), r5
54 movd JMP_BUF_R6(r2), r6
55 movd JMP_BUF_R7(r2), r7
57 movd JMP_BUF_PC(r2), 0(sp) /* patch return pc */
59 cmpqd 0, r0
60 bne nonzero
61 movqd 1, r0
62 nonzero:
63 ret 0