1 | /*␊ |
2 | * Copyright 2008 mackerintel␊ |
3 | */␊ |
4 | ␊ |
5 | #ifndef __LIBSAIO_SMBIOS_PATCHER_H␊ |
6 | #define __LIBSAIO_SMBIOS_PATCHER_H␊ |
7 | ␊ |
8 | #include "libsaio.h"␊ |
9 | #include "SMBIOS.h"␊ |
10 | ␊ |
11 | extern EFI_GUID gEfiAcpiTableGuid;␊ |
12 | extern EFI_GUID gEfiAcpi20TableGuid;␊ |
13 | ␊ |
14 | /* From Foundation/Efi/Guid/Smbios/SmBios.h */␊ |
15 | /* Modified to wrap Data4 array init with {} */␊ |
16 | #define EFI_SMBIOS_TABLE_GUID \␊ |
17 | { \␊ |
18 | 0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} \␊ |
19 | }␊ |
20 | ␊ |
21 | /* From Foundation/Efi/Guid/Smbios/SmBios.c */␊ |
22 | //EFI_GUID const gEfiSmbiosTableGuid = EFI_SMBIOS_TABLE_GUID;␊ |
23 | ␊ |
24 | #define SMBIOS_RANGE_START 0x000F0000␊ |
25 | #define SMBIOS_RANGE_END 0x000FFFFF␊ |
26 | ␊ |
27 | /* '_SM_' in little endian: */␊ |
28 | #define SMBIOS_ANCHOR_UINT32_LE 0x5f4d535f␊ |
29 | ␊ |
30 | struct smbios_table_header ␊ |
31 | {␊ |
32 | ␉uint8_t type;␊ |
33 | ␉uint8_t length;␊ |
34 | ␉uint16_t handle;␊ |
35 | } __attribute__ ((packed));␊ |
36 | ␊ |
37 | struct smbios_property␊ |
38 | {␊ |
39 | ␉char *name;␊ |
40 | ␉uint8_t table_type;␊ |
41 | ␉enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type;␊ |
42 | ␉int offset;␊ |
43 | ␉//union {␊ |
44 | ␉int (*auto_int) (char *name, int table_num);␊ |
45 | ␉char * (*auto_str) (char *name, int table_num);␊ |
46 | ␉char * (*auto_oword) (char *name, int table_num);␊ |
47 | ␉//};␊ |
48 | };␊ |
49 | ␊ |
50 | struct smbios_table_description␊ |
51 | {␊ |
52 | ␉uint8_t type;␊ |
53 | ␉int len;␊ |
54 | ␉int (*numfunc)(int tablen);␊ |
55 | };␊ |
56 | ␊ |
57 | ␊ |
58 | extern struct SMBEntryPoint *␉getAddressOfSmbiosTable(void);␊ |
59 | extern struct SMBEntryPoint *␉getSmbios(void);␊ |
60 | #endif /* !__LIBSAIO_SMBIOS_PATCHER_H */␊ |
61 | |