Adding upstream version 3.31.
[syslinux-debian/hramrach.git] / com32 / include / dmi / dmi.h
blob5e72b82c39b8b09cd9ac86883b88564e5ea819eb
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
16 #define u32 unsigned int
17 #define u16 unsigned short
18 #define u8 unsigned char
19 #define PAGE_SIZE 4096
21 typedef struct {
22 u32 l;
23 u32 h;
24 } u64;
26 static const char *out_of_spec = "<OUT OF SPEC>";
27 static const char *bad_index = "<BAD INDEX>";
29 #define WORD(x) (u16)(*(const u16 *)(x))
30 #define DWORD(x) (u32)(*(const u32 *)(x))
31 #define QWORD(x) (*(const u64 *)(x))
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"
39 extern char display_line;
40 #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);
42 typedef struct {
43 u16 num;
44 u16 len;
45 u16 ver;
46 u32 base;
47 } dmi_table;
49 static dmi_table dmitable;
52 struct dmi_header
54 u8 type;
55 u8 length;
56 u16 handle;
57 u8 *data;
60 typedef struct {
61 s_bios bios;
62 s_system system;
63 s_base_board base_board;
64 s_chassis chassis;
65 s_processor processor;
66 } s_dmi;
68 void to_dmi_header(struct dmi_header *h, u8 *data);
69 void dmi_bios_runtime_size(u32 code, s_dmi *dmi);
70 const char *dmi_string(struct dmi_header *dm, u8 s);
71 inline int dmi_checksum(u8 *buf);
72 void parse_dmitable(s_dmi *dmi);
73 void dmi_decode(struct dmi_header *h, u16 ver, s_dmi *dmi);
74 int dmi_interate();
76 /* dmi_utils.c */
77 void display_bios_characteristics(s_dmi *dmi);
78 void display_base_board_features(s_dmi *dmi);
79 void display_processor_flags(s_dmi *dmi);
80 #endif