Changeset 20493 in vbox
- Timestamp:
- Jun 12, 2009 9:55:46 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp
r20486 r20493 55 55 return 0; 56 56 } 57 58 #else 59 static int patchAml(PPDMDEVINS pDevIns, uint8_t* pAml, size_t uAmlLen) 60 { 61 uint16_t cNumCpus; 62 int rc; 63 64 rc = CFGMR3QueryU16Def(pDevIns->pCfgHandle, "NumCPUs", &cNumCpus, 1); 65 66 if (RT_FAILURE(rc)) 67 return rc; 68 69 /** 70 * Now search AML for: 71 * AML_PROCESSOR_OP (UINT16) 0x5b83 72 * and replace whole block with 73 * AML_NOOP_OP (UINT16) 0xa3 74 * for VCPU not configured 75 */ 76 uint16_t cAcpiCpus = 0; 77 for (uint32_t i = 0; i < uAmlLen - 5; i++) 78 { 79 /* 80 * AML_PROCESSOR_OP 81 * 82 * DefProcessor := ProcessorOp PkgLength NameString ProcID 83 PblkAddr PblkLen ObjectList 84 * ProcessorOp := ExtOpPrefix 0x83 85 * ProcID := ByteData 86 * PblkAddr := DwordData 87 * PblkLen := ByteData 88 */ 89 if ((pAml[i] == 0x5b) && (pAml[i+1] == 0x83)) 90 { 91 if ((pAml[i+3] != 'C') || (pAml[i+4] != 'P')) 92 /* false alarm, not named starting CP */ 93 continue; 94 95 /* Maybe use ProcID instead? */ 96 cAcpiCpus++; 97 if (cAcpiCpus <= cNumCpus) 98 continue; 99 100 /* Will fill unwanted CPU block with NOOPs */ 101 /* 102 * See 18.2.4 Package Length Encoding in ACPI spec 103 * for full format 104 */ 105 uint32_t cBytes = pAml[i + 2]; 106 AssertReleaseMsg((cBytes >> 6) == 0, 107 ("So far, we only understand simple package length")); 108 109 /* including AML_PROCESSOR_OP itself */ 110 for (uint32_t j = 0; j < cBytes + 2; j++) 111 pAml[i+j] = 0xa3; 112 113 /* Can increase i by cBytes + 1, but not really worth it */ 114 } 115 } 116 117 /* now recompute checksum, whole file byte sum must be 0 */ 118 pAml[9] = 0; 119 uint8_t aSum = 0; 120 for (uint32_t i = 0; i < uAmlLen; i++) 121 aSum = aSum + (uint8_t)pAml[i]; 122 pAml[9] = (uint8_t) (0 - aSum); 123 124 return 0; 125 } 57 126 #endif 58 127 -
trunk/src/VBox/Devices/PC/vbox.dsl
r20486 r20493 128 128 Scope (\_PR) 129 129 { 130 Processor (CPU0, /* Name */130 Processor (CPU0, /* Name */ 131 131 0x00, /* Id */ 132 132 0x0, /* Processor IO ports range start */ … … 142 142 ) 143 143 { 144 Method (_STA) { Return(\_SB.UCP1) }145 144 } 146 145 Processor (CPU2, /* Name */ … … 150 149 ) 151 150 { 152 Method (_STA) { Return(\_SB.UCP2) }153 151 } 154 152 Processor (CPU3, /* Name */ … … 158 156 ) 159 157 { 160 Method (_STA) { Return(\_SB.UCP3) } 161 } 158 } 159 Processor (CPU4, /* Name */ 160 0x04, /* Id */ 161 0x0, /* Processor IO ports range start */ 162 0x0 /* Processor IO ports range length */ 163 ) 164 { 165 } 166 Processor (CPU5, /* Name */ 167 0x05, /* Id */ 168 0x0, /* Processor IO ports range start */ 169 0x0 /* Processor IO ports range length */ 170 ) 171 { 172 } 173 Processor (CPU6, /* Name */ 174 0x06, /* Id */ 175 0x0, /* Processor IO ports range start */ 176 0x0 /* Processor IO ports range length */ 177 ) 178 { 179 } 180 Processor (CPU7, /* Name */ 181 0x07, /* Id */ 182 0x0, /* Processor IO ports range start */ 183 0x0 /* Processor IO ports range length */ 184 ) 185 { 186 } 187 Processor (CPU8, /* Name */ 188 0x08, /* Id */ 189 0x0, /* Processor IO ports range start */ 190 0x0 /* Processor IO ports range length */ 191 ) 192 { 193 } 194 Processor (CPU9, /* Name */ 195 0x09, /* Id */ 196 0x0, /* Processor IO ports range start */ 197 0x0 /* Processor IO ports range length */ 198 ) 199 { 200 } 201 Processor (CPUA, /* Name */ 202 0x0a, /* Id */ 203 0x0, /* Processor IO ports range start */ 204 0x0 /* Processor IO ports range length */ 205 ) 206 { 207 } 208 Processor (CPUB, /* Name */ 209 0x0b, /* Id */ 210 0x0, /* Processor IO ports range start */ 211 0x0 /* Processor IO ports range length */ 212 ) 213 { 214 } 215 Processor (CPUC, /* Name */ 216 0x0c, /* Id */ 217 0x0, /* Processor IO ports range start */ 218 0x0 /* Processor IO ports range length */ 219 ) 220 { 221 } 222 Processor (CPUD, /* Name */ 223 0x0d, /* Id */ 224 0x0, /* Processor IO ports range start */ 225 0x0 /* Processor IO ports range length */ 226 ) 227 { 228 } 229 Processor (CPUE, /* Name */ 230 0x0e, /* Id */ 231 0x0, /* Processor IO ports range start */ 232 0x0 /* Processor IO ports range length */ 233 ) 234 { 235 } 236 Processor (CPUF, /* Name */ 237 0x0f, /* Id */ 238 0x0, /* Processor IO ports range start */ 239 0x0 /* Processor IO ports range length */ 240 ) 241 { 242 } 243 Processor (CPUG, /* Name */ 244 0x10, /* Id */ 245 0x0, /* Processor IO ports range start */ 246 0x0 /* Processor IO ports range length */ 247 ) 248 { 249 } 250 Processor (CPUH, /* Name */ 251 0x11, /* Id */ 252 0x0, /* Processor IO ports range start */ 253 0x0 /* Processor IO ports range length */ 254 ) 255 { 256 } 257 Processor (CPUI, /* Name */ 258 0x12, /* Id */ 259 0x0, /* Processor IO ports range start */ 260 0x0 /* Processor IO ports range length */ 261 ) 262 { 263 } 264 Processor (CPUJ, /* Name */ 265 0x13, /* Id */ 266 0x0, /* Processor IO ports range start */ 267 0x0 /* Processor IO ports range length */ 268 ) 269 { 270 } 271 Processor (CPUK, /* Name */ 272 0x14, /* Id */ 273 0x0, /* Processor IO ports range start */ 274 0x0 /* Processor IO ports range length */ 275 ) 276 { 277 } 278 Processor (CPUL, /* Name */ 279 0x15, /* Id */ 280 0x0, /* Processor IO ports range start */ 281 0x0 /* Processor IO ports range length */ 282 ) 283 { 284 } 285 Processor (CPUM, /* Name */ 286 0x16, /* Id */ 287 0x0, /* Processor IO ports range start */ 288 0x0 /* Processor IO ports range length */ 289 ) 290 { 291 } 292 Processor (CPUN, /* Name */ 293 0x17, /* Id */ 294 0x0, /* Processor IO ports range start */ 295 0x0 /* Processor IO ports range length */ 296 ) 297 { 298 } 299 Processor (CPUO, /* Name */ 300 0x18, /* Id */ 301 0x0, /* Processor IO ports range start */ 302 0x0 /* Processor IO ports range length */ 303 ) 304 { 305 } 306 Processor (CPUP, /* Name */ 307 0x19, /* Id */ 308 0x0, /* Processor IO ports range start */ 309 0x0 /* Processor IO ports range length */ 310 ) 311 { 312 } 313 Processor (CPUQ, /* Name */ 314 0x1a, /* Id */ 315 0x0, /* Processor IO ports range start */ 316 0x0 /* Processor IO ports range length */ 317 ) 318 { 319 } 320 Processor (CPUR, /* Name */ 321 0x1b, /* Id */ 322 0x0, /* Processor IO ports range start */ 323 0x0 /* Processor IO ports range length */ 324 ) 325 { 326 } 327 Processor (CPUS, /* Name */ 328 0x1c, /* Id */ 329 0x0, /* Processor IO ports range start */ 330 0x0 /* Processor IO ports range length */ 331 ) 332 { 333 } 334 Processor (CPUT, /* Name */ 335 0x1d, /* Id */ 336 0x0, /* Processor IO ports range start */ 337 0x0 /* Processor IO ports range length */ 338 ) 339 { 340 } 341 Processor (CPUU, /* Name */ 342 0x1e, /* Id */ 343 0x0, /* Processor IO ports range start */ 344 0x0 /* Processor IO ports range length */ 345 ) 346 { 347 } 348 Processor (CPUV, /* Name */ 349 0x1f, /* Id */ 350 0x0, /* Processor IO ports range start */ 351 0x0 /* Processor IO ports range length */ 352 ) 353 { 354 } 355 162 356 } 163 357
Note:
See TracChangeset
for help on using the changeset viewer.