]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ipf/SwitchStack.s
Current IPF version SwitchStack implementation uses loadrs instruction to restore...
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / SwitchStack.s
CommitLineData
f1baef62 1/// @file\r
2/// IPF specific SwitchStack() function\r
3///\r
fcbccedb 4/// Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
bb817c56 5/// This program and the accompanying materials\r
f1baef62 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
c5b16b1b 8/// http://opensource.org/licenses/bsd-license.php.\r
f1baef62 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/// Module Name: SwitchStack.s\r
14///\r
15///\r
16\r
17.auto\r
18.text\r
19\r
20.proc AsmSwitchStackAndBackingStore\r
21.type AsmSwitchStackAndBackingStore, @function\r
22.regstk 5, 0, 0, 0\r
23AsmSwitchStackAndBackingStore::\r
24 mov r14 = ar.rsc\r
25 movl r2 = ~((((1 << 14) - 1) << 16) | 3)\r
26\r
27 mov r17 = in1\r
28 mov r18 = in2\r
29 and r2 = r14, r2\r
fcbccedb 30 \r
31 flushrs\r
32 \r
f1baef62 33 mov ar.rsc = r2\r
34 mov sp = in3\r
35 mov r19 = in4\r
36\r
37 ld8.nt1 r16 = [in0], 8\r
38 ld8.nta gp = [in0]\r
39 mov r3 = -1\r
40\r
41 loadrs\r
42 mov ar.bspstore = r19\r
43 mov b7 = r16\r
44\r
45 alloc r2 = ar.pfs, 0, 0, 2, 0\r
46 mov out0 = r17\r
47 mov out1 = r18\r
48\r
49 mov ar.rnat = r3\r
50 mov ar.rsc = r14\r
51 br.call.sptk.many b0 = b7\r
52.endp AsmSwitchStackAndBackingStore\r