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