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