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