]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
7ef341b0d688aeffadff163dd36bb723f3eda985
[mirror_edk2.git] / ShellPkg / Library / UefiShellDebug1CommandsLib / SmbiosView / LibSmbiosView.h
1 /** @file
2 API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.
3
4 Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _LIB_SMBIOS_VIEW_H
16 #define _LIB_SMBIOS_VIEW_H
17
18 #include "LibSmbios.h"
19
20 #define DMI_SUCCESS 0x00
21 #define DMI_UNKNOWN_FUNCTION 0x81
22 #define DMI_FUNCTION_NOT_SUPPORTED 0x82
23 #define DMI_INVALID_HANDLE 0x83
24 #define DMI_BAD_PARAMETER 0x84
25 #define DMI_INVALID_SUBFUNCTION 0x85
26 #define DMI_NO_CHANGE 0x86
27 #define DMI_ADD_STRUCTURE_FAILED 0x87
28 #define DMI_READ_ONLY 0x8D
29 #define DMI_LOCK_NOT_SUPPORTED 0x90
30 #define DMI_CURRENTLY_LOCKED 0x91
31 #define DMI_INVALID_LOCK 0x92
32
33 #define INVALIDE_HANDLE (UINT16) (-1)
34
35 #define EFI_SMBIOSERR(val) EFIERR (0x30000 | val)
36
37 #define EFI_SMBIOSERR_FAILURE EFI_SMBIOSERR (1)
38 #define EFI_SMBIOSERR_STRUCT_NOT_FOUND EFI_SMBIOSERR (2)
39 #define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)
40 #define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)
41
42 EFI_STATUS
43 LibSmbiosInit (
44 VOID
45 );
46
47 VOID
48 LibSmbiosCleanup (
49 VOID
50 );
51
52 VOID
53 LibSmbiosGetEPS (
54 SMBIOS_STRUCTURE_TABLE **pEntryPointStructure
55 );
56
57 VOID
58 LibSmbiosGetStructHead (
59 SMBIOS_STRUCTURE_POINTER *pHead
60 );
61
62 EFI_STATUS
63 LibGetSmbiosInfo (
64 OUT CHAR8 *dmiBIOSRevision,
65 OUT UINT16 *NumStructures,
66 OUT UINT16 *StructureSize,
67 OUT UINT32 *dmiStorageBase,
68 OUT UINT16 *dmiStorageSize
69 );
70
71 /*++
72 Description:
73 Get SMBIOS Information.
74
75 Arguments:
76 dmiBIOSRevision - Revision of the SMBIOS Extensions.
77 NumStructures - Max. Number of Structures the BIOS will return.
78 StructureSize - Size of largest SMBIOS Structure.
79 dmiStorageBase - 32-bit physical base address for memory mapped SMBIOS data.
80 dmiStorageSize - Size of the memory-mapped SMBIOS data.
81
82 Returns:
83 DMI_SUCCESS - successful.
84 DMI_FUNCTION_NOT_SUPPORTED - Does not support SMBIOS calling interface capability.
85 **/
86 EFI_STATUS
87 LibGetSmbiosStructure (
88 IN OUT UINT16 *Handle,
89 IN OUT UINT8 *Buffer,
90 OUT UINT16 *Length
91 );
92
93 /*++
94 Description:
95 Get SMBIOS structure given the Handle,copy data to the Buffer,Handle is then the next.
96
97 Arguments:
98 Handle: - 0x0: get the first structure
99 - Others: get a certain structure according to this value.
100 Buffter: - contains the pointer to the caller's memory buffer.
101
102 Returns:
103 DMI_SUCCESS - Buffer contains the required structure data
104 - Handle is updated with next structure handle or 0xFFFF(end-of-list).
105 DMI_INVALID_HANDLE - Buffer not contain the requiring structure data
106 - Handle is updated with next structure handle or 0xFFFF(end-of-list).
107 **/
108 VOID
109 SmbiosGetPendingString (
110 IN SMBIOS_STRUCTURE_POINTER *Smbios,
111 IN UINT16 StringNumber,
112 OUT CHAR8 *Buffer
113 );
114
115 EFI_STATUS
116 SmbiosCheckStructure (
117 IN SMBIOS_STRUCTURE_POINTER *Smbios
118 );
119
120 #endif