diff options
author | Tom Rini <trini@konsulko.com> | 2017-11-22 07:28:58 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-11-22 07:28:58 -0500 |
commit | d9d76023ea0d567b0630e85d1bef67b5b1a788d3 (patch) | |
tree | 670247b653a049be8aceebc16bf9dcc1d112f9f4 /arch/arm/lib/setjmp_aarch64.S | |
parent | 16fa2eb95172e63820ee5f3d4052f3362a6de84e (diff) | |
parent | 08790230fe80d46ff6368e0dc1e1be500ca3c4bf (diff) |
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'arch/arm/lib/setjmp_aarch64.S')
-rw-r--r-- | arch/arm/lib/setjmp_aarch64.S | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/lib/setjmp_aarch64.S b/arch/arm/lib/setjmp_aarch64.S new file mode 100644 index 0000000000..b68edb86d6 --- /dev/null +++ b/arch/arm/lib/setjmp_aarch64.S @@ -0,0 +1,42 @@ +/* + * (C) 2017 Theobroma Systems Design und Consulting GmbH + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <config.h> +#include <asm/macro.h> +#include <linux/linkage.h> + +.pushsection .text.setjmp, "ax" +ENTRY(setjmp) + /* Preserve all callee-saved registers and the SP */ + stp x19, x20, [x0,#0] + stp x21, x22, [x0,#16] + stp x23, x24, [x0,#32] + stp x25, x26, [x0,#48] + stp x27, x28, [x0,#64] + stp x29, x30, [x0,#80] + mov x2, sp + str x2, [x0, #96] + mov x0, #0 + ret +ENDPROC(setjmp) +.popsection + +.pushsection .text.longjmp, "ax" +ENTRY(longjmp) + ldp x19, x20, [x0,#0] + ldp x21, x22, [x0,#16] + ldp x23, x24, [x0,#32] + ldp x25, x26, [x0,#48] + ldp x27, x28, [x0,#64] + ldp x29, x30, [x0,#80] + ldr x2, [x0,#96] + mov sp, x2 + /* Move the return value in place, but return 1 if passed 0. */ + adds x0, xzr, x1 + csinc x0, x0, xzr, ne + ret +ENDPROC(longjmp) +.popsection |