Home | History | Annotate | Line # | Download | only in inc
libsmbios.h revision 1.1.1.1.6.2
      1  1.1.1.1.6.2  yamt /*	$NetBSD: libsmbios.h,v 1.1.1.1.6.2 2014/05/22 11:40:57 yamt Exp $	*/
      2  1.1.1.1.6.2  yamt 
      3  1.1.1.1.6.2  yamt #ifndef _LIB_SMBIOS_H
      4  1.1.1.1.6.2  yamt #define _LIB_SMBIOS_H
      5  1.1.1.1.6.2  yamt /*++
      6  1.1.1.1.6.2  yamt 
      7  1.1.1.1.6.2  yamt Copyright (c) 2000  Intel Corporation
      8  1.1.1.1.6.2  yamt 
      9  1.1.1.1.6.2  yamt Module Name:
     10  1.1.1.1.6.2  yamt 
     11  1.1.1.1.6.2  yamt     LibSmbios.h
     12  1.1.1.1.6.2  yamt 
     13  1.1.1.1.6.2  yamt Abstract:
     14  1.1.1.1.6.2  yamt 
     15  1.1.1.1.6.2  yamt     Lib include  for SMBIOS services. Used to get system serial number and GUID
     16  1.1.1.1.6.2  yamt 
     17  1.1.1.1.6.2  yamt Revision History
     18  1.1.1.1.6.2  yamt 
     19  1.1.1.1.6.2  yamt --*/
     20  1.1.1.1.6.2  yamt 
     21  1.1.1.1.6.2  yamt //
     22  1.1.1.1.6.2  yamt // Define SMBIOS tables.
     23  1.1.1.1.6.2  yamt //
     24  1.1.1.1.6.2  yamt #pragma pack(1)
     25  1.1.1.1.6.2  yamt typedef struct {
     26  1.1.1.1.6.2  yamt     UINT8   AnchorString[4];
     27  1.1.1.1.6.2  yamt     UINT8   EntryPointStructureChecksum;
     28  1.1.1.1.6.2  yamt     UINT8   EntryPointLength;
     29  1.1.1.1.6.2  yamt     UINT8   MajorVersion;
     30  1.1.1.1.6.2  yamt     UINT8   MinorVersion;
     31  1.1.1.1.6.2  yamt     UINT16  MaxStructureSize;
     32  1.1.1.1.6.2  yamt     UINT8   EntryPointRevision;
     33  1.1.1.1.6.2  yamt     UINT8   FormattedArea[5];
     34  1.1.1.1.6.2  yamt     UINT8   IntermediateAnchorString[5];
     35  1.1.1.1.6.2  yamt     UINT8   IntermediateChecksum;
     36  1.1.1.1.6.2  yamt     UINT16  TableLength;
     37  1.1.1.1.6.2  yamt     UINT32  TableAddress;
     38  1.1.1.1.6.2  yamt     UINT16  NumberOfSmbiosStructures;
     39  1.1.1.1.6.2  yamt     UINT8   SmbiosBcdRevision;
     40  1.1.1.1.6.2  yamt } SMBIOS_STRUCTURE_TABLE;
     41  1.1.1.1.6.2  yamt 
     42  1.1.1.1.6.2  yamt //
     43  1.1.1.1.6.2  yamt // Please note that SMBIOS structures can be odd byte aligned since the
     44  1.1.1.1.6.2  yamt //  unformated section of each record is a set of arbitrary size strings.
     45  1.1.1.1.6.2  yamt //
     46  1.1.1.1.6.2  yamt 
     47  1.1.1.1.6.2  yamt typedef struct {
     48  1.1.1.1.6.2  yamt     UINT8   Type;
     49  1.1.1.1.6.2  yamt     UINT8   Length;
     50  1.1.1.1.6.2  yamt     UINT8   Handle[2];
     51  1.1.1.1.6.2  yamt } SMBIOS_HEADER;
     52  1.1.1.1.6.2  yamt 
     53  1.1.1.1.6.2  yamt typedef UINT8   SMBIOS_STRING;
     54  1.1.1.1.6.2  yamt 
     55  1.1.1.1.6.2  yamt typedef struct {
     56  1.1.1.1.6.2  yamt     SMBIOS_HEADER   Hdr;
     57  1.1.1.1.6.2  yamt     SMBIOS_STRING   Vendor;
     58  1.1.1.1.6.2  yamt     SMBIOS_STRING   BiosVersion;
     59  1.1.1.1.6.2  yamt     UINT8           BiosSegment[2];
     60  1.1.1.1.6.2  yamt     SMBIOS_STRING   BiosReleaseDate;
     61  1.1.1.1.6.2  yamt     UINT8           BiosSize;
     62  1.1.1.1.6.2  yamt     UINT8           BiosCharacteristics[8];
     63  1.1.1.1.6.2  yamt } SMBIOS_TYPE0;
     64  1.1.1.1.6.2  yamt 
     65  1.1.1.1.6.2  yamt typedef struct {
     66  1.1.1.1.6.2  yamt     SMBIOS_HEADER   Hdr;
     67  1.1.1.1.6.2  yamt     SMBIOS_STRING   Manufacturer;
     68  1.1.1.1.6.2  yamt     SMBIOS_STRING   ProductName;
     69  1.1.1.1.6.2  yamt     SMBIOS_STRING   Version;
     70  1.1.1.1.6.2  yamt     SMBIOS_STRING   SerialNumber;
     71  1.1.1.1.6.2  yamt 
     72  1.1.1.1.6.2  yamt     //
     73  1.1.1.1.6.2  yamt     // always byte copy this data to prevent alignment faults!
     74  1.1.1.1.6.2  yamt     //
     75  1.1.1.1.6.2  yamt     EFI_GUID        Uuid;
     76  1.1.1.1.6.2  yamt 
     77  1.1.1.1.6.2  yamt     UINT8           WakeUpType;
     78  1.1.1.1.6.2  yamt } SMBIOS_TYPE1;
     79  1.1.1.1.6.2  yamt 
     80  1.1.1.1.6.2  yamt typedef struct {
     81  1.1.1.1.6.2  yamt     SMBIOS_HEADER   Hdr;
     82  1.1.1.1.6.2  yamt     SMBIOS_STRING   Manufacturer;
     83  1.1.1.1.6.2  yamt     SMBIOS_STRING   ProductName;
     84  1.1.1.1.6.2  yamt     SMBIOS_STRING   Version;
     85  1.1.1.1.6.2  yamt     SMBIOS_STRING   SerialNumber;
     86  1.1.1.1.6.2  yamt } SMBIOS_TYPE2;
     87  1.1.1.1.6.2  yamt 
     88  1.1.1.1.6.2  yamt typedef struct {
     89  1.1.1.1.6.2  yamt     SMBIOS_HEADER   Hdr;
     90  1.1.1.1.6.2  yamt     SMBIOS_STRING   Manufacturer;
     91  1.1.1.1.6.2  yamt     UINT8           Type;
     92  1.1.1.1.6.2  yamt     SMBIOS_STRING   Version;
     93  1.1.1.1.6.2  yamt     SMBIOS_STRING   SerialNumber;
     94  1.1.1.1.6.2  yamt     SMBIOS_STRING   AssetTag;
     95  1.1.1.1.6.2  yamt     UINT8           BootupState;
     96  1.1.1.1.6.2  yamt     UINT8           PowerSupplyState;
     97  1.1.1.1.6.2  yamt     UINT8           ThermalState;
     98  1.1.1.1.6.2  yamt     UINT8           SecurityStatus;
     99  1.1.1.1.6.2  yamt     UINT8           OemDefined[4];
    100  1.1.1.1.6.2  yamt } SMBIOS_TYPE3;
    101  1.1.1.1.6.2  yamt 
    102  1.1.1.1.6.2  yamt typedef struct {
    103  1.1.1.1.6.2  yamt     SMBIOS_HEADER   Hdr;
    104  1.1.1.1.6.2  yamt     UINT8           Socket;
    105  1.1.1.1.6.2  yamt     UINT8           ProcessorType;
    106  1.1.1.1.6.2  yamt     UINT8           ProcessorFamily;
    107  1.1.1.1.6.2  yamt     SMBIOS_STRING   ProcessorManufacture;
    108  1.1.1.1.6.2  yamt     UINT8           ProcessorId[8];
    109  1.1.1.1.6.2  yamt     SMBIOS_STRING   ProcessorVersion;
    110  1.1.1.1.6.2  yamt     UINT8           Voltage;
    111  1.1.1.1.6.2  yamt     UINT8           ExternalClock[2];
    112  1.1.1.1.6.2  yamt     UINT8           MaxSpeed[2];
    113  1.1.1.1.6.2  yamt     UINT8           CurrentSpeed[2];
    114  1.1.1.1.6.2  yamt     UINT8           Status;
    115  1.1.1.1.6.2  yamt     UINT8           ProcessorUpgrade;
    116  1.1.1.1.6.2  yamt     UINT8           L1CacheHandle[2];
    117  1.1.1.1.6.2  yamt     UINT8           L2CacheHandle[2];
    118  1.1.1.1.6.2  yamt     UINT8           L3CacheHandle[2];
    119  1.1.1.1.6.2  yamt } SMBIOS_TYPE4;
    120  1.1.1.1.6.2  yamt 
    121  1.1.1.1.6.2  yamt typedef union {
    122  1.1.1.1.6.2  yamt     SMBIOS_HEADER   *Hdr;
    123  1.1.1.1.6.2  yamt     SMBIOS_TYPE0    *Type0;
    124  1.1.1.1.6.2  yamt     SMBIOS_TYPE1    *Type1;
    125  1.1.1.1.6.2  yamt     SMBIOS_TYPE2    *Type2;
    126  1.1.1.1.6.2  yamt     SMBIOS_TYPE3    *Type3;
    127  1.1.1.1.6.2  yamt     SMBIOS_TYPE4    *Type4;
    128  1.1.1.1.6.2  yamt     UINT8           *Raw;
    129  1.1.1.1.6.2  yamt } SMBIOS_STRUCTURE_POINTER;
    130  1.1.1.1.6.2  yamt #pragma pack()
    131  1.1.1.1.6.2  yamt 
    132  1.1.1.1.6.2  yamt 
    133  1.1.1.1.6.2  yamt #endif
    134  1.1.1.1.6.2  yamt 
    135