Root/
Source at commit 2381 created 10 years 21 days ago. By ifabio, Apply patch: (Credits to Thomas Jansen aka tja) - Reading options from all devices during boot. The options for the boot menu are only read from the devices rd(0,0) or bt(0,0). Consequently, boot menu options (e.g. "Quiet Boot", "Timeout", etc.) in plists on other devices (like most users have) are ignored. This patch extends the list of paths to search for the options plist on all devices that can be found. | |
---|---|
1 | /*␊ |
2 | * platform.h␊ |
3 | * AsereBLN: reworked and extended␊ |
4 | *␊ |
5 | */␊ |
6 | ␊ |
7 | #ifndef __LIBSAIO_PLATFORM_H␊ |
8 | #define __LIBSAIO_PLATFORM_H␊ |
9 | ␊ |
10 | //#include "libsaio.h"␊ |
11 | ␊ |
12 | extern bool platformCPUFeature(uint32_t);␊ |
13 | extern void scan_platform(void);␊ |
14 | extern void dumpPhysAddr(const char * title, void * a, int len);␊ |
15 | ␊ |
16 | /* CPUID Vendor */␊ |
17 | #define CPUID_VENDOR_INTEL 0x756E6547␊ |
18 | #define CPUID_VENDOR_AMD 0x68747541␊ |
19 | ␊ |
20 | /* CPUID index into cpuid_raw */␊ |
21 | #define CPUID_0␉␉␉␉0␊ |
22 | #define CPUID_1␉␉␉␉1␊ |
23 | #define CPUID_2␉␉␉␉2␊ |
24 | #define CPUID_3␉␉␉␉3␊ |
25 | #define CPUID_4␉␉␉␉4␊ |
26 | #define CPUID_5␉␉␉␉5␊ |
27 | #define CPUID_6␉␉␉␉6␊ |
28 | #define CPUID_80␉␉␉7␊ |
29 | #define CPUID_81␉␉␉8␊ |
30 | #define CPUID_88␉␉␉9␊ |
31 | #define CPUID_MAX␉␉␉10␊ |
32 | ␊ |
33 | #define CPU_MODEL_DOTHAN␉␉0x0D␉␉␉// Dothan␊ |
34 | #define CPU_MODEL_YONAH␉␉␉0x0E␉␉␉// Sossaman, Yonah␊ |
35 | #define CPU_MODEL_MEROM␉␉␉0x0F␉␉␉// Allendale, Conroe, Kentsfield, Woodcrest, Clovertown, Tigerton, Merom␊ |
36 | #define CPU_MODEL_PENRYN␉␉0x17␉␉␉// Wolfdale, Yorkfield, Harpertown, Penryn␊ |
37 | #define CPU_MODEL_NEHALEM␉␉0x1A␉␉␉// Bloomfield. Nehalem-EP, Nehalem-WS, Gainestown␊ |
38 | #define CPU_MODEL_ATOM␉␉␉0x1C␉␉␉// Atom␊ |
39 | #define CPU_MODEL_FIELDS␉␉0x1E␉␉␉// Lynnfield, Clarksfield, Jasper Forest␊ |
40 | #define CPU_MODEL_DALES␉␉␉0x1F␉␉␉// Havendale, Auburndale␊ |
41 | #define CPU_MODEL_DALES_32NM␉0x25␉␉␉// Clarkdale, Arrandale␊ |
42 | #define CPU_MODEL_SANDYBRIDGE␉0x2A␉␉␉// Sandy Bridge␊ |
43 | #define CPU_MODEL_WESTMERE␉␉0x2C␉␉␉// Gulftown, Westmere-EP, Westmere-WS␊ |
44 | #define CPU_MODEL_JAKETOWN␉␉0x2D␉␉␉// Sandy Bridge-E, Sandy Bridge-EP ␊ |
45 | #define CPU_MODEL_NEHALEM_EX␉0x2E␉␉␉// Beckton␊ |
46 | #define CPU_MODEL_WESTMERE_EX␉0x2F␊ |
47 | #define CPU_MODEL_IVYBRIDGE␉␉0x3A␉␉␉// Ivy Bridge␊ |
48 | ␊ |
49 | /* CPU Features */␊ |
50 | #define CPU_FEATURE_MMX␉␉␉0x00000001␉␉// MMX Instruction Set␊ |
51 | #define CPU_FEATURE_SSE␉␉␉0x00000002␉␉// SSE Instruction Set␊ |
52 | #define CPU_FEATURE_SSE2␉␉0x00000004␉␉// SSE2 Instruction Set␊ |
53 | #define CPU_FEATURE_SSE3␉␉0x00000008␉␉// SSE3 Instruction Set␊ |
54 | #define CPU_FEATURE_SSE41␉␉0x00000010␉␉// SSE41 Instruction Set␊ |
55 | #define CPU_FEATURE_SSE42␉␉0x00000020␉␉// SSE42 Instruction Set␊ |
56 | #define CPU_FEATURE_EM64T␉␉0x00000040␉␉// 64Bit Support␊ |
57 | #define CPU_FEATURE_HTT␉␉␉0x00000080␉␉// HyperThreading␊ |
58 | #define CPU_FEATURE_MOBILE␉␉0x00000100␉␉// Mobile CPU␊ |
59 | #define CPU_FEATURE_MSR␉␉␉0x00000200␉␉// MSR Support␊ |
60 | ␊ |
61 | /* SMBIOS Memory Types */ ␊ |
62 | #define SMB_MEM_TYPE_UNDEFINED␉0␊ |
63 | #define SMB_MEM_TYPE_OTHER␉␉1␊ |
64 | #define SMB_MEM_TYPE_UNKNOWN␉2␊ |
65 | #define SMB_MEM_TYPE_DRAM␉␉3␊ |
66 | #define SMB_MEM_TYPE_EDRAM␉␉4␊ |
67 | #define SMB_MEM_TYPE_VRAM␉␉5␊ |
68 | #define SMB_MEM_TYPE_SRAM␉␉6␊ |
69 | #define SMB_MEM_TYPE_RAM␉␉7␊ |
70 | #define SMB_MEM_TYPE_ROM␉␉8␊ |
71 | #define SMB_MEM_TYPE_FLASH␉␉9␊ |
72 | #define SMB_MEM_TYPE_EEPROM␉␉10␊ |
73 | #define SMB_MEM_TYPE_FEPROM␉␉11␊ |
74 | #define SMB_MEM_TYPE_EPROM␉␉12␊ |
75 | #define SMB_MEM_TYPE_CDRAM␉␉13␊ |
76 | #define SMB_MEM_TYPE_3DRAM␉␉14␊ |
77 | #define SMB_MEM_TYPE_SDRAM␉␉15␊ |
78 | #define SMB_MEM_TYPE_SGRAM␉␉16␊ |
79 | #define SMB_MEM_TYPE_RDRAM␉␉17␊ |
80 | #define SMB_MEM_TYPE_DDR␉␉18␊ |
81 | #define SMB_MEM_TYPE_DDR2␉␉19␊ |
82 | #define SMB_MEM_TYPE_FBDIMM␉␉20␊ |
83 | #define SMB_MEM_TYPE_DDR3␉␉24␉␉␉␉// Supported in 10.5.6+ AppleSMBIOS␊ |
84 | ␊ |
85 | /* Memory Configuration Types */ ␊ |
86 | #define SMB_MEM_CHANNEL_UNKNOWN␉␉0␊ |
87 | #define SMB_MEM_CHANNEL_SINGLE␉␉1␊ |
88 | #define SMB_MEM_CHANNEL_DUAL␉␉2␊ |
89 | #define SMB_MEM_CHANNEL_TRIPLE␉␉3␊ |
90 | ␊ |
91 | /* Maximum number of ram slots */␊ |
92 | #define MAX_RAM_SLOTS␉␉␉8␊ |
93 | #define RAM_SLOT_ENUMERATOR␉␉{0, 2, 4, 1, 3, 5, 6, 8, 10, 7, 9, 11}␊ |
94 | ␊ |
95 | /* Maximum number of SPD bytes */␊ |
96 | #define MAX_SPD_SIZE␉␉␉256␊ |
97 | ␊ |
98 | /* Size of SMBIOS UUID in bytes */␊ |
99 | #define UUID_LEN␉␉␉16␊ |
100 | ␊ |
101 | typedef struct _RamSlotInfo_t {␊ |
102 | uint32_t␉␉ModuleSize;␉␉␉␉␉// Size of Module in MB␊ |
103 | uint32_t␉␉Frequency;␉␉␉␉␉// in Mhz␊ |
104 | const char*␉␉Vendor;␊ |
105 | const char*␉␉PartNo;␊ |
106 | const char*␉␉SerialNo;␊ |
107 | char*␉␉␉spd;␉␉␉␉␉␉// SPD Dump␊ |
108 | bool␉␉␉InUse;␊ |
109 | uint8_t␉␉␉Type;␊ |
110 | uint8_t␉␉␉BankConnections;␉␉␉// table type 6, see (3.3.7)␊ |
111 | uint8_t␉␉␉BankConnCnt;␊ |
112 | } RamSlotInfo_t;␊ |
113 | ␊ |
114 | typedef struct _PlatformInfo_t {␊ |
115 | ␉struct CPU {␊ |
116 | ␉␉uint32_t␉␉Features;␉␉␉␉// CPU Features like MMX, SSE2, VT, MobileCPU␊ |
117 | ␉␉uint32_t␉␉Vendor;␉␉␉␉␉// Vendor␊ |
118 | ␉␉uint32_t␉␉Signature;␉␉␉␉// Signature␊ |
119 | ␉␉uint32_t␉␉Stepping;␉␉␉␉// Stepping␊ |
120 | ␉␉uint32_t␉␉Model;␉␉␉␉␉// Model␊ |
121 | ␉␉uint32_t␉␉ExtModel;␉␉␉␉// Extended Model␊ |
122 | ␉␉uint32_t␉␉Family;␉␉␉␉␉// Family␊ |
123 | ␉␉uint32_t␉␉ExtFamily;␉␉␉␉// Extended Family␊ |
124 | ␉␉uint32_t␉␉NoCores;␉␉␉␉// No Cores per Package␊ |
125 | ␉␉uint32_t␉␉NoThreads;␉␉␉␉// Threads per Package␊ |
126 | ␉␉uint8_t␉␉␉MaxCoef;␉␉␉␉// Max Multiplier␊ |
127 | ␉␉uint8_t␉␉␉MaxDiv;␊ |
128 | ␉␉uint8_t␉␉␉CurrCoef;␉␉␉␉// Current Multiplier␊ |
129 | ␉␉uint8_t␉␉␉CurrDiv;␊ |
130 | ␉␉uint64_t␉␉TSCFrequency;␉␉␉// TSC Frequency Hz␊ |
131 | ␉␉uint64_t␉␉FSBFrequency;␉␉␉// FSB Frequency Hz␊ |
132 | ␉␉uint64_t␉␉CPUFrequency;␉␉␉// CPU Frequency Hz␊ |
133 | ␉␉uint32_t␉␉MaxRatio;␉␉␉␉// Max Bus Ratio␊ |
134 | ␉␉uint32_t␉␉MinRatio;␉␉␉␉// Min Bus Ratio␊ |
135 | ␉␉char␉␉␉BrandString[48];␉␉// 48 Byte Branding String␊ |
136 | ␉␉uint32_t␉␉CPUID[CPUID_MAX][4];␉// CPUID 0..4, 80..81 Raw Values␊ |
137 | ␉} CPU;␊ |
138 | ␉␊ |
139 | ␉struct RAM {␊ |
140 | ␉␉uint64_t␉␉Frequency;␉␉␉␉// Ram Frequency␊ |
141 | ␉␉uint32_t␉␉Divider;␉␉␉␉// Memory divider␊ |
142 | ␉␉uint8_t␉␉␉CAS;␉␉␉␉␉// CAS 1/2/2.5/3/4/5/6/7␊ |
143 | ␉␉uint8_t␉␉␉TRC;␉␉␉␉␉␊ |
144 | ␉␉uint8_t␉␉␉TRP;␊ |
145 | ␉␉uint8_t␉␉␉RAS;␊ |
146 | ␉␉uint8_t␉␉␉Channels;␉␉␉␉// Channel Configuration Single,Dual or Triple␊ |
147 | ␉␉uint8_t␉␉␉NoSlots;␉␉␉␉// Maximum no of slots available␊ |
148 | ␉␉uint8_t␉␉␉Type;␉␉␉␉␉// Standard SMBIOS v2.5 Memory Type␊ |
149 | ␉␉RamSlotInfo_t␉DIMM[MAX_RAM_SLOTS];␉// Information about each slot␊ |
150 | ␉} RAM;␊ |
151 | ␉␊ |
152 | ␉struct DMI {␊ |
153 | ␉␉int␉␉␉MaxMemorySlots;␉␉␉␉// number of memory slots populated by SMBIOS␊ |
154 | ␉␉int␉␉␉CntMemorySlots;␉␉␉␉// number of memory slots counted␊ |
155 | ␉␉int␉␉␉MemoryModules;␉␉␉␉// number of memory modules installed␊ |
156 | ␉␉int␉␉␉DIMM[MAX_RAM_SLOTS];␉␉// Information and SPD mapping for each slot␊ |
157 | ␉} DMI;␊ |
158 | ␉␊ |
159 | ␉uint8_t␉␉␉␉Type; // System Type: 1=Desktop, 2=Portable... according ACPI2.0 (FACP: PM_Profile)␊ |
160 | ␉uint8_t␉␉␉␉*UUID;␊ |
161 | } PlatformInfo_t;␊ |
162 | ␊ |
163 | extern PlatformInfo_t Platform;␊ |
164 | ␊ |
165 | #endif /* !__LIBSAIO_PLATFORM_H */␊ |
166 |