]>
Commit | Line | Data |
---|---|---|
863be5d0 | 1 | /// @file\r |
2 | /// Assembly procedures to get and set ESAL entry point.\r | |
3 | ///\r | |
4 | /// Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
5 | /// 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 | \r | |
14 | .auto\r | |
15 | .text\r | |
16 | \r | |
17 | #include "IpfMacro.i"\r | |
18 | \r | |
19 | //\r | |
20 | // Exports\r | |
21 | //\r | |
22 | ASM_GLOBAL GetEsalEntryPoint\r | |
23 | \r | |
24 | //-----------------------------------------------------------------------------\r | |
25 | //++\r | |
26 | // GetEsalEntryPoint\r | |
27 | //\r | |
28 | // Return Esal global and PSR register.\r | |
29 | //\r | |
30 | // On Entry :\r | |
31 | //\r | |
32 | //\r | |
33 | // Return Value:\r | |
34 | // r8 = EFI_SAL_SUCCESS\r | |
35 | // r9 = Physical Plabel\r | |
36 | // r10 = Virtual Plabel\r | |
37 | // r11 = psr\r | |
38 | // \r | |
39 | // As per static calling conventions. \r | |
40 | // \r | |
41 | //--\r | |
42 | //---------------------------------------------------------------------------\r | |
43 | PROCEDURE_ENTRY (GetEsalEntryPoint)\r | |
44 | \r | |
45 | NESTED_SETUP (0,8,0,0)\r | |
46 | \r | |
47 | EsalCalcStart:\r | |
48 | mov r8 = ip;;\r | |
49 | add r8 = (EsalEntryPoint - EsalCalcStart), r8;;\r | |
50 | mov r9 = r8;;\r | |
51 | add r10 = 0x10, r8;;\r | |
52 | mov r11 = psr;;\r | |
53 | mov r8 = r0;;\r | |
54 | \r | |
55 | NESTED_RETURN\r | |
56 | \r | |
57 | PROCEDURE_EXIT (GetEsalEntryPoint)\r | |
58 | \r | |
59 | //-----------------------------------------------------------------------------\r | |
60 | //++\r | |
61 | // SetEsalPhysicalEntryPoint\r | |
62 | //\r | |
63 | // Set the dispatcher entry point\r | |
64 | //\r | |
65 | // On Entry:\r | |
66 | // in0 = Physical address of Esal Dispatcher\r | |
67 | // in1 = Physical GP\r | |
68 | //\r | |
69 | // Return Value: \r | |
70 | // r8 = EFI_SAL_SUCCESS\r | |
71 | // \r | |
72 | // As per static calling conventions. \r | |
73 | // \r | |
74 | //--\r | |
75 | //---------------------------------------------------------------------------\r | |
76 | PROCEDURE_ENTRY (SetEsalPhysicalEntryPoint)\r | |
77 | \r | |
78 | NESTED_SETUP (2,8,0,0)\r | |
79 | \r | |
80 | EsalCalcStart1:\r | |
81 | mov r8 = ip;;\r | |
82 | add r8 = (EsalEntryPoint - EsalCalcStart1), r8;;\r | |
83 | st8 [r8] = in0;;\r | |
84 | add r8 = 0x08, r8;;\r | |
85 | st8 [r8] = in1;;\r | |
86 | mov r8 = r0;;\r | |
87 | \r | |
88 | NESTED_RETURN\r | |
89 | \r | |
90 | PROCEDURE_EXIT (SetEsalPhysicalEntryPoint)\r | |
91 | \r | |
92 | //-----------------------------------------------------------------------------\r | |
93 | //++\r | |
94 | // SetEsalVirtualEntryPoint\r | |
95 | //\r | |
96 | // Register physical address of Esal globals.\r | |
97 | //\r | |
98 | // On Entry :\r | |
99 | // in0 = Virtual address of Esal Dispatcher\r | |
100 | // in1 = Virtual GP\r | |
101 | //\r | |
102 | // Return Value: \r | |
103 | // r8 = EFI_SAL_ERROR\r | |
104 | // \r | |
105 | // As per static calling conventions. \r | |
106 | // \r | |
107 | //--\r | |
108 | //---------------------------------------------------------------------------\r | |
109 | PROCEDURE_ENTRY (SetEsalVirtualEntryPoint)\r | |
110 | \r | |
111 | NESTED_SETUP (2,8,0,0)\r | |
112 | \r | |
113 | EsalCalcStart2:\r | |
114 | mov r8 = ip;;\r | |
115 | add r8 = (EsalEntryPoint - EsalCalcStart2), r8;;\r | |
116 | add r8 = 0x10, r8;;\r | |
117 | st8 [r8] = in0;;\r | |
118 | add r8 = 0x08, r8;;\r | |
119 | st8 [r8] = in1;;\r | |
120 | mov r8 = r0;;\r | |
121 | \r | |
122 | NESTED_RETURN\r | |
123 | \r | |
124 | PROCEDURE_EXIT (SetEsalVirtualEntryPoint)\r | |
125 | \r | |
126 | .align 32\r | |
127 | EsalEntryPoint: \r | |
128 | data8 0 // Physical Entry\r | |
129 | data8 0 // GP\r | |
130 | data8 0 // Virtual Entry\r | |
131 | data8 0 // GP\r |