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