Chameleon

Chameleon Svn Source Tree

Root/branches/cparm/i386/libsaio/SMBIOS.h

1/*
2 * Copyright (c) 1998-2006 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23/* This file is a stripped-down version of the one found in the AppleSMBIOS project.
24 * Changes:
25 * - Don't use pragma pack but instead use GCC's packed attribute
26 */
27
28#ifndef _LIBSAIO_SMBIOS_H
29#define _LIBSAIO_SMBIOS_H
30
31/*
32 * Based on System Management BIOS Reference Specification v2.5
33 */
34
35typedef uint8_tSMBString;
36typedef uint8_tSMBByte;
37typedef uint16_tSMBWord;
38typedef uint32_tSMBDWord;
39typedef uint64_tSMBQWord;
40
41typedef struct DMIHeader {
42SMBBytetype;
43SMBBytelength;
44SMBWordhandle;
45} __attribute__((packed)) DMIHeader;
46
47#define DMI_STRUCT_HEADER DMIHeader dmiHeader;
48
49typedef struct DMIEntryPoint {
50SMBByteanchor[5];
51SMBBytechecksum;
52SMBWordtableLength;
53SMBDWordtableAddress;
54SMBWordstructureCount;
55SMBBytebcdRevision;
56} __attribute__((packed)) DMIEntryPoint;
57
58typedef struct SMBEntryPoint {
59SMBByteanchor[4];
60SMBBytechecksum;
61SMBByteentryPointLength;
62SMBBytemajorVersion;
63SMBByteminorVersion;
64SMBWordmaxStructureSize;
65SMBByteentryPointRevision;
66SMBByteformattedArea[5];
67struct DMIEntryPointdmi;
68} __attribute__((packed)) SMBEntryPoint;
69
70typedef struct DMIMemoryControllerInfo {/* 3.3.6 Memory Controller Information (Type 5) */
71DMI_STRUCT_HEADER
72SMBByteerrorDetectingMethod;
73SMBByteerrorCorrectingCapability;
74SMBBytesupportedInterleave;
75SMBBytecurrentInterleave;
76SMBBytemaxMemoryModuleSize;
77SMBWordsupportedSpeeds;
78SMBWordsupportedMemoryTypes;
79SMBBytememoryModuleVoltage;
80SMBBytenumberOfMemorySlots;
81} __attribute__((packed)) DMIMemoryControllerInfo;
82
83typedef struct DMIMemoryModuleInfo {/* 3.3.7 Memory Module Information (Type 6) */
84DMI_STRUCT_HEADER
85SMBBytesocketDesignation;
86SMBBytebankConnections;
87SMBBytecurrentSpeed;
88SMBWordcurrentMemoryType;
89SMBByteinstalledSize;
90SMBByteenabledSize;
91SMBByteerrorStatus;
92} __attribute__((packed)) DMIMemoryModuleInfo;
93
94typedef struct DMIPhysicalMemoryArray {/* 3.3.17 Physical Memory Array (Type 16) */
95DMI_STRUCT_HEADER
96SMBBytelocation;
97SMBByteuse;
98SMBBytememoryCorrectionError;
99SMBDWordmaximumCapacity;
100SMBWordmemoryErrorInformationHandle;
101SMBWordnumberOfMemoryDevices;
102} __attribute__((packed)) DMIPhysicalMemoryArray;
103
104typedef struct DMIMemoryDevice {/* 3.3.18 Memory Device (Type 17) */
105DMI_STRUCT_HEADER
106SMBWordphysicalMemoryArrayHandle;
107SMBWordmemoryErrorInformationHandle;
108SMBWordtotalWidth;
109SMBWorddataWidth;
110SMBWordsize;
111SMBByteformFactor;
112SMBBytedeviceSet;
113SMBBytedeviceLocator;
114SMBBytebankLocator;
115SMBBytememoryType;
116SMBWordtypeDetail;
117 SMBWord speed;
118} __attribute__((packed)) DMIMemoryDevice;
119
120typedef struct SMBStructHeader {
121 SMBByte type;
122 SMBByte length;
123 SMBWord handle;
124}__attribute__((packed)) SMBStructHeader;
125
126#define SMB_STRUCT_HEADER SMBStructHeader header;
127
128typedef struct SMBSystemInformation {
129// 2.0+ spec (8 bytes)
130SMB_STRUCT_HEADER // Type 1
131SMBString manufacturer;
132SMBString productName;
133SMBString version;
134SMBString serialNumber;
135// 2.1+ spec (25 bytes)
136SMBByte uuid[16]; // can be all 0 or all 1's
137SMBByte wakeupReason; // reason for system wakeup
138// 2.4+ spec (27 bytes)
139 SMBString skuNumber;
140 SMBString family;
141}__attribute__((packed)) SMBSystemInformation;
142
143#endif /* !_LIBSAIO_SMBIOS_H */
144

Archive Download this file

Revision: 789