Home | History | Annotate | Download | only in DebugAssert
      1 /*++
      2 
      3 Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
      4 This program and the accompanying materials
      5 are licensed and made available under the terms and conditions of the BSD License
      6 which accompanies this distribution.  The full text of the license may be found at
      7 http://opensource.org/licenses/bsd-license.php
      8 
      9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     11 
     12 Module Name:
     13 
     14   DebugAssert.h
     15 
     16 Abstract:
     17 
     18   This protocol allows provides debug services to a driver. This is not
     19   debugger support, but things like ASSERT() and DEBUG() macros
     20 
     21 --*/
     22 
     23 #ifndef _DEBUG_ASSERT_H_
     24 #define _DEBUG_ASSERT_H_
     25 
     26 
     27 #define EFI_DEBUG_ASSERT_PROTOCOL_GUID \
     28   { 0xbe499c92, 0x7d4b, 0x11d4, {0xbc, 0xee, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
     29 
     30 //
     31 // Forward reference for pure ANSI compatability
     32 //
     33 EFI_FORWARD_DECLARATION (EFI_DEBUG_ASSERT_PROTOCOL);
     34 
     35 
     36 typedef
     37 EFI_STATUS
     38 (EFIAPI *EFI_DEBUG_ASSERT) (
     39   IN EFI_DEBUG_ASSERT_PROTOCOL  *This,
     40   IN CHAR8                              *FileName,
     41   IN INTN                               LineNumber,
     42   IN CHAR8                              *Description
     43   );
     44 
     45 typedef
     46 EFI_STATUS
     47 (EFIAPI *EFI_DEBUG_PRINT) (
     48   IN EFI_DEBUG_ASSERT_PROTOCOL  *This,
     49   IN  UINTN                             ErrorLevel,
     50   IN  CHAR8                             *Format,
     51   IN  VA_LIST                           Marker
     52   );
     53 
     54 typedef
     55 EFI_STATUS
     56 (EFIAPI *EFI_POST_CODE) (
     57   IN EFI_DEBUG_ASSERT_PROTOCOL  *This,
     58   IN  UINT16                            PostCode,
     59   IN  CHAR8                             *PostCodeString  OPTIONAL
     60   );
     61 
     62 typedef
     63 EFI_STATUS
     64 (EFIAPI *EFI_GET_ERROR_LEVEL) (
     65   IN EFI_DEBUG_ASSERT_PROTOCOL  *This,
     66   IN  UINTN                             *ErrorLevel
     67   );
     68 
     69 typedef
     70 EFI_STATUS
     71 (EFIAPI *EFI_SET_ERROR_LEVEL) (
     72   IN EFI_DEBUG_ASSERT_PROTOCOL  *This,
     73   IN  UINTN                             ErrorLevel
     74   );
     75 
     76 struct _EFI_DEBUG_ASSERT_PROTOCOL {
     77 
     78   EFI_DEBUG_ASSERT    Assert;
     79   EFI_DEBUG_PRINT     Print;
     80   EFI_POST_CODE       PostCode;
     81 
     82   EFI_GET_ERROR_LEVEL GetErrorLevel;
     83   EFI_SET_ERROR_LEVEL SetErrorLevel;
     84 
     85 };
     86 
     87 extern EFI_GUID gEfiDebugAssertProtocolGuid;
     88 
     89 #endif
     90