Home | History | Annotate | Download | only in Ipf
      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 //
     22 ASM_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 //---------------------------------------------------------------------------
     43 PROCEDURE_ENTRY (GetEsalEntryPoint)
     44 
     45       NESTED_SETUP (0,8,0,0)
     46 
     47 EsalCalcStart:
     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 
     57 PROCEDURE_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 //---------------------------------------------------------------------------
     76 PROCEDURE_ENTRY (SetEsalPhysicalEntryPoint)
     77 
     78       NESTED_SETUP (2,8,0,0)
     79 
     80 EsalCalcStart1:
     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 
     90 PROCEDURE_EXIT (SetEsalPhysicalEntryPoint)
     91 
     92 .align 32
     93 EsalEntryPoint:
     94     data8 0   // Physical Entry
     95     data8 0   //         GP
     96     data8 0   // Virtual Entry
     97     data8 0   //         GP
     98