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