]>
Commit | Line | Data |
---|---|---|
ebd04fc2 | 1 | #------------------------------------------------------------------------------ \r |
2 | #\r | |
3 | # Copyright (c) 2006 - 2009, Intel Corporation<BR>\r | |
4 | # Portions copyright (c) 2008-2009 Apple Inc.<BR>\r | |
5 | # All rights reserved. This program and the accompanying materials\r | |
6 | # are licensed and made available under the terms and conditions of the BSD License\r | |
7 | # which accompanies this distribution. The full text of the license may be found at\r | |
8 | # http://opensource.org/licenses/bsd-license.php\r | |
9 | #\r | |
10 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | #\r | |
13 | #------------------------------------------------------------------------------\r | |
14 | .text\r | |
15 | .p2align 2\r | |
16 | \r | |
17 | .globl ASM_PFX(SetJump)\r | |
18 | .globl ASM_PFX(InternalLongJump)\r | |
19 | \r | |
20 | #/**\r | |
21 | # Saves the current CPU context that can be restored with a call to LongJump() and returns 0.#\r | |
22 | #\r | |
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 | |
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 | |
31 | #\r | |
32 | #**/\r | |
33 | #\r | |
34 | #UINTN\r | |
35 | #EFIAPI\r | |
36 | #SetJump (\r | |
37 | # IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer // R0\r | |
38 | # );\r | |
39 | #\r | |
40 | ASM_PFX(SetJump):\r | |
41 | mov r3, r13\r | |
42 | stmia r0, {r3-r12,r14}\r | |
43 | eor r0, r0, r0\r | |
44 | bx lr\r | |
45 | \r | |
46 | #/**\r | |
47 | # Restores the CPU context that was saved with SetJump().#\r | |
48 | #\r | |
49 | # Restores the CPU context from the buffer specified by JumpBuffer.\r | |
50 | # This function never returns to the caller.\r | |
51 | # Instead is resumes execution based on the state of JumpBuffer.\r | |
52 | #\r | |
53 | # @param JumpBuffer A pointer to CPU context buffer.\r | |
54 | # @param Value The value to return when the SetJump() context is restored.\r | |
55 | #\r | |
56 | #**/\r | |
57 | #VOID\r | |
58 | #EFIAPI\r | |
59 | #InternalLongJump (\r | |
60 | # IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, // R0\r | |
61 | # IN UINTN Value // R1\r | |
62 | # );\r | |
63 | #\r | |
64 | ASM_PFX(InternalLongJump):\r | |
65 | ldmia r0, {r3-r12,r14}\r | |
66 | mov r13, r3\r | |
67 | mov r0, r1\r | |
68 | bx lr\r | |
69 | \r | |
70 | ASM_FUNCTION_REMOVE_IF_UNREFERENCED()\r |