1 #------------------------------------------------------------------------------
3 # Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
4 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 # SPDX-License-Identifier: BSD-2-Clause-Patent
7 #------------------------------------------------------------------------------
11 GCC_ASM_EXPORT(SetJump)
12 GCC_ASM_EXPORT(InternalLongJump)
15 # Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#
17 # Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial
18 # call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero
19 # value to be returned by SetJump().
21 # If JumpBuffer is NULL, then ASSERT().
22 # For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
24 # @param JumpBuffer A pointer to CPU context buffer.
31 # IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // R0
36 stmia r0, {r3-r12,r14}
41 # Restores the CPU context that was saved with SetJump().#
43 # Restores the CPU context from the buffer specified by JumpBuffer.
44 # This function never returns to the caller.
45 # Instead is resumes execution based on the state of JumpBuffer.
47 # @param JumpBuffer A pointer to CPU context buffer.
48 # @param Value The value to return when the SetJump() context is restored.
54 # IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // R0
55 # IN UINTN Value // R1
58 ASM_PFX(InternalLongJump):
59 ldmia r0, {r3-r12,r14}
64 ASM_FUNCTION_REMOVE_IF_UNREFERENCED