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
35
36typedef struct DMIEntryPoint
37{
38 SMBByte anchor[5];
39 SMBByte checksum;
40 SMBWord tableLength;
41 SMBDWord tableAddress;
42 SMBWord structureCount;
43 SMBByte bcdRevision;
44} __attribute__((packed)) DMIEntryPoint;
45
46typedef struct SMBEntryPoint
47{
48 SMBByte anchor[4];
49 SMBByte checksum;
50 SMBByte entryPointLength;
51 SMBByte majorVersion;
52 SMBByte minorVersion;
53 SMBWord maxStructureSize;
54 SMBByte entryPointRevision;
55 SMBByte formattedArea[5];
56 DMIEntryPoint dmi;
57} __attribute__((packed)) SMBEntryPoint;
58
59/* Header common to all SMBIOS structures */
60typedef struct SMBStructHeader
61{
62SMBBytetype;
63SMBBytelength;
64SMBWordhandle;
65//SMBByte*data;
66} __attribute__((packed)) SMBStructHeader;
67
68#define SMB_STRUCT_HEADER SMBStructHeader header;
69
70typedef struct SMBAnchor
71{
72const SMBStructHeader *header;
73const uint8_t *next;
74const uint8_t *end;
75} SMBAnchor;
76
77#define SMB_ANCHOR_IS_VALID(x)\
78((x) && ((x)->header) && ((x)->next) && ((x)->end))
79
80#define SMB_ANCHOR_RESET(x)\
81bzero(x, sizeof(typedef struct SMBAnchor));
82
83/* ======================= SMBIOS structure types. ======================= */
84enum
85{
86kSMBTypeBIOSInformation= 0, // BIOS information (Type 0)
87kSMBTypeSystemInformation= 1, // System Information (Type 1)
88kSMBTypeBaseBoard= 2, // BaseBoard Information (Type 2)
89kSMBTypeSystemEnclosure= 3, // System Chassis Information (Type 3)
90kSMBTypeProcessorInformation= 4, // Processor Information (Type 4)
91// Memory Controller Information (Type 5) Obsolete
92kSMBTypeMemoryModule= 6, // Memory Module Information (Type 6) Obsolete
93kSMBTypeCacheInformation= 7, // Cache Information (Type 7)
94// Port Connector Information (Type 8)
95kSMBTypeSystemSlot= 9, // System Slots (Type 9)
96// On Board Devices Information (Type 10) Obsolete
97kSMBOEMStrings= 11 ,// OEM Strings (Type 11)
98// System Configuration Options (Type 12)
99// BIOS Language Information (Type 13)
100// Group Associations (Type 14)
101// System Event Log (Type 15)
102kSMBTypePhysicalMemoryArray= 16, // Physical Memory Array (Type 16)
103kSMBTypeMemoryDevice= 17, // Memory Device (Type 17)
104kSMBType32BitMemoryErrorInfo= 18, // 32-Bit Memory Error Information (Type 18)
105// Memory Array Mapped Address (Type 19)
106// Memory Device Mapped Address (Type 20)
107// Built-in Pointing Device (Type 21)
108// Portable Battery (Type 22)
109// System Reset (Type 23)
110// Hardware Security (Type 24)
111// System Power Controls (Type 25)
112// Voltage Probe (Type 26)
113// Cooling Device (Type 27)
114// Temperature Probe (Type 28)
115// Electrical Current Probe (Type 29)
116// Out-of-Band Remote Access (Type 30)
117// Boot Integrity Service (BIS) Entry Point (Type 31)
118// System Boot Information (Type 32)
119kSMBType64BitMemoryErrorInfo= 33, // 64-Bit Memory Error Information (Type 33)
120// Managment Device (Type 34)
121// Managment Device Component (Type 35)
122// Management Device Threshold Data (Type 36)
123// Memory Channel (Type 37)
124// IPMI Device Information (Type 38)
125// System Power Supply (Type 39)
126// Additional Information (Type 40)
127// Onboard Devices Extended Information (Type 41)
128// Management Controlle Host Interface (Type 42)
129
130// Inactive (Type 126)
131kSMBTypeEndOfTable= 127, // End-of-Table (Type 127)
132
133// Apple Specific Structures
134kSMBTypeFirmwareVolume= 128, // FirmwareVolume (TYPE 128)
135kSMBTypeMemorySPD= 130, // MemorySPD (TYPE 130)
136kSMBTypeOemProcessorType= 131, // Processor Type (Type 131)
137kSMBTypeOemProcessorBusSpeed= 132, // Processor Bus Speed (Type 132)
138kSMBTypeOemPlatformFeature= 133 // Platform Feature (Type 133)
139};
140
141//----------------------------------------------------------------------------------------------------------
142// Struct - BIOS Information (Type 0)
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)
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)
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)
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
289 //SMBByte 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 //SMBString skuNumber;// Number of null-terminated string describing the chassis or enclosure SKU number (2.7+)
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).
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)
572SMBByte coreCount;
573SMBByte coreEnabled;
574SMBByte 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)
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)
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)
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)
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)
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)
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)
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#include "efi_tables.h"
853/* From Foundation/Efi/Guid/Smbios/SmBios.h */
854/* Modified to wrap Data4 array init with {} */
855#define EFI_SMBIOS_TABLE_GUID {0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d}}
856extern EFI_GUID const gEfiSmbiosTableGuid;
857
858#define SMBIOS_ORIGINAL0
859#define SMBIOS_PATCHED1
860
861extern uint64_t smbios_p;
862extern void *getSmbios(int which);
863extern void readSMBIOSInfo(SMBEntryPoint *eps);
864extern void setupSMBIOS(void);
865extern void decodeSMBIOSTable(SMBEntryPoint *eps);
866
867
868#endif /* !__LIBSAIO_SMBIOS_H */
869

Archive Download this file

Revision: 2469