Adding upstream version 3.86+dfsg.
[syslinux-debian/hramrach.git] / com32 / gplinclude / dmi / dmi.h
blobdba2229bb5ce5b47ca93d68af539ced3ae1be2fe
1 /* ----------------------------------------------------------------------- *
3 * Copyright 2006 Erwan Velu - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
13 #ifndef DMI_H
14 #define DMI_H
15 #include <inttypes.h>
16 #define DMI_BUFFER_SIZE 16
17 #define MAX_DMI_MEMORY_ITEMS 32
18 #define MAX_DMI_CACHE_ITEMS 32
19 #define OEM_STRINGS_SIZE 512
20 #define HARDWARE_SECURITY_SIZE 16
22 #define PAGE_SIZE 4096
24 extern const char *out_of_spec;
25 extern const char *bad_index;
27 #define WORD(x) (uint16_t)(*(const uint16_t *)(x))
28 #define DWORD(x) (uint32_t)(*(const uint32_t *)(x))
29 #define QWORD(x) (*(const uint64_t *)(x))
31 enum { DMI_TABLE_PRESENT = 100, ENODMITABLE };
33 #include "dmi_bios.h"
34 #include "dmi_system.h"
35 #include "dmi_base_board.h"
36 #include "dmi_chassis.h"
37 #include "dmi_processor.h"
38 #include "dmi_memory.h"
39 #include "dmi_battery.h"
40 #include "dmi_ipmi.h"
41 #include "dmi_cache.h"
43 extern char display_line;
44 #define moreprintf(...) do { display_line++; if (display_line == 24) { char tempbuf[10]; display_line=0; printf("Press enter to continue"); fgets(tempbuf, sizeof tempbuf, stdin);} printf ( __VA_ARGS__); } while (0);
46 typedef struct {
47 uint16_t num;
48 uint16_t len;
49 uint16_t ver;
50 uint32_t base;
51 uint16_t major_version;
52 uint16_t minor_version;
53 } dmi_table;
55 struct dmi_header {
56 uint8_t type;
57 uint8_t length;
58 uint16_t handle;
59 uint8_t *data;
62 typedef struct {
63 s_bios bios;
64 s_system system;
65 s_base_board base_board;
66 s_chassis chassis;
67 s_processor processor;
68 s_battery battery;
69 s_memory_module memory_module[MAX_DMI_MEMORY_ITEMS];
70 s_memory memory[MAX_DMI_MEMORY_ITEMS];
71 s_ipmi ipmi;
72 s_cache cache[MAX_DMI_CACHE_ITEMS];
73 int memory_module_count;
74 int memory_count;
75 int cache_count;
76 dmi_table dmitable;
77 char oem_strings[OEM_STRINGS_SIZE];
78 struct {
79 char power_on_passwd_status[HARDWARE_SECURITY_SIZE];
80 char keyboard_passwd_status[HARDWARE_SECURITY_SIZE];
81 char administrator_passwd_status[HARDWARE_SECURITY_SIZE];
82 char front_panel_reset_status[HARDWARE_SECURITY_SIZE];
83 bool filled;
84 } hardware_security;
85 } s_dmi;
87 void to_dmi_header(struct dmi_header *h, uint8_t * data);
88 void dmi_bios_runtime_size(uint32_t code, s_dmi * dmi);
89 const char *dmi_string(struct dmi_header *dm, uint8_t s);
90 int dmi_checksum(uint8_t * buf, int len);
91 void parse_dmitable(s_dmi * dmi);
92 void dmi_decode(struct dmi_header *h, uint16_t ver, s_dmi * dmi);
93 int dmi_iterate(s_dmi * dmi);
95 /* dmi_utils.c */
96 void display_bios_characteristics(s_dmi * dmi);
97 void display_base_board_features(s_dmi * dmi);
98 void display_processor_flags(s_dmi * dmi);
99 #endif