2 * Copyright (c) 1992 Helsinki University of Technology
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.
18 * 29-Apr-92 Johannes Helander (jvh) at Helsinki University of Technology
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>
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)
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 */