]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/BaseLib/Ipf/SwitchStack.s
1. Port X64, IPF and EBC arch for BaseLib
[mirror_edk2.git] / MdePkg / Library / BaseLib / Ipf / SwitchStack.s
CommitLineData
f1baef62 1/// @file\r
2/// IPF specific SwitchStack() function\r
3///\r
4/// Copyright (c) 2006, Intel Corporation\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/// 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
30\r
31 mov ar.rsc = r2\r
32 mov sp = in3\r
33 mov r19 = in4\r
34\r
35 ld8.nt1 r16 = [in0], 8\r
36 ld8.nta gp = [in0]\r
37 mov r3 = -1\r
38\r
39 loadrs\r
40 mov ar.bspstore = r19\r
41 mov b7 = r16\r
42\r
43 alloc r2 = ar.pfs, 0, 0, 2, 0\r
44 mov out0 = r17\r
45 mov out1 = r18\r
46\r
47 mov ar.rnat = r3\r
48 mov ar.rsc = r14\r
49 br.call.sptk.many b0 = b7\r
50.endp AsmSwitchStackAndBackingStore\r