Chameleon

Chameleon Svn Source Tree

Root/branches/Bungo/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 kSMBchassisMainServer = 0x11,
243 // ... fill up if needed ;-)
244 kSMBchassisBlade = 0x1C,
245 kSMBchassisBladeEnclosing = 0x1D
246} MISC_CHASSIS_TYPE;
247
248// System Enclosure or Chassis States.
249// values for SMBSystemEnclosure.bootupState
250// values for SMBSystemEnclosure.powerSupplyState
251// values for SMBSystemEnclosure.thermalState
252typedef enum {
253 kSMBChassisStateOther = 0x01,
254 kSMBChassisStateUnknown = 0x02,
255 kSMBChassisStateSafe = 0x03,
256 kSMBChassisStateWarning = 0x04,
257 kSMBChassisStateCritical = 0x05,
258 kSMBChassisStateNonRecoverable = 0x06
259} MISC_CHASSIS_STATE;
260
261// System Enclosure or Chassis Security Status.
262// values for SMBSystemEnclosure.securityStatus
263typedef enum {
264 kSMBChassisSecurityStatusOther = 0x01,
265 kSMBChassisSecurityStatusUnknown = 0x02,
266 kSMBChassisSecurityStatusNone = 0x03,
267 kSMBChassisSecurityStatusExternalInterfaceLockedOut = 0x04,
268 kSMBChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05
269} MISC_CHASSIS_SECURITY_STATE;
270
271// Struct - System Enclosure (Type 3), Apple uses 21 bytes length
272typedef struct SMBSystemEnclosure
273{
274SMB_STRUCT_HEADER // Type 3
275SMBString manufacturer;
276SMBByte chassisType;// System Enclosure Indicator
277SMBString version;// Board Number?
278SMBString serialNumber;
279SMBString assetTag;// Bungo: renamed from assetTagNumber folowing convention
280SMBByte bootupState;// State of enclosure when when it was last booted
281SMBByte powerSupplyState;// State of enclosure's power supply when last booted
282SMBByte thermalState;// Thermal state of the enclosure when last booted
283SMBByte securityStatus;// Physical security status of the enclosure when last booted
284SMBDWord oemDefined;// OEM- or BIOS vendor-specific information
285SMBByte height;// Height of the enclosure, in 'U's
286SMBByte numberOfPowerCords;// Number of power cords associated with the enclosure or chassis
287SMBByte containedElementCount;// Number of Contained Element record that follow, in the range 0 to 255
288 SMBByte containedElementRecord;// Byte leght of each Contained Element record that follow, in the range 0 to 255
289 // SMBByte containedElements;// Elements, possibly defined by other SMBIOS structures present in chassis
290 // 2.7+
291 //SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number
292} __attribute__((packed)) SMBSystemEnclosure;
293
294//----------------------------------------------------------------------------------------------------------
295// Processor Information (Type 4)
296#define kSMBProcessorInformationMinSize 26
297
298// Processor Information - Processor Type.
299// Values for SMBProcessorInformation.processorType
300typedef enum
301{
302kSMBprocessorTypeOther = 0x01,
303kSMBprocessorTypeUnknown = 0x02,
304kSMBprocessorTypeCPU = 0x03,
305kSMBprocessorTypeMPU = 0x04,
306kSMBprocessorTypeDSP = 0x05,
307kSMBprocessorTypeGPU = 0x06
308} PROCESSOR_TYPE_DATA;
309
310// Processor Information - Processor Family.
311// Values for SMBProcessorInformation.processorFamily
312typedef enum {
313 kSMBprocessorFamilyOther = 0x01,
314 kSMBprocessorFamilyUnknown = 0x02,
315 kSMBprocessorFamily8086 = 0x03,
316 kSMBprocessorFamily80286 = 0x04,
317 kSMBprocessorFamilyIntel386 = 0x05,
318 kSMBprocessorFamilyIntel486 = 0x06,
319 kSMBprocessorFamily8087 = 0x07,
320 kSMBprocessorFamily80287 = 0x08,
321 kSMBprocessorFamily80387 = 0x09,
322 kSMBprocessorFamily80487 = 0x0A,
323 kSMBprocessorFamilyPentium = 0x0B,
324 kSMBprocessorFamilyPentiumPro = 0x0C,
325 kSMBprocessorFamilyPentiumII = 0x0D,
326 kSMBprocessorFamilyPentiumMMX = 0x0E,
327 kSMBprocessorFamilyCeleron = 0x0F,
328 kSMBprocessorFamilyPentiumIIXeon = 0x10,
329 kSMBprocessorFamilyPentiumIII = 0x11,
330 kSMBprocessorFamilyM1 = 0x12,
331 kSMBprocessorFamilyM2 = 0x13,
332 kSMBprocessorFamilyIntelCeleronM = 0x14,
333 kSMBprocessorFamilyIntelPentium4Ht = 0x15,
334 kSMBprocessorFamilyM1Reserved4 = 0x16,
335 kSMBprocessorFamilyM1Reserved5 = 0x17,
336 kSMBprocessorFamilyAmdDuron = 0x18,
337 kSMBprocessorFamilyK5 = 0x19,
338 kSMBprocessorFamilyK6 = 0x1A,
339 kSMBprocessorFamilyK6_2 = 0x1B,
340 kSMBprocessorFamilyK6_3 = 0x1C,
341 kSMBprocessorFamilyAmdAthlon = 0x1D,
342 kSMBprocessorFamilyAmd29000 = 0x1E,
343 kSMBprocessorFamilyK6_2Plus = 0x1F,
344 kSMBprocessorFamilyPowerPC = 0x20,
345 kSMBprocessorFamilyPowerPC601 = 0x21,
346 kSMBprocessorFamilyPowerPC603 = 0x22,
347 kSMBprocessorFamilyPowerPC603Plus = 0x23,
348 kSMBprocessorFamilyPowerPC604 = 0x24,
349 kSMBprocessorFamilyPowerPC620 = 0x25,
350 kSMBprocessorFamilyPowerPCx704 = 0x26,
351 kSMBprocessorFamilyPowerPC750 = 0x27,
352 kSMBprocessorFamilyIntelCoreDuo = 0x28,
353 kSMBprocessorFamilyIntelCoreDuoMobile = 0x29,
354 kSMBprocessorFamilyIntelCoreSoloMobile = 0x2A,
355 kSMBprocessorFamilyIntelAtom = 0x2B,
356 kSMBprocessorFamilyAlpha3 = 0x30,
357 kSMBprocessorFamilyAlpha21064 = 0x31,
358 kSMBprocessorFamilyAlpha21066 = 0x32,
359 kSMBprocessorFamilyAlpha21164 = 0x33,
360 kSMBprocessorFamilyAlpha21164PC = 0x34,
361 kSMBprocessorFamilyAlpha21164a = 0x35,
362 kSMBprocessorFamilyAlpha21264 = 0x36,
363 kSMBprocessorFamilyAlpha21364 = 0x37,
364 kSMBprocessorFamilyAmdTurionIIUltraDualCoreMobileM = 0x38,
365 kSMBprocessorFamilyAmdTurionIIDualCoreMobileM = 0x39,
366 kSMBprocessorFamilyAmdAthlonIIDualCoreM = 0x3A,
367 kSMBprocessorFamilyAmdOpteron6100Series = 0x3B,
368 kSMBprocessorFamilyAmdOpteron4100Series = 0x3C,
369 kSMBprocessorFamilyAmdOpteron6200Series = 0x3D,
370 kSMBprocessorFamilyAmdOpteron4200Series = 0x3E,
371 kSMBprocessorFamilyMips = 0x40,
372 kSMBprocessorFamilyMIPSR4000 = 0x41,
373 kSMBprocessorFamilyMIPSR4200 = 0x42,
374 kSMBprocessorFamilyMIPSR4400 = 0x43,
375 kSMBprocessorFamilyMIPSR4600 = 0x44,
376 kSMBprocessorFamilyMIPSR10000 = 0x45,
377 kSMBprocessorFamilyAmdCSeries = 0x46,
378 kSMBprocessorFamilyAmdESeries = 0x47,
379 kSMBprocessorFamilyAmdSSeries = 0x48,
380 kSMBprocessorFamilyAmdGSeries = 0x49,
381 kSMBprocessorFamilySparc = 0x50,
382 kSMBprocessorFamilySuperSparc = 0x51,
383 kSMBprocessorFamilymicroSparcII = 0x52,
384 kSMBprocessorFamilymicroSparcIIep = 0x53,
385 kSMBprocessorFamilyUltraSparc = 0x54,
386 kSMBprocessorFamilyUltraSparcII = 0x55,
387 kSMBprocessorFamilyUltraSparcIIi = 0x56,
388 kSMBprocessorFamilyUltraSparcIII = 0x57,
389 kSMBprocessorFamilyUltraSparcIIIi = 0x58,
390 kSMBprocessorFamily68040 = 0x60,
391 kSMBprocessorFamily68xxx = 0x61,
392 kSMBprocessorFamily68000 = 0x62,
393 kSMBprocessorFamily68010 = 0x63,
394 kSMBprocessorFamily68020 = 0x64,
395 kSMBprocessorFamily68030 = 0x65,
396 kSMBprocessorFamilyHobbit = 0x70,
397 kSMBprocessorFamilyCrusoeTM5000 = 0x78,
398 kSMBprocessorFamilyCrusoeTM3000 = 0x79,
399 kSMBprocessorFamilyEfficeonTM8000 = 0x7A,
400 kSMBprocessorFamilyWeitek = 0x80,
401 kSMBprocessorFamilyItanium = 0x82,
402 kSMBprocessorFamilyAmdAthlon64 = 0x83,
403 kSMBprocessorFamilyAmdOpteron = 0x84,
404 kSMBprocessorFamilyAmdSempron = 0x85,
405 kSMBprocessorFamilyAmdTurion64Mobile = 0x86,
406 kSMBprocessorFamilyDualCoreAmdOpteron = 0x87,
407 kSMBprocessorFamilyAmdAthlon64X2DualCore = 0x88,
408 kSMBprocessorFamilyAmdTurion64X2Mobile = 0x89,
409 kSMBprocessorFamilyQuadCoreAmdOpteron = 0x8A,
410 kSMBprocessorFamilyThirdGenerationAmdOpteron = 0x8B,
411 kSMBprocessorFamilyAmdPhenomFxQuadCore = 0x8C,
412 kSMBprocessorFamilyAmdPhenomX4QuadCore = 0x8D,
413 kSMBprocessorFamilyAmdPhenomX2DualCore = 0x8E,
414 kSMBprocessorFamilyAmdAthlonX2DualCore = 0x8F,
415 kSMBprocessorFamilyPARISC = 0x90,
416 kSMBprocessorFamilyPaRisc8500 = 0x91,
417 kSMBprocessorFamilyPaRisc8000 = 0x92,
418 kSMBprocessorFamilyPaRisc7300LC = 0x93,
419 kSMBprocessorFamilyPaRisc7200 = 0x94,
420 kSMBprocessorFamilyPaRisc7100LC = 0x95,
421 kSMBprocessorFamilyPaRisc7100 = 0x96,
422 kSMBprocessorFamilyV30 = 0xA0,
423 kSMBprocessorFamilyQuadCoreIntelXeon3200Series = 0xA1,
424 kSMBprocessorFamilyDualCoreIntelXeon3000Series = 0xA2,
425 kSMBprocessorFamilyQuadCoreIntelXeon5300Series = 0xA3,
426 kSMBprocessorFamilyDualCoreIntelXeon5100Series = 0xA4,
427 kSMBprocessorFamilyDualCoreIntelXeon5000Series = 0xA5,
428 kSMBprocessorFamilyDualCoreIntelXeonLV = 0xA6,
429 kSMBprocessorFamilyDualCoreIntelXeonULV = 0xA7,
430 kSMBprocessorFamilyDualCoreIntelXeon7100Series = 0xA8,
431 kSMBprocessorFamilyQuadCoreIntelXeon5400Series = 0xA9,
432 kSMBprocessorFamilyQuadCoreIntelXeon = 0xAA,
433 kSMBprocessorFamilyDualCoreIntelXeon5200Series = 0xAB,
434 kSMBprocessorFamilyDualCoreIntelXeon7200Series = 0xAC,
435 kSMBprocessorFamilyQuadCoreIntelXeon7300Series = 0xAD,
436 kSMBprocessorFamilyQuadCoreIntelXeon7400Series = 0xAE,
437 kSMBprocessorFamilyMultiCoreIntelXeon7400Series = 0xAF,
438 kSMBprocessorFamilyPentiumIIIXeon = 0xB0,
439 kSMBprocessorFamilyPentiumIIISpeedStep = 0xB1,
440 kSMBprocessorFamilyPentium4 = 0xB2,
441 kSMBprocessorFamilyIntelXeon = 0xB3,
442 kSMBprocessorFamilyAS400 = 0xB4,
443 kSMBprocessorFamilyIntelXeonMP = 0xB5,
444 kSMBprocessorFamilyAMDAthlonXP = 0xB6,
445 kSMBprocessorFamilyAMDAthlonMP = 0xB7,
446 kSMBprocessorFamilyIntelItanium2 = 0xB8,
447 kSMBprocessorFamilyIntelPentiumM = 0xB9,
448 kSMBprocessorFamilyIntelCeleronD = 0xBA,
449 kSMBprocessorFamilyIntelPentiumD = 0xBB,
450 kSMBprocessorFamilyIntelPentiumEx = 0xBC,
451 kSMBprocessorFamilyIntelCoreSolo = 0xBD, ///< SMBIOS spec 2.6 correct this value
452 kSMBprocessorFamilyReserved = 0xBE,
453 kSMBprocessorFamilyIntelCore2 = 0xBF,
454 kSMBprocessorFamilyIntelCore2Solo = 0xC0,
455 kSMBprocessorFamilyIntelCore2Extreme = 0xC1,
456 kSMBprocessorFamilyIntelCore2Quad = 0xC2,
457 kSMBprocessorFamilyIntelCore2ExtremeMobile = 0xC3,
458 kSMBprocessorFamilyIntelCore2DuoMobile = 0xC4,
459 kSMBprocessorFamilyIntelCore2SoloMobile = 0xC5,
460 kSMBprocessorFamilyIntelCoreI7 = 0xC6,
461 kSMBprocessorFamilyDualCoreIntelCeleron = 0xC7,
462 kSMBprocessorFamilyIBM390 = 0xC8,
463 kSMBprocessorFamilyG4 = 0xC9,
464 kSMBprocessorFamilyG5 = 0xCA,
465 kSMBprocessorFamilyG6 = 0xCB,
466 kSMBprocessorFamilyzArchitectur = 0xCC,
467 kSMBprocessorFamilyIntelCoreI5 = 0xCD,
468 kSMBprocessorFamilyIntelCoreI3 = 0xCE,
469 kSMBprocessorFamilyViaC7M = 0xD2,
470 kSMBprocessorFamilyViaC7D = 0xD3,
471 kSMBprocessorFamilyViaC7 = 0xD4,
472 kSMBprocessorFamilyViaEden = 0xD5,
473 kSMBprocessorFamilyMultiCoreIntelXeon = 0xD6,
474 kSMBprocessorFamilyDualCoreIntelXeon3Series = 0xD7,
475 kSMBprocessorFamilyQuadCoreIntelXeon3Series = 0xD8,
476 kSMBprocessorFamilyViaNano = 0xD9,
477 kSMBprocessorFamilyDualCoreIntelXeon5Series = 0xDA,
478 kSMBprocessorFamilyQuadCoreIntelXeon5Series = 0xDB,
479 kSMBprocessorFamilyDualCoreIntelXeon7Series = 0xDD,
480 kSMBprocessorFamilyQuadCoreIntelXeon7Series = 0xDE,
481 kSMBprocessorFamilyMultiCoreIntelXeon7Series = 0xDF,
482 kSMBprocessorFamilyMultiCoreIntelXeon3400Series = 0xE0,
483 kSMBprocessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,
484 kSMBprocessorFamilyAmdPhenomTripleCore = 0xE7,
485 kSMBprocessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,
486 kSMBprocessorFamilyAmdTurionDualCoreMobile = 0xE9,
487 kSMBprocessorFamilyAmdAthlonDualCore = 0xEA,
488 kSMBprocessorFamilyAmdSempronSI = 0xEB,
489 kSMBprocessorFamilyAmdPhenomII = 0xEC,
490 kSMBprocessorFamilyAmdAthlonII = 0xED,
491 kSMBprocessorFamilySixCoreAmdOpteron = 0xEE,
492 kSMBprocessorFamilyAmdSempronM = 0xEF,
493 kSMBprocessorFamilyi860 = 0xFA,
494 kSMBprocessorFamilyi960 = 0xFB,
495 kSMBprocessorFamilyIndicatorFamily2 = 0xFE,
496 kSMBprocessorFamilyReserved1 = 0xFF
497} PROCESSOR_FAMILY_DATA;
498
499// Processor Information - Processor Upgrade.
500// Values for SMBProcessorInformation.processorUpgrade
501typedef enum {
502 kSMBprocessorUpgradeOther = 0x01,
503 kSMBprocessorUpgradeUnknown = 0x02,
504 kSMBprocessorUpgradeDaughterBoard = 0x03,
505 kSMBprocessorUpgradeZIFSocket = 0x04,
506 kSMBprocessorUpgradePiggyBack = 0x05, ///< Replaceable.
507 kSMBprocessorUpgradeNone = 0x06,
508 kSMBprocessorUpgradeLIFSocket = 0x07,
509 kSMBprocessorUpgradeSlot1 = 0x08,
510 kSMBprocessorUpgradeSlot2 = 0x09,
511 kSMBprocessorUpgrade370PinSocket = 0x0A,
512 kSMBprocessorUpgradeSlotA = 0x0B,
513 kSMBprocessorUpgradeSlotM = 0x0C,
514 kSMBprocessorUpgradeSocket423 = 0x0D,
515 kSMBprocessorUpgradeSocketA = 0x0E, ///< Socket 462.
516 kSMBprocessorUpgradeSocket478 = 0x0F,
517 kSMBprocessorUpgradeSocket754 = 0x10,
518 kSMBprocessorUpgradeSocket940 = 0x11,
519 kSMBprocessorUpgradeSocket939 = 0x12,
520 kSMBprocessorUpgradeSocketmPGA604 = 0x13,
521 kSMBprocessorUpgradeSocketLGA771 = 0x14,
522 kSMBprocessorUpgradeSocketLGA775 = 0x15,
523 kSMBprocessorUpgradeSocketS1 = 0x16,
524 kSMBprocessorUpgradeAM2 = 0x17,
525 kSMBprocessorUpgradeF1207 = 0x18,
526 kSMBprocessorUpgradeSocketLGA1366 = 0x19,
527 kSMBprocessorUpgradeSocketG34 = 0x1A,
528 kSMBprocessorUpgradeSocketAM3 = 0x1B,
529 kSMBprocessorUpgradeSocketC32 = 0x1C,
530 kSMBprocessorUpgradeSocketLGA1156 = 0x1D,
531 kSMBprocessorUpgradeSocketLGA1567 = 0x1E,
532 kSMBprocessorUpgradeSocketPGA988A = 0x1F,
533 kSMBprocessorUpgradeSocketBGA1288 = 0x20,
534 kSMBprocessorUpgradeSocketrPGA988B = 0x21,
535 kSMBprocessorUpgradeSocketBGA1023 = 0x22,
536 kSMBprocessorUpgradeSocketBGA1224 = 0x23,
537 kSMBprocessorUpgradeSocketBGA1155 = 0x24,
538 kSMBprocessorUpgradeSocketLGA1356 = 0x25,
539 kSMBprocessorUpgradeSocketLGA2011 = 0x26,
540 kSMBprocessorUpgradeSocketFS1 = 0x27,
541 kSMBprocessorUpgradeSocketFS2 = 0x28,
542 kSMBprocessorUpgradeSocketFM1 = 0x29,
543 kSMBprocessorUpgradeSocketFM2 = 0x2A
544} PROCESSOR_UPGRADE;
545
546// Struct - Processor Information (Type 4), Apple uses 35 bytes length
547typedef struct SMBProcessorInformation
548{
549// 2.0+ spec (26 bytes)
550SMB_STRUCT_HEADER // Type 4
551SMBString socketDesignation;
552SMBByte processorType; // The enumeration value from PROCESSOR_TYPE_DATA.
553SMBByte processorFamily; // The enumeration value from PROCESSOR_FAMILY_DATA.
554SMBString manufacturer;
555SMBQWord processorID; // based on CPUID
556SMBString processorVersion;
557SMBByte voltage; // bit7 cleared indicate legacy mode
558SMBWord externalClock; // external clock in MHz
559SMBWord maximumClock; // max internal clock in MHz
560SMBWord currentClock; // current internal clock in MHz
561SMBByte status;
562SMBByte processorUpgrade; // The enumeration value from PROCESSOR_UPGRADE.
563// 2.1+ spec (32 bytes)
564SMBWord L1CacheHandle;
565SMBWord L2CacheHandle;
566SMBWord L3CacheHandle;
567// 2.3+ spec (35 bytes)
568SMBString serialNumber;
569SMBString assetTag;
570SMBString partNumber;
571// 2.5+ spec (40 bytes) Apple still uses 2.4 spec
572//SMBByte coreCount;
573//SMBByte coreEnabled;
574//SMBByte threadCount;
575//SMBWord processorFuncSupport;
576// 2.6+ spec (42 bytes)
577//SMBWord processorFamily2;
578} __attribute__((packed)) SMBProcessorInformation;
579
580//----------------------------------------------------------------------------------------------------------
581// Struct - Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1
582typedef struct SMBMemoryControllerInfo {
583SMB_STRUCT_HEADER
584SMBByteerrorDetectingMethod;
585SMBByteerrorCorrectingCapability;
586SMBBytesupportedInterleave;
587SMBBytecurrentInterleave;
588SMBBytemaxMemoryModuleSize;
589SMBWordsupportedSpeeds;
590SMBWordsupportedMemoryTypes;
591SMBBytememoryModuleVoltage;
592SMBBytenumberOfMemorySlots;
593} __attribute__((packed)) SMBMemoryControllerInfo;
594
595//----------------------------------------------------------------------------------------------------------
596// Struct - Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1
597typedef struct SMBMemoryModule
598{
599 SMB_STRUCT_HEADER // Type 6
600 SMBString socketDesignation;
601 SMBByte bankConnections;
602 SMBByte currentSpeed;
603 SMBWord currentMemoryType;
604 SMBByte installedSize;
605 SMBByte enabledSize;
606 SMBByte errorStatus;
607} __attribute__((packed)) SMBMemoryModule;
608
609#define kSMBMemoryModuleSizeNotDeterminable 0x7D
610#define kSMBMemoryModuleSizeNotEnabled 0x7E
611#define kSMBMemoryModuleSizeNotInstalled 0x7F
612
613//----------------------------------------------------------------------------------------------------------
614// Struct - Cache Information (Type 7), Apple uses 19 bytes length
615typedef struct SMBCacheInformation
616{
617 SMB_STRUCT_HEADER // Type 7
618 SMBString socketDesignation;
619 SMBWord cacheConfiguration;
620 SMBWord maximumCacheSize;
621 SMBWord installedSize;
622 SMBWord supportedSRAMType;
623 SMBWord currentSRAMType;
624 SMBByte cacheSpeed;
625 SMBByte errorCorrectionType;
626 SMBByte systemCacheType;
627 SMBByte associativity;
628} __attribute__((packed)) SMBCacheInformation;
629
630//----------------------------------------------------------------------------------------------------------
631// Struct - System Slots (Type 9), Apple uses 13 bytes length
632typedef struct SMBSystemSlot
633{
634 // 2.0+ spec (12 bytes)
635SMB_STRUCT_HEADER
636SMBString slotDesignation;
637SMBByte slotType;
638SMBByte slotDataBusWidth;
639SMBByte currentUsage;
640SMBByte slotLength;
641SMBWord slotID;
642SMBByte slotCharacteristics1;
643// 2.1+ spec (13 bytes)
644SMBByte slotCharacteristics2;
645// 2.6+ spec (17 bytes)
646//SMBWordsegmentGroupNumber;
647//SMBBytebusNumber;
648//SMBBytedeviceFunctionNumber;
649} __attribute__((packed)) SMBSystemSlot;
650
651//----------------------------------------------------------------------------------------------------------
652// Struct - OEM Strings (Type 11), Apple uses 5 bytes length
653typedef struct SMBOEMStrings
654{
655SMB_STRUCT_HEADER // Type 11
656SMBBytecount;// number of strings
657} __attribute__((packed)) SMBOEMStrings;
658
659//----------------------------------------------------------------------------------------------------------
660// Physical Memory Array (Type 16)
661
662// Physical Memory Array - Use.
663// Values for SMBPhysicalMemoryArray.arrayUse
664typedef enum
665{
666 kSMBMemoryArrayUseOther = 0x01,
667 kSMBMemoryArrayUseUnknown = 0x02,
668 kSMBMemoryArrayUseSystemMemory = 0x03,
669 kSMBMemoryArrayUseVideoMemory = 0x04,
670 kSMBMemoryArrayUseFlashMemory = 0x05,
671 kSMBMemoryArrayUseNonVolatileMemory = 0x06,
672 kSMBMemoryArrayUseCacheMemory = 0x07
673} MEMORY_ARRAY_USE;
674
675// Physical Memory Array - Error Correction Types.
676// Values for SMBPhysicalMemoryArray.errorCorrection
677typedef enum
678{
679 kSMBMemoryArrayErrorCorrectionTypeOther = 0x01,
680 kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02,
681 kSMBMemoryArrayErrorCorrectionTypeNone = 0x03,
682 kSMBMemoryArrayErrorCorrectionTypeParity = 0x04,
683 kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05,
684 kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06,
685 kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07
686} MEMORY_ERROR_CORRECTION;
687
688// Struct - Physical Memory Array (Type 16), Apple uses 15 bytes length
689typedef struct SMBPhysicalMemoryArray
690{
691// 2.1+ spec (15 bytes)
692SMB_STRUCT_HEADER // Type 16
693SMBByte physicalLocation; // physical location
694SMBByte arrayUse; // the use for the memory array, The enumeration value from MEMORY_ARRAY_USE.
695SMBByte errorCorrection; // error correction/detection method, The enumeration value from MEMORY_ERROR_CORRECTION.
696SMBDWord maximumCapacity; // maximum memory capacity in kilobytes
697SMBWord errorHandle; // handle of a previously detected error
698SMBWord numMemoryDevices; // number of memory slots or sockets
699// 2.7+ spec
700 //SMBQWord extMaximumCapacity;// maximum memory capacity in bytes
701} __attribute__((packed)) SMBPhysicalMemoryArray;
702
703//----------------------------------------------------------------------------------------------------------
704// Struct - Memory Device (Type 17), Apple uses 27 bytes length
705typedef struct SMBMemoryDevice
706{
707// 2.1+ spec (21 bytes)
708SMB_STRUCT_HEADER // Type 17
709SMBWord arrayHandle; // handle of the parent memory array
710SMBWord errorHandle; // handle of a previously detected error
711SMBWord totalWidth; // total width in bits; including ECC bits
712SMBWord dataWidth; // data width in bits
713SMBWord memorySize; // bit15 is scale, 0 = MB, 1 = KB
714SMBByte formFactor; // memory device form factor
715SMBByte deviceSet; // parent set of identical memory devices
716SMBString deviceLocator; // labeled socket; e.g. "SIMM 3"
717SMBString bankLocator; // labeled bank; e.g. "Bank 0" or "A"
718SMBByte memoryType; // type of memory
719SMBWord memoryTypeDetail; // additional detail on memory type
720// 2.3+ spec (27 bytes)
721SMBWord memorySpeed; // speed of device in MHz (0 for unknown)
722SMBString manufacturer;
723SMBString serialNumber;
724SMBString assetTag;
725SMBString partNumber;
726// 2.6+ spec (28 bytes)
727//SMBByte attributes;
728// 2.7+ spec
729//SMBDWord memoryExtSize;
730//SMBWord confMemClkSpeed;
731// 2.8+ spec
732//SMBWord minimumVolt;
733//SMBWord maximumVolt;
734//SMBWord configuredVolt;
735} __attribute__((packed)) SMBMemoryDevice;
736
737//----------------------------------------------------------------------------------------------------------
738
739// Struct - Memory Array Mapped Address (Type 19), Apple uses 15 bytes length
740//typedef struct SMBMemoryArrayMappedAddress
741//{
742 // 2.1+ spec
743//SMB_STRUCT_HEADER // Type 19
744//SMBDWord startingAddress;
745//SMBDWord endingAddress;
746//SMBWord arrayHandle;
747//SMBByte partitionWidth;
748// 2.7+ spec
749//SMBQWord extStartAddress;
750//SMBQWord extEndAddress;
751//} __attribute__((packed)) SMBMemoryArrayMappedAddress;
752
753//----------------------------------------------------------------------------------------------------------
754
755// Struct - Memory Device Mapped Address (Type 20)
756//typedef struct SMBMemoryDeviceMappedAddress
757//{
758// 2.1+ spec
759//SMB_STRUCT_HEADER // Type 20
760//SMBDWord startingAddress;
761//SMBDWord endingAddress;
762//SMBWord arrayHandle;
763//SMBByte partitionRowPosition;
764//SMBByte interleavePosition;
765//SMBByte interleaveDataDepth;
766// 2.7+ spec
767//SMBQWord extStartAddress;
768//SMBQWord extEndAddress;
769//} __attribute__((packed)) SMBMemoryDeviceMappedAddress;
770
771//----------------------------------------------------------------------------------------------------------
772// Firmware Volume Description (Apple Specific - Type 128)
773enum
774{
775FW_REGION_RESERVED = 0,
776FW_REGION_RECOVERY = 1,
777FW_REGION_MAIN = 2,
778FW_REGION_NVRAM = 3,
779FW_REGION_CONFIG = 4,
780FW_REGION_DIAGVAULT = 5,
781
782NUM_FLASHMAP_ENTRIES = 8
783};
784
785typedef struct FW_REGION_INFO
786{
787SMBDWord StartAddress;
788SMBDWord EndAddress;
789} __attribute__((packed)) FW_REGION_INFO;
790
791// Struct - Firmware Volume Description (Apple Specific - Type 128), Apple uses 88 bytes length
792typedef struct SMBFirmwareVolume
793{
794SMB_STRUCT_HEADER// Type 128
795SMBByte RegionCount;
796SMBByte Reserved[3];
797SMBDWord FirmwareFeatures;
798SMBDWord FirmwareFeaturesMask;
799SMBByte RegionType[ NUM_FLASHMAP_ENTRIES ];
800FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ];
801} __attribute__((packed)) SMBFirmwareVolume;
802
803//----------------------------------------------------------------------------------------------------------
804
805/* ===========================================
806 Memory SPD Data (Apple Specific - Type 130)
807 ============================================= */
808typedef struct SMBMemorySPD
809{
810SMB_STRUCT_HEADER// Type 130
811SMBWord Type17Handle;
812SMBWord Offset;
813SMBWord Size;
814SMBWord Data[1];
815} __attribute__((packed)) SMBMemorySPD;
816
817//----------------------------------------------------------------------------------------------------------
818
819/* ============================================
820 OEM Processor Type (Apple Specific - Type 131)
821 ============================================== */
822typedef struct SMBOemProcessorType
823{
824SMB_STRUCT_HEADER// Type131
825SMBWord ProcessorType;
826} __attribute__((packed)) SMBOemProcessorType;
827
828//----------------------------------------------------------------------------------------------------------
829
830/* =================================================
831 OEM Processor Bus Speed (Apple Specific - Type 132)
832 =================================================== */
833typedef struct SMBOemProcessorBusSpeed
834{
835SMB_STRUCT_HEADER// Type 132
836SMBWord ProcessorBusSpeed; // MT/s unit
837} __attribute__((packed)) SMBOemProcessorBusSpeed;
838
839//----------------------------------------------------------------------------------------------------------
840
841/* ==============================================
842 OEM Platform Feature (Apple Specific - Type 133)
843 ================================================ */
844struct SMBOemPlatformFeature
845{
846SMB_STRUCT_HEADER// Type 133
847SMBWord PlatformFeature;
848} __attribute__((packed)) SMBOemPlatformFeature;
849
850//----------------------------------------------------------------------------------------------------------
851
852#define SMBIOS_ORIGINAL0
853#define SMBIOS_PATCHED1
854
855extern void *getSmbios(int which);
856extern void readSMBIOSInfo(SMBEntryPoint *eps);
857extern void setupSMBIOS(void);
858extern void decodeSMBIOSTable(SMBEntryPoint *eps);
859
860#endif /* !__LIBSAIO_SMBIOS_H */
861

Archive Download this file

Revision: 2537