]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
b4806d6f PT |
2 | /* |
3 | * (C) 2017 Theobroma Systems Design und Consulting GmbH | |
b4806d6f PT |
4 | */ |
5 | ||
6 | #include <config.h> | |
7 | #include <asm/assembler.h> | |
8 | #include <linux/linkage.h> | |
9 | ||
10 | .pushsection .text.setjmp, "ax" | |
11 | ENTRY(setjmp) | |
12 | /* | |
13 | * A subroutine must preserve the contents of the registers | |
14 | * r4-r8, r10, r11 (v1-v5, v7 and v8) and SP (and r9 in PCS | |
15 | * variants that designate r9 as v6). | |
16 | */ | |
17 | mov ip, sp | |
18 | stm a1, {v1-v8, ip, lr} | |
19 | mov a1, #0 | |
583f1b2f | 20 | ret lr |
b4806d6f PT |
21 | ENDPROC(setjmp) |
22 | .popsection | |
23 | ||
24 | .pushsection .text.longjmp, "ax" | |
25 | ENTRY(longjmp) | |
26 | ldm a1, {v1-v8, ip, lr} | |
27 | mov sp, ip | |
28 | mov a1, a2 | |
29 | /* If we were passed a return value of zero, return one instead */ | |
30 | cmp a1, #0 | |
31 | bne 1f | |
32 | mov a1, #1 | |
33 | 1: | |
583f1b2f | 34 | ret lr |
b4806d6f PT |
35 | ENDPROC(longjmp) |
36 | .popsection |