]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Library/BaseLib/Ebc/SetJumpLongJump.c
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ebc / SetJumpLongJump.c
1 /** @file
2 Implementation of SetJump() and LongJump() on EBC.
3
4 SetJump() and LongJump() are not currently supported for the EBC processor type.
5 Implementation for EBC just returns 0 for SetJump(), and ASSERT() for LongJump().
6
7 Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10 **/
11
12 #include "BaseLibInternals.h"
13
14 /**
15 Saves the current CPU context that can be restored with a call to LongJump() and returns 0.
16
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().
20
21 If JumpBuffer is NULL, then ASSERT().
22 For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().
23
24 @param JumpBuffer A pointer to CPU context buffer.
25
26 @retval 0 Indicates a return from SetJump().
27
28 **/
29 RETURNS_TWICE
30 UINTN
31 EFIAPI
32 SetJump (
33 OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer
34 )
35 {
36 InternalAssertJumpBuffer (JumpBuffer);
37 return 0;
38 }
39
40 /**
41 Restores the CPU context that was saved with SetJump().
42
43 Restores the CPU context from the buffer specified by JumpBuffer.
44 This function never returns to the caller.
45 Instead it resumes execution based on the state of JumpBuffer.
46
47 @param JumpBuffer A pointer to CPU context buffer.
48 @param Value The value to return when the SetJump() context is restored.
49
50 **/
51 VOID
52 EFIAPI
53 InternalLongJump (
54 IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,
55 IN UINTN Value
56 )
57 {
58 //
59 // This function cannot work on EBC
60 //
61 ASSERT (FALSE);
62 }