]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFspPkg/Library/BaseFspSwitchStackLib/Ia32/Stack.s
Eliminate duplicated file GUID.
[mirror_edk2.git] / IntelFspPkg / Library / BaseFspSwitchStackLib / Ia32 / Stack.s
1 #------------------------------------------------------------------------------
2 #
3 # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
4 # This program and the accompanying materials
5 # are licensed and made available under the terms and conditions of the BSD License
6 # which accompanies this distribution. The full text of the license may be found at
7 # http://opensource.org/licenses/bsd-license.php.
8 #
9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 #
12 # Abstract:
13 #
14 # Switch the stack from temporary memory to permenent memory.
15 #
16 #------------------------------------------------------------------------------
17
18 ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)
19 ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)
20
21 #------------------------------------------------------------------------------
22 # UINT32
23 # EFIAPI
24 # Pei2LoaderSwitchStack (
25 # VOID
26 # )
27 #------------------------------------------------------------------------------
28 ASM_GLOBAL ASM_PFX(Pei2LoaderSwitchStack)
29 ASM_PFX(Pei2LoaderSwitchStack):
30 jmp ASM_PFX(Loader2PeiSwitchStack)
31
32 #------------------------------------------------------------------------------
33 # UINT32
34 # EFIAPI
35 # Loader2PeiSwitchStack (
36 # )
37 #------------------------------------------------------------------------------
38 ASM_GLOBAL ASM_PFX(Loader2PeiSwitchStack)
39 ASM_PFX(Loader2PeiSwitchStack):
40 #Save current contexts
41 push $exit
42 pushf
43 pushf
44 cli
45 pusha
46 push $0x0
47 push $0x0
48 sidt (%esp)
49
50 # Load new stack
51 push %esp
52 call ASM_PFX(SwapStack)
53 mov %eax,%esp
54
55 # Restore previous contexts
56 lidt (%esp)
57 add $8,%esp
58 popa
59 popf
60 popf
61 exit:
62 ret
63
64