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 v3.1.1␊ |
28 | // https://www.dmtf.org/standards/smbios␊ |
29 | //␊ |
30 | ␊ |
31 | typedef uint8_t SMBString;␊ |
32 | typedef uint8_t SMBByte;␊ |
33 | typedef uint16_t SMBWord;␊ |
34 | typedef uint32_t SMBDWord;␊ |
35 | typedef uint64_t SMBQWord;␊ |
36 | ␊ |
37 | ␊ |
38 | ␊ |
39 | //␊ |
40 | // SMBIOS 2.1 (32-bit) Entry Point␊ |
41 | //␊ |
42 | typedef struct DMIEntryPoint␊ |
43 | {␊ |
44 | SMBByte anchor[5];␊ |
45 | SMBByte checksum;␊ |
46 | SMBWord tableLength;␊ |
47 | SMBDWord tableAddress;␊ |
48 | SMBWord structureCount;␊ |
49 | SMBByte bcdRevision;␊ |
50 | } __attribute__((packed)) DMIEntryPoint;␊ |
51 | ␊ |
52 | typedef struct SMBEntryPoint␊ |
53 | {␊ |
54 | SMBByte anchor[4];␊ |
55 | SMBByte checksum;␊ |
56 | SMBByte entryPointLength;␊ |
57 | SMBByte majorVersion;␊ |
58 | SMBByte minorVersion;␊ |
59 | SMBWord maxStructureSize;␊ |
60 | SMBByte entryPointRevision;␊ |
61 | SMBByte formattedArea[5];␊ |
62 | DMIEntryPoint dmi;␊ |
63 | } __attribute__((packed)) SMBEntryPoint;␊ |
64 | ␊ |
65 | ␊ |
66 | ␊ |
67 | //␊ |
68 | // Structure header format␊ |
69 | // Each SMBIOS structure begins with a four-byte header␊ |
70 | //␊ |
71 | typedef struct SMBStructHeader␊ |
72 | {␊ |
73 | ␉SMBByte␉type;␊ |
74 | ␉SMBByte␉length;␊ |
75 | ␉SMBWord␉handle;␊ |
76 | } __attribute__((packed)) SMBStructHeader;␊ |
77 | ␊ |
78 | #define SMB_STRUCT_HEADER SMBStructHeader header;␊ |
79 | ␊ |
80 | typedef struct SMBAnchor␊ |
81 | {␊ |
82 | ␉const SMBStructHeader *␉header;␊ |
83 | ␉const uint8_t *␉␉␉next;␊ |
84 | ␉const uint8_t *␉␉␉end;␊ |
85 | } SMBAnchor;␊ |
86 | ␊ |
87 | #define SMB_ANCHOR_IS_VALID(x)␉\␊ |
88 | ␉((x) && ((x)->header) && ((x)->next) && ((x)->end))␊ |
89 | ␊ |
90 | #define SMB_ANCHOR_RESET(x)␉␉\␊ |
91 | ␉bzero(x, sizeof(typedef struct SMBAnchor));␊ |
92 | ␊ |
93 | ␊ |
94 | ␊ |
95 | //␊ |
96 | // SMBIOS structure types.␊ |
97 | // The following structures are requiered:␊ |
98 | // - BIOS Information (Type 0)␊ |
99 | // - System Information (Type 1)␊ |
100 | // - System Enclosure (Type 3)␊ |
101 | // - Processor Information (Type 4)␊ |
102 | // - Cache Information (Type 7)␊ |
103 | // - System Slots (Type 9)␊ |
104 | // - Physical Memory Array (Type 16)␊ |
105 | // - Memory Device (Type 17)␊ |
106 | // - Memory Array Mapped Address (Type 19)␊ |
107 | // - System Boot Information (Type 32)␊ |
108 | //␊ |
109 | ␊ |
110 | enum␊ |
111 | {␊ |
112 | ␉kSMBTypeBIOSInformation = 0, // BIOS information (Type 0)␊ |
113 | ␉kSMBTypeSystemInformation = 1, // System Information (Type 1)␊ |
114 | ␉kSMBTypeBaseBoard = 2, // BaseBoard Information (Type 2)␊ |
115 | ␉kSMBTypeSystemEnclosure = 3, // System Chassis Information (Type 3)␊ |
116 | ␉kSMBTypeProcessorInformation = 4, // Processor Information (Type 4)␊ |
117 | ␉// Memory Controller Information (Type 5) Obsolete␊ |
118 | ␉// Memory Module Information (Type 6) Obsolete␊ |
119 | ␉kSMBTypeCacheInformation = 7, // Cache Information (Type 7)␊ |
120 | ␉// Port Connector Information (Type 8)␊ |
121 | ␉kSMBTypeSystemSlot = 9, // System Slots (Type 9)␊ |
122 | ␉// On Board Devices Information (Type 10) Obsolete␊ |
123 | ␉kSMBOEMStrings = 11,// OEM Strings (Type 11)␊ |
124 | ␉// System Configuration Options (Type 12)␊ |
125 | ␉// BIOS Language Information (Type 13)␊ |
126 | ␉// Group Associations (Type 14)␊ |
127 | ␉// System Event Log (Type 15)␊ |
128 | ␉kSMBTypePhysicalMemoryArray = 16, // Physical Memory Array (Type 16)␊ |
129 | ␉kSMBTypeMemoryDevice = 17, // Memory Device (Type 17)␊ |
130 | ␉kSMBType32BitMemoryErrorInfo = 18, // 32-Bit Memory Error Information (Type 18)␊ |
131 | ␉// Memory Array Mapped Address (Type 19)␊ |
132 | ␉// Memory Device Mapped Address (Type 20)␊ |
133 | ␉// Built-in Pointing Device (Type 21)␊ |
134 | ␉// Portable Battery (Type 22)␊ |
135 | ␉// System Reset (Type 23)␊ |
136 | ␉// Hardware Security (Type 24)␊ |
137 | ␉// System Power Controls (Type 25)␊ |
138 | ␉// Voltage Probe (Type 26)␊ |
139 | ␉// Cooling Device (Type 27)␊ |
140 | ␉// Temperature Probe (Type 28)␊ |
141 | ␉// Electrical Current Probe (Type 29)␊ |
142 | ␉// Out-of-Band Remote Access (Type 30)␊ |
143 | ␉// Boot Integrity Service (BIS) Entry Point (Type 31)␊ |
144 | ␉// System Boot Information (Type 32)␊ |
145 | ␉kSMBType64BitMemoryErrorInfo = 33, // 64-Bit Memory Error Information (Type 33)␊ |
146 | ␉// Managment Device (Type 34)␊ |
147 | ␉// Managment Device Component (Type 35)␊ |
148 | ␉// Management Device Threshold Data (Type 36)␊ |
149 | ␉// Memory Channel (Type 37)␊ |
150 | ␉// IPMI Device Information (Type 38)␊ |
151 | ␉// System Power Supply (Type 39)␊ |
152 | ␉// Additional Information (Type 40)␊ |
153 | ␉// Onboard Devices Extended Information (Type 41)␊ |
154 | ␉// Management Controlle Host Interface (Type 42)␊ |
155 | ␊ |
156 | ␉// Inactive (Type 126)␊ |
157 | ␉kSMBTypeEndOfTable = 127, // End-of-Table (Type 127)␊ |
158 | ␊ |
159 | ␉// Apple Specific Structures␊ |
160 | ␉kSMBTypeFirmwareVolume = 128, // FirmwareVolume (TYPE 128)␊ |
161 | ␉kSMBTypeMemorySPD = 130, // MemorySPD (TYPE 130)␊ |
162 | ␉kSMBTypeOemProcessorType = 131, // Processor Type (Type 131)␊ |
163 | ␉kSMBTypeOemProcessorBusSpeed = 132, // Processor Bus Speed (Type 132)␊ |
164 | ␉kSMBTypeOemPlatformFeature = 133, // Platform Feature (Type 133)␊ |
165 | ␉kSMBTypeOemSMCVersion = 134 // SMC Version (Type 134)␊ |
166 | };␊ |
167 | ␊ |
168 | ␊ |
169 | ␊ |
170 | //----------------------------------------------------------------------------------------------------------␊ |
171 | // Struct - BIOS Information (Type 0), Apple uses 24 bytes length␊ |
172 | //----------------------------------------------------------------------------------------------------------␊ |
173 | ␊ |
174 | typedef struct SMBBIOSInformation␊ |
175 | {␊ |
176 | SMB_STRUCT_HEADER // Type 0␊ |
177 | SMBString vendor; // BIOS vendor name␊ |
178 | SMBString version; // BIOS version␊ |
179 | SMBWord startSegment; // BIOS segment start␊ |
180 | SMBString releaseDate; // BIOS release date (mm/dd/yy or mm/dd/yyyy)␊ |
181 | SMBByte romSize; // BIOS ROM Size (n); 64K * (n+1) bytes␊ |
182 | SMBQWord characteristics; // supported BIOS functions␊ |
183 | ␊ |
184 | // Bungo - 2.4+ spec (6 bytes)␊ |
185 | SMBByte characteristicsExt1; // BIOS characteristics extension byte 1␊ |
186 | SMBByte characteristicsExt2; // BIOS characteristics extension byte 2␊ |
187 | SMBByte releaseMajor; // BIOS release (major)␊ |
188 | SMBByte releaseMinor; // BIOS release (minor)␊ |
189 | SMBByte ECreleaseMajor; // Embedded Controller firmware release (major)␊ |
190 | SMBByte ECreleaseMinor; // Embedded Controller firmware release (minor)␊ |
191 | } __attribute__((packed)) SMBBIOSInformation;␊ |
192 | ␊ |
193 | // TODO: Add constants for BIOS characteristics bits (Section 7.1.1, table 7)␊ |
194 | // TODO: Add constants for BIOS characteristics extenstion bytes (Section 7.1.2, table 8+9)␊ |
195 | ␊ |
196 | ␊ |
197 | //----------------------------------------------------------------------------------------------------------␊ |
198 | // Struct - System Information (Type 1), Apple uses 27 bytes length␊ |
199 | //----------------------------------------------------------------------------------------------------------␊ |
200 | ␊ |
201 | typedef struct SMBSystemInformation␊ |
202 | {␊ |
203 | // 2.0+ spec (8 bytes)␊ |
204 | SMB_STRUCT_HEADER // Type 1␊ |
205 | SMBString manufacturer;␊ |
206 | SMBString productName;␊ |
207 | SMBString version;␊ |
208 | SMBString serialNumber;␊ |
209 | // 2.1+ spec (25 bytes)␊ |
210 | SMBByte uuid[16]; // can be all 0 or all 1's␊ |
211 | SMBByte wakeupReason; // reason for system wakeup␊ |
212 | // 2.4+ spec (27 bytes)␊ |
213 | SMBString skuNumber;␊ |
214 | SMBString family;␊ |
215 | } __attribute__((packed)) SMBSystemInformation;␊ |
216 | ␊ |
217 | // TODO: Add enum for wake-up type field (Section 7.2.2, table 12)␊ |
218 | ␊ |
219 | ␊ |
220 | //----------------------------------------------------------------------------------------------------------␊ |
221 | // Base Board (or Module) Information (Type 2), Apple uses 16 bytes length␊ |
222 | //----------------------------------------------------------------------------------------------------------␊ |
223 | ␊ |
224 | typedef struct SMBBaseBoard␊ |
225 | {␊ |
226 | SMB_STRUCT_HEADER // Type 2␊ |
227 | SMBString␉manufacturer;␊ |
228 | SMBString␉product;␊ |
229 | SMBString␉version;␊ |
230 | SMBString␉serialNumber;␊ |
231 | SMBString␉assetTag; // Bungo: renamed from assetTagNumber folowing convention␊ |
232 | SMBByte featureFlags; // Collection of flag that identify features of this baseboard␊ |
233 | SMBString␉locationInChassis;␊ |
234 | SMBWord chassisHandle;␊ |
235 | SMBByte boardType;␉␉␉ // Type of board, numeration value from BASE_BOARD_TYPE.␊ |
236 | SMBByte numberOfContainedHandles;␊ |
237 | // 0 - 255 contained handles go here but we do not include␊ |
238 | // them in our structure. Be careful to use numberOfContainedHandles␊ |
239 | // times sizeof(SMBWord) when computing the actual record size,␊ |
240 | // if you need it.␊ |
241 | SMBByte containedObjectHandles;␊ |
242 | } __attribute__((packed)) SMBBaseBoard;␊ |
243 | ␊ |
244 | // Base Board - Board Type.␊ |
245 | // Values for SMBBaseBoard.boardType␊ |
246 | typedef enum␊ |
247 | {␊ |
248 | kSMBBaseBoardUnknown = 0x01,␉// Unknown␊ |
249 | kSMBBaseBoardOther = 0x02,␉// Other␊ |
250 | kSMBBaseBoardServerBlade = 0x03,␉// Server Blade␊ |
251 | kSMBBaseBoardConnectivitySwitch = 0x04,␉// Connectivity Switch␊ |
252 | kSMBBaseBoardSystemMgmtModule = 0x05,␉// System Management Module␊ |
253 | kSMBBaseBoardProcessorModule = 0x06,␉// Processor Module␊ |
254 | kSMBBaseBoardIOModule = 0x07,␉// I/O Module␊ |
255 | kSMBBaseBoardMemoryModule = 0x08,␉// Memory Module␊ |
256 | kSMBBaseBoardDaughter = 0x09,␉// Daughter board␊ |
257 | kSMBBaseBoardMotherboard = 0x0A,␉// Motherboard (includes processor, memory, and I/O)␊ |
258 | kSMBBaseBoardProcessorMemoryModule = 0x0B,␉// Processor/Memory Module␊ |
259 | kSMBBaseBoardProcessorIOModule = 0x0C,␉// Processor/IO Module␊ |
260 | kSMBBaseBoardInterconnect = 0x0D␉// Interconnect board␊ |
261 | } BASE_BOARD_TYPE;␊ |
262 | ␊ |
263 | // TODO: Add constants to identify the baseboard feature flags␊ |
264 | ␊ |
265 | ␊ |
266 | //----------------------------------------------------------------------------------------------------------␊ |
267 | // System Enclosure or Chassis (Type 3), Apple uses 21 bytes length␊ |
268 | //----------------------------------------------------------------------------------------------------------␊ |
269 | ␊ |
270 | typedef struct SMBSystemEnclosure␊ |
271 | {␊ |
272 | ␉SMB_STRUCT_HEADER // Type 3␊ |
273 | ␉SMBString manufacturer;␊ |
274 | ␉SMBByte chassisType; // System Enclosure Indicator␊ |
275 | ␉SMBString version; // Board Number?␊ |
276 | ␉SMBString serialNumber;␊ |
277 | ␉SMBString assetTag; // Bungo: renamed from assetTagNumber folowing convention␊ |
278 | ␉SMBByte bootupState; // State of enclosure when when it was last booted␊ |
279 | ␉SMBByte powerSupplyState; // State of enclosure's power supply when last booted␊ |
280 | ␉SMBByte thermalState; // Thermal state of the enclosure when last booted␊ |
281 | ␉SMBByte securityStatus; // Physical security status of the enclosure when last booted␊ |
282 | ␉SMBDWord oemDefined; // OEM- or BIOS vendor-specific information␊ |
283 | ␉SMBByte height; // Height of the enclosure, in 'U's␊ |
284 | ␉SMBByte numberOfPowerCords; // Number of power cords associated with the enclosure or chassis␊ |
285 | ␉SMBByte containedElementCount; // Number of Contained Element record that follow, in the range 0 to 255␊ |
286 | ␉SMBByte containedElementRecord; // Byte leght of each Contained Element record that follow, in the range 0 to 255␊ |
287 | //␉SMBByte containedElements; // Elements, possibly defined by other SMBIOS structures present in chassis␊ |
288 | // 2.7+␊ |
289 | //␉SMBString skuNumber;␉␉// Number of null-terminated string describing the chassis or enclosure SKU number␊ |
290 | } __attribute__((packed)) SMBSystemEnclosure;␊ |
291 | ␊ |
292 | ␊ |
293 | // Bungo: values for SMBSystemEnclosure.chassisType␊ |
294 | // MinusZwei: renamed enum values and added new values from later specs␊ |
295 | typedef enum {␊ |
296 | kSMBChassisTypeOther = 0x01, // Other␊ |
297 | kSMBChassisTypeUnknown = 0x02, // Unknown␊ |
298 | kSMBChassisTypeDesktop = 0x03, // Desktop␊ |
299 | kSMBChassisTypeLowProfileDesktop = 0x04, // Low Profile Desktop␊ |
300 | kSMBChassisTypePizzaBox = 0x05, // Pizza Box␊ |
301 | kSMBChassisTypeMiniTower = 0x06, // Mini Tower␊ |
302 | kSMBChassisTypeTower = 0x07, // Tower␊ |
303 | kSMBChassisTypePortable = 0x08, // Portable␊ |
304 | kSMBChassisTypeLaptop = 0x09, // Laptop␊ |
305 | kSMBChassisTypeNotebook = 0x0A, // Notebook␊ |
306 | kSMBChassisTypeHandHeld = 0x0B, // Hand Held␊ |
307 | kSMBChassisTypeDockingStation = 0x0C, // Docking Station␊ |
308 | kSMBChassisTypeAllInOne = 0x0D, // All in One␊ |
309 | kSMBChassisTypeSubNotebook = 0x0E, // Sub Notebook␊ |
310 | kSMBChassisTypeSpaceSaving = 0x0F, // Space-saving␊ |
311 | kSMBChassisTypeLunchBox = 0x10, // Lunch Box␊ |
312 | kSMBChassisTypeMainServer = 0x11, // Main Server Chassis␊ |
313 | kSMBChassisTypeExpansion = 0x12, // Expansion Chassis␊ |
314 | kSMBChassisTypeSubChassis = 0x13, // SubChassis␊ |
315 | kSMBChassisTypeBusExpansion = 0x14, // Bus Expansion Chassis␊ |
316 | kSMBChassisTypePeripheral = 0x15, // Peripheral Chassis␊ |
317 | kSMBChassisTypeRAID = 0x16, // RAID Chassis␊ |
318 | kSMBChassisTypeRackMount = 0x17, // Rack Mount Chassis␊ |
319 | kSMBChassisTypeSealedCase = 0x18, // Sealed-case PC␊ |
320 | kSMBChassisTypeMultiSystem = 0x19, // Multi-system chassis␊ |
321 | kSMBChassisTypeCompactPCI = 0x1A, // Compact PCI␊ |
322 | kSMBChassisTypeAdvancedTCA = 0x1B, // Advanced TCA␊ |
323 | kSMBChassisTypeBlade = 0x1C, // Blade␊ |
324 | kSMBChassisTypeBladeEnclosing = 0x1D, // Blade Enclosure␊ |
325 | kSMBChassisTypeTablet = 0x1E, // Tablet␊ |
326 | kSMBChassisTypeConvertible = 0x1F, // Convertible␊ |
327 | kSMBChassisTypeDetachable = 0x20, // Detachable␊ |
328 | kSMBChassisTypeIoTGateway = 0x21, // IoT Gateway␊ |
329 | kSMBChassisTypeEmbeddedPC = 0x22, // Embedded PC␊ |
330 | kSMBChassisTypeMiniPC = 0x23, // Mini PC␊ |
331 | kSMBChassisTypeStickPC = 0x24 // Stick PC␊ |
332 | } SYSTEM_ENCLOSURE_CHASSIS_TYPE;␊ |
333 | ␊ |
334 | // System Enclosure or Chassis States.␊ |
335 | // values for SMBSystemEnclosure.bootupState␊ |
336 | // values for SMBSystemEnclosure.powerSupplyState␊ |
337 | // values for SMBSystemEnclosure.thermalState␊ |
338 | typedef enum {␊ |
339 | kSMBChassisStateOther = 0x01, // Other␊ |
340 | kSMBChassisStateUnknown = 0x02, // Unknown␊ |
341 | kSMBChassisStateSafe = 0x03, // Safe␊ |
342 | kSMBChassisStateWarning = 0x04, // Warning␊ |
343 | kSMBChassisStateCritical = 0x05, // Critical␊ |
344 | kSMBChassisStateNonRecoverable = 0x06 // Non-recoverable␊ |
345 | } SYSTEM_ENCLOSURE_CHASSIS_STATE;␊ |
346 | ␊ |
347 | // System Enclosure or Chassis Security Status.␊ |
348 | // values for SMBSystemEnclosure.securityStatus␊ |
349 | typedef enum {␊ |
350 | kSMBChassisSecurityStatusOther = 0x01, // Other␊ |
351 | kSMBChassisSecurityStatusUnknown = 0x02, // Unknown␊ |
352 | kSMBChassisSecurityStatusNone = 0x03, // None␊ |
353 | kSMBChassisSecurityStatusExternalInterfaceLockedOut = 0x04, // External interface locked out␊ |
354 | kSMBChassisSecurityStatusExternalInterfaceLockedEnabled = 0x05 // External interface enabled␊ |
355 | } SYSTEM_ENCLOSURE_CHASSIS_SECURITY_STATE;␊ |
356 | ␊ |
357 | ␊ |
358 | //----------------------------------------------------------------------------------------------------------␊ |
359 | // Processor Information (Type 4), Apple uses 35 bytes length␊ |
360 | //----------------------------------------------------------------------------------------------------------␊ |
361 | ␊ |
362 | typedef struct SMBProcessorInformation␊ |
363 | {␊ |
364 | // 2.0+ spec (26 bytes)␊ |
365 | SMB_STRUCT_HEADER // Type 4␊ |
366 | SMBString socketDesignation;␊ |
367 | SMBByte processorType; // The enumeration value from PROCESSOR_TYPE.␊ |
368 | SMBByte processorFamily; // The enumeration value from PROCESSOR_FAMILY.␊ |
369 | SMBString manufacturer;␊ |
370 | SMBQWord processorID; // based on CPUID␊ |
371 | SMBString processorVersion;␊ |
372 | SMBByte voltage; // bit7 cleared indicate legacy mode␊ |
373 | SMBWord externalClock; // external clock in MHz␊ |
374 | SMBWord maximumClock; // max internal clock in MHz␊ |
375 | SMBWord currentClock; // current internal clock in MHz␊ |
376 | SMBByte status;␊ |
377 | SMBByte processorUpgrade; // The enumeration value from PROCESSOR_UPGRADE.␊ |
378 | // 2.1+ spec (32 bytes)␊ |
379 | SMBWord L1CacheHandle;␊ |
380 | SMBWord L2CacheHandle;␊ |
381 | SMBWord L3CacheHandle;␊ |
382 | // 2.3+ spec (35 bytes)␊ |
383 | SMBString serialNumber;␊ |
384 | SMBString assetTag;␊ |
385 | SMBString partNumber;␊ |
386 | // 2.5+ spec (40 bytes) Apple still uses 2.4 spec␊ |
387 | // SMBByte coreCount;␊ |
388 | // SMBByte coreEnabled;␊ |
389 | // SMBByte threadCount;␊ |
390 | //␉SMBWord processorCharacteristics;␊ |
391 | // 2.6+ spec (42 bytes)␊ |
392 | //␉SMBWord processorFamily2;␊ |
393 | } __attribute__((packed)) SMBProcessorInformation;␊ |
394 | ␊ |
395 | #define kSMBProcessorInformationMinSize 26␊ |
396 | ␊ |
397 | // Processor Information - Processor Type.␊ |
398 | // Values for SMBProcessorInformation.processorType␊ |
399 | typedef enum␊ |
400 | {␊ |
401 | ␉kSMBProcessorTypeOther = 0x01, // Other␊ |
402 | ␉kSMBProcessorTypeUnknown = 0x02, // Unknown␊ |
403 | ␉kSMBProcessorTypeCPU = 0x03, // Central Processor␊ |
404 | kSMBProcessorTypeMPU = 0x04, // Math Processor␊ |
405 | ␉kSMBProcessorTypeDSP = 0x05, // DSP Processor␊ |
406 | ␉kSMBProcessorTypeGPU = 0x06 // Video Processor␊ |
407 | } PROCESSOR_TYPE;␊ |
408 | ␊ |
409 | // Processor Information - Processor Family.␊ |
410 | // Values for SMBProcessorInformation.processorFamily␊ |
411 | typedef enum {␊ |
412 | kSMBProcessorFamilyOther = 0x01,␊ |
413 | kSMBProcessorFamilyUnknown = 0x02,␊ |
414 | kSMBProcessorFamily8086 = 0x03,␊ |
415 | kSMBProcessorFamily80286 = 0x04,␊ |
416 | kSMBProcessorFamilyIntel386 = 0x05,␊ |
417 | kSMBProcessorFamilyIntel486 = 0x06,␊ |
418 | kSMBProcessorFamily8087 = 0x07,␊ |
419 | kSMBProcessorFamily80287 = 0x08,␊ |
420 | kSMBProcessorFamily80387 = 0x09,␊ |
421 | kSMBProcessorFamily80487 = 0x0A,␊ |
422 | kSMBProcessorFamilyPentium = 0x0B,␊ |
423 | kSMBProcessorFamilyPentiumPro = 0x0C,␊ |
424 | kSMBProcessorFamilyPentiumII = 0x0D,␊ |
425 | kSMBProcessorFamilyPentiumMMX = 0x0E,␊ |
426 | kSMBProcessorFamilyCeleron = 0x0F,␊ |
427 | kSMBProcessorFamilyPentiumIIXeon = 0x10,␊ |
428 | kSMBProcessorFamilyPentiumIII = 0x11,␊ |
429 | kSMBProcessorFamilyM1 = 0x12,␊ |
430 | kSMBProcessorFamilyM2 = 0x13,␊ |
431 | kSMBProcessorFamilyIntelCeleronM = 0x14,␊ |
432 | kSMBProcessorFamilyIntelPentium4Ht = 0x15,␊ |
433 | kSMBProcessorFamilyM1Reserved4 = 0x16,␊ |
434 | kSMBProcessorFamilyM1Reserved5 = 0x17,␊ |
435 | kSMBProcessorFamilyAmdDuron = 0x18,␊ |
436 | kSMBProcessorFamilyK5 = 0x19,␊ |
437 | kSMBProcessorFamilyK6 = 0x1A,␊ |
438 | kSMBProcessorFamilyK6_2 = 0x1B,␊ |
439 | kSMBProcessorFamilyK6_3 = 0x1C,␊ |
440 | kSMBProcessorFamilyAmdAthlon = 0x1D,␊ |
441 | kSMBProcessorFamilyAmd29000 = 0x1E,␊ |
442 | kSMBProcessorFamilyK6_2Plus = 0x1F,␊ |
443 | kSMBProcessorFamilyPowerPC = 0x20,␊ |
444 | kSMBProcessorFamilyPowerPC601 = 0x21,␊ |
445 | kSMBProcessorFamilyPowerPC603 = 0x22,␊ |
446 | kSMBProcessorFamilyPowerPC603Plus = 0x23,␊ |
447 | kSMBProcessorFamilyPowerPC604 = 0x24,␊ |
448 | kSMBProcessorFamilyPowerPC620 = 0x25,␊ |
449 | kSMBProcessorFamilyPowerPCx704 = 0x26,␊ |
450 | kSMBProcessorFamilyPowerPC750 = 0x27,␊ |
451 | kSMBProcessorFamilyIntelCoreDuo = 0x28,␊ |
452 | kSMBProcessorFamilyIntelCoreDuoMobile = 0x29,␊ |
453 | kSMBProcessorFamilyIntelCoreSoloMobile = 0x2A,␊ |
454 | kSMBProcessorFamilyIntelAtom = 0x2B,␊ |
455 | kSMBProcessorFamilyAlpha3 = 0x30,␊ |
456 | kSMBProcessorFamilyAlpha21064 = 0x31,␊ |
457 | kSMBProcessorFamilyAlpha21066 = 0x32,␊ |
458 | kSMBProcessorFamilyAlpha21164 = 0x33,␊ |
459 | kSMBProcessorFamilyAlpha21164PC = 0x34,␊ |
460 | kSMBProcessorFamilyAlpha21164a = 0x35,␊ |
461 | kSMBProcessorFamilyAlpha21264 = 0x36,␊ |
462 | kSMBProcessorFamilyAlpha21364 = 0x37,␊ |
463 | kSMBProcessorFamilyAmdTurionIIUltraDualCoreMobileM = 0x38,␊ |
464 | kSMBProcessorFamilyAmdTurionIIDualCoreMobileM = 0x39,␊ |
465 | kSMBProcessorFamilyAmdAthlonIIDualCoreM = 0x3A,␊ |
466 | kSMBProcessorFamilyAmdOpteron6100Series = 0x3B,␊ |
467 | kSMBProcessorFamilyAmdOpteron4100Series = 0x3C,␊ |
468 | kSMBProcessorFamilyAmdOpteron6200Series = 0x3D,␊ |
469 | kSMBProcessorFamilyAmdOpteron4200Series = 0x3E,␊ |
470 | kSMBProcessorFamilyMips = 0x40,␊ |
471 | kSMBProcessorFamilyMIPSR4000 = 0x41,␊ |
472 | kSMBProcessorFamilyMIPSR4200 = 0x42,␊ |
473 | kSMBProcessorFamilyMIPSR4400 = 0x43,␊ |
474 | kSMBProcessorFamilyMIPSR4600 = 0x44,␊ |
475 | kSMBProcessorFamilyMIPSR10000 = 0x45,␊ |
476 | kSMBProcessorFamilyAmdCSeries = 0x46,␊ |
477 | kSMBProcessorFamilyAmdESeries = 0x47,␊ |
478 | kSMBProcessorFamilyAmdSSeries = 0x48,␊ |
479 | kSMBProcessorFamilyAmdGSeries = 0x49,␊ |
480 | kSMBProcessorFamilySparc = 0x50,␊ |
481 | kSMBProcessorFamilySuperSparc = 0x51,␊ |
482 | kSMBProcessorFamilymicroSparcII = 0x52,␊ |
483 | kSMBProcessorFamilymicroSparcIIep = 0x53,␊ |
484 | kSMBProcessorFamilyUltraSparc = 0x54,␊ |
485 | kSMBProcessorFamilyUltraSparcII = 0x55,␊ |
486 | kSMBProcessorFamilyUltraSparcIIi = 0x56,␊ |
487 | kSMBProcessorFamilyUltraSparcIII = 0x57,␊ |
488 | kSMBProcessorFamilyUltraSparcIIIi = 0x58,␊ |
489 | kSMBProcessorFamily68040 = 0x60,␊ |
490 | kSMBProcessorFamily68xxx = 0x61,␊ |
491 | kSMBProcessorFamily68000 = 0x62,␊ |
492 | kSMBProcessorFamily68010 = 0x63,␊ |
493 | kSMBProcessorFamily68020 = 0x64,␊ |
494 | kSMBProcessorFamily68030 = 0x65,␊ |
495 | kSMBProcessorFamilyHobbit = 0x70,␊ |
496 | kSMBProcessorFamilyCrusoeTM5000 = 0x78,␊ |
497 | kSMBProcessorFamilyCrusoeTM3000 = 0x79,␊ |
498 | kSMBProcessorFamilyEfficeonTM8000 = 0x7A,␊ |
499 | kSMBProcessorFamilyWeitek = 0x80,␊ |
500 | kSMBProcessorFamilyItanium = 0x82,␊ |
501 | kSMBProcessorFamilyAmdAthlon64 = 0x83,␊ |
502 | kSMBProcessorFamilyAmdOpteron = 0x84,␊ |
503 | kSMBProcessorFamilyAmdSempron = 0x85,␊ |
504 | kSMBProcessorFamilyAmdTurion64Mobile = 0x86,␊ |
505 | kSMBProcessorFamilyDualCoreAmdOpteron = 0x87,␊ |
506 | kSMBProcessorFamilyAmdAthlon64X2DualCore = 0x88,␊ |
507 | kSMBProcessorFamilyAmdTurion64X2Mobile = 0x89,␊ |
508 | kSMBProcessorFamilyQuadCoreAmdOpteron = 0x8A,␊ |
509 | kSMBProcessorFamilyThirdGenerationAmdOpteron = 0x8B,␊ |
510 | kSMBProcessorFamilyAmdPhenomFxQuadCore = 0x8C,␊ |
511 | kSMBProcessorFamilyAmdPhenomX4QuadCore = 0x8D,␊ |
512 | kSMBProcessorFamilyAmdPhenomX2DualCore = 0x8E,␊ |
513 | kSMBProcessorFamilyAmdAthlonX2DualCore = 0x8F,␊ |
514 | kSMBProcessorFamilyPARISC = 0x90,␊ |
515 | kSMBProcessorFamilyPaRisc8500 = 0x91,␊ |
516 | kSMBProcessorFamilyPaRisc8000 = 0x92,␊ |
517 | kSMBProcessorFamilyPaRisc7300LC = 0x93,␊ |
518 | kSMBProcessorFamilyPaRisc7200 = 0x94,␊ |
519 | kSMBProcessorFamilyPaRisc7100LC = 0x95,␊ |
520 | kSMBProcessorFamilyPaRisc7100 = 0x96,␊ |
521 | kSMBProcessorFamilyV30 = 0xA0,␊ |
522 | kSMBProcessorFamilyQuadCoreIntelXeon3200Series = 0xA1,␊ |
523 | kSMBProcessorFamilyDualCoreIntelXeon3000Series = 0xA2,␊ |
524 | kSMBProcessorFamilyQuadCoreIntelXeon5300Series = 0xA3,␊ |
525 | kSMBProcessorFamilyDualCoreIntelXeon5100Series = 0xA4,␊ |
526 | kSMBProcessorFamilyDualCoreIntelXeon5000Series = 0xA5,␊ |
527 | kSMBProcessorFamilyDualCoreIntelXeonLV = 0xA6,␊ |
528 | kSMBProcessorFamilyDualCoreIntelXeonULV = 0xA7,␊ |
529 | kSMBProcessorFamilyDualCoreIntelXeon7100Series = 0xA8,␊ |
530 | kSMBProcessorFamilyQuadCoreIntelXeon5400Series = 0xA9,␊ |
531 | kSMBProcessorFamilyQuadCoreIntelXeon = 0xAA,␊ |
532 | kSMBProcessorFamilyDualCoreIntelXeon5200Series = 0xAB,␊ |
533 | kSMBProcessorFamilyDualCoreIntelXeon7200Series = 0xAC,␊ |
534 | kSMBProcessorFamilyQuadCoreIntelXeon7300Series = 0xAD,␊ |
535 | kSMBProcessorFamilyQuadCoreIntelXeon7400Series = 0xAE,␊ |
536 | kSMBProcessorFamilyMultiCoreIntelXeon7400Series = 0xAF,␊ |
537 | kSMBProcessorFamilyPentiumIIIXeon = 0xB0,␊ |
538 | kSMBProcessorFamilyPentiumIIISpeedStep = 0xB1,␊ |
539 | kSMBProcessorFamilyPentium4 = 0xB2,␊ |
540 | kSMBProcessorFamilyIntelXeon = 0xB3,␊ |
541 | kSMBProcessorFamilyAS400 = 0xB4,␊ |
542 | kSMBProcessorFamilyIntelXeonMP = 0xB5,␊ |
543 | kSMBProcessorFamilyAMDAthlonXP = 0xB6,␊ |
544 | kSMBProcessorFamilyAMDAthlonMP = 0xB7,␊ |
545 | kSMBProcessorFamilyIntelItanium2 = 0xB8,␊ |
546 | kSMBProcessorFamilyIntelPentiumM = 0xB9,␊ |
547 | kSMBProcessorFamilyIntelCeleronD = 0xBA,␊ |
548 | kSMBProcessorFamilyIntelPentiumD = 0xBB,␊ |
549 | kSMBProcessorFamilyIntelPentiumEx = 0xBC,␊ |
550 | kSMBProcessorFamilyIntelCoreSolo = 0xBD, ///< SMBIOS spec 2.6 correct this value␊ |
551 | kSMBProcessorFamilyReserved = 0xBE,␊ |
552 | kSMBProcessorFamilyIntelCore2 = 0xBF,␊ |
553 | kSMBProcessorFamilyIntelCore2Solo = 0xC0,␊ |
554 | kSMBProcessorFamilyIntelCore2Extreme = 0xC1,␊ |
555 | kSMBProcessorFamilyIntelCore2Quad = 0xC2,␊ |
556 | kSMBProcessorFamilyIntelCore2ExtremeMobile = 0xC3,␊ |
557 | kSMBProcessorFamilyIntelCore2DuoMobile = 0xC4,␊ |
558 | kSMBProcessorFamilyIntelCore2SoloMobile = 0xC5,␊ |
559 | kSMBProcessorFamilyIntelCoreI7 = 0xC6,␊ |
560 | kSMBProcessorFamilyDualCoreIntelCeleron = 0xC7,␊ |
561 | kSMBProcessorFamilyIBM390 = 0xC8,␊ |
562 | kSMBProcessorFamilyG4 = 0xC9,␊ |
563 | kSMBProcessorFamilyG5 = 0xCA,␊ |
564 | kSMBProcessorFamilyG6 = 0xCB,␊ |
565 | kSMBProcessorFamilyzArchitectur = 0xCC,␊ |
566 | kSMBProcessorFamilyIntelCoreI5 = 0xCD,␊ |
567 | kSMBProcessorFamilyIntelCoreI3 = 0xCE,␊ |
568 | kSMBProcessorFamilyViaC7M = 0xD2,␊ |
569 | kSMBProcessorFamilyViaC7D = 0xD3,␊ |
570 | kSMBProcessorFamilyViaC7 = 0xD4,␊ |
571 | kSMBProcessorFamilyViaEden = 0xD5,␊ |
572 | kSMBProcessorFamilyMultiCoreIntelXeon = 0xD6,␊ |
573 | kSMBProcessorFamilyDualCoreIntelXeon3Series = 0xD7,␊ |
574 | kSMBProcessorFamilyQuadCoreIntelXeon3Series = 0xD8,␊ |
575 | kSMBProcessorFamilyViaNano = 0xD9,␊ |
576 | kSMBProcessorFamilyDualCoreIntelXeon5Series = 0xDA,␊ |
577 | kSMBProcessorFamilyQuadCoreIntelXeon5Series = 0xDB,␊ |
578 | kSMBProcessorFamilyDualCoreIntelXeon7Series = 0xDD,␊ |
579 | kSMBProcessorFamilyQuadCoreIntelXeon7Series = 0xDE,␊ |
580 | kSMBProcessorFamilyMultiCoreIntelXeon7Series = 0xDF,␊ |
581 | kSMBProcessorFamilyMultiCoreIntelXeon3400Series = 0xE0,␊ |
582 | kSMBProcessorFamilyEmbeddedAmdOpteronQuadCore = 0xE6,␊ |
583 | kSMBProcessorFamilyAmdPhenomTripleCore = 0xE7,␊ |
584 | kSMBProcessorFamilyAmdTurionUltraDualCoreMobile = 0xE8,␊ |
585 | kSMBProcessorFamilyAmdTurionDualCoreMobile = 0xE9,␊ |
586 | kSMBProcessorFamilyAmdAthlonDualCore = 0xEA,␊ |
587 | kSMBProcessorFamilyAmdSempronSI = 0xEB,␊ |
588 | kSMBProcessorFamilyAmdPhenomII = 0xEC,␊ |
589 | kSMBProcessorFamilyAmdAthlonII = 0xED,␊ |
590 | kSMBProcessorFamilySixCoreAmdOpteron = 0xEE,␊ |
591 | kSMBProcessorFamilyAmdSempronM = 0xEF,␊ |
592 | kSMBProcessorFamilyi860 = 0xFA,␊ |
593 | kSMBProcessorFamilyi960 = 0xFB,␊ |
594 | kSMBProcessorFamilyIndicatorFamily2 = 0xFE,␊ |
595 | kSMBProcessorFamilyReserved1 = 0xFF␊ |
596 | } PROCESSOR_FAMILY;␊ |
597 | ␊ |
598 | // Processor Information - Processor Upgrade.␊ |
599 | // Values for SMBProcessorInformation.processorUpgrade␊ |
600 | typedef enum {␊ |
601 | kSMBProcessorUpgradeOther = 0x01, // Other␊ |
602 | kSMBProcessorUpgradeUnknown = 0x02, // Unknown␊ |
603 | kSMBProcessorUpgradeDaughterBoard = 0x03, // Daughter Board␊ |
604 | kSMBProcessorUpgradeZIFSocket = 0x04, // ZIF Socket␊ |
605 | kSMBProcessorUpgradePiggyBack = 0x05, // Replaceable Piggy Back␊ |
606 | kSMBProcessorUpgradeNone = 0x06, // None␊ |
607 | kSMBProcessorUpgradeLIFSocket = 0x07, // LIF Socket␊ |
608 | kSMBProcessorUpgradeSlot1 = 0x08, // Slot 1␊ |
609 | kSMBProcessorUpgradeSlot2 = 0x09, // Slot 2␊ |
610 | kSMBProcessorUpgrade370PinSocket = 0x0A, // 370-pin socket␊ |
611 | kSMBProcessorUpgradeSlotA = 0x0B, // Slot A␊ |
612 | kSMBProcessorUpgradeSlotM = 0x0C, // Slot M␊ |
613 | kSMBProcessorUpgradeSocket423 = 0x0D, // Socket 423␊ |
614 | kSMBProcessorUpgradeSocketA = 0x0E, // Socket A (Socket 462)␊ |
615 | kSMBProcessorUpgradeSocket478 = 0x0F, // Socket 478␊ |
616 | kSMBProcessorUpgradeSocket754 = 0x10, // Socket 754␊ |
617 | kSMBProcessorUpgradeSocket940 = 0x11, // Socket 940␊ |
618 | kSMBProcessorUpgradeSocket939 = 0x12, // Socket 939␊ |
619 | kSMBProcessorUpgradeSocketmPGA604 = 0x13, // Socket mPGA604␊ |
620 | kSMBProcessorUpgradeSocketLGA771 = 0x14, // Socket LGA771␊ |
621 | kSMBProcessorUpgradeSocketLGA775 = 0x15, // Socket LGA775␊ |
622 | kSMBProcessorUpgradeSocketS1 = 0x16, // Socket S1␊ |
623 | kSMBProcessorUpgradeAM2 = 0x17, // Socket AM2␊ |
624 | kSMBProcessorUpgradeF1207 = 0x18, // Socket F (1207)␊ |
625 | kSMBProcessorUpgradeSocketLGA1366 = 0x19, // Socket LGA1366␊ |
626 | kSMBProcessorUpgradeSocketG34 = 0x1A, // Socket G34␊ |
627 | kSMBProcessorUpgradeSocketAM3 = 0x1B, // Socket AM3␊ |
628 | kSMBProcessorUpgradeSocketC32 = 0x1C, // Socket C32␊ |
629 | kSMBProcessorUpgradeSocketLGA1156 = 0x1D, // Socket LGA1156␊ |
630 | kSMBProcessorUpgradeSocketLGA1567 = 0x1E, // Socket LGA1567␊ |
631 | kSMBProcessorUpgradeSocketPGA988A = 0x1F, // Socket PGA988A␊ |
632 | kSMBProcessorUpgradeSocketBGA1288 = 0x20, // Socket BGA1288␊ |
633 | kSMBProcessorUpgradeSocketrPGA988B = 0x21, // Socket rPGA988B␊ |
634 | kSMBProcessorUpgradeSocketBGA1023 = 0x22, // Socket BGA1023␊ |
635 | kSMBProcessorUpgradeSocketBGA1224 = 0x23, // Socket BGA1224␊ |
636 | kSMBProcessorUpgradeSocketBGA1155 = 0x24, // Socket LGA1155␊ |
637 | kSMBProcessorUpgradeSocketLGA1356 = 0x25, // Socket LGA1356␊ |
638 | kSMBProcessorUpgradeSocketLGA2011 = 0x26, // Socket LGA2011␊ |
639 | kSMBProcessorUpgradeSocketFS1 = 0x27, // Socket FS1␊ |
640 | kSMBProcessorUpgradeSocketFS2 = 0x28, // Socket FS2␊ |
641 | kSMBProcessorUpgradeSocketFM1 = 0x29, // Socket FM1␊ |
642 | kSMBProcessorUpgradeSocketFM2 = 0x2A, // Socket FM2␊ |
643 | kSMBProcessorUpgradeSocketLGA2011_3 = 0x2B, // Socket LGA2011-3␊ |
644 | kSMBProcessorUpgradeSocketLGA1356_3 = 0x2C, // Socket LGA1356-3␊ |
645 | kSMBProcessorUpgradeSocketLGA1150 = 0x2D, // Socket LGA1150␊ |
646 | kSMBProcessorUpgradeSocketBGA1168 = 0x2E, // Socket BGA1168␊ |
647 | kSMBProcessorUpgradeSocketBGA1234 = 0x2F, // Socket BGA1234␊ |
648 | kSMBProcessorUpgradeSocketBGA1364 = 0x30, // Socket BGA1364␊ |
649 | kSMBProcessorUpgradeSocketAM4 = 0x31, // Socket AM4␊ |
650 | kSMBProcessorUpgradeSocketLGA1151 = 0x32, // Socket LGA1151␊ |
651 | kSMBProcessorUpgradeSocketBGA1356 = 0x33, // Socket BGA1356␊ |
652 | kSMBProcessorUpgradeSocketBGA1440 = 0x34, // Socket BGA1440␊ |
653 | kSMBProcessorUpgradeSocketBGA1515 = 0x35, // Socket BGA1515␊ |
654 | kSMBProcessorUpgradeSocketLGA3647_1 = 0x36 // Socket LGA3647-1␊ |
655 | } PROCESSOR_UPGRADE;␊ |
656 | ␊ |
657 | ␊ |
658 | //----------------------------------------------------------------------------------------------------------␊ |
659 | // Struct - Cache Information (Type 7), Apple uses 19 bytes length␊ |
660 | //----------------------------------------------------------------------------------------------------------␊ |
661 | ␊ |
662 | typedef struct SMBCacheInformation␊ |
663 | {␊ |
664 | SMB_STRUCT_HEADER // Type 7␊ |
665 | SMBString socketDesignation;␊ |
666 | SMBWord cacheConfiguration;␊ |
667 | SMBWord maximumCacheSize;␊ |
668 | SMBWord installedSize;␊ |
669 | SMBWord supportedSRAMType;␊ |
670 | SMBWord currentSRAMType;␊ |
671 | SMBByte cacheSpeed;␊ |
672 | SMBByte errorCorrectionType;␊ |
673 | SMBByte systemCacheType;␊ |
674 | SMBByte associativity;␊ |
675 | } __attribute__((packed)) SMBCacheInformation;␊ |
676 | ␊ |
677 | ␊ |
678 | //----------------------------------------------------------------------------------------------------------␊ |
679 | // Struct - System Slots (Type 9), Apple uses 13 bytes length␊ |
680 | //----------------------------------------------------------------------------------------------------------␊ |
681 | ␊ |
682 | typedef struct SMBSystemSlot␊ |
683 | {␊ |
684 | // 2.0+ spec (12 bytes)␊ |
685 | ␉SMB_STRUCT_HEADER␊ |
686 | ␉SMBString slotDesignation;␊ |
687 | ␉SMBByte slotType;␊ |
688 | ␉SMBByte slotDataBusWidth;␊ |
689 | ␉SMBByte currentUsage;␊ |
690 | ␉SMBByte slotLength;␊ |
691 | ␉SMBWord slotID;␊ |
692 | ␉SMBByte slotCharacteristics1;␊ |
693 | ␉// 2.1+ spec (13 bytes)␊ |
694 | ␉SMBByte slotCharacteristics2;␊ |
695 | ␉// 2.6+ spec (17 bytes)␊ |
696 | //␉SMBWord␉␉segmentGroupNumber;␊ |
697 | //␉SMBByte␉␉busNumber;␊ |
698 | //␉SMBByte␉␉deviceFunctionNumber;␊ |
699 | } __attribute__((packed)) SMBSystemSlot;␊ |
700 | ␊ |
701 | ␊ |
702 | //----------------------------------------------------------------------------------------------------------␊ |
703 | // Struct - OEM Strings (Type 11), Apple uses 5 bytes length␊ |
704 | //----------------------------------------------------------------------------------------------------------␊ |
705 | ␊ |
706 | typedef struct SMBOEMStrings␊ |
707 | {␊ |
708 | ␉SMB_STRUCT_HEADER // Type 11␊ |
709 | ␉SMBByte␉␉count;␉␉// number of strings␊ |
710 | } __attribute__((packed)) SMBOEMStrings;␊ |
711 | ␊ |
712 | ␊ |
713 | //----------------------------------------------------------------------------------------------------------␊ |
714 | // Physical Memory Array (Type 16), Apple uses 15 bytes length␊ |
715 | //----------------------------------------------------------------------------------------------------------␊ |
716 | ␊ |
717 | typedef struct SMBPhysicalMemoryArray␊ |
718 | {␊ |
719 | // 2.1+ spec (15 bytes)␊ |
720 | SMB_STRUCT_HEADER // Type 16␊ |
721 | SMBByte physicalLocation; // physical location␊ |
722 | SMBByte arrayUse; // the use for the memory array, The enumeration value from MEMORY_ARRAY_USE.␊ |
723 | SMBByte errorCorrection; // error correction/detection method, The enumeration value from MEMORY_ERROR_CORRECTION.␊ |
724 | SMBDWord maximumCapacity; // maximum memory capacity in kilobytes␊ |
725 | SMBWord errorHandle; // handle of a previously detected error␊ |
726 | SMBWord numMemoryDevices; // number of memory slots or sockets␊ |
727 | // 2.7+ spec␊ |
728 | //␉SMBQWord extMaximumCapacity;␉// maximum memory capacity in bytes␊ |
729 | } __attribute__((packed)) SMBPhysicalMemoryArray;␊ |
730 | ␊ |
731 | // Physical Memory Array - Use.␊ |
732 | // Values for SMBPhysicalMemoryArray.arrayUse␊ |
733 | typedef enum␊ |
734 | {␊ |
735 | kSMBMemoryArrayUseOther = 0x01,␊ |
736 | kSMBMemoryArrayUseUnknown = 0x02,␊ |
737 | kSMBMemoryArrayUseSystemMemory = 0x03,␊ |
738 | kSMBMemoryArrayUseVideoMemory = 0x04,␊ |
739 | kSMBMemoryArrayUseFlashMemory = 0x05,␊ |
740 | kSMBMemoryArrayUseNonVolatileMemory = 0x06,␊ |
741 | kSMBMemoryArrayUseCacheMemory = 0x07␊ |
742 | } MEMORY_ARRAY_USE;␊ |
743 | ␊ |
744 | // Physical Memory Array - Error Correction Types.␊ |
745 | // Values for SMBPhysicalMemoryArray.errorCorrection␊ |
746 | typedef enum␊ |
747 | {␊ |
748 | kSMBMemoryArrayErrorCorrectionTypeOther = 0x01,␊ |
749 | kSMBMemoryArrayErrorCorrectionTypeUnknown = 0x02,␊ |
750 | kSMBMemoryArrayErrorCorrectionTypeNone = 0x03,␊ |
751 | kSMBMemoryArrayErrorCorrectionTypeParity = 0x04,␊ |
752 | kSMBMemoryArrayErrorCorrectionTypeSingleBitECC = 0x05,␊ |
753 | kSMBMemoryArrayErrorCorrectionTypeMultiBitECC = 0x06,␊ |
754 | kSMBMemoryArrayErrorCorrectionTypeCRC = 0x07␊ |
755 | } MEMORY_ERROR_CORRECTION;␊ |
756 | ␊ |
757 | ␊ |
758 | //----------------------------------------------------------------------------------------------------------␊ |
759 | // Struct - Memory Device (Type 17), Apple uses 27 bytes length␊ |
760 | //----------------------------------------------------------------------------------------------------------␊ |
761 | ␊ |
762 | typedef struct SMBMemoryDevice␊ |
763 | {␊ |
764 | ␉// 2.1+ spec (21 bytes)␊ |
765 | ␉SMB_STRUCT_HEADER // Type 17␊ |
766 | ␉SMBWord arrayHandle; // handle of the parent memory array␊ |
767 | ␉SMBWord errorHandle; // handle of a previously detected error␊ |
768 | ␉SMBWord totalWidth; // total width in bits; including ECC bits␊ |
769 | ␉SMBWord dataWidth; // data width in bits␊ |
770 | ␉SMBWord memorySize; // bit15 is scale, 0 = MB, 1 = KB␊ |
771 | ␉SMBByte formFactor; // memory device form factor␊ |
772 | ␉SMBByte deviceSet; // parent set of identical memory devices␊ |
773 | ␉SMBString deviceLocator; // labeled socket; e.g. "SIMM 3"␊ |
774 | ␉SMBString bankLocator; // labeled bank; e.g. "Bank 0" or "A"␊ |
775 | ␉SMBByte memoryType; // type of memory␊ |
776 | ␉SMBWord memoryTypeDetail; // additional detail on memory type␊ |
777 | ␉// 2.3+ spec (27 bytes)␊ |
778 | ␉SMBWord memorySpeed; // speed of device in MHz (0 for unknown)␊ |
779 | ␉SMBString manufacturer;␊ |
780 | ␉SMBString serialNumber;␊ |
781 | ␉SMBString assetTag;␊ |
782 | ␉SMBString partNumber;␊ |
783 | ␉// 2.6+ spec (28 bytes)␊ |
784 | //␉SMBByte attributes;␊ |
785 | ␉// 2.7+ spec␊ |
786 | //␉SMBDWord memoryExtSize;␊ |
787 | //␉SMBWord confMemClkSpeed;␊ |
788 | ␉// 2.8+ spec␊ |
789 | //␉SMBWord minimumVolt;␊ |
790 | //␉SMBWord maximumVolt;␊ |
791 | //␉SMBWord configuredVolt;␊ |
792 | } __attribute__((packed)) SMBMemoryDevice;␊ |
793 | ␊ |
794 | ␊ |
795 | //----------------------------------------------------------------------------------------------------------␊ |
796 | // Struct - Memory Array Mapped Address (Type 19), Apple uses 15 bytes length␊ |
797 | //----------------------------------------------------------------------------------------------------------␊ |
798 | ␊ |
799 | #if 0␊ |
800 | typedef struct SMBMemoryArrayMappedAddress␊ |
801 | {␊ |
802 | // 2.1+ spec␊ |
803 | ␉SMB_STRUCT_HEADER // Type 19␊ |
804 | ␉SMBDWord startingAddress;␊ |
805 | ␉SMBDWord endingAddress;␊ |
806 | ␉SMBWord arrayHandle;␊ |
807 | ␉SMBByte partitionWidth;␊ |
808 | // 2.7+ spec␊ |
809 | ␉SMBQWord extStartAddress;␊ |
810 | ␉SMBQWord extEndAddress;␊ |
811 | } __attribute__((packed)) SMBMemoryArrayMappedAddress;␊ |
812 | #endif␊ |
813 | ␊ |
814 | ␊ |
815 | //----------------------------------------------------------------------------------------------------------␊ |
816 | // Struct - Memory Device Mapped Address (Type 20)␊ |
817 | //----------------------------------------------------------------------------------------------------------␊ |
818 | ␊ |
819 | #if 0␊ |
820 | typedef struct SMBMemoryDeviceMappedAddress␊ |
821 | {␊ |
822 | // 2.1+ spec␊ |
823 | ␉SMB_STRUCT_HEADER // Type 20␊ |
824 | ␉SMBDWord startingAddress;␊ |
825 | ␉SMBDWord endingAddress;␊ |
826 | ␉SMBWord arrayHandle;␊ |
827 | ␉SMBByte partitionRowPosition;␊ |
828 | ␉SMBByte interleavePosition;␊ |
829 | ␉SMBByte interleaveDataDepth;␊ |
830 | // 2.7+ spec␊ |
831 | ␉SMBQWord extStartAddress;␊ |
832 | ␉SMBQWord extEndAddress;␊ |
833 | } __attribute__((packed)) SMBMemoryDeviceMappedAddress;␊ |
834 | #endif␊ |
835 | ␊ |
836 | ␊ |
837 | ␊ |
838 | //␊ |
839 | // Apple Specific structures␊ |
840 | //␊ |
841 | ␊ |
842 | //----------------------------------------------------------------------------------------------------------␊ |
843 | // Firmware Volume Description (Apple Specific - Type 128), Apple uses 88 bytes length␊ |
844 | //----------------------------------------------------------------------------------------------------------␊ |
845 | ␊ |
846 | enum␊ |
847 | {␊ |
848 | ␉FW_REGION_RESERVED = 0,␊ |
849 | ␉FW_REGION_RECOVERY = 1,␊ |
850 | ␉FW_REGION_MAIN = 2,␊ |
851 | ␉FW_REGION_NVRAM = 3,␊ |
852 | ␉FW_REGION_CONFIG = 4,␊ |
853 | ␉FW_REGION_DIAGVAULT = 5,␊ |
854 | ␊ |
855 | ␉NUM_FLASHMAP_ENTRIES = 8␊ |
856 | };␊ |
857 | ␊ |
858 | typedef struct FW_REGION_INFO␊ |
859 | {␊ |
860 | ␉SMBDWord StartAddress;␊ |
861 | ␉SMBDWord EndAddress;␊ |
862 | } __attribute__((packed)) FW_REGION_INFO;␊ |
863 | ␊ |
864 | typedef struct SMBFirmwareVolume␊ |
865 | {␊ |
866 | ␉SMB_STRUCT_HEADER␉␉␉// Type 128␊ |
867 | ␉SMBByte RegionCount;␊ |
868 | ␉SMBByte Reserved[3];␊ |
869 | ␉SMBDWord FirmwareFeatures;␊ |
870 | ␉SMBDWord FirmwareFeaturesMask;␊ |
871 | ␉SMBByte RegionType[ NUM_FLASHMAP_ENTRIES ];␊ |
872 | ␉FW_REGION_INFO FlashMap[ NUM_FLASHMAP_ENTRIES ];␊ |
873 | } __attribute__((packed)) SMBFirmwareVolume;␊ |
874 | ␊ |
875 | ␊ |
876 | //----------------------------------------------------------------------------------------------------------␊ |
877 | // Memory SPD Data (Apple Specific - Type 130)␊ |
878 | //----------------------------------------------------------------------------------------------------------␊ |
879 | ␊ |
880 | typedef struct SMBMemorySPD␊ |
881 | {␊ |
882 | ␉SMB_STRUCT_HEADER␉␉␉// Type 130␊ |
883 | ␉SMBWord Type17Handle;␊ |
884 | ␉SMBWord Offset;␊ |
885 | ␉SMBWord Size;␊ |
886 | ␉SMBWord Data[1];␊ |
887 | } __attribute__((packed)) SMBMemorySPD;␊ |
888 | ␊ |
889 | ␊ |
890 | //----------------------------------------------------------------------------------------------------------␊ |
891 | // OEM Processor Type (Apple Specific - Type 131)␊ |
892 | //----------------------------------------------------------------------------------------------------------␊ |
893 | ␊ |
894 | typedef struct SMBOemProcessorType␊ |
895 | {␊ |
896 | ␉SMB_STRUCT_HEADER␉␉␉// Type131␊ |
897 | ␉SMBWord ProcessorType;␊ |
898 | } __attribute__((packed)) SMBOemProcessorType;␊ |
899 | ␊ |
900 | ␊ |
901 | //----------------------------------------------------------------------------------------------------------␊ |
902 | // OEM Processor Bus Speed (Apple Specific - Type 132)␊ |
903 | //----------------------------------------------------------------------------------------------------------␊ |
904 | ␊ |
905 | typedef struct SMBOemProcessorBusSpeed␊ |
906 | {␊ |
907 | ␉SMB_STRUCT_HEADER␉␉␉// Type 132␊ |
908 | ␉SMBWord ProcessorBusSpeed;␉␉// MT/s unit␊ |
909 | } __attribute__((packed)) SMBOemProcessorBusSpeed;␊ |
910 | ␊ |
911 | ␊ |
912 | //----------------------------------------------------------------------------------------------------------␊ |
913 | // OEM Platform Feature (Apple Specific - Type 133)␊ |
914 | //----------------------------------------------------------------------------------------------------------␊ |
915 | ␊ |
916 | typedef struct SMBOemPlatformFeature␊ |
917 | {␊ |
918 | ␉SMB_STRUCT_HEADER␉␉␉// Type 133␊ |
919 | ␉SMBWord PlatformFeature;␊ |
920 | } __attribute__((packed)) SMBOemPlatformFeature;␊ |
921 | ␊ |
922 | ␊ |
923 | //----------------------------------------------------------------------------------------------------------␊ |
924 | // OEM SMC Version (Apple Specific - Type 134)␊ |
925 | //----------------------------------------------------------------------------------------------------------␊ |
926 | ␊ |
927 | typedef struct SMBOemSMCVersion␊ |
928 | {␊ |
929 | ␉SMB_STRUCT_HEADER␉␉␉// Type 134␊ |
930 | ␉SMBWord SMCVersion;␊ |
931 | } __attribute__((packed)) SMBOemSMCVersion;␊ |
932 | ␊ |
933 | ␊ |
934 | ␊ |
935 | //␊ |
936 | // Obsolete SMBIOS structures␊ |
937 | //␊ |
938 | ␊ |
939 | //----------------------------------------------------------------------------------------------------------␊ |
940 | // Struct - Memory Controller Information (Type 5) Obsolete since SMBIOS version 2.1␊ |
941 | //----------------------------------------------------------------------------------------------------------␊ |
942 | ␊ |
943 | typedef struct SMBMemoryControllerInfo {␊ |
944 | SMB_STRUCT_HEADER␊ |
945 | SMBByte␉␉␉errorDetectingMethod;␊ |
946 | SMBByte␉␉␉errorCorrectingCapability;␊ |
947 | SMBByte␉␉␉supportedInterleave;␊ |
948 | SMBByte␉␉␉currentInterleave;␊ |
949 | SMBByte␉␉␉maxMemoryModuleSize;␊ |
950 | SMBWord␉␉␉supportedSpeeds;␊ |
951 | SMBWord␉␉␉supportedMemoryTypes;␊ |
952 | SMBByte␉␉␉memoryModuleVoltage;␊ |
953 | SMBByte␉␉␉numberOfMemorySlots;␊ |
954 | } __attribute__((packed)) SMBMemoryControllerInfo;␊ |
955 | ␊ |
956 | ␊ |
957 | //----------------------------------------------------------------------------------------------------------␊ |
958 | // Struct - Memory Module Information (Type 6) Obsolete since SMBIOS version 2.1␊ |
959 | //----------------------------------------------------------------------------------------------------------␊ |
960 | ␊ |
961 | typedef struct SMBMemoryModule␊ |
962 | {␊ |
963 | SMB_STRUCT_HEADER // Type 6␊ |
964 | SMBString socketDesignation;␊ |
965 | SMBByte bankConnections;␊ |
966 | SMBByte currentSpeed;␊ |
967 | SMBWord currentMemoryType;␊ |
968 | SMBByte installedSize;␊ |
969 | SMBByte enabledSize;␊ |
970 | SMBByte errorStatus;␊ |
971 | } __attribute__((packed)) SMBMemoryModule;␊ |
972 | ␊ |
973 | #define kSMBMemoryModuleSizeNotDeterminable 0x7D␊ |
974 | #define kSMBMemoryModuleSizeNotEnabled 0x7E␊ |
975 | #define kSMBMemoryModuleSizeNotInstalled 0x7F␊ |
976 | ␊ |
977 | ␊ |
978 | ␊ |
979 | //----------------------------------------------------------------------------------------------------------␊ |
980 | ␊ |
981 | #define SMBIOS_ORIGINAL␉␉0␊ |
982 | #define SMBIOS_PATCHED␉␉1␊ |
983 | ␊ |
984 | ␊ |
985 | extern void *getSmbios(int which);␊ |
986 | ␊ |
987 | extern void readSMBIOSInfo(SMBEntryPoint *eps);␊ |
988 | ␊ |
989 | extern void setupSMBIOSTable(void);␊ |
990 | ␊ |
991 | extern void decodeSMBIOSTable(SMBEntryPoint *eps);␊ |
992 | ␊ |
993 | #endif /* !__LIBSAIO_SMBIOS_H */␊ |
994 | |