• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2 
3 Copyright (c) 2006 - 2011, 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   SerialStatusCode.c
14 
15 Abstract:
16 
17 Revision History:
18 
19 **/
20 
21 #include <Library/SerialPortLib.h>
22 #include "SerialStatusCode.h"
23 
24 //
25 // All of the lookup tables are only needed in debug.
26 //
27 
28 typedef struct {
29   UINT32                  Value;
30   CHAR8                   *Token;
31 } STATUS_CODE_LOOKUP_TABLE;
32 
33 STATUS_CODE_LOOKUP_TABLE mSeverityToken[] = {
34   { EFI_ERROR_MINOR,                "ERROR_MINOR" },
35   { EFI_ERROR_MAJOR,                "ERROR_MAJOR" },
36   { EFI_ERROR_UNRECOVERED,          "ERROR_UNRECOVERED" },
37   { EFI_ERROR_UNCONTAINED,          "ERROR_UNCONTAINED" },
38   { 0xFFFFFFFF,                     "ERROR_UNRECOGNIZED"  }
39   };
40 
41 STATUS_CODE_LOOKUP_TABLE mClassSubClassToken[] = {
42   { EFI_COMPUTING_UNIT_UNSPECIFIED,             "COMPUTING_UNIT_UNSPECIFIED" },
43   { EFI_COMPUTING_UNIT_HOST_PROCESSOR,          "COMPUTING_UNIT_HOST_PROCESSOR" },
44   { EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR,          "COMPUTING_UNIT_FIRMWARE_PROCESSOR" },
45   { EFI_COMPUTING_UNIT_IO_PROCESSOR,            "COMPUTING_UNIT_IO_PROCESSOR" },
46   { EFI_COMPUTING_UNIT_CACHE,                   "COMPUTING_UNIT_CACHE" },
47   { EFI_COMPUTING_UNIT_MEMORY,            "COMPUTING_UNIT_MEMORY" },
48   { EFI_COMPUTING_UNIT_CHIPSET,           "COMPUTING_UNIT_CHIPSET" },
49   { EFI_PERIPHERAL_UNSPECIFIED,           "PERIPHERAL_UNSPECIFIED" },
50   { EFI_PERIPHERAL_KEYBOARD,              "PERIPHERAL_KEYBOARD" },
51   { EFI_PERIPHERAL_MOUSE,                 "PERIPHERAL_MOUSE" },
52   { EFI_PERIPHERAL_LOCAL_CONSOLE,          "PERIPHERAL_LOCAL_CONSOLE" },
53   { EFI_PERIPHERAL_REMOTE_CONSOLE,          "PERIPHERAL_REMOTE_CONSOLE" },
54   { EFI_PERIPHERAL_SERIAL_PORT,          "PERIPHERAL_SERIAL_PORT" },
55   { EFI_PERIPHERAL_PARALLEL_PORT,          "PERIPHERAL_PARALLEL_PORT" },
56   { EFI_PERIPHERAL_FIXED_MEDIA,          "PERIPHERAL_FIXED_MEDIA" },
57   { EFI_PERIPHERAL_REMOVABLE_MEDIA,          "PERIPHERAL_REMOVABLE_MEDIA" },
58   { EFI_PERIPHERAL_AUDIO_INPUT,          "PERIPHERAL_AUDIO_INPUT" },
59   { EFI_PERIPHERAL_AUDIO_OUTPUT,          "PERIPHERAL_AUDIO_OUTPUT" },
60   { EFI_PERIPHERAL_LCD_DEVICE,          "PERIPHERAL_LCD_DEVICE" },
61   { EFI_IO_BUS_UNSPECIFIED,          "IO_BUS_UNSPECIFIED" },
62   { EFI_IO_BUS_PCI,          "IO_BUS_PCI" },
63   { EFI_IO_BUS_USB,          "IO_BUS_USB" },
64   { EFI_IO_BUS_IBA,          "IO_BUS_IBA" },
65   { EFI_IO_BUS_AGP,          "IO_BUS_AGP" },
66   { EFI_IO_BUS_PC_CARD,          "IO_BUS_PC_CARD" },
67   { EFI_IO_BUS_LPC,          "IO_BUS_LPC" },
68   { EFI_IO_BUS_SCSI,          "IO_BUS_SCSI" },
69   { EFI_IO_BUS_ATA_ATAPI,          "IO_BUS_ATA_ATAPI" },
70   { EFI_IO_BUS_FC,          "IO_BUS_FC" },
71   { EFI_IO_BUS_IP_NETWORK,          "IO_BUS_IP_NETWORK" },
72   { EFI_IO_BUS_SMBUS,          "IO_BUS_SMBUS" },
73   { EFI_IO_BUS_I2C,          "IO_BUS_I2C" },
74   { EFI_SOFTWARE_UNSPECIFIED,          "SOFTWARE_UNSPECIFIED" },
75   { EFI_SOFTWARE_SEC,          "SOFTWARE_SEC" },
76   { EFI_SOFTWARE_PEI_CORE,          "SOFTWARE_PEI_CORE" },
77   { EFI_SOFTWARE_PEI_MODULE,          "SOFTWARE_PEI_MODULE" },
78   { EFI_SOFTWARE_DXE_CORE,          "SOFTWARE_DXE_CORE" },
79   { EFI_SOFTWARE_EFI_BOOT_SERVICE,          "SOFTWARE_EFI_BOOT_SERVICE" },
80   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE,          "SOFTWARE_EFI_RUNTIME_SERVICE" },
81   { EFI_SOFTWARE_DXE_BS_DRIVER,          "SOFTWARE_DXE_BS_DRIVER" },
82   { EFI_SOFTWARE_DXE_RT_DRIVER,          "SOFTWARE_DXE_RT_DRIVER" },
83   { EFI_SOFTWARE_SMM_DRIVER,         "SOFTWARE_SMM_DRIVER" },
84   { EFI_SOFTWARE_RT,          "SOFTWARE_EFI_RT" },
85   { EFI_SOFTWARE_AL,          "SOFTWARE_EFI_AL" },
86   { EFI_SOFTWARE_EFI_APPLICATION,          "SOFTWARE_EFI_APPLICATION" },
87   { EFI_SOFTWARE_EFI_OS_LOADER,          "SOFTWARE_EFI_OS_LOADER" },
88   { 0xFFFFFFFF,          "ERROR_UNRECOGNIZED"  }
89   };
90 
91 STATUS_CODE_LOOKUP_TABLE mOperationToken[] = {
92   { EFI_COMPUTING_UNIT_UNSPECIFIED          | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
93   { EFI_COMPUTING_UNIT_UNSPECIFIED          | EFI_CU_EC_DISABLED,          "DISABLED" },
94   { EFI_COMPUTING_UNIT_UNSPECIFIED          | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
95   { EFI_COMPUTING_UNIT_UNSPECIFIED          | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
96   { EFI_COMPUTING_UNIT_UNSPECIFIED          | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
97   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
98   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_EC_DISABLED,          "DISABLED" },
99   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
100   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
101   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
102   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_INVALID_TYPE,          "INVALID_TYPE" },
103   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_INVALID_SPEED,          "INVALID_SPEED" },
104   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_MISMATCH,          "MISMATCH" },
105   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_TIMER_EXPIRED,          "TIMER_EXPIRED" },
106   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_SELF_TEST,          "SELF_TEST" },
107   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_INTERNAL,          "INTERNAL" },
108   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_THERMAL,          "THERMAL" },
109   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_LOW_VOLTAGE,          "LOW_VOLTAGE" },
110   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_HIGH_VOLTAGE,          "HIGH_VOLTAGE" },
111   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_CACHE,          "CACHE" },
112   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_MICROCODE_UPDATE,          "MICROCODE_UPDATE" },
113   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_NO_MICROCODE_UPDATE,          "NO_MICROCODE_UPDATE" },
114   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_CORRECTABLE,         "1XECC" },
115   { EFI_COMPUTING_UNIT_HOST_PROCESSOR       | EFI_CU_HP_EC_UNCORRECTABLE,          "2XECC" },
116   { EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR   | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
117   { EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR   | EFI_CU_EC_DISABLED,          "DISABLED" },
118   { EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR   | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
119   { EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR   | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
120   { EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR   | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
121   { EFI_COMPUTING_UNIT_IO_PROCESSOR         | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
122   { EFI_COMPUTING_UNIT_IO_PROCESSOR         | EFI_CU_EC_DISABLED,          "DISABLED" },
123   { EFI_COMPUTING_UNIT_IO_PROCESSOR         | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
124   { EFI_COMPUTING_UNIT_IO_PROCESSOR         | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
125   { EFI_COMPUTING_UNIT_IO_PROCESSOR         | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
126   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
127   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_EC_DISABLED,          "DISABLED" },
128   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
129   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
130   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
131   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_CACHE_EC_INVALID_TYPE,          "INVALID_TYPE" },
132   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_CACHE_EC_INVALID_SPEED,          "INVALID_SPEED" },
133   { EFI_COMPUTING_UNIT_CACHE                | EFI_CU_CACHE_EC_INVALID_SIZE,          "INVALID_SIZE" },
134   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
135   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_EC_DISABLED,          "DISABLED" },
136   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
137   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
138   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
139   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_INVALID_TYPE,          "INVALID_TYPE" },
140   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_INVALID_SPEED,          "INVALID_SPEED" },
141   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_CORRECTABLE,          "1XECC" },
142   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_UNCORRECTABLE,        "2XECC" },
143   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_SPD_FAIL,          "SPD_FAIL" },
144   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_INVALID_SIZE,          "INVALID_SIZE" },
145   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_MISMATCH,          "MISMATCH" },
146   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_S3_RESUME_FAIL,          "S3_RESUME_FAIL" },
147   { EFI_COMPUTING_UNIT_MEMORY               | EFI_CU_MEMORY_EC_UPDATE_FAIL,          "UPDATE_FAIL" },
148   { EFI_COMPUTING_UNIT_CHIPSET              | EFI_CU_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
149   { EFI_COMPUTING_UNIT_CHIPSET              | EFI_CU_EC_DISABLED,          "DISABLED" },
150   { EFI_COMPUTING_UNIT_CHIPSET              | EFI_CU_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
151   { EFI_COMPUTING_UNIT_CHIPSET              | EFI_CU_EC_NOT_DETECTED,          "NOT_DETECTED" },
152   { EFI_COMPUTING_UNIT_CHIPSET              | EFI_CU_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
153   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
154   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_DISABLED,          "DISABLED" },
155   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
156   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
157   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
158   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
159   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
160   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
161   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
162   { EFI_PERIPHERAL_UNSPECIFIED              | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
163   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
164   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_DISABLED,          "DISABLED" },
165   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
166   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
167   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
168   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
169   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
170   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
171   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
172   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
173   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_KEYBOARD_EC_LOCKED,          "LOCKED" },
174   { EFI_PERIPHERAL_KEYBOARD                 | EFI_P_KEYBOARD_EC_STUCK_KEY,          "STUCK_KEY" },
175   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
176   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_DISABLED,          "DISABLED" },
177   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
178   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
179   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
180   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
181   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
182   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
183   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
184   { EFI_PERIPHERAL_MOUSE                    | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
185   { EFI_PERIPHERAL_MOUSE                    | EFI_P_MOUSE_EC_LOCKED,          "LOCKED" },
186   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
187   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_DISABLED,          "DISABLED" },
188   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
189   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
190   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
191   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
192   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
193   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
194   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
195   { EFI_PERIPHERAL_LOCAL_CONSOLE            | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
196   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
197   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_DISABLED,          "DISABLED" },
198   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
199   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
200   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
201   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
202   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
203   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
204   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
205   { EFI_PERIPHERAL_REMOTE_CONSOLE           | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
206   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
207   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_DISABLED,          "DISABLED" },
208   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
209   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
210   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
211   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
212   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
213   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
214   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
215   { EFI_PERIPHERAL_SERIAL_PORT              | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
216   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
217   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_DISABLED,          "DISABLED" },
218   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
219   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
220   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
221   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
222   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
223   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
224   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
225   { EFI_PERIPHERAL_PARALLEL_PORT            | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
226   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
227   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_DISABLED,          "DISABLED" },
228   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
229   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
230   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
231   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
232   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
233   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
234   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
235   { EFI_PERIPHERAL_FIXED_MEDIA              | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
236   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
237   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_DISABLED,          "DISABLED" },
238   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
239   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
240   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
241   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
242   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
243   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
244   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
245   { EFI_PERIPHERAL_REMOVABLE_MEDIA          | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
246   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
247   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_DISABLED,          "DISABLED" },
248   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
249   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
250   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
251   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
252   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
253   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
254   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
255   { EFI_PERIPHERAL_AUDIO_INPUT              | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
256   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
257   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_DISABLED,          "DISABLED" },
258   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
259   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
260   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
261   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
262   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
263   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
264   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
265   { EFI_PERIPHERAL_AUDIO_OUTPUT             | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
266   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
267   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_DISABLED,          "DISABLED" },
268   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
269   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_NOT_DETECTED,          "NOT_DETECTED" },
270   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
271   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
272   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
273   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_INPUT_ERROR,          "INPUT_ERROR" },
274   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_OUTPUT_ERROR,          "OUTPUT_ERROR" },
275   { EFI_PERIPHERAL_LCD_DEVICE               | EFI_P_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
276   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
277   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_DISABLED,          "DISABLED" },
278   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
279   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
280   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
281   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
282   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
283   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
284   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
285   { EFI_IO_BUS_UNSPECIFIED                  | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
286   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
287   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_DISABLED,          "DISABLED" },
288   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
289   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
290   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
291   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
292   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
293   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
294   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
295   { EFI_IO_BUS_PCI                          | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
296   { EFI_IO_BUS_PCI                          | EFI_IOB_PCI_EC_PERR,          "PERR" },
297   { EFI_IO_BUS_PCI                          | EFI_IOB_PCI_EC_SERR,          "SERR" },
298   { EFI_IO_BUS_USB                          | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
299   { EFI_IO_BUS_USB                          | EFI_IOB_EC_DISABLED,          "DISABLED" },
300   { EFI_IO_BUS_USB                          | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
301   { EFI_IO_BUS_USB                          | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
302   { EFI_IO_BUS_USB                          | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
303   { EFI_IO_BUS_USB                          | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
304   { EFI_IO_BUS_USB                          | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
305   { EFI_IO_BUS_USB                          | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
306   { EFI_IO_BUS_USB                          | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
307   { EFI_IO_BUS_USB                          | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
308   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
309   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_DISABLED,          "DISABLED" },
310   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
311   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
312   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
313   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
314   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
315   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
316   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
317   { EFI_IO_BUS_IBA                          | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
318   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
319   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_DISABLED,          "DISABLED" },
320   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
321   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
322   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
323   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
324   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
325   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
326   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
327   { EFI_IO_BUS_AGP                          | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
328   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
329   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_DISABLED,          "DISABLED" },
330   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
331   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
332   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
333   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
334   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
335   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
336   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
337   { EFI_IO_BUS_PC_CARD                      | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
338   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
339   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_DISABLED,          "DISABLED" },
340   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
341   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
342   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
343   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
344   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
345   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
346   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
347   { EFI_IO_BUS_LPC                          | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
348   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
349   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_DISABLED,          "DISABLED" },
350   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
351   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
352   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
353   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
354   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
355   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
356   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
357   { EFI_IO_BUS_SCSI                         | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
358   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
359   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_DISABLED,          "DISABLED" },
360   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
361   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
362   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
363   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
364   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
365   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
366   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
367   { EFI_IO_BUS_ATA_ATAPI                    | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
368   { EFI_IO_BUS_FC                           | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
369   { EFI_IO_BUS_FC                           | EFI_IOB_EC_DISABLED,          "DISABLED" },
370   { EFI_IO_BUS_FC                           | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
371   { EFI_IO_BUS_FC                           | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
372   { EFI_IO_BUS_FC                           | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
373   { EFI_IO_BUS_FC                           | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
374   { EFI_IO_BUS_FC                           | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
375   { EFI_IO_BUS_FC                           | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
376   { EFI_IO_BUS_FC                           | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
377   { EFI_IO_BUS_FC                           | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
378   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
379   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_DISABLED,          "DISABLED" },
380   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
381   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
382   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
383   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
384   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
385   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
386   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
387   { EFI_IO_BUS_IP_NETWORK                   | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
388   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
389   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_DISABLED,          "DISABLED" },
390   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
391   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
392   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
393   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
394   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
395   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
396   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
397   { EFI_IO_BUS_SMBUS                        | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
398   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
399   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_DISABLED,          "DISABLED" },
400   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_NOT_SUPPORTED,          "NOT_SUPPORTED" },
401   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_NOT_DETECTED,          "NOT_DETECTED" },
402   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_NOT_CONFIGURED,          "NOT_CONFIGURED" },
403   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_INTERFACE_ERROR,          "INTERFACE_ERROR" },
404   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_CONTROLLER_ERROR,          "CONTROLLER_ERROR" },
405   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_READ_ERROR,          "READ_ERROR" },
406   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_WRITE_ERROR,          "WRITE_ERROR" },
407   { EFI_IO_BUS_I2C                          | EFI_IOB_EC_RESOURCE_CONFLICT,          "RESOURCE_CONFLICT" },
408   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
409   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
410   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
411   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
412   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
413   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
414   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_ABORTED,          "ABORTED" },
415   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
416   { EFI_SOFTWARE_UNSPECIFIED                | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
417   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
418   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
419   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
420   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
421   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
422   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
423   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_ABORTED,          "ABORTED" },
424   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
425   { EFI_SOFTWARE_SEC                    | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
426   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
427   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
428   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
429   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
430   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
431   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
432   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_ABORTED,          "ABORTED" },
433   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
434   { EFI_SOFTWARE_PEI_CORE               | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
435   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
436   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
437   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
438   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
439   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
440   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
441   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_ABORTED,          "ABORTED" },
442   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
443   { EFI_SOFTWARE_PEI_MODULE             | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
444   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
445   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
446   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
447   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
448   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
449   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
450   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_ABORTED,          "ABORTED" },
451   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
452   { EFI_SOFTWARE_DXE_CORE               | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
453   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
454   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
455   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
456   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
457   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
458   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
459   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_ABORTED,          "ABORTED" },
460   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
461   { EFI_SOFTWARE_EFI_BOOT_SERVICE           | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
462   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
463   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
464   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
465   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
466   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
467   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
468   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_ABORTED,          "ABORTED" },
469   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
470   { EFI_SOFTWARE_EFI_RUNTIME_SERVICE        | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
471   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
472   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
473   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
474   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
475   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
476   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
477   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_ABORTED,          "ABORTED" },
478   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
479   { EFI_SOFTWARE_DXE_BS_DRIVER          | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
480   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
481   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
482   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
483   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
484   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
485   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
486   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_ABORTED,          "ABORTED" },
487   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
488   { EFI_SOFTWARE_DXE_RT_DRIVER          | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
489   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
490   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
491   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
492   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
493   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
494   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
495   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_ABORTED,          "ABORTED" },
496   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
497   { EFI_SOFTWARE_SMM_DRIVER                    | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
498   { EFI_SOFTWARE_RT                     | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
499   { EFI_SOFTWARE_RT                     | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
500   { EFI_SOFTWARE_RT                     | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
501   { EFI_SOFTWARE_RT                     | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
502   { EFI_SOFTWARE_RT                     | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
503   { EFI_SOFTWARE_RT                     | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
504   { EFI_SOFTWARE_RT                     | EFI_SW_EC_ABORTED,          "ABORTED" },
505   { EFI_SOFTWARE_RT                     | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
506   { EFI_SOFTWARE_RT                     | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
507   { EFI_SOFTWARE_AL                     | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
508   { EFI_SOFTWARE_AL                     | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
509   { EFI_SOFTWARE_AL                     | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
510   { EFI_SOFTWARE_AL                     | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
511   { EFI_SOFTWARE_AL                     | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
512   { EFI_SOFTWARE_AL                     | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
513   { EFI_SOFTWARE_AL                     | EFI_SW_EC_ABORTED,          "ABORTED" },
514   { EFI_SOFTWARE_AL                     | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
515   { EFI_SOFTWARE_AL                     | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
516   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
517   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
518   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
519   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
520   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
521   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
522   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_ABORTED,          "ABORTED" },
523   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
524   { EFI_SOFTWARE_EFI_APPLICATION        | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
525   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_NON_SPECIFIC,          "NON_SPECIFIC" },
526   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_LOAD_ERROR,          "LOAD_ERROR" },
527   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_INVALID_PARAMETER,          "INVALID_PARAMETER" },
528   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_UNSUPPORTED,          "NOT_SUPPORTED" },
529   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_INVALID_BUFFER,          "INVALID_BUFFER" },
530   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_OUT_OF_RESOURCES,          "OUT_OF_RESOURCES" },
531   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_ABORTED,          "ABORTED" },
532   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE,          "ILLEGAL_SOFTWARE_STATE" },
533   { EFI_SOFTWARE_EFI_OS_LOADER              | EFI_SW_EC_ILLEGAL_HARDWARE_STATE,          "ILLEGAL_HARDWARE_STATE" },
534   { 0xFFFFFFFF,                              "ERROR_UNRECOGNIZED"                }
535   };
536 
537 
538 EFI_STATUS
539 MatchString (
540   IN  STATUS_CODE_LOOKUP_TABLE  *Table,
541   IN  UINT32                    Value,
542   OUT CHAR8                     **Token
543   );
544 
545 //
546 // Function implemenations
547 //
548 
549 //
550 // Match is only needed for debug.
551 //
552 
553 EFI_STATUS
MatchString(IN STATUS_CODE_LOOKUP_TABLE * Table,IN UINT32 Value,OUT CHAR8 ** Token)554 MatchString (
555   IN  STATUS_CODE_LOOKUP_TABLE  *Table,
556   IN  UINT32                    Value,
557   OUT CHAR8                     **Token
558   )
559 /*++
560 
561 Routine Description:
562 
563   Search the input table for a matching value and return the token associated
564   with that value.  Well formed tables will have the last value == 0 and will
565   return a default token.
566 
567 Arguments:
568 
569   Table     Pointer to first entry in an array of table entries.
570   Value     Value to look up.
571   Token     String to return.
572 
573 Returns:
574 
575   EFI_SUCCESS   The function always returns success.
576 
577 --*/
578 {
579   UINTN         Current;
580 
581   Current = 0;
582   *Token = 0;
583 
584   while (!*Token) {
585     //
586     // Found token if values match or current entry is the last entry.
587     //
588     if ((Table[Current].Value == (-1)) ||
589         (Table[Current].Value == Value)) {
590       *Token = Table[Current].Token;
591     }
592     Current++;
593   }
594   return EFI_SUCCESS;
595 }
596 
597 
598 EFI_STATUS
599 EFIAPI
SerialReportStatusCode(IN EFI_STATUS_CODE_TYPE CodeType,IN EFI_STATUS_CODE_VALUE Value,IN UINT32 Instance,IN EFI_GUID * CallerId,IN EFI_STATUS_CODE_DATA * Data OPTIONAL)600 SerialReportStatusCode (
601   IN EFI_STATUS_CODE_TYPE     CodeType,
602   IN EFI_STATUS_CODE_VALUE    Value,
603   IN UINT32                   Instance,
604   IN EFI_GUID                 *CallerId,
605   IN EFI_STATUS_CODE_DATA     *Data OPTIONAL
606   )
607 /*++
608 
609 Routine Description:
610 
611   Provide a serial port print
612 
613 Arguments:
614 
615   PeiServices - General purpose services available to every PEIM.
616 
617 Returns:
618 
619   Status -  EFI_SUCCESS if the interface could be successfully
620             installed
621 
622 --*/
623 {
624   CHAR8                   Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE];
625   UINT32                  LineNumber;
626   CHAR8                   *Filename;
627   CHAR8                   *Description;
628   CHAR8                   *Format;
629   BASE_LIST               Marker;
630   UINT32                  ErrorLevel;
631   UINTN                   CharCount = 0;
632 
633   Buffer[0] = '\0';
634 
635   if (Data != NULL &&
636       ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) {
637     //
638     // Processes PEI_ASSERT ()
639     //
640     CharCount = AsciiSPrint (
641       Buffer,
642       sizeof (Buffer),
643       "\nPEI_ASSERT!: %a (%d): %a\n",
644       Filename,
645       LineNumber,
646       Description
647       );
648 
649   } else if (Data != NULL &&
650              ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
651     //
652     // Process PEI_DEBUG () macro to Serial
653     //
654     CharCount = AsciiBSPrint (Buffer, sizeof (Buffer), Format, Marker);
655 
656   } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
657     //
658     // Process Errors
659     //
660     CharCount = AsciiSPrint (Buffer, sizeof (Buffer), "ERROR: C%x:V%x I%x", CodeType, Value, Instance);
661     //
662     // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
663     //
664     if (CallerId) {
665       CharCount += AsciiSPrint (&Buffer[CharCount - 1], (sizeof (Buffer) - (sizeof(Buffer[0]) * CharCount)), " %g", CallerId);
666     }
667     if (Data) {
668       CharCount += AsciiSPrint (&Buffer[CharCount - 1], (sizeof (Buffer) - (sizeof(Buffer[0]) * CharCount)), " %x", Data);
669     }
670     CharCount += AsciiSPrint (&Buffer[CharCount - 1], (sizeof (Buffer) - (sizeof(Buffer[0]) * CharCount)), "\n");
671 
672   }
673 
674   if (Buffer[0] != '\0') {
675     //
676     // Callout to platform Lib function to do print.
677     //
678     SerialPortWrite ((UINT8 *) Buffer, CharCount);
679   }
680 
681   //
682   // Debug code to display human readable code information.
683   //
684     {
685       CHAR8       *SeverityToken;
686       CHAR8       *SubClassToken;
687       CHAR8       *OperationToken;
688 
689       if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
690         //
691         // Get the severity token
692         //
693         MatchString (
694           mSeverityToken,
695           (CodeType & EFI_STATUS_CODE_SEVERITY_MASK),
696           &SeverityToken
697           );
698 
699         //
700         // Get the Class/SubClass token
701         //
702         MatchString (
703           mClassSubClassToken,
704           (Value & (EFI_STATUS_CODE_CLASS_MASK | EFI_STATUS_CODE_SUBCLASS_MASK)),
705           &SubClassToken
706           );
707 
708         //
709         // Get the operation token
710         //
711         MatchString (
712           mOperationToken,
713           (Value & (EFI_STATUS_CODE_CLASS_MASK | EFI_STATUS_CODE_SUBCLASS_MASK | EFI_STATUS_CODE_OPERATION_MASK)),
714           &OperationToken
715           );
716 
717         //
718         // Concatenate the instance
719         //
720         CharCount = AsciiSPrint (
721           Buffer,
722           sizeof (Buffer),
723           "%a:%a:%a:%d\n",
724           SeverityToken,
725           SubClassToken,
726           OperationToken,
727           Instance
728           );
729 
730         SerialPortWrite ((UINT8 *) Buffer, CharCount);
731       }
732     }
733 
734   return EFI_SUCCESS;
735 }
736 
737 
738 VOID
InstallSerialStatusCode(IN EFI_REPORT_STATUS_CODE * ReportStatusCode)739 InstallSerialStatusCode (
740   IN EFI_REPORT_STATUS_CODE    *ReportStatusCode
741   )
742 /*++
743 
744 Routine Description:
745 
746   Initialize Serial Port and Status Code Handler
747 
748 Arguments:
749 
750   ReportStatusCode - A pointer to the handler
751 
752 Returns:
753 
754   None
755 
756 --*/
757 {
758   SerialPortInitialize();
759   *ReportStatusCode = SerialReportStatusCode;
760 }
761