Chameleon

Chameleon Svn Source Tree

Root/branches/ErmaC/Enoch/i386/libsaio/smbios.h

1/*
2 * Copyright (c) 1998-2009 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#ifndef __LIBSAIO_SMBIOS_H
24#define __LIBSAIO_SMBIOS_H
25
26/* Based on System Management BIOS Reference Specification v2.4 */
27// http://dmtf.org/standards/smbios
28
29typedef uint8_t SMBString;
30typedef uint8_t SMBByte;
31typedef uint16_t SMBWord;
32typedef uint32_t SMBDWord;
33typedef uint64_t SMBQWord;
34
35typedef struct DMIEntryPoint
36{
37 SMBByte anchor[5];
38 SMBByte checksum;
39 SMBWord tableLength;
40 SMBDWord tableAddress;
41 SMBWord structureCount;
42 SMBByte bcdRevision;
43} __attribute__((packed)) DMIEntryPoint;
44
45typedef struct SMBEntryPoint
46{
47 SMBByte anchor[4];
48 SMBByte checksum;
49 SMBByte entryPointLength;
50 SMBByte majorVersion;
51 SMBByte minorVersion;
52 SMBWord maxStructureSize;
53 SMBByte entryPointRevision;
54 SMBByte formattedArea[5];
55 DMIEntryPoint dmi;
56} __attribute__((packed)) SMBEntryPoint;
57
58/* Header common to all SMBIOS structures */
59typedef struct SMBStructHeader
60{
61SMBBytetype;
62SMBBytelength;
63SMBWordhandle;
64//SMBByte*data;
65} __attribute__((packed)) SMBStructHeader;
66
67#define SMB_STRUCT_HEADER SMBStructHeader header;
68
69typedef struct SMBAnchor
70{
71const SMBStructHeader *header;
72const uint8_t *next;
73const uint8_t *end;
74} SMBAnchor;
75
76#define SMB_ANCHOR_IS_VALID(x)\
77((x) && ((x)->header) && ((x)->next) && ((x)->end))
78
79#define SMB_ANCHOR_RESET(x)\
80bzero(x, sizeof(typedef struct SMBAnchor));
81
82/* ======================= SMBIOS structure types. ======================= */
83enum
84{
85kSMBTypeBIOSInformation= 0, // BIOS information (Type 0)
86kSMBTypeSystemInformation= 1, // System Information (Type 1)
87kSMBTypeBaseBoard= 2, // BaseBoard Information (Type 2)
88kSMBTypeSystemEnclosure= 3, // System Chassis Information (Type 3)
89kSMBTypeProcessorInformation= 4, // Processor Information (Type 4)
90// Memory Controller Information (Type 5) Obsolete
91kSMBTypeMemoryModule= 6, // Memory Module Information (Type 6) Obsolete
92kSMBTypeCacheInformation= 7, // Cache Information (Type 7)
93// Port Connector Information (Type 8)
94kSMBTypeSystemSlot= 9, // System Slots (Type 9)
95// On Board Devices Information (Type 10) Obsolete
96kSMBOEMStrings= 11 ,// OEM Strings (Type 11)
97// System Configuration Options (Type 12)
98// BIOS Language Information (Type 13)
99// Group Associations (Type 14)
100// System Event Log (Type 15)
101kSMBTypePhysicalMemoryArray= 16, // Physical Memory Array (Type 16)
102kSMBTypeMemoryDevice= 17, // Memory Device (Type 17)
103kSMBType32BitMemoryErrorInfo= 18, // 32-Bit Memory Error Information (Type 18)
104// Memory Array Mapped Address (Type 19)
105// Memory Device Mapped Address (Type 20)
106// Built-in Pointing Device (Type 21)
107// Portable Battery (Type 22)
108// System Reset (Type 23)
109// Hardware Security (Type 24)
110// System Power Controls (Type 25)
111// Voltage Probe (Type 26)
112// Cooling Device (Type 27)
113// Temperature Probe (Type 28)
114// Electrical Current Probe (Type 29)
115// Out-of-Band Remote Access (Type 30)
116// Boot Integrity Service (BIS) Entry Point (Type 31)
117// System Boot Information (Type 32)
118kSMBType64BitMemoryErrorInfo= 33, // 64-Bit Memory Error Information (Type 33)
119// Managment Device (Type 34)
120// Managment Device Component (Type 35)
121// Management Device Threshold Data (Type 36)
122// Memory Channel (Type 37)
123// IPMI Device Information (Type 38)
124// System Power Supply (Type 39)
125// Additional Information (Type 40)
126// Onboard Devices Extended Information (Type 41)
127// Management Controlle Host Interface (Type 42)
128
129// Inactive (Type 126)
130kSMBTypeEndOfTable= 127, // End-of-Table (Type 127)
131
132// Apple Specific Structures
133kSMBTypeFirmwareVolume= 128, // FirmwareVolume (TYPE 128)
134kSMBTypeMemorySPD= 130, // MemorySPD (TYPE 130)
135kSMBTypeOemProcessorType= 131, // Processor Type (Type 131)
136kSMBTypeOemProcessorBusSpeed= 132, // Processor Bus Speed (Type 132)
137kSMBTypeOemPlatformFeature= 133 // Platform Feature (Type 133)
138};
139
140//----------------------------------------------------------------------------------------------------------
141// Struct - BIOS Information (Type 0), Apple uses 24 bytes length
142typedef struct SMBBIOSInformation
143{
144 SMB_STRUCT_HEADER
145 SMBString vendor; // BIOS vendor name
146 SMBString version; // BIOS version
147 SMBWord startSegment; // BIOS segment start
148 SMBString releaseDate; // BIOS release date
149 SMBByte romSize; // BIOS ROM Size (n); 64K * (n+1) bytes
150 SMBQWord characteristics; // supported BIOS functions
151 // Bungo
152 SMBByte characteristicsExt1; // BIOS characteristics extension byte 1
153 SMBByte characteristicsExt2; // BIOS characteristics extension byte 2
154 SMBByte releaseMajor; // BIOS release (major)
155 SMBByte releaseMinor; // BIOS release (minor)
156 SMBByte ECreleaseMajor; // Embedded Controller firmware release (major)
157 SMBByte ECreleaseMinor; // Embedded Controller firmware release (minor)
158} __attribute__((packed)) SMBBIOSInformation;
159
160//----------------------------------------------------------------------------------------------------------
161// Struct - System Information (Type 1), Apple uses 27 bytes length
162typedef struct SMBSystemInformation
163{
164 // 2.0+ spec (8 bytes)
165 SMB_STRUCT_HEADER
166 SMBString manufacturer;
167 SMBString productName;
168 SMBString version;
169 SMBString serialNumber;
170 // 2.1+ spec (25 bytes)
171 SMBByte uuid[16]; // can be all 0 or all 1's
172 SMBByte wakeupReason; // reason for system wakeup
173 // 2.4+ spec (27 bytes)
174 SMBString skuNumber;
175 SMBString family;
176} __attribute__((packed)) SMBSystemInformation;
177
178//----------------------------------------------------------------------------------------------------------
179// Base Board (or Module) Information (Type 2)
180
181// Base Board - Board Type.
182// Values for SMBBaseBoard.boardType
183typedef enum
184{
185 kSMBBaseBoardUnknown = 0x01,// Unknow
186 kSMBBaseBoardOther = 0x02,// Other
187 kSMBBaseBoardServerBlade = 0x03,// Server Blade
188 kSMBBaseBoardConnectivitySwitch = 0x04,// Connectivity Switch
189 kSMBBaseBoardSystemMgmtModule = 0x05,// System Management Module
190 kSMBBaseBoardProcessorModule = 0x06,// Processor Module
191 kSMBBaseBoardIOModule = 0x07,// I/O Module
192 kSMBBaseBoardMemoryModule = 0x08,// Memory Module
193 kSMBBaseBoardDaughter = 0x09,// Daughter Board
194 kSMBBaseBoardMotherboard = 0x0A,// Motherboard (includes processor, memory, and I/O)
195 kSMBBaseBoardProcessorMemoryModule = 0x0B,// Processor/Memory Module
196 kSMBBaseBoardProcessorIOModule = 0x0C,// Processor/IO Module
197 kSMBBaseBoardInterconnect = 0x0D// Interconnect board
198} BASE_BOARD_TYPE;
199
200// Struct - Base Board (or Module) Information (Type 2), Apple uses 16 bytes length
201typedef struct SMBBaseBoard
202{
203SMB_STRUCT_HEADER // Type 2
204SMBStringmanufacturer;
205SMBStringproduct;
206SMBStringversion;
207SMBStringserialNumber;
208SMBStringassetTag;// Bungo: renamed from assetTagNumber folowing convention
209SMBByte featureFlags;// Collection of flag that identify features of this baseboard
210SMBStringlocationInChassis;
211SMBWord chassisHandle;
212SMBByte boardType;// Type of board, numeration value from BASE_BOARD_TYPE.
213SMBByte numberOfContainedHandles;
214// 0 - 255 contained handles go here but we do not include
215// them in our structure. Be careful to use numberOfContainedHandles
216// times sizeof(SMBWord) when computing the actual record size,
217// if you need it.
218SMBByte containedObjectHandles;
219} __attribute__((packed)) SMBBaseBoard;
220
221//----------------------------------------------------------------------------------------------------------
222// System Enclosure (Type 3)
223
224// Bungo: values for SMBSystemEnclosure.chassisType
225typedef enum {
226 kSMBchassisOther = 0x01,
227 kSMBchassisUnknown = 0x02,
228 kSMBchassisDesktop = 0x03,
229 kSMBchassisLPDesktop = 0x04,
230 kSMBchassisPizzaBox = 0x05,
231 kSMBchassisMiniTower = 0x06,
232 kSMBchassisTower = 0x07,
233 kSMBchassisPortable = 0x08,
234 kSMBchassisLaptop = 0x09,
235 kSMBchassisNotebook = 0x0A,
236 kSMBchassisHandHeld = 0x0B,
237 kSMBchassisDockingStation = 0x0C,
238 kSMBchassisAllInOne = 0x0D,
239 kSMBchassisSubNotebook = 0x0E,
240 // ... fill up if needed ;-)
241 kSMBchassisLunchBox = 0x10,
242 // ... fill up if needed ;-)
243 kSMBchassisBladeEnclosing = 0x1D
244} MISC_CHASSIS_TYPE;
245
246// System Enclosure or Chassis States.
247// values for SMBSystemEnclosure.bootupState
248// values for SMBSystemEnclosure.powerSupplyState
249// values for SMBSystemEnclosure.thermalState
250typedef enum {
251 kSMBChassisStateOther = 0x01,
252 kSMBChassisStateUnknown = 0x02,
253 kSMBChassisStateSafe = 0x03,
254 kSMBChassisStateWarning = 0x04,
255 kSMBChassisStateCritical = 0x05,
256 kSMBChassisStateNonRecoverable = 0x06
257} MISC_CHASSIS_STATE;
258
259// System Enclosure or Chassis Security Status.
260// values for SMBSystemEnclosure.securityStatus
261typedef enum {
262 kSMBChassisSecurityStatusOther = 0x01,
263 kSMBChassisSecurityStatusUnknown = 0x02,
264 kSMBChassisSecurityStatusNone = 0x03,
265 kSMBChassisSecurityStatusExternalInterfaceLockedOut = 0x04,
266 kSMBChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05
267} MISC_CHASSIS_SECURITY_STATE;
268
269// Struct - System Enclosure (Type 3), Apple uses 21 bytes length
270typedef struct SMBSystemEnclosure
271{
272SMB_STRUCT_HEADER // Type 3
273SMBString manufacturer;
274SMBByte chassisType;// System Enclosure Indicator
275SMBString version;// Board Number?
276SMBString serialNumber;
277SMBString assetTag;// Bungo: renamed from assetTagNumber folowing convention
278SMBByte bootupState;// State of enclosure when when it was last booted
279SMBByte powerSupplyState;// State of enclosure's power supply when last booted
280SMBByte thermalState;// Thermal state of the enclosure when last booted
281SMBByte securityStatus;// Physical security status of the enclosure when last booted
282SMBDWord oemDefined;// OEM- or BIOS vendor-specific information
283SMBByte height;// Height of the enclosure, in 'U's
284SMBByte numberOfPowerCords;// Number of power cords associated with the enclosure or chassis
285SMBByte containedElementCount;// Number of Contained Element record that follow, in the range 0 to 255
286 //SMBByte containedElementRecord;// Byte leght of each Contained Element record that follow, in the range 0 to 255
287 //SMBByte containedElements;// Elements, possibly defined by other SMBIOS structures present in chassis
288 // 2.7+
289 //SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number
290} __attribute__((packed)) SMBSystemEnclosure;
291
292//----------------------------------------------------------------------------------------------------------
293// Processor Information (Type 4)
294#define kSMBProcessorInformationMinSize 26
295
296// Processor Information - Processor Type.
297// Values for SMBProcessorInformation.processorType
298typedef enum
299{
300kSMBprocessorTypeOther = 0x01,
301kSMBprocessorTypeUnknown = 0x02,
302kSMBprocessorTypeCPU = 0x03,
303kSMBprocessorTypeMPU = 0x04,
304kSMBprocessorTypeDSP = 0x05,
305kSMBprocessorTypeGPU = 0x06
306} PROCESSOR_TYPE_DATA;
307
308// Processor Information - Processor Family.
309// Values for SMBProcessorInformation.processorFamily
310typedef enum {
311 kSMBprocessorFamilyOther = 0x01,
312 kSMBprocessorFamilyUnknown = 0x02,
313 kSMBprocessorFamily8086 = 0x03,
314 kSMBprocessorFamily80286 = 0x04,
315 kSMBprocessorFamilyIntel386 = 0x05,
316 kSMBprocessorFamilyIntel486 = 0x06,
317 kSMBprocessorFamily8087 = 0x07,
318 kSMBprocessorFamily80287 = 0x08,
319 kSMBprocessorFamily80387 = 0x09,
320 kSMBprocessorFamily80487 = 0x0A,
321 kSMBprocessorFamilyPentium = 0x0B,
322 kSMBprocessorFamilyPentiumPro = 0x0C,
323 kSMBprocessorFamilyPentiumII = 0x0D,
324 kSMBprocessorFamilyPentiumMMX = 0x0E,
325 kSMBprocessorFamilyCeleron = 0x0F,
326 kSMBprocessorFamilyPentiumIIXeon = 0x10,
327 kSMBprocessorFamilyPentiumIII = 0x11,
328 kSMBprocessorFamilyM1 = 0x12,
329 kSMBprocessorFamilyM2 = 0x13,
330 kSMBprocessorFamilyIntelCeleronM = 0x14,
331 kSMBprocessorFamilyIntelPentium4Ht = 0x15,
332 kSMBprocessorFamilyM1Reserved4 = 0x16,
333 kSMBprocessorFamilyM1Reserved5 = 0x17,
334 kSMBprocessorFamilyAmdDuron = 0x18,
335 kSMBprocessorFamilyK5 = 0x19,
336 kSMBprocessorFamilyK6 = 0x1A,
337 kSMBprocessorFamilyK6_2 = 0x1B,
338 kSMBprocessorFamilyK6_3 = 0x1C,
339 kSMBprocessorFamilyAmdAthlon = 0x1D,
340 kSMBprocessorFamilyAmd29000 = 0x1E,
341 kSMBprocessorFamilyK6_2Plus = 0x1F,
342 kSMBprocessorFamilyPowerPC = 0x20,
343 kSMBprocessorFamilyPowerPC601 = 0x21,
344 kSMBprocessorFamilyPowerPC603 = 0x22,
345 kSMBprocessorFamilyPowerPC603Plus = 0x23,
346 kSMBprocessorFamilyPowerPC604 = 0x24,
347 kSMBprocessorFamilyPowerPC620 = 0x25,
348 kSMBprocessorFamilyPowerPCx704 = 0x26,
349 kSMBprocessorFamilyPowerPC750 = 0x27,
350 kSMBprocessorFamilyIntelCoreDuo = 0x28,
351 kSMBprocessorFamilyIntelCoreDuoMobile = 0x29,
352 kSMBprocessorFamilyIntelCoreSoloMobile = 0x2A,
353 kSMBprocessorFamilyIntelAtom = 0x2B,
354 kSMBprocessorFamilyAlpha3 = 0x30,
355 kSMBprocessorFamilyAlpha21064 = 0x31,
356 kSMBprocessorFamilyAlpha21066 = 0x32,
357 kSMBprocessorFamilyAlpha21164 = 0x33,
358 kSMBprocessorFamilyAlpha21164PC = 0x34,
359 kSMBprocessorFamilyAlpha21164a = 0x35,
360 kSMBprocessorFamilyAlpha21264 = 0x36,
361 kSMBprocessorFamilyAlpha21364 = 0x37,
362 kSMBprocessorFamilyAmdTurionIIUltraDualCoreMobileM = 0x38,
363 kSMBprocessorFamilyAmdTurionIIDualCoreMobileM = 0x39,
364 kSMBprocessorFamilyAmdAthlonIIDualCoreM = 0x3A,
365 kSMBprocessorFamilyAmdOpteron6100Series = 0x3B,
366 kSMBprocessorFamilyAmdOpteron4100Series = 0x3C,
367 kSMBprocessorFamilyAmdOpteron6200Series = 0x3D,
368 kSMBprocessorFamilyAmdOpteron4200Series = 0x3E,
369 kSMBprocessorFamilyMips = 0x40,
370 kSMBprocessorFamilyMIPSR4000 = 0x41,
371 kSMBprocessorFamilyMIPSR4200 = 0x42,
372 kSMBprocessorFamilyMIPSR4400 = 0x43,
373 kSMBprocessorFamilyMIPSR4600 = 0x44,
374 kSMBprocessorFamilyMIPSR10000 = 0x45,
375 kSMBprocessorFamilyAmdCSeries = 0x46,
376 kSMBprocessorFamilyAmdESeries = 0x47,
377 kSMBprocessorFamilyAmdSSeries = 0x48,
378 kSMBprocessorFamilyAmdGSeries = 0x49,
379 kSMBprocessorFamilySparc = 0x50,
380 kSMBprocessorFamilySuperSparc = 0x51,
381 kSMBprocessorFamilymicroSparcII = 0x52,
382 kSMBprocessorFamilymicroSparcIIep = 0x53,
383 kSMBprocessorFamilyUltraSparc = 0x54,
384 kSMBprocessorFamilyUltraSparcII = 0x55,
385 kSMBprocessorFamilyUltraSparcIIi = 0x56,
386 kSMBprocessorFamilyUltraSparcIII = 0x57,
387 kSMBprocessorFamilyUltraSparcIIIi = 0x58,
388 kSMBprocessorFamily68040 = 0x60,
389 kSMBprocessorFamily68xxx = 0x61,
390 kSMBprocessorFamily68000 = 0x62,
391 kSMBprocessorFamily68010 = 0x63,
392 kSMBprocessorFamily68020 = 0x64,
393 kSMBprocessorFamily68030 = 0x65,
394 kSMBprocessorFamilyHobbit = 0x70,
395 kSMBprocessorFamilyCrusoeTM5000 = 0x78,
396 kSMBprocessorFamilyCrusoeTM3000 = 0x79,
397 kSMBprocessorFamilyEfficeonTM8000 = 0x7A,
398 kSMBprocessorFamilyWeitek = 0x80,
399 kSMBprocessorFamilyItanium = 0x82,
400 kSMBprocessorFamilyAmdAthlon64 = 0x83,
401 kSMBprocessorFamilyAmdOpteron = 0x84,
402 kSMBprocessorFamilyAmdSempron = 0x85,
403 kSMBprocessorFamilyAmdTurion64Mobile = 0x86,
404 kSMBprocessorFamilyDualCoreAmdOpteron = 0x87,
405 kSMBprocessorFamilyAmdAthlon64X2DualCore = 0x88,
406 kSMBprocessorFamilyAmdTurion64X2Mobile = 0x89,
407 kSMBprocessorFamilyQuadCoreAmdOpteron = 0x8A,
408 kSMBprocessorFamilyThirdGenerationAmdOpteron = 0x8B,
409 kSMBprocessorFamilyAmdPhenomFxQuadCore = 0x8C,
410 kSMBprocessorFamilyAmdPhenomX4QuadCore = 0x8D,
411 kSMBprocessorFamilyAmdPhenomX2DualCore = 0x8E,
412 kSMBprocessorFamilyAmdAthlonX2DualCore = 0x8F,
413 kSMBprocessorFamilyPARISC = 0x90,
414 kSMBprocessorFamilyPaRisc8500 = 0x91,
415 kSMBprocessorFamilyPaRisc8000 = 0x92,
416 kSMBprocessorFamilyPaRisc7300LC = 0x93,
417 kSMBprocessorFamilyPaRisc7200 = 0x94,
418 kSMBprocessorFamilyPaRisc7100LC = 0x95,
419 kSMBprocessorFamilyPaRisc7100 = 0x96,
420 kSMBprocessorFamilyV30 = 0xA0,
421 kSMBprocessorFamilyQuadCoreIntelXeon3200Series = 0xA1,
422 kSMBprocessorFamilyDualCoreIntelXeon3000Series = 0xA2,
423 kSMBprocessorFamilyQuadCoreIntelXeon5300Series = 0xA3,
424 kSMBprocessorFamilyDualCoreIntelXeon5100Series = 0xA4,
425 kSMBprocessorFamilyDualCoreIntelXeon5000Series = 0xA5,
426 kSMBprocessorFamilyDualCoreIntelXeonLV = 0xA6,
427 kSMBprocessorFamilyDualCoreIntelXeonULV = 0xA7,
428 kSMBprocessorFamilyDualCoreIntelXeon7100Series = 0xA8,
429 kSMBprocessorFamilyQuadCoreIntelXeon5400Series = 0xA9,
430 kSMBprocessorFamilyQuadCoreIntelXeon = 0xAA,
431 kSMBprocessorFamilyDualCoreIntelXeon5200Series = 0xAB,
432 kSMBprocessorFamilyDualCoreIntelXeon7200Series = 0xAC,
433 kSMBprocessorFamilyQuadCoreIntelXeon7300Series = 0xAD,
434 kSMBprocessorFamilyQuadCoreIntelXeon7400Series = 0xAE,
435 kSMBprocessorFamilyMultiCoreIntelXeon7400Series = 0xAF,
436 kSMBprocessorFamilyPentiumIIIXeon = 0xB0,
437 kSMBprocessorFamilyPentiumIIISpeedStep = 0xB1,
438 kSMBprocessorFamilyPentium4 = 0xB2,
439 kSMBprocessorFamilyIntelXeon = 0xB3,
440 kSMBprocessorFamilyAS400 = 0xB4,
441 kSMBprocessorFamilyIntelXeonMP = 0xB5,
442 kSMBprocessorFamilyAMDAthlonXP = 0xB6,
443 kSMBprocessorFamilyAMDAthlonMP = 0xB7,
444 kSMBprocessorFamilyIntelItanium2 = 0xB8,
445 kSMBprocessorFamilyIntelPentiumM = 0xB9,
446 kSMBprocessorFamilyIntelCeleronD = 0xBA,
447 kSMBprocessorFamilyIntelPentiumD = 0xBB,
448 kSMBprocessorFamilyIntelPentiumEx = 0xBC,
449 kSMBprocessorFamilyIntelCoreSolo = 0xBD, ///< SMBIOS spec 2.6 correct this value
450 kSMBprocessorFamilyReserved = 0xBE,
451 kSMBprocessorFamilyIntelCore2 = 0xBF,
452 kSMBprocessorFamilyIntelCore2Solo = 0xC0,
453 kSMBprocessorFamilyIntelCore2Extreme = 0xC1,
454 kSMBprocessorFamilyIntelCore2Quad = 0xC2,
455 kSMBprocessorFamilyIntelCore2ExtremeMobile = 0xC3,
456 kSMBprocessorFamilyIntelCore2DuoMobile = 0xC4,
457 kSMBprocessorFamilyIntelCore2SoloMobile = 0xC5,
458 kSMBprocessorFamilyIntelCoreI7 = 0xC6,
459 kSMBprocessorFamilyDualCoreIntelCeleron = 0xC7,
460 kSMBprocessorFamilyIBM390 = 0xC8,
461 kSMBprocessorFamilyG4 = 0xC9,
462 kSMBprocessorFamilyG5 = 0xCA,
463 kSMBprocessorFamilyG6 = 0xCB,
464 kSMBprocessorFamilyzArchitectur = 0xCC,
465 kSMBprocessorFamilyIntelCoreI5 = 0xCD,
466 kSMBprocessorFamilyIntelCoreI3 = 0xCE,
467 kSMBprocessorFamilyViaC7M = 0xD2,
468 kSMBprocessorFamilyViaC7D = 0xD3,
469 kSMBprocessorFamilyViaC7 = 0xD4,
470 kSMBprocessorFamilyViaEden = 0xD5,
471 kSMBprocessorFamilyMultiCoreIntelXeon = 0xD6,
472 kSMBprocessorFamilyDualCoreIntelXeon3Series = 0xD7,
473 kSMBprocessorFamilyQuadCoreIntelXeon3Series = 0xD8,
474 kSMBprocessorFamilyViaNano = 0xD9,
475 kSMBprocessorFamilyDualCoreIntelXeon5Series = 0xDA,
476 kSMBprocessorFamilyQuadCoreIntelXeon5Series = 0xDB,
477 kSMBprocessorFamilyDualCoreIntelXeon7Series = 0xDD,
478 kSMBprocessorFamilyQuadCoreIntelXeon7Series = 0xDE,
479 kSMBprocessorFamilyMultiCoreIntelXeon7Series = 0xDF,
480 kSMBprocessorFamilyMultiCoreIntelXeon3400Series = 0xE0,
481 kSMBprocessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,
482 kSMBprocessorFamilyAmdPhenomTripleCore = 0xE7,
483 kSMBprocessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,
484 kSMBprocessorFamilyAmdTurionDualCoreMobile = 0xE9,
485 kSMBprocessorFamilyAmdAthlonDualCore = 0xEA,
486 kSMBprocessorFamilyAmdSempronSI = 0xEB,
487 kSMBprocessorFamilyAmdPhenomII = 0xEC,
488 kSMBprocessorFamilyAmdAthlonII = 0xED,
489 kSMBprocessorFamilySixCoreAmdOpteron = 0xEE,
490 kSMBprocessorFamilyAmdSempronM = 0xEF,
491 kSMBprocessorFamilyi860 = 0xFA,
492 kSMBprocessorFamilyi960 = 0xFB,
493 kSMBprocessorFamilyIndicatorFamily2 = 0xFE,
494 kSMBprocessorFamilyReserved1 = 0xFF
495} PROCESSOR_FAMILY_DATA;
496
497// Processor Information - Processor Upgrade.
498// Values for SMBProcessorInformation.processorUpgrade
499typedef enum {
500 kSMBprocessorUpgradeOther = 0x01,
501 kSMBprocessorUpgradeUnknown = 0x02,
502 kSMBprocessorUpgradeDaughterBoard = 0x03,
503 kSMBprocessorUpgradeZIFSocket = 0x04,
504 kSMBprocessorUpgradePiggyBack = 0x05, ///< Replaceable.
505 kSMBprocessorUpgradeNone = 0x06,
506 kSMBprocessorUpgradeLIFSocket = 0x07,
507 kSMBprocessorUpgradeSlot1 = 0x08,
508 kSMBprocessorUpgradeSlot2 = 0x09,
509 kSMBprocessorUpgrade370PinSocket = 0x0A,
510 kSMBprocessorUpgradeSlotA = 0x0B,
511 kSMBprocessorUpgradeSlotM = 0x0C,
512 kSMBprocessorUpgradeSocket423 = 0x0D,
513 kSMBprocessorUpgradeSocketA = 0x0E, ///< Socket 462.
514 kSMBprocessorUpgradeSocket478 = 0x0F,
515 kSMBprocessorUpgradeSocket754 = 0x10,
516 kSMBprocessorUpgradeSocket940 = 0x11,
517 kSMBprocessorUpgradeSocket939 = 0x12,
518 kSMBprocessorUpgradeSocketmPGA604 = 0x13,
519 kSMBprocessorUpgradeSocketLGA771 = 0x14,
520 kSMBprocessorUpgradeSocketLGA775 = 0x15,
521 kSMBprocessorUpgradeSocketS1 = 0x16,
522 kSMBprocessorUpgradeAM2 = 0x17,
523 kSMBprocessorUpgradeF1207 = 0x18,
524 kSMBprocessorUpgradeSocketLGA1366 = 0x19,
525 kSMBprocessorUpgradeSocketG34 = 0x1A,
526 kSMBprocessorUpgradeSocketAM3 = 0x1B,
527 kSMBprocessorUpgradeSocketC32 = 0x1C,
528 kSMBprocessorUpgradeSocketLGA1156 = 0x1D,
529 kSMBprocessorUpgradeSocketLGA1567 = 0x1E,
530 kSMBprocessorUpgradeSocketPGA988A = 0x1F,
531 kSMBprocessorUpgradeSocketBGA1288 = 0x20,
532 kSMBprocessorUpgradeSocketrPGA988B = 0x21,
533 kSMBprocessorUpgradeSocketBGA1023 = 0x22,
534 kSMBprocessorUpgradeSocketBGA1224 = 0x23,
535 kSMBprocessorUpgradeSocketBGA1155 = 0x24,
536 kSMBprocessorUpgradeSocketLGA1356 = 0x25,
537 kSMBprocessorUpgradeSocketLGA2011 = 0x26,
538 kSMBprocessorUpgradeSocketFS1 = 0x27,
539 kSMBprocessorUpgradeSocketFS2 = 0x28,
540 kSMBprocessorUpgradeSocketFM1 = 0x29,
541 kSMBprocessorUpgradeSocketFM2 = 0x2A
542} PROCESSOR_UPGRADE;
543
544// Struct - Processor Information (Type 4), Apple uses 35 bytes length
545typedef struct SMBProcessorInformation
546{
547// 2.0+ spec (26 bytes)
548SMB_STRUCT_HEADER // Type 4
549SMBString socketDesignation;
550SMBByte processorType; // The enumeration value from PROCESSOR_TYPE_DATA.
551SMBByte processorFamily; // The enumeration value from PROCESSOR_FAMILY_DATA.
552SMBString manufacturer;
553SMBQWord processorID; // based on CPUID
554SMBString processorVersion;
555SMBByte voltage; // bit7 cleared indicate legacy mode
556SMBWord externalClock; // external clock in MHz
557SMBWord maximumClock; // max internal clock in MHz
558SMBWord currentClock; // current internal clock in MHz
559SMBByte status;
560SMBByte processorUpgrade; // The enumeration value from PROCESSOR_UPGRADE.
561// 2.1+ spec (32 bytes)
562SMBWord L1CacheHandle;
563SMBWord L2CacheHandle;
564SMBWord L3CacheHandle;
565// 2.3+ spec (35 bytes)
566SMBString serialNumber;
567SMBString assetTag;
568SMBString partNumber;
569// 2.5+ spec (40 bytes)
570SMBByte coreCount;
571SMBByte coreEnabled;
572SMBByte threadCount;
573//SMBWord processorFuncSupport;
574// 2.6+ spec (42 bytes)
575//SMBWord processorFamily2;
576} __attribute__((packed)) SMBProcessorInformation;
577
578//----------------------------------------------------------------------------------------------------------
579// Struct - Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1
580typedef struct SMBMemoryControllerInfo {
581SMB_STRUCT_HEADER
582SMBByteerrorDetectingMethod;
583SMBByteerrorCorrectingCapability;
584SMBBytesupportedInterleave;
585SMBBytecurrentInterleave;
586SMBBytemaxMemoryModuleSize;
587SMBWordsupportedSpeeds;
588SMBWordsupportedMemoryTypes;
589SMBBytememoryModuleVoltage;
590SMBBytenumberOfMemorySlots;
591} __attribute__((packed)) SMBMemoryControllerInfo;
592
593//----------------------------------------------------------------------------------------------------------
594// Struct - Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1
595typedef struct SMBMemoryModule
596{
597 SMB_STRUCT_HEADER // Type 6
598 SMBString socketDesignation;
599 SMBByte bankConnections;
600 SMBByte currentSpeed;
601 SMBWord currentMemoryType;
602 SMBByte installedSize;
603 SMBByte enabledSize;
604 SMBByte errorStatus;
605} __attribute__((packed)) SMBMemoryModule;
606
607#define kSMBMemoryModuleSizeNotDeterminable 0x7D
608#define kSMBMemoryModuleSizeNotEnabled 0x7E
609#define kSMBMemoryModuleSizeNotInstalled 0x7F
610
611//----------------------------------------------------------------------------------------------------------
612// Struct - Cache Information (Type 7), Apple uses 19 bytes length
613typedef struct SMBCacheInformation
614{
615 SMB_STRUCT_HEADER // Type 7
616 SMBString socketDesignation;
617 SMBWord cacheConfiguration;
618 SMBWord maximumCacheSize;
619 SMBWord installedSize;
620 SMBWord supportedSRAMType;
621 SMBWord currentSRAMType;
622 SMBByte cacheSpeed;
623 SMBByte errorCorrectionType;
624 SMBByte systemCacheType;
625 SMBByte associativity;
626} __attribute__((packed)) SMBCacheInformation;
627
628//----------------------------------------------------------------------------------------------------------
629// Struct - System Slots (Type 9), Apple uses 13 bytes length
630typedef struct SMBSystemSlot
631{
632 // 2.0+ spec (12 bytes)
633SMB_STRUCT_HEADER
634SMBString slotDesignation;
635SMBByte slotType;
636SMBByte slotDataBusWidth;
637SMBByte currentUsage;
638SMBByte slotLength;
639SMBWord slotID;
640SMBByte slotCharacteristics1;
641// 2.1+ spec (13 bytes)
642SMBByte slotCharacteristics2;
643// 2.6+ spec (17 bytes)
644//SMBWordsegmentGroupNumber;
645//SMBBytebusNumber;
646//SMBBytedeviceFunctionNumber;
647} __attribute__((packed)) SMBSystemSlot;
648
649//----------------------------------------------------------------------------------------------------------
650// Struct - OEM Strings (Type 11), Apple uses 5 bytes length
651typedef struct SMBOEMStrings
652{
653SMB_STRUCT_HEADER // Type 11
654SMBBytecount;// number of strings
655} __attribute__((packed)) SMBOEMStrings;
656
657//----------------------------------------------------------------------------------------------------------
658// Physical Memory Array (Type 16)
659
660// Physical Memory Array - Use.
661// Values for SMBPhysicalMemoryArray.arrayUse
662typedef enum
663{
664 kSMBMemoryArrayUseOther = 0x01,
665 kSMBMemoryArrayUseUnknown = 0x02,
666 kSMBMemoryArrayUseSystemMemory = 0x03,
667 kSMBMemoryArrayUseVideoMemory = 0x04,
668 kSMBMemoryArrayUseFlashMemory = 0x05,
669 kSMBMemoryArrayUseNonVolatileMemory = 0x06,
670 kSMBMemoryArrayUseCacheMemory = 0x07
671} MEMORY_ARRAY_USE;
672
673// Physical Memory Array - Error Correction Types.
674// Values for SMBPhysicalMemoryArray.errorCorrection
675typedef enum
676{
677 kSMBMemoryArrayErrorCorrectionTypeOther = 0x01,
678 kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02,
679 kSMBMemoryArrayErrorCorrectionTypeNone = 0x03,
680 kSMBMemoryArrayErrorCorrectionTypeParity = 0x04,
681 kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05,
682 kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06,
683 kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07
684} MEMORY_ERROR_CORRECTION;
685
686// Struct - Physical Memory Array (Type 16), Apple uses 15 bytes length
687typedef struct SMBPhysicalMemoryArray
688{
689// 2.1+ spec (15 bytes)
690SMB_STRUCT_HEADER // Type 16
691SMBByte physicalLocation; // physical location
692SMBByte arrayUse; // the use for the memory array, The enumeration value from MEMORY_ARRAY_USE.
693SMBByte errorCorrection; // error correction/detection method, The enumeration value from MEMORY_ERROR_CORRECTION.
694SMBDWord maximumCapacity; // maximum memory capacity in kilobytes
695SMBWord errorHandle; // handle of a previously detected error
696SMBWord numMemoryDevices; // number of memory slots or sockets
697// 2.7+ spec
698 //SMBQWord extMaximumCapacity;// maximum memory capacity in bytes
699} __attribute__((packed)) SMBPhysicalMemoryArray;
700
701//----------------------------------------------------------------------------------------------------------
702// Struct - Memory Device (Type 17), Apple uses 27 bytes length
703typedef struct SMBMemoryDevice
704{
705// 2.1+ spec (21 bytes)
706SMB_STRUCT_HEADER // Type 17
707SMBWord arrayHandle; // handle of the parent memory array
708SMBWord errorHandle; // handle of a previously detected error
709SMBWord totalWidth; // total width in bits; including ECC bits
710SMBWord dataWidth; // data width in bits
711SMBWord memorySize; // bit15 is scale, 0 = MB, 1 = KB
712SMBByte formFactor; // memory device form factor
713SMBByte deviceSet; // parent set of identical memory devices
714SMBString deviceLocator; // labeled socket; e.g. "SIMM 3"
715SMBString bankLocator; // labeled bank; e.g. "Bank 0" or "A"
716SMBByte memoryType; // type of memory
717SMBWord memoryTypeDetail; // additional detail on memory type
718// 2.3+ spec (27 bytes)
719SMBWord memorySpeed; // speed of device in MHz (0 for unknown)
720SMBString manufacturer;
721SMBString serialNumber;
722SMBString assetTag;
723SMBString partNumber;
724// 2.6+ spec (28 bytes)
725//SMBByte attributes;
726// 2.7+ spec
727//SMBDWord memoryExtSize;
728//SMBWord confMemClkSpeed;
729// 2.8+ spec
730//SMBWord minimumVolt;
731//SMBWord maximumVolt;
732//SMBWord configuredVolt;
733} __attribute__((packed)) SMBMemoryDevice;
734
735//----------------------------------------------------------------------------------------------------------
736
737// Struct - Memory Array Mapped Address (Type 19), Apple uses 15 bytes length
738//typedef struct SMBMemoryArrayMappedAddress
739//{
740 // 2.1+ spec
741//SMB_STRUCT_HEADER // Type 19
742//SMBDWord startingAddress;
743//SMBDWord endingAddress;
744//SMBWord arrayHandle;
745//SMBByte partitionWidth;
746// 2.7+ spec
747//SMBQWord extStartAddress;
748//SMBQWord extEndAddress;
749//} __attribute__((packed)) SMBMemoryArrayMappedAddress;
750
751//----------------------------------------------------------------------------------------------------------
752
753// Struct - Memory Device Mapped Address (Type 20)
754//typedef struct SMBMemoryDeviceMappedAddress
755//{
756// 2.1+ spec
757//SMB_STRUCT_HEADER // Type 20
758//SMBDWord startingAddress;
759//SMBDWord endingAddress;
760//SMBWord arrayHandle;
761//SMBByte partitionRowPosition;
762//SMBByte interleavePosition;
763//SMBByte interleaveDataDepth;
764// 2.7+ spec
765//SMBQWord extStartAddress;
766//SMBQWord extEndAddress;
767//} __attribute__((packed)) SMBMemoryDeviceMappedAddress;
768
769//----------------------------------------------------------------------------------------------------------
770// Firmware Volume Description (Apple Specific - Type 128)
771enum
772{
773FW_REGION_RESERVED = 0,
774FW_REGION_RECOVERY = 1,
775FW_REGION_MAIN = 2,
776FW_REGION_NVRAM = 3,
777FW_REGION_CONFIG = 4,
778FW_REGION_DIAGVAULT = 5,
779
780NUM_FLASHMAP_ENTRIES = 8
781};
782
783typedef struct FW_REGION_INFO
784{
785SMBDWord StartAddress;
786SMBDWord EndAddress;
787} __attribute__((packed)) FW_REGION_INFO;
788
789// Struct - Firmware Volume Description (Apple Specific - Type 128), Apple uses 88 bytes length
790typedef struct SMBFirmwareVolume
791{
792SMB_STRUCT_HEADER// Type 128
793SMBByte RegionCount;
794SMBByte Reserved[3];
795SMBDWord FirmwareFeatures;
796SMBDWord FirmwareFeaturesMask;
797SMBByte RegionType[ NUM_FLASHMAP_ENTRIES ];
798FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ];
799} __attribute__((packed)) SMBFirmwareVolume;
800
801//----------------------------------------------------------------------------------------------------------
802
803/* ===========================================
804 Memory SPD Data (Apple Specific - Type 130)
805 ============================================= */
806typedef struct SMBMemorySPD
807{
808SMB_STRUCT_HEADER// Type 130
809SMBWord Type17Handle;
810SMBWord Offset;
811SMBWord Size;
812SMBWord Data[1];
813} __attribute__((packed)) SMBMemorySPD;
814
815//----------------------------------------------------------------------------------------------------------
816
817/* ============================================
818 OEM Processor Type (Apple Specific - Type 131)
819 ============================================== */
820typedef struct SMBOemProcessorType
821{
822SMB_STRUCT_HEADER// Type131
823SMBWord ProcessorType;
824} __attribute__((packed)) SMBOemProcessorType;
825
826//----------------------------------------------------------------------------------------------------------
827
828/* =================================================
829 OEM Processor Bus Speed (Apple Specific - Type 132)
830 =================================================== */
831typedef struct SMBOemProcessorBusSpeed
832{
833SMB_STRUCT_HEADER// Type 132
834SMBWord ProcessorBusSpeed; // MT/s unit
835} __attribute__((packed)) SMBOemProcessorBusSpeed;
836
837//----------------------------------------------------------------------------------------------------------
838
839/* ==============================================
840 OEM Platform Feature (Apple Specific - Type 133)
841 ================================================ */
842struct SMBOemPlatformFeature
843{
844SMB_STRUCT_HEADER// Type 133
845SMBWord PlatformFeature;
846} __attribute__((packed)) SMBOemPlatformFeature;
847
848//----------------------------------------------------------------------------------------------------------
849
850/* From Foundation/Efi/Guid/Smbios/SmBios.h */
851/* Modified to wrap Data4 array init with {} */
852#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}}
853
854#define SMBIOS_ORIGINAL0
855#define SMBIOS_PATCHED1
856
857extern void *getSmbios(int which);
858extern void readSMBIOSInfo(SMBEntryPoint *eps);
859extern void setupSMBIOSTable(void);
860
861extern void decodeSMBIOSTable(SMBEntryPoint *eps);
862
863#endif /* !__LIBSAIO_SMBIOS_H */
864

Archive Download this file

Revision: 2542