]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
2c7e5c2f HT |
3 | Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
3eb9473e | 5 | are licensed and made available under the terms and conditions of the BSD License \r |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | SetJumpLongJump.c\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
c7f33ca4 | 22 | #include "BaseLibInternals.h"\r |
3eb9473e | 23 | \r |
24 | /**\r | |
25 | Worker function that checks ASSERT condition for JumpBuffer\r | |
26 | \r | |
27 | Checks ASSERT condition for JumpBuffer.\r | |
28 | \r | |
29 | If JumpBuffer is NULL, then ASSERT().\r | |
30 | For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r | |
31 | \r | |
32 | @param JumpBuffer A pointer to CPU context buffer.\r | |
33 | \r | |
34 | **/\r | |
35 | VOID\r | |
c7f33ca4 | 36 | EFIAPI\r |
3eb9473e | 37 | InternalAssertJumpBuffer (\r |
38 | IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r | |
39 | );\r | |
40 | \r | |
41 | /**\r | |
42 | Saves the current CPU context that can be restored with a call to LongJump() and returns 0.\r | |
43 | \r | |
44 | Saves the current CPU context in the buffer specified by JumpBuffer and returns 0. The initial \r | |
45 | call to SetJump() must always return 0. Subsequent calls to LongJump() cause a non-zero \r | |
46 | value to be returned by SetJump(). \r | |
47 | \r | |
48 | If JumpBuffer is NULL, then ASSERT().\r | |
49 | For IPF CPUs, if JumpBuffer is not aligned on a 16-byte boundary, then ASSERT().\r | |
50 | \r | |
51 | @param JumpBuffer A pointer to CPU context buffer.\r | |
52 | \r | |
53 | **/\r | |
54 | UINTN\r | |
55 | EFIAPI\r | |
56 | SetJump (\r | |
57 | IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer\r | |
58 | )\r | |
59 | {\r | |
60 | InternalAssertJumpBuffer (JumpBuffer);\r | |
61 | return 0;\r | |
62 | }\r | |
63 | \r | |
64 | /**\r | |
65 | Restores the CPU context that was saved with SetJump().\r | |
66 | \r | |
67 | Restores the CPU context from the buffer specified by JumpBuffer.\r | |
68 | This function never returns to the caller.\r | |
69 | Instead is resumes execution based on the state of JumpBuffer.\r | |
70 | \r | |
71 | @param JumpBuffer A pointer to CPU context buffer.\r | |
72 | @param Value The value to return when the SetJump() context is restored.\r | |
73 | \r | |
74 | **/\r | |
75 | VOID\r | |
76 | EFIAPI\r | |
77 | InternalLongJump (\r | |
78 | IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer,\r | |
79 | IN UINTN Value\r | |
80 | )\r | |
81 | {\r | |
82 | //\r | |
83 | // This function cannot work on EBC\r | |
84 | //\r | |
85 | ASSERT (FALSE);\r | |
86 | }\r |