1 /*++ 2 3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR> 4 This program and the accompanying materials 5 are licensed and made available under the terms and conditions of the BSD License 6 which accompanies this distribution. The full text of the license may be found at 7 http://opensource.org/licenses/bsd-license.php 8 9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 12 13 Module Name: 14 15 SetJumpLongJump.c 16 17 Abstract: 18 19 20 --*/ 21 22 #include "BaseLibInternals.h" 23 24 /** 25 Worker function that checks ASSERT condition for JumpBuffer 26 27 Checks ASSERT condition for JumpBuffer. 28 29 If JumpBuffer is NULL, then ASSERT(). 30 For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT(). 31 32 @param JumpBuffer A pointer to CPU context buffer. 33 34 **/ 35 VOID 36 EFIAPI 37 InternalAssertJumpBuffer ( 38 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer 39 ); 40 41 /** 42 Saves the current CPU context that can be restored with a call to LongJump() and returns 0. 43 44 Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial 45 call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero 46 value to be returned by SetJump(). 47 48 If JumpBuffer is NULL, then ASSERT(). 49 For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT(). 50 51 @param JumpBuffer A pointer to CPU context buffer. 52 53 **/ 54 UINTN 55 EFIAPI 56 SetJump ( 57 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer 58 ) 59 { 60 InternalAssertJumpBuffer (JumpBuffer); 61 return 0; 62 } 63 64 /** 65 Restores the CPU context that was saved with SetJump(). 66 67 Restores the CPU context from the buffer specified by JumpBuffer. 68 This function never returns to the caller. 69 Instead is resumes execution based on the state of JumpBuffer. 70 71 @param JumpBuffer A pointer to CPU context buffer. 72 @param Value The value to return when the SetJump() context is restored. 73 74 **/ 75 VOID 76 EFIAPI 77 InternalLongJump ( 78 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, 79 IN UINTN Value 80 ) 81 { 82 // 83 // This function cannot work on EBC 84 // 85 ASSERT (FALSE); 86 } 87