Home | History | Annotate | Download | only in Protocol
      1 /** @file
      2   This protocol provides registering and unregistering services to status code consumers while in DXE SMM.
      3 
      4   Copyright (c) 2007 - 2009, 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 
     15 #ifndef __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
     16 #define __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
     17 
     18 #define EFI_SMM_RSC_HANDLER_PROTOCOL_GUID \
     19   { \
     20     0x2ff29fa7, 0x5e80, 0x4ed9, {0xb3, 0x80, 0x1, 0x7d, 0x3c, 0x55, 0x4f, 0xf4} \
     21   }
     22 
     23 typedef
     24 EFI_STATUS
     25 (EFIAPI *EFI_SMM_RSC_HANDLER_CALLBACK)(
     26   IN EFI_STATUS_CODE_TYPE   CodeType,
     27   IN EFI_STATUS_CODE_VALUE  Value,
     28   IN UINT32                 Instance,
     29   IN EFI_GUID               *CallerId,
     30   IN EFI_STATUS_CODE_DATA   *Data
     31 );
     32 
     33 /**
     34   Register the callback function for ReportStatusCode() notification.
     35 
     36   When this function is called the function pointer is added to an internal list and any future calls to
     37   ReportStatusCode() will be forwarded to the Callback function.
     38 
     39   @param[in] Callback               A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is called when
     40                                     a call to ReportStatusCode() occurs.
     41 
     42   @retval EFI_SUCCESS               Function was successfully registered.
     43   @retval EFI_INVALID_PARAMETER     The callback function was NULL.
     44   @retval EFI_OUT_OF_RESOURCES      The internal buffer ran out of space. No more functions can be
     45                                     registered.
     46   @retval EFI_ALREADY_STARTED       The function was already registered. It can't be registered again.
     47 **/
     48 typedef
     49 EFI_STATUS
     50 (EFIAPI *EFI_SMM_RSC_HANDLER_REGISTER)(
     51   IN EFI_SMM_RSC_HANDLER_CALLBACK Callback
     52 );
     53 
     54 /**
     55   Remove a previously registered callback function from the notification list.
     56 
     57   A callback function must be unregistered before it is deallocated. It is important that any registered
     58   callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.
     59 
     60   @param[in] Callback           A pointer to a function of type EFI_SMM_RSC_HANDLER_CALLBACK that is to be
     61                                 unregistered.
     62 
     63   @retval EFI_SUCCESS           The function was successfully unregistered.
     64   @retval EFI_INVALID_PARAMETER The callback function was NULL.
     65   @retval EFI_NOT_FOUND         The callback function was not found to be unregistered.
     66 
     67 **/
     68 typedef
     69 EFI_STATUS
     70 (EFIAPI *EFI_SMM_RSC_HANDLER_UNREGISTER)(
     71   IN EFI_SMM_RSC_HANDLER_CALLBACK Callback
     72 );
     73 
     74 typedef struct _EFI_SMM_RSC_HANDLER_PROTOCOL {
     75   EFI_SMM_RSC_HANDLER_REGISTER      Register;
     76   EFI_SMM_RSC_HANDLER_UNREGISTER    Unregister;
     77 } EFI_SMM_RSC_HANDLER_PROTOCOL;
     78 
     79 extern EFI_GUID gEfiSmmRscHandlerProtocolGuid;
     80 
     81 #endif // __SMM_REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
     82