Home | History | Annotate | Download | only in PiSmmStatusCodeOnFrameworkSmmStatusCodeThunk
      1 /** @file
      2   Include file for PI SMM Status Code Protocol on Framework SMM Status Code Protocol Thunk driver.
      3 
      4   Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
      5   This program and the accompanying materials are licensed and made available under
      6   the terms and conditions of the BSD License that accompanies this distribution.
      7   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 
     15 #ifndef __PI_SMM_STATUS_CODE_ON_FRAMEWORK_SMM_STATUS_CODE_H__
     16 #define __PI_SMM_STATUS_CODE_ON_FRAMEWORK_SMM_STATUS_CODE_H__
     17 
     18 
     19 #include <Protocol/SmmReportStatusCodeHandler.h>
     20 #include <Protocol/SmmStatusCode.h>
     21 
     22 #include <Library/BaseLib.h>
     23 #include <Library/DebugLib.h>
     24 #include <Library/SynchronizationLib.h>
     25 #include <Library/UefiDriverEntryPoint.h>
     26 #include <Library/SmmServicesTableLib.h>
     27 #include <Library/MemoryAllocationLib.h>
     28 
     29 #define SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE  SIGNATURE_32 ('s', 'h', 'c', 'e')
     30 
     31 typedef struct {
     32   UINTN                         Signature;
     33   EFI_SMM_RSC_HANDLER_CALLBACK  RscHandlerCallback;
     34   LIST_ENTRY                    Node;
     35 } SMM_RSC_HANDLER_CALLBACK_ENTRY;
     36 
     37 /**
     38   Register the callback function for ReportStatusCode() notification.
     39 
     40   When this function is called the function pointer is added to an internal list and any future calls to
     41   ReportStatusCode() will be forwarded to the Callback function.
     42 
     43   @param[in] Callback           A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called
     44                                 when a call to ReportStatusCode() occurs.
     45 
     46   @retval EFI_SUCCESS           Function was successfully registered.
     47   @retval EFI_INVALID_PARAMETER The callback function was NULL.
     48   @retval EFI_OUT_OF_RESOURCES  The internal buffer ran out of space. No more functions can be
     49                                 registered.
     50   @retval EFI_ALREADY_STARTED   The function was already registered. It can't be registered again.
     51 
     52 **/
     53 EFI_STATUS
     54 EFIAPI
     55 Register (
     56   IN EFI_SMM_RSC_HANDLER_CALLBACK   Callback
     57   );
     58 
     59 /**
     60   Remove a previously registered callback function from the notification list.
     61 
     62   ReportStatusCode() messages will no longer be forwarded to the Callback function.
     63 
     64   @param[in] Callback           A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
     65                                 unregistered.
     66 
     67   @retval EFI_SUCCESS           The function was successfully unregistered.
     68   @retval EFI_INVALID_PARAMETER The callback function was NULL.
     69   @retval EFI_NOT_FOUND         The callback function was not found to be unregistered.
     70 
     71 **/
     72 EFI_STATUS
     73 EFIAPI
     74 Unregister (
     75   IN EFI_SMM_RSC_HANDLER_CALLBACK Callback
     76   );
     77 
     78 /**
     79   Provides an interface that a software module can call to report a status code.
     80 
     81   @param  This             EFI_SMM_STATUS_CODE_PROTOCOL instance.
     82   @param  Type             Indicates the type of status code being reported.
     83   @param  Value            Describes the current status of a hardware or software entity.
     84                            This included information about the class and subclass that is used to
     85                            classify the entity as well as an operation.
     86   @param  Instance         The enumeration of a hardware or software entity within
     87                            the system. Valid instance numbers start with 1.
     88   @param  CallerId         This optional parameter may be used to identify the caller.
     89                            This parameter allows the status code driver to apply different rules to
     90                            different callers.
     91   @param  Data             This optional parameter may be used to pass additional data.
     92 
     93   @retval EFI_SUCCESS           The function completed successfully
     94   @retval EFI_DEVICE_ERROR      The function should not be completed due to a device error.
     95 
     96 **/
     97 EFI_STATUS
     98 EFIAPI
     99 ReportDispatcher (
    100   IN CONST EFI_SMM_STATUS_CODE_PROTOCOL  *This,
    101   IN EFI_STATUS_CODE_TYPE                Type,
    102   IN EFI_STATUS_CODE_VALUE               Value,
    103   IN UINT32                              Instance,
    104   IN CONST EFI_GUID                      *CallerId  OPTIONAL,
    105   IN EFI_STATUS_CODE_DATA                *Data      OPTIONAL
    106   );
    107 
    108 #endif
    109