Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 2877