]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/Library/HardwareInfoLib/HardwareInfoTypesLib.h
8508e425094d125ff4b508a02c1ee22bb00f968a
[mirror_edk2.git] / OvmfPkg / Library / HardwareInfoLib / HardwareInfoTypesLib.h
1 /**@file
2 Hardware info types' definitions.
3 General hardware info types to parse the binary data
4
5 Copyright 2021 - 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __HARDWARE_INFO_TYPES_LIB_H__
11 #define __HARDWARE_INFO_TYPES_LIB_H__
12
13 // Specific hardware types:
14 #include "HardwareInfoPciHostBridgeLib.h"
15
16 //
17 // Hardware info types enumeration listing the supported
18 // types which have an associated type definition
19 //
20 typedef enum {
21 HardwareInfoTypeUndefined = 0,
22 HardwareInfoTypeHostBridge = 1,
23
24 HardwareInfoTypeMax
25 } HARDWARE_INFO_TYPE;
26
27 //
28 // Header format preceding and describing an associated hardware
29 // info element
30 //
31 #pragma pack(1)
32 typedef struct {
33 union {
34 UINT64 Uint64;
35 HARDWARE_INFO_TYPE Value;
36 } Type;
37 UINT64 Size;
38 } HARDWARE_INFO_HEADER;
39 #pragma pack()
40
41 //
42 // Generic data structure to access any supported hardware type
43 // resource definition
44 //
45 #pragma pack(1)
46 typedef struct {
47 LIST_ENTRY Link;
48 HARDWARE_INFO_HEADER Header;
49 union {
50 UINT8 *Raw;
51 HOST_BRIDGE_INFO *PciHostBridge;
52 } Data;
53 } HARDWARE_INFO;
54 #pragma pack()
55
56 #define HARDWARE_INFO_FROM_LINK(a) \
57 BASE_CR (a, HARDWARE_INFO, Link)
58
59 #endif // __HARDWARE_INFO_TYPES_LIB_H__