Home | History | Annotate | Download | only in Protocol
      1 /** @file
      2   MCA/PMI/INIT Protocol as defined in PI Specification VOLUME 4.
      3 
      4   This protocol provides services to handle Machine Checks (MCA),
      5   Initialization (INIT) events, and Platform Management Interrupt (PMI) events
      6   on an Intel Itanium Processor Family based system.
      7 
      8   Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
      9   This program and the accompanying materials
     10   are licensed and made available under the terms and conditions of the BSD License
     11   which accompanies this distribution.  The full text of the license may be found at
     12   http://opensource.org/licenses/bsd-license.php
     13 
     14   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     15   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     16 
     17 **/
     18 
     19 #ifndef __MCA_INIT_PMI_PROTOCOL_H__
     20 #define __MCA_INIT_PMI_PROTOCOL_H__
     21 
     22 ///
     23 /// Global ID for the MCA/PMI/INIT Protocol.
     24 ///
     25 #define EFI_SAL_MCA_INIT_PMI_PROTOCOL_GUID \
     26   { 0xb60dc6e8, 0x3b6f, 0x11d5, {0xaf, 0x9, 0x0, 0xa0, 0xc9, 0x44, 0xa0, 0x5b} }
     27 
     28 
     29 ///
     30 /// Declare forward reference for the Timer Architectural Protocol
     31 ///
     32 typedef struct _EFI_SAL_MCA_INIT_PMI_PROTOCOL  EFI_SAL_MCA_INIT_PMI_PROTOCOL;
     33 
     34 #pragma pack(1)
     35 ///
     36 /// MCA Records Structure
     37 ///
     38 typedef struct {
     39   UINT64  First : 1;
     40   UINT64  Last : 1;
     41   UINT64  EntryCount : 16;
     42   UINT64  DispatchedCount : 16;
     43   UINT64  Reserved : 30;
     44 } SAL_MCA_COUNT_STRUCTURE;
     45 
     46 #pragma pack()
     47 
     48 /**
     49   Prototype of MCA handler.
     50 
     51   @param  ModuleGlobal                The context of MCA Handler
     52   @param  ProcessorStateParameters    The processor state parameters (PSP)
     53   @param  MinstateBase                Base address of the min-state
     54   @param  RendezvouseStateInformation Rendezvous state information to be passed to
     55                                       the OS on OS MCA entry
     56   @param  CpuIndex                    Index of the logical processor
     57   @param  McaCountStructure           Pointer to the MCA records structure
     58   @param  CorrectedMachineCheck       This flag is set to TRUE is the MCA has been
     59                                       corrected by the handler or by a previous handler
     60 
     61   @retval EFI_SUCCESS                 Handler successfully returned
     62 
     63 **/
     64 typedef
     65 EFI_STATUS
     66 (EFIAPI *EFI_SAL_MCA_HANDLER)(
     67   IN  VOID                    *ModuleGlobal,
     68   IN  UINT64                  ProcessorStateParameters,
     69   IN  EFI_PHYSICAL_ADDRESS    MinstateBase,
     70   IN  UINT64                  RendezvouseStateInformation,
     71   IN  UINT64                  CpuIndex,
     72   IN  SAL_MCA_COUNT_STRUCTURE *McaCountStructure,
     73   OUT BOOLEAN                 *CorrectedMachineCheck
     74   );
     75 
     76 /**
     77   Prototype of INIT handler.
     78 
     79   @param  ModuleGlobal                The context of INIT Handler
     80   @param  ProcessorStateParameters    The processor state parameters (PSP)
     81   @param  MinstateBase                Base address of the min-state
     82   @param  McaInProgress               This flag indicates if an MCA is in progress
     83   @param  CpuIndex                    Index of the logical processor
     84   @param  McaCountStructure           Pointer to the MCA records structure
     85   @param  DumpSwitchPressed           This flag indicates the crash dump switch has been pressed
     86 
     87   @retval EFI_SUCCESS                 Handler successfully returned
     88 
     89 **/
     90 typedef
     91 EFI_STATUS
     92 (EFIAPI *EFI_SAL_INIT_HANDLER)(
     93   IN  VOID                     *ModuleGlobal,
     94   IN  UINT64                   ProcessorStateParameters,
     95   IN  EFI_PHYSICAL_ADDRESS     MinstateBase,
     96   IN  BOOLEAN                  McaInProgress,
     97   IN  UINT64                   CpuIndex,
     98   IN  SAL_MCA_COUNT_STRUCTURE  *McaCountStructure,
     99   OUT BOOLEAN                  *DumpSwitchPressed
    100   );
    101 
    102 /**
    103   Prototype of PMI handler
    104 
    105   @param  ModuleGlobal                The context of PMI Handler
    106   @param  CpuIndex                    Index of the logical processor
    107   @param  PmiVector                   The PMI vector number as received from the PALE_PMI exit state (GR24)
    108 
    109   @retval EFI_SUCCESS                 Handler successfully returned
    110 
    111 **/
    112 typedef
    113 EFI_STATUS
    114 (EFIAPI *EFI_SAL_PMI_HANDLER)(
    115   IN VOID          *ModuleGlobal,
    116   IN UINT64        CpuIndex,
    117   IN UINT64        PmiVector
    118   );
    119 
    120 /**
    121   Register a MCA handler with the MCA dispatcher.
    122 
    123   @param  This                        The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance
    124   @param  McaHandler                  The MCA handler to register
    125   @param  ModuleGlobal                The context of MCA Handler
    126   @param  MakeFirst                   This flag specifies the handler should be made first in the list
    127   @param  MakeLast                    This flag specifies the handler should be made last in the list
    128 
    129   @retval EFI_SUCCESS                 MCA Handle was registered
    130   @retval EFI_OUT_OF_RESOURCES        No more resources to register an MCA handler
    131   @retval EFI_INVALID_PARAMETER       Invalid parameters were passed
    132 
    133 **/
    134 typedef
    135 EFI_STATUS
    136 (EFIAPI *EFI_SAL_REGISTER_MCA_HANDLER)(
    137   IN  EFI_SAL_MCA_INIT_PMI_PROTOCOL         *This,
    138   IN  EFI_SAL_MCA_HANDLER                   McaHandler,
    139   IN  VOID                                  *ModuleGlobal,
    140   IN  BOOLEAN                               MakeFirst,
    141   IN  BOOLEAN                               MakeLast
    142   );
    143 
    144 /**
    145   Register an INIT handler with the INIT dispatcher.
    146 
    147   @param  This                        The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance
    148   @param  InitHandler                 The INIT handler to register
    149   @param  ModuleGlobal                The context of INIT Handler
    150   @param  MakeFirst                   This flag specifies the handler should be made first in the list
    151   @param  MakeLast                    This flag specifies the handler should be made last in the list
    152 
    153   @retval EFI_SUCCESS                 INIT Handle was registered
    154   @retval EFI_OUT_OF_RESOURCES        No more resources to register an INIT handler
    155   @retval EFI_INVALID_PARAMETER       Invalid parameters were passed
    156 
    157 **/
    158 typedef
    159 EFI_STATUS
    160 (EFIAPI *EFI_SAL_REGISTER_INIT_HANDLER)(
    161   IN  EFI_SAL_MCA_INIT_PMI_PROTOCOL         *This,
    162   IN  EFI_SAL_INIT_HANDLER                  InitHandler,
    163   IN  VOID                                  *ModuleGlobal,
    164   IN  BOOLEAN                               MakeFirst,
    165   IN  BOOLEAN                               MakeLast
    166   );
    167 
    168 /**
    169   Register a PMI handler with the PMI dispatcher.
    170 
    171   @param  This                        The EFI_SAL_MCA_INIT_PMI_PROTOCOL instance
    172   @param  PmiHandler                  The PMI handler to register
    173   @param  ModuleGlobal                The context of PMI Handler
    174   @param  MakeFirst                   This flag specifies the handler should be made first in the list
    175   @param  MakeLast                    This flag specifies the handler should be made last in the list
    176 
    177   @retval EFI_SUCCESS                 PMI Handle was registered
    178   @retval EFI_OUT_OF_RESOURCES        No more resources to register an PMI handler
    179   @retval EFI_INVALID_PARAMETER       Invalid parameters were passed
    180 
    181 **/
    182 typedef
    183 EFI_STATUS
    184 (EFIAPI *EFI_SAL_REGISTER_PMI_HANDLER)(
    185   IN  EFI_SAL_MCA_INIT_PMI_PROTOCOL         *This,
    186   IN  EFI_SAL_PMI_HANDLER                   PmiHandler,
    187   IN  VOID                                  *ModuleGlobal,
    188   IN  BOOLEAN                               MakeFirst,
    189   IN  BOOLEAN                               MakeLast
    190   );
    191 
    192 ///
    193 /// This protocol is used to register MCA, INIT and PMI handlers with their respective dispatcher
    194 ///
    195 struct _EFI_SAL_MCA_INIT_PMI_PROTOCOL {
    196   EFI_SAL_REGISTER_MCA_HANDLER  RegisterMcaHandler;
    197   EFI_SAL_REGISTER_INIT_HANDLER RegisterInitHandler;
    198   EFI_SAL_REGISTER_PMI_HANDLER  RegisterPmiHandler;
    199   BOOLEAN                       McaInProgress;       ///< Whether MCA handler is in progress
    200   BOOLEAN                       InitInProgress;      ///< Whether Init handler is in progress
    201   BOOLEAN                       PmiInProgress;       ///< Whether Pmi handler is in progress
    202 };
    203 
    204 extern EFI_GUID gEfiSalMcaInitPmiProtocolGuid;
    205 
    206 #endif
    207 
    208