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