]>
Commit | Line | Data |
---|---|---|
f1baef62 | 1 | /** @file\r |
76d99594 | 2 | Implementation of SetJump() and LongJump() on EBC.\r |
0a6c0fd5 | 3 | \r |
76d99594 | 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 | |
f1baef62 | 6 | \r |
bb817c56 | 7 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 8 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
f1baef62 | 9 | \r |
f1baef62 | 10 | **/\r |
1efcc4ae | 11 | \r |
47fc17d8 | 12 | #include "BaseLibInternals.h"\r |
f1baef62 | 13 | \r |
f1baef62 | 14 | /**\r |
15 | Saves the current CPU context that can be restored with a call to LongJump() and returns 0.\r | |
16 | \r | |
c6aa36b6 | 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 | |
f1baef62 | 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 | |
c6aa36b6 | 25 | \r |
0a6c0fd5 | 26 | @retval 0 Indicates a return from SetJump().\r |
27 | \r | |
f1baef62 | 28 | **/\r |
2117989c | 29 | RETURNS_TWICE\r |
f1baef62 | 30 | UINTN\r |
31 | EFIAPI\r | |
32 | SetJump (\r | |
0a6c0fd5 | 33 | OUT BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r |
f1baef62 | 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 | |
76d99594 | 45 | Instead it resumes execution based on the state of JumpBuffer.\r |
f1baef62 | 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 | |
51 | VOID\r | |
52 | EFIAPI\r | |
53 | InternalLongJump (\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 |