Chameleon Applications

Chameleon Applications Svn Source Tree

Root/branches/iFabio/Chameleon/i386/libsaio/smbios_patcher.h

Source at commit 308 created 12 years 10 months ago.
By ifabio, Organizing the script builddmg, and update from main chameleon trunk
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
14extern char MacModel[8];
15extern unsigned int ModelRev;
16extern uint64_t smbios_p;
17
18
19/* From Foundation/Efi/Guid/Smbios/SmBios.h */
20/* Modified to wrap Data4 array init with {} */
21#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, {0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}}
22
23#define SMBIOS_RANGE_START 0x000F0000
24#define SMBIOS_RANGE_END 0x000FFFFF
25
26#define SMBIOS_ORIGINAL0
27#define SMBIOS_PATCHED1
28
29struct smbios_table_header
30{
31uint8_ttype;
32uint8_tlength;
33uint16_thandle;
34} __attribute__ ((packed));
35
36struct smbios_property
37{
38const char*name;
39uint8_ttable_type;
40enum {SMSTRING, SMWORD, SMBYTE, SMOWORD} value_type;
41intoffset;
42int(*auto_int) (const char *name, int table_num);
43const char*(*auto_str) (const char *name, int table_num);
44const char*(*auto_oword) (const char *name, int table_num);
45};
46
47struct smbios_table_description
48{
49uint8_ttype;
50intlen;
51int(*numfunc)(int tablen);
52};
53
54/** call with flag SMBIOS_ORIGINAL to get orig. entrypoint
55 or call with flag SMBIOS_PATCHED to get patched smbios entrypoint
56*/
57extern struct SMBEntryPoint*getSmbios(int);
58extern struct DMIHeader* FindNextDmiTableOfType(int type, int minlen);
59extern struct DMIHeader* FindFirstDmiTableOfType(int type, int minlen);
60extern void getSmbiosProductName();
61const char *smbiosStringAtIndex(DMIHeader*, int index, int *length );
62extern bool scanDMI(void);
63extern void scan_cpu_DMI(void); //PlatformInfo_t *); //Slice
64
65
66#endif /* !__LIBSAIO_SMBIOS_PATCHER_H */
67

Archive Download this file

Revision: 308