]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Arm/SetJumpLongJump.asm
MdePkg: Clean up source files
[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
HT
4; Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>\r
5; This program and the accompanying materials\r
ebd04fc2 6; are licensed and made available under the terms and conditions of the BSD License\r
7; which accompanies this distribution. The full text of the license may be found at\r
35a17154 8; http://opensource.org/licenses/bsd-license.php.\r
ebd04fc2 9;\r
10; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12;\r
13;------------------------------------------------------------------------------\r
14\r
01a54966 15 EXPORT SetJump\r
16 EXPORT InternalLongJump\r
ebd04fc2 17\r
01a54966 18 AREA BaseLib, CODE, READONLY\r
ebd04fc2 19\r
20;/**\r
21; Saves the current CPU context that can be restored with a call to LongJump() and returns 0.;\r
22;\r
23; Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial\r
24; call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero\r
25; value to be returned by SetJump().\r
26;\r
27; If JumpBuffer is NULL, then ASSERT().\r
28; For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r
29;\r
30; @param JumpBuffer A pointer to CPU context buffer.\r
31;\r
32;**/\r
33;\r
34;UINTN\r
35;EFIAPI\r
36;SetJump (\r
37; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // R0\r
38; )\r
39;\r
40SetJump\r
41 MOV R3, R13\r
42 STM R0, {R3-R12,R14}\r
43 EOR R0, R0\r
44 BX LR\r
45\r
46;/**\r
47; Restores the CPU context that was saved with SetJump().;\r
48;\r
49; Restores the CPU context from the buffer specified by JumpBuffer.\r
50; This function never returns to the caller.\r
51; Instead is resumes execution based on the state of JumpBuffer.\r
52;\r
53; @param JumpBuffer A pointer to CPU context buffer.\r
54; @param Value The value to return when the SetJump() context is restored.\r
55;\r
56;**/\r
57;VOID\r
58;EFIAPI\r
59;InternalLongJump (\r
60; IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // R0\r
61; IN UINTN Value // R1\r
62; );\r
63;\r
64InternalLongJump\r
65 LDM R0, {R3-R12,R14}\r
66 MOV R13, R3\r
67 MOV R0, R1\r
68 BX LR\r
69\r
70 END\r