Chameleon

Chameleon Svn Source Tree

Root/trunk/i386/libsaio/smbios_patcher.h

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_ORIGINAL0
22#define SMBIOS_PATCHED1
23
24struct smbios_table_header
25{
26uint8_ttype;
27uint8_tlength;
28uint16_thandle;
29} __attribute__ ((packed));
30
31struct smbios_property
32{
33char*name;
34uint8_ttable_type;
35enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type;
36intoffset;
37int(*auto_int) (char *name, int table_num);
38char*(*auto_str) (char *name, int table_num);
39char*(*auto_oword) (char *name, int table_num);
40};
41
42struct smbios_table_description
43{
44uint8_ttype;
45intlen;
46int(*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*/
52extern struct DMIHeader *getSmbiosTableStructure(struct SMBEntryPoint*smbios, int type, int min_length);
53extern struct SMBEntryPoint*getSmbios(int);
54#endif /* !__LIBSAIO_SMBIOS_PATCHER_H */
55

Archive Download this file

Revision: 84