forked from andikleen/mcelog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dmi.h
82 lines (72 loc) · 2.01 KB
/
dmi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
struct dmi_entry {
unsigned char type;
unsigned char length;
unsigned short handle;
} __attribute__((packed));
enum {
DMI_MEMORY_ARRAY = 16,
DMI_MEMORY_DEVICE = 17,
DMI_MEMORY_ARRAY_ADDR = 19,
DMI_MEMORY_MAPPED_ADDR = 20,
};
struct dmi_memdev_addr {
struct dmi_entry header;
unsigned start_addr;
unsigned end_addr;
unsigned short dev_handle;
unsigned short memarray_handle;
unsigned char row;
unsigned char interleave_pos;
unsigned char interleave_depth;
} __attribute__((packed));
struct dmi_memdev {
struct dmi_entry header;
unsigned short array_handle;
unsigned short memerr_handle;
unsigned short total_width;
unsigned short data_width;
unsigned short size;
unsigned char form_factor;
unsigned char device_set;
unsigned char device_locator;
unsigned char bank_locator;
unsigned char memory_type;
unsigned short type_details;
unsigned short speed;
unsigned char manufacturer;
unsigned char serial_number;
unsigned char asset_tag;
unsigned char part_number;
} __attribute__((packed));
struct dmi_memarray {
struct dmi_entry header;
unsigned char location;
unsigned char use;
unsigned char error_correction;
unsigned int maximum_capacity;
unsigned short error_handle;
short num_devices;
} __attribute__((packed));
struct dmi_memarray_addr {
struct dmi_entry header;
unsigned int start_addr;
unsigned int end_addr;
unsigned short array_handle;
unsigned partition_width;
} __attribute__((packed));
int opendmi(void);
void dmi_decodeaddr(unsigned long long addr);
int dmi_sanity_check(void);
unsigned dmi_dimm_size(unsigned short size, char *unit);
struct dmi_memdev **dmi_find_addr(unsigned long long addr);
void dmi_set_verbosity(int v);
char *dmi_getstring(struct dmi_entry *e, unsigned number);
extern void checkdmi(void);
void closedmi(void);
/* valid after opendmi: */
extern struct dmi_memdev **dmi_dimms;
extern struct dmi_memdev_addr **dmi_ranges;
extern struct dmi_memarray **dmi_arrays;
extern struct dmi_memarray_addr **dmi_array_ranges;
extern int dmi_forced;
extern int do_dmi;