diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-03-12 22:40:38 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-03-12 22:40:38 +0100 |
commit | be15fb5e6fe184eb1bb725f229e157a7d1967986 (patch) | |
tree | 0e03c26bfcec2384b6eb46d4784938a1ef42a4bc /com32/gplinclude/dmi/dmi.h | |
parent | e2b00cb9768811ad45526d11bcc5be5e7722b5ba (diff) | |
download | syslinux-be15fb5e6fe184eb1bb725f229e157a7d1967986.tar.gz syslinux-be15fb5e6fe184eb1bb725f229e157a7d1967986.tar.xz syslinux-be15fb5e6fe184eb1bb725f229e157a7d1967986.zip |
Moving dmi & cpuid stuff to gpl subdirs
Fixing copyrights
Moving dmi includes to gplinclude/dmi
Moving dmi code to gpllib/dmi/
Moving cpuid includes to gplinclude/
Moving cpuid code to gpllib/
Fixing Makefiles accordingly
Diffstat (limited to 'com32/gplinclude/dmi/dmi.h')
-rw-r--r-- | com32/gplinclude/dmi/dmi.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/com32/gplinclude/dmi/dmi.h b/com32/gplinclude/dmi/dmi.h new file mode 100644 index 00000000..924ed420 --- /dev/null +++ b/com32/gplinclude/dmi/dmi.h @@ -0,0 +1,88 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2006 Erwan Velu - All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, Inc., 53 Temple Place Ste 330, + * Boston MA 02111-1307, USA; either version 2 of the License, or + * (at your option) any later version; incorporated herein by reference. + * + * ----------------------------------------------------------------------- */ + +#ifndef DMI_H +#define DMI_H +#include <inttypes.h> +#define MAX_DMI_MEMORY_ITEMS 32 + +#define PAGE_SIZE 4096 + +/*typedef struct { + uint32_t l; + uint32_t h; +} uint64_t;*/ + +extern const char *out_of_spec; +extern const char *bad_index; + +#define WORD(x) (uint16_t)(*(const uint16_t *)(x)) +#define DWORD(x) (uint32_t)(*(const uint32_t *)(x)) +#define QWORD(x) (*(const uint64_t *)(x)) + +enum {DMI_TABLE_PRESENT = 100, ENODMITABLE}; + +#include "dmi_bios.h" +#include "dmi_system.h" +#include "dmi_base_board.h" +#include "dmi_chassis.h" +#include "dmi_processor.h" +#include "dmi_memory.h" +#include "dmi_battery.h" + +extern char display_line; +#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); + +typedef struct { +uint16_t num; +uint16_t len; +uint16_t ver; +uint32_t base; +uint16_t major_version; +uint16_t minor_version; +} dmi_table; + + + +struct dmi_header +{ + uint8_t type; + uint8_t length; + uint16_t handle; + uint8_t *data; +}; + +typedef struct { + s_bios bios; + s_system system; + s_base_board base_board; + s_chassis chassis; + s_processor processor; + s_battery battery; + s_memory memory[MAX_DMI_MEMORY_ITEMS]; + int memory_count; + dmi_table dmitable; +} s_dmi; + +void to_dmi_header(struct dmi_header *h, uint8_t *data); +void dmi_bios_runtime_size(uint32_t code, s_dmi *dmi); +const char *dmi_string(struct dmi_header *dm, uint8_t s); +int dmi_checksum(uint8_t *buf); +void parse_dmitable(s_dmi *dmi); +void dmi_decode(struct dmi_header *h, uint16_t ver, s_dmi *dmi); +int dmi_iterate(s_dmi *dmi); + +/* dmi_utils.c */ +void display_bios_characteristics(s_dmi *dmi); +void display_base_board_features(s_dmi *dmi); +void display_processor_flags(s_dmi *dmi); +#endif |