1 //++ 2 // Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> 3 // This program and the accompanying materials 4 // are licensed and made available under the terms and conditions of the BSD License 5 // which accompanies this distribution. The full text of the license may be found at 6 // http://opensource.org/licenses/bsd-license.php 7 // 8 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 9 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 10 // 11 // Module Name: 12 // 13 // EsalLib.s 14 // 15 // Abstract: 16 // 17 // 18 // Revision History: 19 // 20 //-- 21 22 .file "EsalLib.s" 23 24 #include "IpfMacro.i" 25 26 // 27 // Exports 28 // 29 .globl GetEsalEntryPoint 30 31 32 //----------------------------------------------------------------------------- 33 //++ 34 // GetEsalEntryPoint 35 // 36 // Return Esal global and PSR register. 37 // 38 // On Entry : 39 // 40 // 41 // Return Value: 42 // r8 = EFI_SAL_SUCCESS 43 // r9 = Physical Plabel 44 // r10 = Virtual Plabel 45 // r11 = psr 46 // 47 // As per static calling conventions. 48 // 49 //-- 50 //--------------------------------------------------------------------------- 51 PROCEDURE_ENTRY (GetEsalEntryPoint) 52 53 NESTED_SETUP (0,8,0,0) 54 55 EsalCalcStart: 56 mov r8 = ip;; 57 add r8 = (EsalEntryPoint - EsalCalcStart), r8;; 58 mov r9 = r8;; 59 add r10 = 0x10, r8;; 60 mov r11 = psr;; 61 mov r8 = r0;; 62 63 NESTED_RETURN 64 65 PROCEDURE_EXIT (GetEsalEntryPoint) 66 67 68 69 70 71 //----------------------------------------------------------------------------- 72 //++ 73 // SetEsalPhysicalEntryPoint 74 // 75 // Set the dispatcher entry point 76 // 77 // On Entry: 78 // in0 = Physical address of Esal Dispatcher 79 // in1 = Physical GP 80 // 81 // Return Value: 82 // r8 = EFI_SAL_SUCCESS 83 // 84 // As per static calling conventions. 85 // 86 //-- 87 //--------------------------------------------------------------------------- 88 PROCEDURE_ENTRY (SetEsalPhysicalEntryPoint) 89 90 NESTED_SETUP (2,8,0,0) 91 92 EsalCalcStart1: 93 mov r8 = ip;; 94 add r8 = (EsalEntryPoint - EsalCalcStart1), r8;; 95 st8 [r8] = in0;; 96 add r8 = 0x08, r8;; 97 st8 [r8] = in1;; 98 mov r8 = r0;; 99 100 NESTED_RETURN 101 102 PROCEDURE_EXIT (SetEsalPhysicalEntryPoint) 103 104 105 //----------------------------------------------------------------------------- 106 //++ 107 // SetEsalVirtualEntryPoint 108 // 109 // Register physical address of Esal globals. 110 // 111 // On Entry : 112 // in0 = Virtual address of Esal Dispatcher 113 // in1 = Virtual GP 114 // 115 // Return Value: 116 // r8 = EFI_SAL_ERROR 117 // 118 // As per static calling conventions. 119 // 120 //-- 121 //--------------------------------------------------------------------------- 122 PROCEDURE_ENTRY (SetEsalVirtualEntryPoint) 123 124 NESTED_SETUP (2,8,0,0) 125 126 EsalCalcStart2: 127 mov r8 = ip;; 128 add r8 = (EsalEntryPoint - EsalCalcStart2), r8;; 129 add r8 = 0x10, r8;; 130 st8 [r8] = in0;; 131 add r8 = 0x08, r8;; 132 st8 [r8] = in1;; 133 mov r8 = r0;; 134 135 NESTED_RETURN 136 137 PROCEDURE_EXIT (SetEsalVirtualEntryPoint) 138 139 140 141 142 .align 32 143 EsalEntryPoint: 144 data8 0 // Physical Entry 145 data8 0 // GP 146 data8 0 // Virtual Entry 147 data8 0 // GP 148 149 150