]>
Commit | Line | Data |
---|---|---|
c8ec22a2 JY |
1 | #------------------------------------------------------------------------------\r |
2 | #\r | |
3 | # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r | |
4 | # This program and the accompanying materials\r | |
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 | # Abstract:\r | |
13 | #\r | |
14 | # Switch the stack from temporary memory to permenent memory.\r | |
15 | #\r | |
16 | #------------------------------------------------------------------------------\r | |
17 | \r | |
18 | ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r | |
19 | ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r | |
20 | \r | |
21 | #------------------------------------------------------------------------------\r | |
22 | # UINT32\r | |
23 | # EFIAPI\r | |
24 | # Pei2LoaderSwitchStack (\r | |
25 | # VOID\r | |
26 | # )\r | |
27 | #------------------------------------------------------------------------------\r | |
28 | ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)\r | |
29 | ASM_PFX(Pei2LoaderSwitchStack):\r | |
30 | jmp ASM_PFX(Loader2PeiSwitchStack)\r | |
31 | \r | |
32 | #------------------------------------------------------------------------------\r | |
33 | # UINT32\r | |
34 | # EFIAPI\r | |
35 | # Loader2PeiSwitchStack (\r | |
36 | # )\r | |
37 | #------------------------------------------------------------------------------\r | |
38 | ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)\r | |
39 | ASM_PFX(Loader2PeiSwitchStack):\r | |
40 | #Save current contexts\r | |
41 | push $exit\r | |
42 | pushf\r | |
43 | pushf\r | |
44 | cli\r | |
45 | pusha\r | |
46 | push $0x0\r | |
47 | push $0x0\r | |
48 | sidt (%esp)\r | |
49 | \r | |
50 | # Load new stack\r | |
51 | push %esp\r | |
52 | call ASM_PFX(SwapStack)\r | |
53 | mov %eax,%esp\r | |
54 | \r | |
55 | # Restore previous contexts\r | |
56 | lidt (%esp)\r | |
57 | add $8,%esp\r | |
58 | popa\r | |
59 | popf\r | |
60 | popf\r | |
61 | exit:\r | |
62 | ret\r | |
63 | \r | |
64 | \r |