1 /** @file
2 Long Jump functions.
3
4 Copyright (c) 2006 - 2008, Intel Corporation. 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
16
17
18 #include "BaseLibInternals.h"
19
20 /**
21 Restores the CPU context that was saved with SetJump().
22
23 Restores the CPU context from the buffer specified by JumpBuffer. This
24 function never returns to the caller. Instead is resumes execution based on
25 the state of JumpBuffer.
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 If Value is 0, then ASSERT().
30
31 @param JumpBuffer A pointer to CPU context buffer.
32 @param Value The value to return when the SetJump() context is
33 restored and must be non-zero.
34
35 **/
36 VOID
37 EFIAPI
LongJump(IN BASE_LIBRARY_JUMP_BUFFER * JumpBuffer,IN UINTN Value)38 LongJump (
39 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
40 IN UINTN Value
41 )
42 {
43 InternalAssertJumpBuffer (JumpBuffer);
44 ASSERT (Value != 0);
45
46 InternalLongJump (JumpBuffer, Value);
47 }
48