]> git.proxmox.com Git - mirror_edk2.git/blame - OldMdePkg/Library/BaseLib/Ipf/longjmp.s
Moved the MdePkg to OldMdePkg so that new code in MdePkg does not break existing...
[mirror_edk2.git] / OldMdePkg / Library / BaseLib / Ipf / longjmp.s
CommitLineData
4cbd2175 1/// @file\r
2/// Contains an implementation of longjmp for the Itanium-based architecture.\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: longjmp.s\r
14///\r
15///\r
16\r
17.auto\r
18.text\r
19\r
20.proc InternalLongJump\r
21.type InternalLongJump, @function\r
22.regstk 2, 0, 0, 0\r
23InternalLongJump::\r
24 add r10 = 0x10*20 + 8*14, in0\r
25 movl r2 = ~((((1 << 14) - 1) << 16) | 3)\r
26\r
27 ld8.nt1 r14 = [r10], -8*2 // BSP, skip PFS\r
28 mov r15 = ar.bspstore // BSPSTORE\r
29\r
30 ld8.nt1 r17 = [r10], -8 // UNAT after spill\r
31 mov r16 = ar.rsc // RSC\r
32 cmp.leu p6 = r14, r15\r
33\r
34 ld8.nt1 r18 = [r10], -8 // UNAT\r
35 ld8.nt1 r25 = [r10], -8 // b5\r
36 and r2 = r16, r2\r
37\r
38 ldf.fill.nt1 f2 = [in0], 0x10\r
39 ld8.nt1 r24 = [r10], -8 // b4\r
40 mov b5 = r25\r
41\r
42 mov ar.rsc = r2\r
43 ld8.nt1 r23 = [r10], -8 // b3\r
44 mov b4 = r24\r
45\r
46 ldf.fill.nt1 f3 = [in0], 0x10\r
47 mov ar.unat = r17\r
48(p6) br.spnt.many _skip_flushrs\r
49\r
50 flushrs\r
51 mov r15 = ar.bsp // New BSPSTORE\r
52\r
53_skip_flushrs:\r
54 mov r31 = ar.rnat // RNAT\r
55 loadrs\r
56\r
57 ldf.fill.nt1 f4 = [in0], 0x10\r
58 ld8.nt1 r22 = [r10], -8\r
59 dep r2 = -1, r14, 3, 6\r
60\r
61 ldf.fill.nt1 f5 = [in0], 0x10\r
62 ld8.nt1 r21 = [r10], -8\r
63 cmp.ltu p6 = r2, r15\r
64\r
65 ld8.nt1 r20 = [r10], -0x10 // skip sp\r
66(p6) ld8.nta r31 = [r2]\r
67 mov b3 = r23\r
68\r
69 ldf.fill.nt1 f16 = [in0], 0x10\r
70 ld8.fill.nt1 r7 = [r10], -8\r
71 mov b2 = r22\r
72\r
73 ldf.fill.nt1 f17 = [in0], 0x10\r
74 ld8.fill.nt1 r6 = [r10], -8\r
75 mov b1 = r21\r
76\r
77 ldf.fill.nt1 f18 = [in0], 0x10\r
78 ld8.fill.nt1 r5 = [r10], -8\r
79 mov b0 = r20\r
80\r
81 ldf.fill.nt1 f19 = [in0], 0x10\r
82 ld8.fill.nt1 r4 = [r10], 8*13\r
83\r
84 ldf.fill.nt1 f20 = [in0], 0x10\r
85 ld8.nt1 r19 = [r10], 0x10 // PFS\r
86\r
87 ldf.fill.nt1 f21 = [in0], 0x10\r
88 ld8.nt1 r26 = [r10], 8 // Predicate\r
89 mov ar.pfs = r19\r
90\r
91 ldf.fill.nt1 f22 = [in0], 0x10\r
92 ld8.nt1 r27 = [r10], 8 // LC\r
93 mov pr = r26, -1\r
94\r
95 ldf.fill.nt1 f23 = [in0], 0x10\r
96 ld8.nt1 r28 = [r10], -17*8 - 0x10\r
97 mov ar.lc = r27\r
98\r
99 ldf.fill.nt1 f24 = [in0], 0x10\r
100 ldf.fill.nt1 f25 = [in0], 0x10\r
101 mov r8 = in1\r
102\r
103 ldf.fill.nt1 f26 = [in0], 0x10\r
104 ldf.fill.nt1 f31 = [r10], -0x10\r
105\r
106 ldf.fill.nt1 f27 = [in0], 0x10\r
107 ldf.fill.nt1 f30 = [r10], -0x10\r
108\r
109 ldf.fill.nt1 f28 = [in0]\r
110 ldf.fill.nt1 f29 = [r10], 0x10*3 + 8*4\r
111\r
112 ld8.fill.nt1 sp = [r10]\r
113 mov ar.unat = r18\r
114\r
115 mov ar.bspstore = r14\r
116 mov ar.rnat = r31\r
117\r
118 invala\r
119 mov ar.rsc = r16\r
120 br.ret.sptk b0\r
121.endp\r