2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
7 #if defined(__native_client_nonsfi__)
12 /* int setjmp(jmp_buf env) */
14 stmia r0!, {r4-r11, sp, lr}
22 /* void longjmp(jmp_buf env, int val) */
24 ldmia r0!, {r4-r11, sp, lr}
26 /* Return the result argument if nonzero or 1 otherwise */
27 /* Note: move updates condition codes */
34 #include "nacl_arm_defs.h"
37 * jump_buf is organized as follows
39 * r4, r5, r6, r7, r8, r10 (sl), r11 (fp), r12 (ip/pad), r13 (sp), r14 (lr),
42 * Note: We do not save/restore r9 - which pnacl uses for thread accounting.
43 * r12 is spilled to pad out the jump buf so that d8-d15 are stored at an
44 * 8-byte aligned location.
46 * This also assumes that the minimal ARM hardware has d8-d15 registers,
47 * which is checked: src/trusted/platform_qualify/arch/arm/nacl_qualify_fpu.c
51 .align NACL_BLOCK_SHIFT
54 /* int setjmp(jmp_buf env) */
56 bic r0, r0, #NACL_DATA_FLOW_MASK
57 stmia r0!, {r4, r5, r6, r7, r8, r10, r11, r12, sp, lr}
58 bic r0, r0, #NACL_DATA_FLOW_MASK
62 bic lr, lr, #NACL_CONTROL_FLOW_MASK
67 .align NACL_BLOCK_SHIFT
70 /* void longjmp(jmp_buf env, int val) */
72 bic r0, r0, #NACL_DATA_FLOW_MASK
73 ldmia r0!, {r4, r5, r6, r7, r8, r10, r11, r12, sp, lr}
74 bic sp, sp, #NACL_DATA_FLOW_MASK
77 bic r0, r0, #NACL_DATA_FLOW_MASK
79 /* Return the result argument if nonzero or 1 otherwise */
80 /* Note: move updates condition codes */
84 bic lr, lr, #NACL_CONTROL_FLOW_MASK