]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/Pei/Ipf/SwitchStack.s
PI Enable:
[mirror_edk2.git] / MdeModulePkg / Core / Pei / Ipf / SwitchStack.s
1 /// @file
2 /// IPF specific SwitchStack() function
3 ///
4 /// Copyright (c) 2006, Intel Corporation
5 /// All rights reserved. This program and the accompanying materials
6 /// are licensed and made available under the terms and conditions of the BSD License
7 /// which accompanies this distribution. The full text of the license may be found at
8 /// http://opensource.org/licenses/bsd-license.php
9 ///
10 /// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 /// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 ///
13 /// Module Name: SwitchStack.s
14 ///
15 ///
16
17 .auto
18 .text
19
20 .proc IpfAsmSwitchStack
21 .type IpfAsmSwitchStack, @function
22 .regstk 6, 0, 0, 0
23 IpfAsmSwitchStack::
24 mov r14 = ar.rsc
25 movl r2 = ~((((1 << 14) - 1) << 16) | 3)
26
27 mov r17 = in1
28 mov r18 = in2
29 mov r19 = in3
30 and r2 = r14, r2
31
32 mov ar.rsc = r2
33 mov sp = in4
34 mov r20 = in5
35
36 ld8.nt1 r16 = [in0], 8
37 ld8.nta gp = [in0]
38 mov r3 = -1
39
40 loadrs
41 mov ar.bspstore = r20
42 mov b7 = r16
43
44 alloc r2 = ar.pfs, 0, 0, 3, 0
45 mov out0 = r17
46 mov out1 = r18
47 mov out2 = r19
48
49 mov ar.rnat = r3
50 mov ar.rsc = r14
51 br.call.sptk.many b0 = b7
52 .endp IpfAsmSwitchStack