setjmp.S revision 1.1.1.1.6.2 1 1.1.1.1.6.2 christos /* $NetBSD: setjmp.S,v 1.1.1.1.6.2 2019/06/10 22:08:36 christos Exp $ */
2 1.1.1.1.6.2 christos
3 1.1.1.1.6.2 christos /*
4 1.1.1.1.6.2 christos * Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
5 1.1.1.1.6.2 christos * This program and the accompanying materials are licensed and made
6 1.1.1.1.6.2 christos available
7 1.1.1.1.6.2 christos * under the terms and conditions of the BSD License which accompanies
8 1.1.1.1.6.2 christos this
9 1.1.1.1.6.2 christos * distribution. The full text of the license may be found at
10 1.1.1.1.6.2 christos * http://opensource.org/licenses/bsd-license.php.
11 1.1.1.1.6.2 christos *
12 1.1.1.1.6.2 christos * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
13 1.1.1.1.6.2 christos BASIS,
14 1.1.1.1.6.2 christos * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR
15 1.1.1.1.6.2 christos * IMPLIED.
16 1.1.1.1.6.2 christos */
17 1.1.1.1.6.2 christos .text
18 1.1.1.1.6.2 christos .p2align 3
19 1.1.1.1.6.2 christos
20 1.1.1.1.6.2 christos #define GPR_LAYOUT \
21 1.1.1.1.6.2 christos REG_PAIR (x19, x20, 0); \
22 1.1.1.1.6.2 christos REG_PAIR (x21, x22, 16); \
23 1.1.1.1.6.2 christos REG_PAIR (x23, x24, 32); \
24 1.1.1.1.6.2 christos REG_PAIR (x25, x26, 48); \
25 1.1.1.1.6.2 christos REG_PAIR (x27, x28, 64); \
26 1.1.1.1.6.2 christos REG_PAIR (x29, x30, 80); \
27 1.1.1.1.6.2 christos REG_ONE (x16, 96)
28 1.1.1.1.6.2 christos
29 1.1.1.1.6.2 christos #define FPR_LAYOUT \
30 1.1.1.1.6.2 christos REG_PAIR(d8, d9, 112); \
31 1.1.1.1.6.2 christos REG_PAIR(d10, d11, 128); \
32 1.1.1.1.6.2 christos REG_PAIR(d12, d13, 144); \
33 1.1.1.1.6.2 christos REG_PAIR(d14, d15, 160);
34 1.1.1.1.6.2 christos
35 1.1.1.1.6.2 christos #define REG_PAIR(REG1, REG2, OFFS) stp REG1, REG2, [x0, OFFS]
36 1.1.1.1.6.2 christos #define REG_ONE(REG1, OFFS) str REG1, [x0, OFFS]
37 1.1.1.1.6.2 christos
38 1.1.1.1.6.2 christos .globl setjmp
39 1.1.1.1.6.2 christos .type setjmp, @function
40 1.1.1.1.6.2 christos setjmp:
41 1.1.1.1.6.2 christos mov x16, sp
42 1.1.1.1.6.2 christos GPR_LAYOUT
43 1.1.1.1.6.2 christos FPR_LAYOUT
44 1.1.1.1.6.2 christos mov w0, #0
45 1.1.1.1.6.2 christos ret
46 1.1.1.1.6.2 christos
47 1.1.1.1.6.2 christos #undef REG_PAIR
48 1.1.1.1.6.2 christos #undef REG_ONE
49 1.1.1.1.6.2 christos
50 1.1.1.1.6.2 christos #define REG_PAIR(REG1, REG2, OFFS) ldp REG1, REG2, [x0, OFFS]
51 1.1.1.1.6.2 christos #define REG_ONE(REG1, OFFS) ldr REG1, [x0, OFFS]
52 1.1.1.1.6.2 christos
53 1.1.1.1.6.2 christos .globl longjmp
54 1.1.1.1.6.2 christos .type longjmp, @function
55 1.1.1.1.6.2 christos longjmp:
56 1.1.1.1.6.2 christos GPR_LAYOUT
57 1.1.1.1.6.2 christos FPR_LAYOUT
58 1.1.1.1.6.2 christos mov sp, x16
59 1.1.1.1.6.2 christos cmp w1, #0
60 1.1.1.1.6.2 christos mov w0, #1
61 1.1.1.1.6.2 christos csel w0, w1, w0, ne
62 1.1.1.1.6.2 christos br x30
63