1 | /*␊ |
2 | * Copyright 2008 mackerintel␊ |
3 | */␊ |
4 | /*␊ |
5 | * AsereBLN: cleanup␊ |
6 | */␊ |
7 | ␊ |
8 | #ifndef __LIBSAIO_SMBIOS_PATCHER_H␊ |
9 | #define __LIBSAIO_SMBIOS_PATCHER_H␊ |
10 | ␊ |
11 | #include "libsaio.h"␊ |
12 | #include "SMBIOS.h"␊ |
13 | ␊ |
14 | /* From Foundation/Efi/Guid/Smbios/SmBios.h */␊ |
15 | /* Modified to wrap Data4 array init with {} */␊ |
16 | #define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}}␊ |
17 | ␊ |
18 | #define SMBIOS_RANGE_START 0x000F0000␊ |
19 | #define SMBIOS_RANGE_END 0x000FFFFF␊ |
20 | ␊ |
21 | #define SMBIOS_ORIGINAL␉␉0␊ |
22 | #define SMBIOS_PATCHED␉␉1␊ |
23 | ␊ |
24 | struct smbios_table_header ␊ |
25 | {␊ |
26 | ␉uint8_t␉␉type;␊ |
27 | ␉uint8_t␉␉length;␊ |
28 | ␉uint16_t␉handle;␊ |
29 | } __attribute__ ((packed));␊ |
30 | ␊ |
31 | struct smbios_property␊ |
32 | {␊ |
33 | ␉const char␉␉*name;␊ |
34 | ␉uint8_t␉␉table_type;␊ |
35 | ␉enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type;␊ |
36 | ␉int␉␉offset;␊ |
37 | ␉int␉␉(*auto_int) (const char *name, int table_num);␊ |
38 | ␉const char␉*(*auto_str) (const char *name, int table_num);␊ |
39 | ␉const char␉*(*auto_oword) (const char *name, int table_num);␊ |
40 | };␊ |
41 | ␊ |
42 | struct smbios_table_description␊ |
43 | {␊ |
44 | ␉uint8_t␉␉type;␊ |
45 | ␉int␉␉len;␊ |
46 | ␉int␉␉(*numfunc)(int tablen);␊ |
47 | };␊ |
48 | ␊ |
49 | /** call with flag SMBIOS_ORIGINAL to get orig. entrypoint␊ |
50 | or call with flag SMBIOS_PATCHED to get patched smbios entrypoint␊ |
51 | */␊ |
52 | extern struct DMIHeader *getSmbiosTableStructure(struct SMBEntryPoint␉*smbios, int type, int min_length);␊ |
53 | extern struct SMBEntryPoint␉*getSmbios(int);␊ |
54 | extern struct DMIHeader* FindNextDmiTableOfType(int type, int minlen);␊ |
55 | extern struct DMIHeader* FindFirstDmiTableOfType(int type, int minlen);␊ |
56 | ␊ |
57 | #endif /* !__LIBSAIO_SMBIOS_PATCHER_H */␊ |
58 | |