]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Arm/SetJumpLongJump.S
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Library / BaseLib / Arm / SetJumpLongJump.S
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.text\r
15.p2align 2\r
16\r
4c8a6e06 17GCC_ASM_EXPORT(SetJump)\r
18GCC_ASM_EXPORT(InternalLongJump)\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
40ASM_PFX(SetJump):\r
41 mov r3, r13\r
42 stmia r0, {r3-r12,r14}\r
43 eor r0, 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
64ASM_PFX(InternalLongJump):\r
65 ldmia r0, {r3-r12,r14}\r
66 mov r13, r3\r
67 mov r0, r1\r
68 bx lr\r
69\r
7f22d351 70ASM_FUNCTION_REMOVE_IF_UNREFERENCED\r