]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Arm / SetJumpLongJump.asm
CommitLineData
9095d37b 1;------------------------------------------------------------------------------\r
ebd04fc2 2;\r
9095d37b 3; Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
bb817c56 4; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
9344f092 5; SPDX-License-Identifier: BSD-2-Clause-Patent\r
ebd04fc2 6;\r
7;------------------------------------------------------------------------------\r
8\r
01a54966 9 EXPORT SetJump\r
10 EXPORT InternalLongJump\r
ebd04fc2 11\r
01a54966 12 AREA BaseLib, CODE, READONLY\r
ebd04fc2 13\r
14;/**\r
15; Saves the current CPU context that can be restored with a call to LongJump() and returns 0.;\r
16;\r
17; Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial\r
18; call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero\r
19; value to be returned by SetJump().\r
20;\r
21; If JumpBuffer is NULL, then ASSERT().\r
22; For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
23;\r
24; @param JumpBuffer A pointer to CPU context buffer.\r
25;\r
26;**/\r
27;\r
28;UINTN\r
29;EFIAPI\r
30;SetJump (\r
31; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // R0\r
32; )\r
33;\r
34SetJump\r
35 MOV R3, R13\r
36 STM R0, {R3-R12,R14}\r
37 EOR R0, R0\r
38 BX LR\r
39\r
40;/**\r
41; Restores the CPU context that was saved with SetJump().;\r
42;\r
43; Restores the CPU context from the buffer specified by JumpBuffer.\r
44; This function never returns to the caller.\r
45; Instead is resumes execution based on the state of JumpBuffer.\r
46;\r
47; @param JumpBuffer A pointer to CPU context buffer.\r
48; @param Value The value to return when the SetJump() context is restored.\r
49;\r
50;**/\r
51;VOID\r
52;EFIAPI\r
53;InternalLongJump (\r
54; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // R0\r
55; IN UINTN Value // R1\r
56; );\r
57;\r
58InternalLongJump\r
59 LDM R0, {R3-R12,R14}\r
60 MOV R13, R3\r
61 MOV R0, R1\r
62 BX LR\r
63\r
64 END\r