Changeset 52475 in vbox for trunk/src/VBox
- Timestamp:
- Aug 22, 2014 2:13:27 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95690
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r48947 r52475 66 66 /* Default base for PM PIIX4 device */ 67 67 #define PM_PORT_BASE 0x4000 68 /* Port offsets in PM device */ 68 /* Port offsets in PM device */ 69 69 enum 70 70 { … … 78 78 GPE1_OFFSET = -1 /**< not supported */ 79 79 }; 80 81 /* Undef this to enable 24 bit PM timer (mostly for debugging purposes) */ 82 #define PM_TMR_32BIT 80 83 81 84 #define BAT_INDEX 0x00004040 … … 218 221 PTMTIMERR0 pPmTimerR0; 219 222 PTMTIMERRC pPmTimerRC; 223 224 /* PM Timer last calculated value */ 225 uint32_t uPmTimerVal; 226 uint32_t Alignment0; 220 227 221 228 uint32_t gpe0_en; … … 310 317 PDMIACPIPORT IACPIPort; 311 318 /** Pointer to the device instance. */ 312 PPDMDEVINSR3 pDevIns; 319 PPDMDEVINSR3 pDevInsR3; 320 PPDMDEVINSR0 pDevInsR0; 321 PPDMDEVINSRC pDevInsRC; 322 323 uint32_t Alignment1; 313 324 /** Pointer to the driver base interface. */ 314 325 R3PTRTYPE(PPDMIBASE) pDrvBase; … … 333 344 /** ACPI custom OEM Rev */ 334 345 uint32_t u32OemRevision; 335 uint32_t Alignment 0;346 uint32_t Alignment2; 336 347 337 348 /** The custom table binary data. */ … … 485 496 #define FADT_FL_FORCE_APIC_PHYS_DEST_MODE RT_BIT(19) 486 497 498 /* PM Timer mask and msb */ 499 #ifndef PM_TMR_32BIT 500 #define TMR_VAL_MSB 0x800000 501 #define TMR_VAL_MASK 0xffffff 502 #undef FADT_FL_TMR_VAL_EXT 503 #define FADT_FL_TMR_VAL_EXT 0 504 #else 505 #define TMR_VAL_MSB 0x80000000 506 #define TMR_VAL_MASK 0xffffffff 507 #endif 508 487 509 /** Start of the ACPI 2.0 extension. */ 488 510 ACPIGENADDR ResetReg; /**< ext addr of reset register */ … … 620 642 #endif 621 643 622 #ifdef IN_RING3623 624 644 /* SCI IRQ */ 625 DECLINLINE(void) acpi R3SetIrq(ACPIState *pThis, int level)645 DECLINLINE(void) acpiSetIrq(ACPIState *pThis, int level) 626 646 { 627 647 if (pThis->pm1a_ctl & SCI_EN) 628 PDMDevHlpPCISetIrq(pThis-> pDevIns, 0, level);648 PDMDevHlpPCISetIrq(pThis->CTX_SUFF(pDevIns), 0, level); 629 649 } 630 650 … … 651 671 /** 652 672 * Used by acpiR3PM1aStsWrite, acpiR3PM1aEnWrite, acpiR3PmTimer, 653 * acpiR3Port_PowerBuffonPress and acpiR3Port_SleepButtonPress to 654 * update the GPE0.STS and GPE0.EN registers and trigger IRQs. 673 * acpiR3Port_PowerBuffonPress, acpiR3Port_SleepButtonPress 674 * and acpiPmTmrRead to update the PM1a.STS and PM1a.EN 675 * registers and trigger IRQs. 655 676 * 656 677 * Caller must hold the state lock. 657 678 * 658 679 * @param pThis The ACPI instance. 659 * @param sts The new GPE0.STS value.660 * @param en The new GPE0.EN value.661 */ 662 static void apic R3UpdatePm1a(ACPIState *pThis, uint32_t sts, uint32_t en)680 * @param sts The new PM1a.STS value. 681 * @param en The new PM1a.EN value. 682 */ 683 static void apicUpdatePm1a(ACPIState *pThis, uint32_t sts, uint32_t en) 663 684 { 664 685 Assert(PDMCritSectIsOwner(&pThis->CritSect)); … … 670 691 int const new_level = (pm1a_pure_en(en) & pm1a_pure_sts(sts)) != 0; 671 692 672 Log(("apic R3UpdatePm1a() old=%x new=%x\n", old_level, new_level));693 Log(("apicUpdatePm1a() old=%x new=%x\n", old_level, new_level)); 673 694 674 695 pThis->pm1a_en = en; … … 676 697 677 698 if (new_level != old_level) 678 acpiR3SetIrq(pThis, new_level); 679 } 699 acpiSetIrq(pThis, new_level); 700 } 701 702 #ifdef IN_RING3 680 703 681 704 /** … … 696 719 return; 697 720 698 int const old_level = (pThis->gpe0_en & pThis->gpe0_sts) != 0;721 int const old_level = gpe0_level(pThis); 699 722 int const new_level = (en & sts) != 0; 700 723 … … 703 726 704 727 if (new_level != old_level) 705 acpi R3SetIrq(pThis, new_level);728 acpiSetIrq(pThis, new_level); 706 729 } 707 730 … … 714 737 static int acpiR3DoPowerOff(ACPIState *pThis) 715 738 { 716 int rc = PDMDevHlpVMPowerOff(pThis->pDevIns );739 int rc = PDMDevHlpVMPowerOff(pThis->pDevInsR3); 717 740 if (RT_FAILURE(rc)) 718 741 AssertMsgFailed(("Could not power down the VM. rc = %Rrc\n", rc)); … … 735 758 if (pThis->fSuspendToSavedState) 736 759 { 737 rc = PDMDevHlpVMSuspendSaveAndPowerOff(pThis->pDevIns );760 rc = PDMDevHlpVMSuspendSaveAndPowerOff(pThis->pDevInsR3); 738 761 if (rc != VERR_NOT_SUPPORTED) 739 762 AssertRC(rc); … … 741 764 { 742 765 LogRel(("ACPI: PDMDevHlpVMSuspendSaveAndPowerOff is not supported, falling back to suspend-only\n")); 743 rc = PDMDevHlpVMSuspend(pThis->pDevIns );766 rc = PDMDevHlpVMSuspend(pThis->pDevInsR3); 744 767 AssertRC(rc); 745 768 } … … 747 770 else 748 771 { 749 rc = PDMDevHlpVMSuspend(pThis->pDevIns );772 rc = PDMDevHlpVMSuspend(pThis->pDevInsR3); 750 773 AssertRC(rc); 751 774 } … … 764 787 Log(("acpiR3Port_PowerButtonPress: handled=%d status=%x\n", pThis->fPowerButtonHandled, pThis->pm1a_sts)); 765 788 pThis->fPowerButtonHandled = false; 766 apic R3UpdatePm1a(pThis, pThis->pm1a_sts | PWRBTN_STS, pThis->pm1a_en);789 apicUpdatePm1a(pThis, pThis->pm1a_sts | PWRBTN_STS, pThis->pm1a_en); 767 790 768 791 DEVACPI_UNLOCK(pThis); … … 824 847 DEVACPI_LOCK_R3(pThis); 825 848 826 apic R3UpdatePm1a(pThis, pThis->pm1a_sts | SLPBTN_STS, pThis->pm1a_en);849 apicUpdatePm1a(pThis, pThis->pm1a_sts | SLPBTN_STS, pThis->pm1a_en); 827 850 828 851 DEVACPI_UNLOCK(pThis); … … 842 865 { 843 866 uint64_t uTimerFreq = TMTimerGetFreq(pThis->CTX_SUFF(pPmTimer)); 844 uint64_t uInterval = ASMMultU64ByU32DivByU32(0xffffffff, uTimerFreq, PM_TMR_FREQ); 845 TMTimerSet(pThis->pPmTimerR3, uNow + uInterval); 867 uint32_t uPmTmrCyclesToRollover = TMR_VAL_MSB - (pThis->uPmTimerVal & (TMR_VAL_MSB - 1)); 868 uint64_t uInterval = ASMMultU64ByU32DivByU32(uPmTmrCyclesToRollover, uTimerFreq, PM_TMR_FREQ); 869 TMTimerSet(pThis->pPmTimerR3, uNow + uInterval + 1); 846 870 Log(("acpi: uInterval = %RU64\n", uInterval)); 847 871 } 872 873 #endif 874 875 /** 876 * Used by acpiR3PMTimer & acpiPmTmrRead to update TMR_VAL and update TMR_STS 877 * 878 * The caller is expected to either hold the clock lock or to have made sure 879 * the VM is resetting or loading state. 880 * 881 * @param pThis The ACPI instance 882 * @param uNow The current time 883 */ 884 885 static void acpiPmTimerUpdate(ACPIState *pThis, uint64_t u64Now) 886 { 887 uint32_t msb = pThis->uPmTimerVal & TMR_VAL_MSB; 888 uint64_t u64Elapsed = u64Now - pThis->u64PmTimerInitial; 889 Assert(TMTimerIsLockOwner(pThis->CTX_SUFF(pPmTimer))); 890 891 pThis->uPmTimerVal = ASMMultU64ByU32DivByU32(u64Elapsed, PM_TMR_FREQ, TMTimerGetFreq(pThis->CTX_SUFF(pPmTimer))) & TMR_VAL_MASK; 892 893 if ( (pThis->uPmTimerVal & TMR_VAL_MSB) != msb) 894 { 895 apicUpdatePm1a(pThis, pThis->pm1a_sts | TMR_STS, pThis->pm1a_en); 896 } 897 } 898 899 #ifdef IN_RING3 848 900 849 901 /** … … 860 912 pThis->pm1a_sts, (pThis->pm1a_sts & TMR_STS) != 0, 861 913 pThis->pm1a_en, (pThis->pm1a_en & TMR_EN) != 0)); 862 apicR3UpdatePm1a(pThis, pThis->pm1a_sts | TMR_STS, pThis->pm1a_en); 914 uint64_t u64Now = TMTimerGet(pTimer); 915 acpiPmTimerUpdate(pThis, u64Now); 863 916 DEVACPI_UNLOCK(pThis); 864 917 865 acpiR3PmTimerReset(pThis, TMTimerGet(pTimer));918 acpiR3PmTimerReset(pThis, u64Now); 866 919 } 867 920 … … 1343 1396 u32 &= ~(RSR_EN | IGN_EN); 1344 1397 u32 &= 0xffff; 1345 apic R3UpdatePm1a(pThis, pThis->pm1a_sts, u32);1398 apicUpdatePm1a(pThis, pThis->pm1a_sts, u32); 1346 1399 1347 1400 DEVACPI_UNLOCK(pThis); … … 1386 1439 pThis->fPowerButtonHandled = true; /* Remember that the guest handled the last power button event */ 1387 1440 u32 = pThis->pm1a_sts & ~(u32 & ~(RSR_STS | IGN_STS)); 1388 apic R3UpdatePm1a(pThis, u32, pThis->pm1a_en);1441 apicUpdatePm1a(pThis, u32, pThis->pm1a_en); 1389 1442 1390 1443 DEVACPI_UNLOCK(pThis); … … 1490 1543 /* 1491 1544 * We use the clock lock to serialize access to u64PmTimerInitial and to 1492 * make sure we get a reliable time from the clock. 1545 * make sure we get a reliable time from the clock 1546 * as well as and to prevent uPmTimerVal from being updated during read. 1493 1547 */ 1548 1494 1549 int rc = TMTimerLock(pThis->CTX_SUFF(pPmTimer), VINF_IOM_R3_IOPORT_READ); 1495 if (rc == VINF_SUCCESS) 1496 { 1497 uint64_t const u64PmTimerInitial = pThis->u64PmTimerInitial; 1498 uint64_t u64Now = TMTimerGet(pThis->CTX_SUFF(pPmTimer)); 1499 TMTimerUnlock(pThis->CTX_SUFF(pPmTimer)); 1500 1501 /* 1502 * Calculate the return value. 1503 */ 1504 DBGFTRACE_PDM_U64_TAG(pDevIns, u64Now, "acpi"); 1505 uint64_t u64Elapsed = u64Now - u64PmTimerInitial; 1506 *pu32 = ASMMultU64ByU32DivByU32(u64Elapsed, PM_TMR_FREQ, TMTimerGetFreq(pThis->CTX_SUFF(pPmTimer))); 1507 Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32)); 1508 } 1550 if (rc != VINF_SUCCESS) 1551 return rc; 1552 1553 rc = PDMCritSectEnter(&pThis->CritSect, VINF_IOM_R3_IOPORT_READ); 1554 if (rc != VINF_SUCCESS) 1555 { 1556 TMTimerUnlock(pThis->CTX_SUFF(pPmTimer)); 1557 return rc; 1558 } 1559 1560 uint64_t u64Now = TMTimerGet(pThis->CTX_SUFF(pPmTimer)); 1561 acpiPmTimerUpdate(pThis, u64Now); 1562 *pu32 = pThis->uPmTimerVal; 1563 1564 DEVACPI_UNLOCK(pThis); 1565 TMTimerUnlock(pThis->CTX_SUFF(pPmTimer)); 1566 1567 DBGFTRACE_PDM_U64_TAG(pDevIns, u64Now, "acpi"); 1568 Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32)); 1509 1569 1510 1570 NOREF(pvUser); NOREF(Port); … … 1712 1772 #define R(offset, cnt, writer, reader, description) \ 1713 1773 do { \ 1714 rc = PDMDevHlpIOPortRegister(pThis->pDevIns , acpiR3CalcPmPort(pThis, offset), cnt, pThis, writer, reader, \1774 rc = PDMDevHlpIOPortRegister(pThis->pDevInsR3, acpiR3CalcPmPort(pThis, offset), cnt, pThis, writer, reader, \ 1715 1775 NULL, NULL, description); \ 1716 1776 if (RT_FAILURE(rc)) \ … … 1731 1791 if (pThis->fGCEnabled) 1732 1792 { 1733 rc = PDMDevHlpIOPortRegisterRC(pThis->pDevIns , acpiR3CalcPmPort(pThis, PM_TMR_OFFSET),1793 rc = PDMDevHlpIOPortRegisterRC(pThis->pDevInsR3, acpiR3CalcPmPort(pThis, PM_TMR_OFFSET), 1734 1794 1, 0, NULL, "acpiPMTmrRead", 1735 1795 NULL, NULL, "ACPI PM Timer"); … … 1740 1800 if (pThis->fR0Enabled) 1741 1801 { 1742 rc = PDMDevHlpIOPortRegisterR0(pThis->pDevIns , acpiR3CalcPmPort(pThis, PM_TMR_OFFSET),1802 rc = PDMDevHlpIOPortRegisterR0(pThis->pDevInsR3, acpiR3CalcPmPort(pThis, PM_TMR_OFFSET), 1743 1803 1, 0, NULL, "acpiPMTmrRead", 1744 1804 NULL, NULL, "ACPI PM Timer"); … … 1760 1820 #define U(offset, cnt) \ 1761 1821 do { \ 1762 int rc = PDMDevHlpIOPortDeregister(pThis->pDevIns , acpiR3CalcPmPort(pThis, offset), cnt); \1822 int rc = PDMDevHlpIOPortDeregister(pThis->pDevInsR3, acpiR3CalcPmPort(pThis, offset), cnt); \ 1763 1823 AssertRCReturn(rc, rc); \ 1764 1824 } while (0) … … 1871 1931 }; 1872 1932 1933 /** 1934 * Saved state structure description, version 7. 1935 */ 1936 static const SSMFIELD g_AcpiSavedStateFields7[] = 1937 { 1938 SSMFIELD_ENTRY(ACPIState, pm1a_en), 1939 SSMFIELD_ENTRY(ACPIState, pm1a_sts), 1940 SSMFIELD_ENTRY(ACPIState, pm1a_ctl), 1941 SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial), 1942 SSMFIELD_ENTRY(ACPIState, uPmTimerVal), 1943 SSMFIELD_ENTRY(ACPIState, gpe0_en), 1944 SSMFIELD_ENTRY(ACPIState, gpe0_sts), 1945 SSMFIELD_ENTRY(ACPIState, uBatteryIndex), 1946 SSMFIELD_ENTRY(ACPIState, uSystemInfoIndex), 1947 SSMFIELD_ENTRY(ACPIState, uSleepState), 1948 SSMFIELD_ENTRY(ACPIState, u8IndexShift), 1949 SSMFIELD_ENTRY(ACPIState, uPmIoPortBase), 1950 SSMFIELD_ENTRY(ACPIState, fSuspendToSavedState), 1951 SSMFIELD_ENTRY_TERM() 1952 }; 1873 1953 1874 1954 /** … … 1878 1958 { 1879 1959 ACPIState *pThis = PDMINS_2_DATA(pDevIns, ACPIState *); 1880 return SSMR3PutStruct(pSSMHandle, pThis, &g_AcpiSavedStateFields 6[0]);1960 return SSMR3PutStruct(pSSMHandle, pThis, &g_AcpiSavedStateFields7[0]); 1881 1961 } 1882 1962 … … 1907 1987 case 6: 1908 1988 rc = SSMR3GetStruct(pSSMHandle, pThis, &g_AcpiSavedStateFields6[0]); 1989 break; 1990 case 7: 1991 rc = SSMR3GetStruct(pSSMHandle, pThis, &g_AcpiSavedStateFields7[0]); 1909 1992 break; 1910 1993 default: … … 1924 2007 return rc; 1925 2008 TMTimerLock(pThis->pPmTimerR3, VERR_IGNORED); 1926 acpiR3PmTimerReset(pThis, TMTimerGet(pThis->pPmTimerR3)); 2009 DEVACPI_LOCK_R3(pThis); 2010 uint64_t u64Now = TMTimerGet(pThis->pPmTimerR3); 2011 /* The interrupt may be incorrectly re-generated 2012 * if the state is restored from versions < 7 2013 */ 2014 acpiPmTimerUpdate(pThis, u64Now); 2015 acpiR3PmTimerReset(pThis, u64Now); 2016 DEVACPI_UNLOCK(pThis); 1927 2017 TMTimerUnlock(pThis->pPmTimerR3); 1928 2018 } … … 1996 2086 DECLINLINE(void) acpiR3PhysCopy(ACPIState *pThis, RTGCPHYS32 GCPhys32Dst, const void *pvSrc, size_t cbToCopy) 1997 2087 { 1998 PDMDevHlpPhysWrite(pThis->pDevIns , GCPhys32Dst, pvSrc, cbToCopy);2088 PDMDevHlpPhysWrite(pThis->pDevInsR3, GCPhys32Dst, pvSrc, cbToCopy); 1999 2089 } 2000 2090 … … 2130 2220 rsdt = (ACPITBLRSDT*)RTMemAllocZ(size); 2131 2221 if (!rsdt) 2132 return PDMDEV_SET_ERROR(pThis->pDevIns , VERR_NO_TMP_MEMORY, N_("Cannot allocate RSDT"));2222 return PDMDEV_SET_ERROR(pThis->pDevInsR3, VERR_NO_TMP_MEMORY, N_("Cannot allocate RSDT")); 2133 2223 2134 2224 acpiR3PrepareHeader(pThis, &rsdt->header, "RSDT", (uint32_t)size, 1); … … 2514 2604 cbXsdt += cAddr*sizeof(uint64_t); /* each entry: 64 bits phys. address. */ 2515 2605 2516 rc = CFGMR3QueryU64(pThis->pDevIns ->pCfg, "RamSize", &pThis->u64RamSize);2517 if (RT_FAILURE(rc)) 2518 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,2606 rc = CFGMR3QueryU64(pThis->pDevInsR3->pCfg, "RamSize", &pThis->u64RamSize); 2607 if (RT_FAILURE(rc)) 2608 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 2519 2609 N_("Configuration error: Querying \"RamSize\" as integer failed")); 2520 2610 2521 2611 uint32_t cbRamHole; 2522 rc = CFGMR3QueryU32Def(pThis->pDevIns ->pCfg, "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT);2523 if (RT_FAILURE(rc)) 2524 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,2612 rc = CFGMR3QueryU32Def(pThis->pDevInsR3->pCfg, "RamHoleSize", &cbRamHole, MM_RAM_HOLE_SIZE_DEFAULT); 2613 if (RT_FAILURE(rc)) 2614 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 2525 2615 N_("Configuration error: Querying \"RamHoleSize\" as integer failed")); 2526 2616 … … 2579 2669 void *pvSsdtCode = NULL; 2580 2670 size_t cbSsdt = 0; 2581 rc = acpiPrepareSsdt(pThis->pDevIns , &pvSsdtCode, &cbSsdt);2671 rc = acpiPrepareSsdt(pThis->pDevInsR3, &pvSsdtCode, &cbSsdt); 2582 2672 if (RT_FAILURE(rc)) 2583 2673 return rc; … … 2590 2680 void *pvDsdtCode = NULL; 2591 2681 size_t cbDsdt = 0; 2592 rc = acpiPrepareDsdt(pThis->pDevIns , &pvDsdtCode, &cbDsdt);2682 rc = acpiPrepareDsdt(pThis->pDevInsR3, &pvDsdtCode, &cbDsdt); 2593 2683 if (RT_FAILURE(rc)) 2594 2684 return rc; … … 2597 2687 2598 2688 if (GCPhysCur > 0x10000) 2599 return PDMDEV_SET_ERROR(pThis->pDevIns , VERR_TOO_MUCH_DATA,2689 return PDMDEV_SET_ERROR(pThis->pDevInsR3, VERR_TOO_MUCH_DATA, 2600 2690 N_("Error: ACPI tables bigger than 64KB")); 2601 2691 … … 2618 2708 acpiR3SetupRsdp(pThis, (ACPITBLRSDP *)pThis->au8RSDPPage, GCPhysRsdt + addend, GCPhysXsdt + addend); 2619 2709 acpiR3SetupDsdt(pThis, GCPhysDsdt + addend, pvDsdtCode, cbDsdt); 2620 acpiCleanupDsdt(pThis->pDevIns , pvDsdtCode);2710 acpiCleanupDsdt(pThis->pDevInsR3, pvDsdtCode); 2621 2711 acpiR3SetupFacs(pThis, GCPhysFacs + addend); 2622 2712 acpiR3SetupFadt(pThis, GCPhysFadtAcpi1 + addend, GCPhysFadtAcpi2 + addend, GCPhysFacs + addend, GCPhysDsdt + addend); … … 2650 2740 2651 2741 acpiR3SetupSsdt(pThis, GCPhysSsdt + addend, pvSsdtCode, cbSsdt); 2652 acpiCleanupSsdt(pThis->pDevIns , pvSsdtCode);2742 acpiCleanupSsdt(pThis->pDevInsR3, pvSsdtCode); 2653 2743 aGCPhysRsdt[iSsdt] = GCPhysSsdt + addend; 2654 2744 aGCPhysXsdt[iSsdt] = GCPhysSsdt + addend; … … 2827 2917 pThis->pm1a_ctl = 0; 2828 2918 pThis->u64PmTimerInitial = TMTimerGet(pThis->pPmTimerR3); 2919 pThis->uPmTimerVal = 0; 2829 2920 acpiR3PmTimerReset(pThis, pThis->u64PmTimerInitial); 2830 2921 pThis->uBatteryIndex = 0; … … 2876 2967 /** @todo move more of the code up! */ 2877 2968 2878 pThis->pDevIns = pDevIns; 2969 pThis->pDevInsR3 = pDevIns; 2970 pThis->pDevInsR0 = PDMDEVINS_2_R0PTR(pDevIns); 2971 pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 2879 2972 VMCPUSET_EMPTY(&pThis->CpuSetAttached); 2880 2973 VMCPUSET_EMPTY(&pThis->CpuSetLocked); … … 3107 3200 3108 3201 char *pszOemId = NULL; 3109 rc = CFGMR3QueryStringAllocDef(pThis->pDevIns ->pCfg, "AcpiOemId", &pszOemId, "VBOX ");3110 if (RT_FAILURE(rc)) 3111 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,3202 rc = CFGMR3QueryStringAllocDef(pThis->pDevInsR3->pCfg, "AcpiOemId", &pszOemId, "VBOX "); 3203 if (RT_FAILURE(rc)) 3204 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 3112 3205 N_("Configuration error: Querying \"AcpiOemId\" as string failed")); 3113 3206 size_t cbOemId = strlen(pszOemId); 3114 3207 if (cbOemId > 6) 3115 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,3208 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 3116 3209 N_("Configuration error: \"AcpiOemId\" must contain not more than 6 characters")); 3117 3210 memset(pThis->au8OemId, ' ', sizeof(pThis->au8OemId)); … … 3120 3213 3121 3214 char *pszCreatorId = NULL; 3122 rc = CFGMR3QueryStringAllocDef(pThis->pDevIns ->pCfg, "AcpiCreatorId", &pszCreatorId, "ASL ");3123 if (RT_FAILURE(rc)) 3124 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,3215 rc = CFGMR3QueryStringAllocDef(pThis->pDevInsR3->pCfg, "AcpiCreatorId", &pszCreatorId, "ASL "); 3216 if (RT_FAILURE(rc)) 3217 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 3125 3218 N_("Configuration error: Querying \"AcpiCreatorId\" as string failed")); 3126 3219 size_t cbCreatorId = strlen(pszCreatorId); 3127 3220 if (cbCreatorId > 4) 3128 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,3221 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 3129 3222 N_("Configuration error: \"AcpiCreatorId\" must contain not more than 4 characters")); 3130 3223 memset(pThis->au8CreatorId, ' ', sizeof(pThis->au8CreatorId)); … … 3132 3225 MMR3HeapFree(pszCreatorId); 3133 3226 3134 rc = CFGMR3QueryU32Def(pThis->pDevIns ->pCfg, "AcpiCreatorRev", &pThis->u32CreatorRev, RT_H2LE_U32(0x61));3135 if (RT_FAILURE(rc)) 3136 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,3227 rc = CFGMR3QueryU32Def(pThis->pDevInsR3->pCfg, "AcpiCreatorRev", &pThis->u32CreatorRev, RT_H2LE_U32(0x61)); 3228 if (RT_FAILURE(rc)) 3229 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 3137 3230 N_("Configuration error: Querying \"AcpiCreatorRev\" as integer failed")); 3138 3231 pThis->u32OemRevision = RT_H2LE_U32(0x1); … … 3142 3235 */ 3143 3236 char *pszCustBinFile; 3144 rc = CFGMR3QueryStringAlloc(pThis->pDevIns ->pCfg, "CustomTable", &pszCustBinFile);3237 rc = CFGMR3QueryStringAlloc(pThis->pDevInsR3->pCfg, "CustomTable", &pszCustBinFile); 3145 3238 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 3146 rc = CFGMR3QueryStringAlloc(pThis->pDevIns ->pCfg, "SLICTable", &pszCustBinFile);3239 rc = CFGMR3QueryStringAlloc(pThis->pDevInsR3->pCfg, "SLICTable", &pszCustBinFile); 3147 3240 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 3148 3241 { … … 3151 3244 } 3152 3245 else if (RT_FAILURE(rc)) 3153 return PDMDEV_SET_ERROR(pThis->pDevIns , rc,3246 return PDMDEV_SET_ERROR(pThis->pDevInsR3, rc, 3154 3247 N_("Configuration error: Querying \"CustomTable\" as a string failed")); 3155 3248 else if (!*pszCustBinFile) … … 3180 3273 * Allocate buffer for the custom table binary data. 3181 3274 */ 3182 pThis->pu8CustBin = (uint8_t *)PDMDevHlpMMHeapAlloc(pThis->pDevIns , pThis->cbCustBin);3275 pThis->pu8CustBin = (uint8_t *)PDMDevHlpMMHeapAlloc(pThis->pDevInsR3, pThis->cbCustBin); 3183 3276 if (pThis->pu8CustBin) 3184 3277 { … … 3328 3421 * Register the saved state. 3329 3422 */ 3330 rc = PDMDevHlpSSMRegister(pDevIns, 6, sizeof(*pThis), acpiR3SaveState, acpiR3LoadState);3423 rc = PDMDevHlpSSMRegister(pDevIns, 7, sizeof(*pThis), acpiR3SaveState, acpiR3LoadState); 3331 3424 if (RT_FAILURE(rc)) 3332 3425 return rc; -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r52259 r52475 572 572 GEN_CHECK_OFF(ACPIState, pPmTimerR0); 573 573 GEN_CHECK_OFF(ACPIState, pPmTimerRC); 574 GEN_CHECK_OFF(ACPIState, uPmTimerVal); 574 575 GEN_CHECK_OFF(ACPIState, gpe0_en); 575 576 GEN_CHECK_OFF(ACPIState, gpe0_sts); … … 593 594 GEN_CHECK_OFF(ACPIState, IBase); 594 595 GEN_CHECK_OFF(ACPIState, IACPIPort); 595 GEN_CHECK_OFF(ACPIState, pDevIns); 596 GEN_CHECK_OFF(ACPIState, pDevInsR3); 597 GEN_CHECK_OFF(ACPIState, pDevInsR0); 596 598 GEN_CHECK_OFF(ACPIState, pDrvBase); 597 599 GEN_CHECK_OFF(ACPIState, pDrv);
Note:
See TracChangeset
for help on using the changeset viewer.