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 | #include "fake_efi.h"␊ |
14 | ␊ |
15 | #define kSMBIOSdefaults␉␉"SMBIOSdefaults"␉/* smbios_patcher.c */␊ |
16 | ␊ |
17 | #define kSMBIOSRandomSerial␉"randomSerial"␊ |
18 | ␊ |
19 | extern uint64_t smbios_p;␊ |
20 | ␊ |
21 | struct smbios_table_header ␊ |
22 | {␊ |
23 | ␉uint8_t␉␉type;␊ |
24 | ␉uint8_t␉␉length;␊ |
25 | ␉uint16_t␉handle;␊ |
26 | } __attribute__ ((packed));␊ |
27 | ␊ |
28 | struct smbios_property␊ |
29 | {␊ |
30 | ␉const char␉␉*name;␊ |
31 | ␉uint8_t␉␉table_type;␊ |
32 | ␉enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type;␊ |
33 | ␉int␉␉offset;␊ |
34 | ␉int␉␉(*auto_int) (const char *name, int table_num);␊ |
35 | ␉const char␉*(*auto_str) (const char *name, int table_num);␊ |
36 | ␉const char␉*(*auto_oword) (const char *name, int table_num);␊ |
37 | };␊ |
38 | ␊ |
39 | struct smbios_table_description␊ |
40 | {␊ |
41 | ␉uint8_t␉␉type;␊ |
42 | ␉int␉␉len;␊ |
43 | ␉int␉␉(*numfunc)(int tablen);␊ |
44 | };␊ |
45 | ␊ |
46 | extern void scan_memory(PlatformInfo_t *);␊ |
47 | extern const char* sm_get_defstr(const char * key, int table_num);␊ |
48 | extern struct SMBEntryPoint␉*getSmbiosPatched(struct SMBEntryPoint *orig);␊ |
49 | //extern char* getSmbiosProductName();␊ |
50 | extern struct DMIHeader* FindFirstDmiTableOfType(int type, int minlength);␊ |
51 | extern struct DMIHeader* FindNextDmiTableOfType(int type, int minlen);␊ |
52 | extern const char * smbiosStringAtIndex(DMIHeader*, int index, int *length );␊ |
53 | extern void getSmbiosTableStructure(struct SMBEntryPoint *smbios);␊ |
54 | #endif /* !__LIBSAIO_SMBIOS_PATCHER_H */␊ |
55 | |