Chameleon

Chameleon Svn Source Tree

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

Archive Download this file

Revision: 2406