Changeset 36262 in vbox for trunk/include/VBox
- Timestamp:
- Mar 11, 2011 2:50:45 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 70526
- Location:
- trunk/include/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/sup.h
r36254 r36262 88 88 } SUPPAGINGMODE; 89 89 90 #ifdef SUP_WITH_LOTS_OF_CPUS91 # ifndef RT_WITH_LOTS_OF_CPUS92 # error "RT_WITH_LOTS_OF_CPUS must be defined with SUP_WITH_LOTS_OF_CPUS"93 # endif94 #endif95 90 96 91 /** … … 147 142 148 143 /** Reserved for future per processor data. */ 149 #ifdef SUP_WITH_LOTS_OF_CPUS150 144 volatile uint32_t au32Reserved[5+5]; 151 #else152 volatile uint32_t au32Reserved[5];153 #endif154 145 155 146 /** @todo Add topology/NUMA info. */ 156 #ifdef SUP_WITH_LOTS_OF_CPUS157 147 /** The CPU state. */ 158 148 SUPGIPCPUSTATE volatile enmState; … … 163 153 /** The APIC ID of this CPU. */ 164 154 uint16_t idApic; 165 #endif166 155 } SUPGIPCPU; 167 #ifdef SUP_WITH_LOTS_OF_CPUS168 156 AssertCompileSize(RTCPUID, 4); 169 157 AssertCompileSize(SUPGIPCPU, 128); 170 #else171 AssertCompileSize(SUPGIPCPU, 96);172 #endif173 158 AssertCompileMemberAlignment(SUPGIPCPU, u64NanoTS, 8); 174 159 AssertCompileMemberAlignment(SUPGIPCPU, u64TSC, 8); … … 179 164 180 165 181 182 #ifndef SUP_WITH_LOTS_OF_CPUS183 /** The number of CPUs covered by the GIP.184 * @remarks Must be a power of two! */185 # define SUPGLOBALINFOPAGE_CPUS 32186 #endif187 166 188 167 /** … … 202 181 /** The GIP update mode, see SUPGIPMODE. */ 203 182 uint32_t u32Mode; 204 #ifdef SUP_WITH_LOTS_OF_CPUS205 183 /** The number of entries in the CPU table. 206 184 * (This can work as RTMpGetArraySize().) */ … … 208 186 /** The size of the GIP in pages. */ 209 187 uint16_t cPages; 210 #else211 /** Reserved / padding. */212 uint32_t u32Padding0;213 #endif214 188 /** The update frequency of the of the NanoTS. */ 215 189 volatile uint32_t u32UpdateHz; … … 218 192 /** The timestamp of the last time we update the update frequency. */ 219 193 volatile uint64_t u64NanoTSLastUpdateHz; 220 #ifdef SUP_WITH_LOTS_OF_CPUS221 194 /** The set of online CPUs. */ 222 195 RTCPUSET OnlineCpuSet; 223 /** The number of CPUs that are online. */224 volatile uint32_t cOnlineCpus;225 /** The number of CPUs present in the system. */226 volatile uint32_t cPresentCpus;227 196 /** The set of present CPUs. */ 228 197 RTCPUSET PresentCpuSet; 229 198 /** The set of possible CPUs. */ 230 199 RTCPUSET PossibleCpuSet; 200 /** The number of CPUs that are online. */ 201 volatile uint16_t cOnlineCpus; 202 /** The number of CPUs present in the system. */ 203 volatile uint16_t cPresentCpus; 231 204 /** The highest number of CPUs possible. */ 232 uint32_t cPossibleCpus; 205 uint16_t cPossibleCpus; 206 /** The highest number of CPUs possible. */ 207 uint16_t u16Padding0; 233 208 /** The max CPU ID (RTMpGetMaxCpuId). */ 234 209 RTCPUID idCpuMax; 235 #endif236 210 237 211 /** Padding / reserved space for future data. */ 238 #ifdef SUP_WITH_LOTS_OF_CPUS 239 uint32_t au32Padding1[28]; 240 #else 241 uint32_t au32Padding1[56]; 242 #endif 243 244 #ifdef SUP_WITH_LOTS_OF_CPUS 212 uint32_t au32Padding1[29]; 213 245 214 /** Table indexed by the CPU APIC ID to get the CPU table index. */ 246 uint16_t 215 uint16_t aiCpuFromApicId[256]; 247 216 /** CPU set index to CPU table index. */ 248 uint16_t aiCpuFromCpuSetIdx[RTCPUSET_MAX_CPUS]; 249 #endif 250 251 #ifdef SUP_WITH_LOTS_OF_CPUS 217 uint16_t aiCpuFromCpuSetIdx[RTCPUSET_MAX_CPUS]; 218 252 219 /** Array of per-cpu data. 253 220 * This is index by ApicId via the aiCpuFromApicId table. … … 257 224 * entry is updated. */ 258 225 SUPGIPCPU aCPUs[1]; 259 #else260 /** Array of per-cpu data.261 * If u32Mode == SUPGIPMODE_SYNC_TSC then only the first entry is used.262 * If u32Mode == SUPGIPMODE_ASYNC_TSC then the CPU ACPI ID is used as an263 * index into the array. */264 SUPGIPCPU aCPUs[SUPGLOBALINFOPAGE_CPUS];265 #endif266 226 } SUPGLOBALINFOPAGE; 267 #ifndef SUP_WITH_LOTS_OF_CPUS268 AssertCompile(sizeof(SUPGLOBALINFOPAGE) <= 0x1000);269 #endif270 #ifdef SUP_WITH_LOTS_OF_CPUS271 227 AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, u64NanoTSLastUpdateHz, 8); 272 228 AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPUs[0], 256); 273 229 AssertCompileMemberAlignment(SUPGLOBALINFOPAGE, aCPUs[1], 128); 274 #endif275 230 276 231 /** Pointer to the global info page. … … 284 239 * Upper 16 bits is the major version. Major version is only changed with 285 240 * incompatible changes in the GIP. */ 286 #ifdef SUP_WITH_LOTS_OF_CPUS 287 # define SUPGLOBALINFOPAGE_VERSION 0x00030000 288 #else 289 # define SUPGLOBALINFOPAGE_VERSION 0x00020000 290 #endif 241 #define SUPGLOBALINFOPAGE_VERSION 0x00030000 291 242 292 243 /** … … 369 320 else 370 321 { 371 # ifdef SUP_WITH_LOTS_OF_CPUS372 322 iCpu = pGip->aiCpuFromApicId[ASMGetApicId()]; 373 323 if (iCpu >= pGip->cCpus) 374 324 return UINT64_MAX; 375 # else376 iCpu = ASMGetApicId();377 if (RT_UNLIKELY(iCpu >= RT_ELEMENTS(pGip->aCPUs)))378 return UINT64_MAX;379 # endif380 325 } 381 326 -
trunk/include/VBox/sup.mac
r36254 r36262 28 28 %define ___VBox_sup_mac 29 29 30 %ifndef SUP_WITH_LOTS_OF_CPUS31 %define SUPGLOBALINFOPAGE_CPUS 3232 %endif33 34 30 struc SUPGIPCPU 35 31 .u32TransactionId resd 1 … … 42 38 .au32TSCHistory resd 8 43 39 .u32PrevUpdateIntervalNS resd 1 44 %ifdef SUP_WITH_LOTS_OF_CPUS45 40 .au32Reserved resd (5+5) 46 41 .enmState resd 1 … … 48 43 .iCpuSet resw 1 49 44 .idApic resw 1 50 %else51 .au32Reserved resd 552 %endif53 45 endstruc 54 46 … … 58 50 .u32Version resd 1 59 51 .u32Mode resd 1 60 %ifdef SUP_WITH_LOTS_OF_CPUS61 52 .cCpus resw 1 62 53 .cPages resw 1 63 %else64 .u32Padding0 resd 165 %endif66 54 .u32UpdateHz resd 1 67 55 .u32UpdateIntervalNS resd 1 68 56 .u64NanoTSLastUpdateHz resq 1 69 %ifdef SUP_WITH_LOTS_OF_CPUS70 57 .OnlineCpuSet resq 4 71 .cOnlineCpus resd 172 .cPresentCpus resd 173 58 .PresentCpuSet resq 4 74 59 .PossibleCpuSet resq 4 75 .cPossibleCpus resd 1 60 .cOnlineCpus resw 1 61 .cPresentCpus resw 1 62 .cPossibleCpus resw 1 63 .u16Padding0 resw 1 76 64 .idCpuMax resd 1 77 .au32Padding1 resd 2 865 .au32Padding1 resd 29 78 66 .aiCpuFromApicId resw 256 79 67 .aiCpuFromCpuSetIdx resw 256 80 68 .aCPUs resb SUPGIPCPU_size 81 %else82 .au32Padding1 resd 5683 .aCPUs resb (SUPGIPCPU_size*SUPGLOBALINFOPAGE_CPUS)84 %endif85 69 endstruc 86 70
Note:
See TracChangeset
for help on using the changeset viewer.