Chameleon

Chameleon Svn Source Tree

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

Source at commit 576 created 13 years 6 months ago.
By meklort, Retrieve and store the machine's smbios product name. Load machin.DSDT.aml file if it exists.
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
41struct DMIHeader {
42SMBBytetype;
43SMBBytelength;
44SMBWordhandle;
45} __attribute__((packed));
46typedef struct DMIHeader DMIHeader;
47
48struct DMIEntryPoint {
49SMBByteanchor[5];
50SMBBytechecksum;
51SMBWordtableLength;
52SMBDWordtableAddress;
53SMBWordstructureCount;
54SMBBytebcdRevision;
55} __attribute__((packed));
56typedef struct DMIEntryPoint DMIEntryPoint;
57
58struct SMBEntryPoint {
59SMBByteanchor[4];
60SMBBytechecksum;
61SMBByteentryPointLength;
62SMBBytemajorVersion;
63SMBByteminorVersion;
64SMBWordmaxStructureSize;
65SMBByteentryPointRevision;
66SMBByteformattedArea[5];
67struct DMIEntryPointdmi;
68} __attribute__((packed));
69typedef struct SMBEntryPoint SMBEntryPoint;
70
71struct DMIMemoryControllerInfo {/* 3.3.6 Memory Controller Information (Type 5) */
72struct DMIHeaderdmiHeader;
73SMBByteerrorDetectingMethod;
74SMBByteerrorCorrectingCapability;
75SMBBytesupportedInterleave;
76SMBBytecurrentInterleave;
77SMBBytemaxMemoryModuleSize;
78SMBWordsupportedSpeeds;
79SMBWordsupportedMemoryTypes;
80SMBBytememoryModuleVoltage;
81SMBBytenumberOfMemorySlots;
82} __attribute__((packed));
83typedef struct DMIMemoryControllerInfo DMIMemoryControllerInfo;
84
85struct DMIMemoryModuleInfo {/* 3.3.7 Memory Module Information (Type 6) */
86struct DMIHeaderdmiHeader;
87SMBBytesocketDesignation;
88SMBBytebankConnections;
89SMBBytecurrentSpeed;
90SMBWordcurrentMemoryType;
91SMBByteinstalledSize;
92SMBByteenabledSize;
93SMBByteerrorStatus;
94} __attribute__((packed));
95typedef struct DMIMemoryModuleInfo DMIMemoryModuleInfo;
96
97
98struct DMIPhysicalMemoryArray {/* 3.3.17 Physical Memory Array (Type 16) */
99struct DMIHeaderdmiHeader;
100SMBBytelocation;
101SMBByteuse;
102SMBBytememoryCorrectionError;
103SMBDWordmaximumCapacity;
104SMBWordmemoryErrorInformationHandle;
105SMBWordnumberOfMemoryDevices;
106} __attribute__((packed));
107typedef struct DMIPhysicalMemoryArray DMIPhysicalMemoryArray;
108
109struct DMIMemoryDevice {/* 3.3.18 Memory Device (Type 17) */
110struct DMIHeaderdmiHeader;
111SMBWordphysicalMemoryArrayHandle;
112SMBWordmemoryErrorInformationHandle;
113SMBWordtotalWidth;
114SMBWorddataWidth;
115SMBWordsize;
116SMBByteformFactor;
117SMBBytedeviceSet;
118SMBBytedeviceLocator;
119SMBBytebankLocator;
120SMBBytememoryType;
121SMBWordtypeDetail;
122 SMBWord speed;
123} __attribute__((packed));
124typedef struct DMIMemoryDevice DMIMemoryDevice;
125
126
127struct SMBStructHeader {
128 SMBByte type;
129 SMBByte length;
130 SMBWord handle;
131};
132
133typedef struct SMBStructHeader SMBStructHeader;
134
135#define SMB_STRUCT_HEADER SMBStructHeader header;
136
137struct SMBSystemInformation {
138// 2.0+ spec (8 bytes)
139SMB_STRUCT_HEADER // Type 1
140SMBString manufacturer;
141SMBString productName;
142SMBString version;
143SMBString serialNumber;
144// 2.1+ spec (25 bytes)
145SMBByte uuid[16]; // can be all 0 or all 1's
146SMBByte wakeupReason; // reason for system wakeup
147};
148typedef struct SMBSystemInformation SMBSystemInformation;
149
150
151#endif /* !_LIBSAIO_SMBIOS_H */
152

Archive Download this file

Revision: 576