Home | History | Annotate | Download | only in MonoStatusCode
      1 /*++
      2 
      3   Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
      4 
      5   This program and the accompanying materials are licensed and made available under
      7   the terms and conditions of the BSD License that accompanies this distribution.
      9   The full text of the license may be found at
     11   http://opensource.org/licenses/bsd-license.php.
     13 
     15   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     17   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     19 
     21 
     23 Module Name:
     24 
     25   PlatformStatusCode.h
     26 
     27 Abstract:
     28 
     29   Contains Platform specific implementations required to use status codes.
     30 
     31 --*/
     32 
     33 #ifndef _PLATFORM_STATUS_CODE_H_
     34 #define _PLATFORM_STATUS_CODE_H_
     35 
     36 
     37 #define CONFIG_PORT0    0x4E
     38 #define INDEX_PORT0     0x4E
     39 #define DATA_PORT0      0x4F
     40 #define PCI_IDX        0xCF8
     41 #define PCI_DAT        0xCFC
     42 
     43 #include "MonoStatusCode.h"
     44 
     45 /*++
     46 
     47 Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
     48 
     49   This program and the accompanying materials are licensed and made available under
     51   the terms and conditions of the BSD License that accompanies this distribution.
     53   The full text of the license may be found at
     55   http://opensource.org/licenses/bsd-license.php.
     57 
     59   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     61   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     63 
     65 This software and associated documentation (if any) is furnished
     67 under a license and may only be used or copied in accordance
     68 with the terms of the license. Except as permitted by such
     69 license, no part of this software or documentation may be
     70 reproduced, stored in a retrieval system, or transmitted in any
     71 form or by any means without the express written consent of
     72 Intel Corporation.
     73 
     74 
     75 Module Name:
     76 
     77   Port80StatusCodeLib.h
     78 
     79 Abstract:
     80 
     81   Lib to provide status code reporting via port 80.
     82 
     83 --*/
     84 
     85 #ifndef _PEI_PORT_80_STATUS_CODE_H_
     86 #define _PEI_PORT_80_STATUS_CODE_H_
     87 
     88 
     89 
     90 //
     91 // Status code reporting function
     92 //
     93 EFI_STATUS
     94 Port80ReportStatusCode (
     95   IN CONST EFI_PEI_SERVICES         **PeiServices,
     96   IN EFI_STATUS_CODE_TYPE           CodeType,
     97   IN EFI_STATUS_CODE_VALUE          Value,
     98   IN UINT32                         Instance,
     99   IN CONST EFI_GUID                 * CallerId,
    100   IN CONST EFI_STATUS_CODE_DATA     * Data OPTIONAL
    101   );
    102 
    103 #endif
    104 
    105 /*++
    106 
    107 Copyright (c)  1999  - 2014, Intel Corporation. All rights reserved
    108 
    109   This program and the accompanying materials are licensed and made available under
    111   the terms and conditions of the BSD License that accompanies this distribution.
    113   The full text of the license may be found at
    115   http://opensource.org/licenses/bsd-license.php.
    117 
    119   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    121   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    123 
    125 This software and associated documentation (if any) is furnished
    127 under a license and may only be used or copied in accordance
    128 with the terms of the license. Except as permitted by such
    129 license, no part of this software or documentation may be
    130 reproduced, stored in a retrieval system, or transmitted in any
    131 form or by any means without the express written consent of
    132 Intel Corporation.
    133 
    134 
    135 Module Name:
    136 
    137   SerialStatusCodeLib.h
    138 
    139 Abstract:
    140 
    141   Lib to provide Serial I/O status code reporting.
    142 
    143 --*/
    144 
    145 #ifndef _PEI_SERIAL_STATUS_CODE_LIB_H_
    146 #define _PEI_SERIAL_STATUS_CODE_LIB_H_
    147 
    148 
    149 #include <Guid/StatusCodeDataTypeId.h>
    150 #include <Guid/StatusCodeDataTypeDebug.h>
    151 #include <Library/ReportStatusCodeLib.h>
    152 #include <Library/PrintLib.h>
    153 #include <Library/BaseMemoryLib.h>
    154 
    155 //
    156 // Initialization function
    157 //
    158 VOID
    159 SerialInitializeStatusCode (
    160   VOID
    161   );
    162 
    163 //
    164 // Status code reporting function
    165 //
    166 EFI_STATUS
    167 SerialReportStatusCode (
    168   IN CONST EFI_PEI_SERVICES         **PeiServices,
    169   IN EFI_STATUS_CODE_TYPE     CodeType,
    170   IN EFI_STATUS_CODE_VALUE    Value,
    171   IN UINT32                   Instance,
    172   IN CONST EFI_GUID                 * CallerId,
    173   IN CONST EFI_STATUS_CODE_DATA     * Data OPTIONAL
    174   );
    175 
    176 #endif
    177 
    178 extern EFI_PEI_PROGRESS_CODE_PPI    mStatusCodePpi;
    179 extern EFI_PEI_PPI_DESCRIPTOR mPpiListStatusCode;
    180 #define EFI_SIGNATURE_16(A, B)        ((A) | (B << 8))
    181 #define EFI_SIGNATURE_32(A, B, C, D)  (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
    182 #define STATUSCODE_PEIM_SIGNATURE EFI_SIGNATURE_32 ('p', 's', 't', 'c')
    183 
    184 typedef struct {
    185   UINT32                    Signature;
    186   EFI_FFS_FILE_HEADER       *FfsHeader;
    187   EFI_PEI_NOTIFY_DESCRIPTOR StatusCodeNotify;
    188 } STATUSCODE_CALLBACK_STATE_INFORMATION;
    189 
    190 #pragma pack(1)
    191 typedef struct {
    192   UINT16  Limit;
    193   UINT32  Base;
    194 } GDT_DSCRIPTOR;
    195 #pragma pack()
    196 
    197 #define STATUSCODE_PEIM_FROM_THIS(a) \
    198   BASE_CR ( \
    199   a, \
    200   STATUSCODE_CALLBACK_STATE_INFORMATION, \
    201   StatusCodeNotify \
    202   )
    203 
    204 VOID
    205 EFIAPI
    206 PlatformInitializeStatusCode (
    207   IN EFI_FFS_FILE_HEADER       *FfsHeader,
    208   IN CONST EFI_PEI_SERVICES    **PeiServices
    209   );
    210 
    211 
    212 //
    213 // Function declarations
    214 //
    215 /**
    216   Install Firmware Volume Hob's once there is main memory
    217 
    218   @param PeiServices        General purpose services available to every PEIM.
    219   @param NotifyDescriptor   Not Used
    220   @param Ppi                Not Used
    221 
    222   @retval Status            EFI_SUCCESS if the interface could be successfully
    223                             installed
    224 
    225 **/
    226 EFI_STATUS
    227 EFIAPI
    228 MemoryDiscoveredPpiNotifyCallback (
    229   IN EFI_PEI_SERVICES           **PeiServices,
    230   IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
    231   IN VOID                       *Ppi
    232   );
    233 
    234 #endif
    235