]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
ShellPkg/EfiCompress: Handle memory allocation failure
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / LibSmbiosView.h
CommitLineData
5d73d92f 1/** @file\r
2 API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.\r
3\r
ec8a502e 4 Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
5d73d92f 5 This program and the accompanying materials\r
6 are licensed and made available under the terms and conditions of the BSD License\r
7 which accompanies this distribution. The full text of the license may be found at\r
8 http://opensource.org/licenses/bsd-license.php\r
9\r
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
a1d4bfcc 15#ifndef _LIB_SMBIOS_VIEW_H_\r
16#define _LIB_SMBIOS_VIEW_H_\r
5d73d92f 17\r
187cb3dd 18#include <IndustryStandard/SmBios.h>\r
5d73d92f 19\r
20#define DMI_SUCCESS 0x00\r
21#define DMI_UNKNOWN_FUNCTION 0x81\r
22#define DMI_FUNCTION_NOT_SUPPORTED 0x82\r
23#define DMI_INVALID_HANDLE 0x83\r
24#define DMI_BAD_PARAMETER 0x84\r
25#define DMI_INVALID_SUBFUNCTION 0x85\r
26#define DMI_NO_CHANGE 0x86\r
27#define DMI_ADD_STRUCTURE_FAILED 0x87\r
28#define DMI_READ_ONLY 0x8D\r
29#define DMI_LOCK_NOT_SUPPORTED 0x90\r
30#define DMI_CURRENTLY_LOCKED 0x91\r
31#define DMI_INVALID_LOCK 0x92\r
32\r
187cb3dd 33#define INVALID_HANDLE (UINT16) (-1)\r
5d73d92f 34\r
35#define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)\r
36\r
37#define EFI_SMBIOSERR_FAILURE EFI_SMBIOSERR (1)\r
38#define EFI_SMBIOSERR_STRUCT_NOT_FOUND EFI_SMBIOSERR (2)\r
39#define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)\r
40#define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)\r
41\r
a1d4bfcc 42/**\r
ec8a502e 43 Init the SMBIOS VIEW API's environment for the 32-bit table..\r
a1d4bfcc 44\r
45 @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.\r
46**/\r
5d73d92f 47EFI_STATUS\r
48LibSmbiosInit (\r
49 VOID\r
50 );\r
51\r
ec8a502e
EL
52/**\r
53 Init the SMBIOS VIEW API's environment for the 64-bit table..\r
54\r
55 @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.\r
56**/\r
57EFI_STATUS\r
58LibSmbios64BitInit (\r
59 VOID\r
60 );\r
61\r
a1d4bfcc 62/**\r
63 Cleanup the Smbios information.\r
64**/\r
5d73d92f 65VOID\r
66LibSmbiosCleanup (\r
67 VOID\r
68 );\r
69\r
ec8a502e
EL
70/**\r
71 Cleanup the Smbios information.\r
72**/\r
73VOID\r
74LibSmbios64BitCleanup (\r
75 VOID\r
76 );\r
77\r
a1d4bfcc 78/**\r
79 Get the entry point structure for the table.\r
5d73d92f 80\r
a1d4bfcc 81 @param[out] EntryPointStructure The pointer to populate.\r
82**/\r
5d73d92f 83VOID\r
a1d4bfcc 84LibSmbiosGetEPS (\r
187cb3dd 85 OUT SMBIOS_TABLE_ENTRY_POINT **EntryPointStructure\r
5d73d92f 86 );\r
87\r
ec8a502e
EL
88/**\r
89 Get the entry point structure for the 64-bit table.\r
90\r
91 @param[out] EntryPointStructure The pointer to populate.\r
92**/\r
93VOID\r
94LibSmbios64BitGetEPS (\r
95 OUT SMBIOS_TABLE_3_0_ENTRY_POINT **EntryPointStructure\r
96 );\r
97\r
a1d4bfcc 98/**\r
187cb3dd
SZ
99 Return SMBIOS string for the given string number.\r
100\r
101 @param[in] Smbios Pointer to SMBIOS structure.\r
102 @param[in] StringNumber String number to return. -1 is used to skip all strings and\r
103 point to the next SMBIOS structure.\r
104\r
105 @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1\r
106**/\r
107CHAR8*\r
108LibGetSmbiosString (\r
109 IN SMBIOS_STRUCTURE_POINTER *Smbios,\r
110 IN UINT16 StringNumber\r
111 );\r
112\r
113/**\r
114 Get SMBIOS structure for the given Handle,\r
a1d4bfcc 115 Handle is changed to the next handle or 0xFFFF when the end is\r
116 reached or the handle is not found.\r
5d73d92f 117\r
4ff7e37b
ED
118 @param[in, out] Handle 0xFFFF: get the first structure\r
119 Others: get a structure according to this value.\r
187cb3dd
SZ
120 @param[out] Buffer The pointer to the pointer to the structure.\r
121 @param[out] Length Length of the structure.\r
5d73d92f 122\r
187cb3dd 123 @retval DMI_SUCCESS Handle is updated with next structure handle or\r
a1d4bfcc 124 0xFFFF(end-of-list).\r
5d73d92f 125\r
187cb3dd 126 @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or\r
a1d4bfcc 127 0xFFFF(end-of-list).\r
5d73d92f 128**/\r
129EFI_STATUS\r
130LibGetSmbiosStructure (\r
131 IN OUT UINT16 *Handle,\r
187cb3dd 132 OUT UINT8 **Buffer,\r
5d73d92f 133 OUT UINT16 *Length\r
134 );\r
135\r
ec8a502e
EL
136/**\r
137 Get SMBIOS structure for the given Handle in 64-bit table,\r
138 Handle is changed to the next handle or 0xFFFF when the end is\r
139 reached or the handle is not found.\r
140\r
141 @param[in, out] Handle 0xFFFF: get the first structure\r
142 Others: get a structure according to this value.\r
143 @param[out] Buffer The pointer to the pointer to the structure.\r
144 @param[out] Length Length of the structure.\r
145\r
146 @retval DMI_SUCCESS Handle is updated with next structure handle or\r
147 0xFFFF(end-of-list).\r
148\r
149 @retval DMI_INVALID_HANDLE Handle is updated with first structure handle or\r
150 0xFFFF(end-of-list).\r
151**/\r
152EFI_STATUS\r
153LibGetSmbios64BitStructure (\r
154 IN OUT UINT16 *Handle,\r
155 OUT UINT8 **Buffer,\r
156 OUT UINT16 *Length\r
157 );\r
158\r
5d73d92f 159#endif\r