VirtualBox

Changeset 82019 in vbox


Ignore:
Timestamp:
Nov 20, 2019 10:36:50 AM (5 years ago)
Author:
vboxsync
Message:

DevACPI: Cleanups. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevACPI.cpp

    r82014 r82019  
    283283 * The ACPI device state.
    284284 */
    285 typedef struct ACPIState
     285typedef struct ACPISTATE
    286286{
    287287    /** Critical section protecting the ACPI state. */
     
    511511    /** @} */
    512512
    513 } ACPIState, ACPISTATE;
     513} ACPISTATE;
    514514/** Pointer to the shared ACPI device state. */
    515515typedef ACPISTATE *PACPISTATE;
     
    801801*********************************************************************************************************************************/
    802802#ifdef IN_RING3
    803 static int acpiR3PlantTables(PPDMDEVINS pDevIns, ACPIState *pThis);
     803static int acpiR3PlantTables(PPDMDEVINS pDevIns, PACPISTATE pThis);
    804804#endif
    805805
     
    810810}
    811811
    812 DECLINLINE(bool) pm1a_level(ACPIState *pThis)
     812DECLINLINE(bool) pm1a_level(PACPISTATE pThis)
    813813{
    814814    return    (pThis->pm1a_ctl & SCI_EN)
     
    816816}
    817817
    818 DECLINLINE(bool) gpe0_level(ACPIState *pThis)
     818DECLINLINE(bool) gpe0_level(PACPISTATE pThis)
    819819{
    820820    return !!(pThis->gpe0_en & pThis->gpe0_sts);
    821821}
    822822
    823 DECLINLINE(bool) smbus_level(PPDMDEVINS pDevIns, ACPIState *pThis)
     823DECLINLINE(bool) smbus_level(PPDMDEVINS pDevIns, PACPISTATE pThis)
    824824{
    825825    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
     
    830830}
    831831
    832 DECLINLINE(bool) acpiSCILevel(PPDMDEVINS pDevIns, ACPIState *pThis)
     832DECLINLINE(bool) acpiSCILevel(PPDMDEVINS pDevIns, PACPISTATE pThis)
    833833{
    834834    return pm1a_level(pThis) || gpe0_level(pThis) || smbus_level(pDevIns, pThis);
     
    848848 * @param   en          The new PM1a.EN value.
    849849 */
    850 static void acpiUpdatePm1a(PPDMDEVINS pDevIns, ACPIState *pThis, uint32_t sts, uint32_t en)
     850static void acpiUpdatePm1a(PPDMDEVINS pDevIns, PACPISTATE pThis, uint32_t sts, uint32_t en)
    851851{
    852852    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
     
    876876 * @param   en          The new GPE0.EN value.
    877877 */
    878 static void apicR3UpdateGpe0(PPDMDEVINS pDevIns, ACPIState *pThis, uint32_t sts, uint32_t en)
     878static void apicR3UpdateGpe0(PPDMDEVINS pDevIns, PACPISTATE pThis, uint32_t sts, uint32_t en)
    879879{
    880880    Assert(PDMDevHlpCritSectIsOwner(pDevIns, &pThis->CritSect));
     
    911911 * @returns Strict VBox status code.
    912912 */
    913 static VBOXSTRICTRC acpiR3DoSleep(PPDMDEVINS pDevIns, ACPIState *pThis)
     913static VBOXSTRICTRC acpiR3DoSleep(PPDMDEVINS pDevIns, PACPISTATE pThis)
    914914{
    915915    /* We must set WAK_STS on resume (includes restore) so the guest knows that
     
    944944static DECLCALLBACK(int) acpiR3Port_PowerButtonPress(PPDMIACPIPORT pInterface)
    945945{
    946     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     946    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    947947    PPDMDEVINS pDevIns = pThis->pDevIns;
    948948    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    961961static DECLCALLBACK(int) acpiR3Port_GetPowerButtonHandled(PPDMIACPIPORT pInterface, bool *pfHandled)
    962962{
    963     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     963    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    964964    PPDMDEVINS pDevIns = pThis->pDevIns;
    965965    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    977977static DECLCALLBACK(int) acpiR3Port_GetGuestEnteredACPIMode(PPDMIACPIPORT pInterface, bool *pfEntered)
    978978{
    979     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     979    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    980980    PPDMDEVINS pDevIns = pThis->pDevIns;
    981981    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    992992static DECLCALLBACK(int) acpiR3Port_GetCpuStatus(PPDMIACPIPORT pInterface, unsigned uCpu, bool *pfLocked)
    993993{
    994     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     994    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    995995    PPDMDEVINS pDevIns = pThis->pDevIns;
    996996    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    10101010static DECLCALLBACK(int) acpiR3Port_SleepButtonPress(PPDMIACPIPORT pInterface)
    10111011{
    1012     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     1012    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    10131013    PPDMDEVINS pDevIns = pThis->pDevIns;
    10141014    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    10291029static DECLCALLBACK(int) acpiR3Port_MonitorHotPlugEvent(PPDMIACPIPORT pInterface)
    10301030{
    1031     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     1031    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    10321032    PPDMDEVINS pDevIns = pThis->pDevIns;
    10331033    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    10481048static DECLCALLBACK(int) acpiR3Port_BatteryStatusChangeEvent(PPDMIACPIPORT pInterface)
    10491049{
    1050     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IACPIPort);
     1050    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IACPIPort);
    10511051    PPDMDEVINS pDevIns = pThis->pDevIns;
    10521052    DEVACPI_LOCK_R3(pDevIns, pThis);
     
    10681068 * @param   uNow        The current time.
    10691069 */
    1070 static void acpiR3PmTimerReset(PPDMDEVINS pDevIns, ACPIState *pThis, uint64_t uNow)
     1070static void acpiR3PmTimerReset(PPDMDEVINS pDevIns, PACPISTATE pThis, uint64_t uNow)
    10711071{
    10721072    uint64_t uTimerFreq = PDMDevHlpTimerGetFreq(pDevIns, pThis->hPmTimer);
     
    10891089 * @param   u64Now      The current time
    10901090 */
    1091 static void acpiPmTimerUpdate(PPDMDEVINS pDevIns, ACPIState *pThis, uint64_t u64Now)
     1091static void acpiPmTimerUpdate(PPDMDEVINS pDevIns, PACPISTATE pThis, uint64_t u64Now)
    10921092{
    10931093    uint32_t msb = pThis->uPmTimerVal & TMR_VAL_MSB;
     
    11321132 * @param   pThis           The ACPI shared instance data.
    11331133 */
    1134 static int acpiR3FetchBatteryStatus(ACPIState *pThis)
     1134static int acpiR3FetchBatteryStatus(PACPISTATE pThis)
    11351135{
    11361136    uint32_t           *p = pThis->au8BatteryInfo;
     
    11701170 * @param   pThis           The ACPI shared instance data.
    11711171 */
    1172 static int acpiR3FetchBatteryInfo(ACPIState *pThis)
     1172static int acpiR3FetchBatteryInfo(PACPISTATE pThis)
    11731173{
    11741174    uint32_t *p = pThis->au8BatteryInfo;
     
    11931193 * @param   pThis           The ACPI shared instance data.
    11941194 */
    1195 static uint32_t acpiR3GetBatteryDeviceStatus(ACPIState *pThis)
     1195static uint32_t acpiR3GetBatteryDeviceStatus(PACPISTATE pThis)
    11961196{
    11971197    bool               fPresent;              /* battery present? */
     
    12221222 * @param   pThis           The ACPI shared instance data.
    12231223 */
    1224 static uint32_t acpiR3GetPowerSource(ACPIState *pThis)
     1224static uint32_t acpiR3GetPowerSource(PACPISTATE pThis)
    12251225{
    12261226    /* query the current power source from the host driver */
     
    20152015 * @param   pThis       The ACPI shared instance data.
    20162016 */
    2017 static void acpiR3PmPCIBIOSFake(PPDMDEVINS pDevIns, ACPIState *pThis)
     2017static void acpiR3PmPCIBIOSFake(PPDMDEVINS pDevIns, PACPISTATE pThis)
    20182018{
    20192019    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
     
    20312031 * @param   offset              The offset into the I/O space, or -1 if invalid.
    20322032 */
    2033 static RTIOPORT acpiR3CalcPmPort(ACPIState *pThis, int32_t offset)
     2033static RTIOPORT acpiR3CalcPmPort(PACPISTATE pThis, int32_t offset)
    20342034{
    20352035    Assert(pThis->uPmIoPortBase != 0);
     
    20492049 * @param   pThis           The ACPI shared instance data.
    20502050 */
    2051 static int acpiR3MapPmIoPorts(PPDMDEVINS pDevIns, ACPIState *pThis)
     2051static int acpiR3MapPmIoPorts(PPDMDEVINS pDevIns, PACPISTATE pThis)
    20522052{
    20532053    if (pThis->uPmIoPortBase == 0)
     
    20782078 * @param   pThis       The ACPI shared instance data.
    20792079 */
    2080 static int acpiR3UnmapPmIoPorts(PPDMDEVINS pDevIns, ACPIState *pThis)
     2080static int acpiR3UnmapPmIoPorts(PPDMDEVINS pDevIns, PACPISTATE pThis)
    20812081{
    20822082    if (pThis->uPmIoPortBase != 0)
     
    21092109 * @param   NewIoPortBase   The new base address of the I/O ports.
    21102110 */
    2111 static int acpiR3UpdatePmHandlers(PPDMDEVINS pDevIns, ACPIState *pThis, RTIOPORT NewIoPortBase)
     2111static int acpiR3UpdatePmHandlers(PPDMDEVINS pDevIns, PACPISTATE pThis, RTIOPORT NewIoPortBase)
    21122112{
    21132113    Log(("acpi: rebasing PM 0x%x -> 0x%x\n", pThis->uPmIoPortBase, NewIoPortBase));
     
    22962296 * @param   pThis       The ACPI shared instance data.
    22972297 */
    2298 static void acpiR3SMBusPCIBIOSFake(PPDMDEVINS pDevIns, ACPIState *pThis)
     2298static void acpiR3SMBusPCIBIOSFake(PPDMDEVINS pDevIns, PACPISTATE pThis)
    22992299{
    23002300    PPDMPCIDEV pPciDev = pDevIns->apPciDevs[0];
     
    23152315 * @param   pThis           The ACPI shared instance data.
    23162316 */
    2317 static void acpiR3SMBusResetDevice(ACPIState *pThis)
     2317static void acpiR3SMBusResetDevice(PACPISTATE pThis)
    23182318{
    23192319    pThis->u8SMBusHstSts = 0x00;
     
    23392339 * @param   pThis       The ACPI shared instance data.
    23402340 */
    2341 static int acpiR3MapSMBusIoPorts(PPDMDEVINS pDevIns, ACPIState *pThis)
     2341static int acpiR3MapSMBusIoPorts(PPDMDEVINS pDevIns, PACPISTATE pThis)
    23422342{
    23432343    if (pThis->uSMBusIoPortBase != 0)
     
    23562356 * @param   pThis       The ACPI shared instance data.
    23572357 */
    2358 static int acpiR3UnmapSMBusPorts(PPDMDEVINS pDevIns, ACPIState *pThis)
     2358static int acpiR3UnmapSMBusPorts(PPDMDEVINS pDevIns, PACPISTATE pThis)
    23592359{
    23602360    if (pThis->uSMBusIoPortBase != 0)
     
    23762376 * @param   NewIoPortBase   The new base address of the I/O ports.
    23772377 */
    2378 static int acpiR3UpdateSMBusHandlers(PPDMDEVINS pDevIns, ACPIState *pThis, RTIOPORT NewIoPortBase)
     2378static int acpiR3UpdateSMBusHandlers(PPDMDEVINS pDevIns, PACPISTATE pThis, RTIOPORT NewIoPortBase)
    23792379{
    23802380    Log(("acpi: rebasing SMBus 0x%x -> 0x%x\n", pThis->uSMBusIoPortBase, NewIoPortBase));
     
    24072407static const SSMFIELD g_AcpiSavedStateFields4[] =
    24082408{
    2409     SSMFIELD_ENTRY(ACPIState, pm1a_en),
    2410     SSMFIELD_ENTRY(ACPIState, pm1a_sts),
    2411     SSMFIELD_ENTRY(ACPIState, pm1a_ctl),
    2412     SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial),
    2413     SSMFIELD_ENTRY(ACPIState, gpe0_en),
    2414     SSMFIELD_ENTRY(ACPIState, gpe0_sts),
    2415     SSMFIELD_ENTRY(ACPIState, uBatteryIndex),
    2416     SSMFIELD_ENTRY(ACPIState, uSystemInfoIndex),
    2417     SSMFIELD_ENTRY(ACPIState, u64RamSize),
    2418     SSMFIELD_ENTRY(ACPIState, u8IndexShift),
    2419     SSMFIELD_ENTRY(ACPIState, u8UseIOApic),
    2420     SSMFIELD_ENTRY(ACPIState, uSleepState),
     2409    SSMFIELD_ENTRY(ACPISTATE, pm1a_en),
     2410    SSMFIELD_ENTRY(ACPISTATE, pm1a_sts),
     2411    SSMFIELD_ENTRY(ACPISTATE, pm1a_ctl),
     2412    SSMFIELD_ENTRY(ACPISTATE, u64PmTimerInitial),
     2413    SSMFIELD_ENTRY(ACPISTATE, gpe0_en),
     2414    SSMFIELD_ENTRY(ACPISTATE, gpe0_sts),
     2415    SSMFIELD_ENTRY(ACPISTATE, uBatteryIndex),
     2416    SSMFIELD_ENTRY(ACPISTATE, uSystemInfoIndex),
     2417    SSMFIELD_ENTRY(ACPISTATE, u64RamSize),
     2418    SSMFIELD_ENTRY(ACPISTATE, u8IndexShift),
     2419    SSMFIELD_ENTRY(ACPISTATE, u8UseIOApic),
     2420    SSMFIELD_ENTRY(ACPISTATE, uSleepState),
    24212421    SSMFIELD_ENTRY_TERM()
    24222422};
     
    24272427static const SSMFIELD g_AcpiSavedStateFields5[] =
    24282428{
    2429     SSMFIELD_ENTRY(ACPIState, pm1a_en),
    2430     SSMFIELD_ENTRY(ACPIState, pm1a_sts),
    2431     SSMFIELD_ENTRY(ACPIState, pm1a_ctl),
    2432     SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial),
    2433     SSMFIELD_ENTRY(ACPIState, gpe0_en),
    2434     SSMFIELD_ENTRY(ACPIState, gpe0_sts),
    2435     SSMFIELD_ENTRY(ACPIState, uBatteryIndex),
    2436     SSMFIELD_ENTRY(ACPIState, uSystemInfoIndex),
    2437     SSMFIELD_ENTRY(ACPIState, uSleepState),
    2438     SSMFIELD_ENTRY(ACPIState, u8IndexShift),
    2439     SSMFIELD_ENTRY(ACPIState, uPmIoPortBase),
     2429    SSMFIELD_ENTRY(ACPISTATE, pm1a_en),
     2430    SSMFIELD_ENTRY(ACPISTATE, pm1a_sts),
     2431    SSMFIELD_ENTRY(ACPISTATE, pm1a_ctl),
     2432    SSMFIELD_ENTRY(ACPISTATE, u64PmTimerInitial),
     2433    SSMFIELD_ENTRY(ACPISTATE, gpe0_en),
     2434    SSMFIELD_ENTRY(ACPISTATE, gpe0_sts),
     2435    SSMFIELD_ENTRY(ACPISTATE, uBatteryIndex),
     2436    SSMFIELD_ENTRY(ACPISTATE, uSystemInfoIndex),
     2437    SSMFIELD_ENTRY(ACPISTATE, uSleepState),
     2438    SSMFIELD_ENTRY(ACPISTATE, u8IndexShift),
     2439    SSMFIELD_ENTRY(ACPISTATE, uPmIoPortBase),
    24402440    SSMFIELD_ENTRY_TERM()
    24412441};
     
    24462446static const SSMFIELD g_AcpiSavedStateFields6[] =
    24472447{
    2448     SSMFIELD_ENTRY(ACPIState, pm1a_en),
    2449     SSMFIELD_ENTRY(ACPIState, pm1a_sts),
    2450     SSMFIELD_ENTRY(ACPIState, pm1a_ctl),
    2451     SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial),
    2452     SSMFIELD_ENTRY(ACPIState, gpe0_en),
    2453     SSMFIELD_ENTRY(ACPIState, gpe0_sts),
    2454     SSMFIELD_ENTRY(ACPIState, uBatteryIndex),
    2455     SSMFIELD_ENTRY(ACPIState, uSystemInfoIndex),
    2456     SSMFIELD_ENTRY(ACPIState, uSleepState),
    2457     SSMFIELD_ENTRY(ACPIState, u8IndexShift),
    2458     SSMFIELD_ENTRY(ACPIState, uPmIoPortBase),
    2459     SSMFIELD_ENTRY(ACPIState, fSuspendToSavedState),
     2448    SSMFIELD_ENTRY(ACPISTATE, pm1a_en),
     2449    SSMFIELD_ENTRY(ACPISTATE, pm1a_sts),
     2450    SSMFIELD_ENTRY(ACPISTATE, pm1a_ctl),
     2451    SSMFIELD_ENTRY(ACPISTATE, u64PmTimerInitial),
     2452    SSMFIELD_ENTRY(ACPISTATE, gpe0_en),
     2453    SSMFIELD_ENTRY(ACPISTATE, gpe0_sts),
     2454    SSMFIELD_ENTRY(ACPISTATE, uBatteryIndex),
     2455    SSMFIELD_ENTRY(ACPISTATE, uSystemInfoIndex),
     2456    SSMFIELD_ENTRY(ACPISTATE, uSleepState),
     2457    SSMFIELD_ENTRY(ACPISTATE, u8IndexShift),
     2458    SSMFIELD_ENTRY(ACPISTATE, uPmIoPortBase),
     2459    SSMFIELD_ENTRY(ACPISTATE, fSuspendToSavedState),
    24602460    SSMFIELD_ENTRY_TERM()
    24612461};
     
    24662466static const SSMFIELD g_AcpiSavedStateFields7[] =
    24672467{
    2468     SSMFIELD_ENTRY(ACPIState, pm1a_en),
    2469     SSMFIELD_ENTRY(ACPIState, pm1a_sts),
    2470     SSMFIELD_ENTRY(ACPIState, pm1a_ctl),
    2471     SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial),
    2472     SSMFIELD_ENTRY(ACPIState, uPmTimerVal),
    2473     SSMFIELD_ENTRY(ACPIState, gpe0_en),
    2474     SSMFIELD_ENTRY(ACPIState, gpe0_sts),
    2475     SSMFIELD_ENTRY(ACPIState, uBatteryIndex),
    2476     SSMFIELD_ENTRY(ACPIState, uSystemInfoIndex),
    2477     SSMFIELD_ENTRY(ACPIState, uSleepState),
    2478     SSMFIELD_ENTRY(ACPIState, u8IndexShift),
    2479     SSMFIELD_ENTRY(ACPIState, uPmIoPortBase),
    2480     SSMFIELD_ENTRY(ACPIState, fSuspendToSavedState),
     2468    SSMFIELD_ENTRY(ACPISTATE, pm1a_en),
     2469    SSMFIELD_ENTRY(ACPISTATE, pm1a_sts),
     2470    SSMFIELD_ENTRY(ACPISTATE, pm1a_ctl),
     2471    SSMFIELD_ENTRY(ACPISTATE, u64PmTimerInitial),
     2472    SSMFIELD_ENTRY(ACPISTATE, uPmTimerVal),
     2473    SSMFIELD_ENTRY(ACPISTATE, gpe0_en),
     2474    SSMFIELD_ENTRY(ACPISTATE, gpe0_sts),
     2475    SSMFIELD_ENTRY(ACPISTATE, uBatteryIndex),
     2476    SSMFIELD_ENTRY(ACPISTATE, uSystemInfoIndex),
     2477    SSMFIELD_ENTRY(ACPISTATE, uSleepState),
     2478    SSMFIELD_ENTRY(ACPISTATE, u8IndexShift),
     2479    SSMFIELD_ENTRY(ACPISTATE, uPmIoPortBase),
     2480    SSMFIELD_ENTRY(ACPISTATE, fSuspendToSavedState),
    24812481    SSMFIELD_ENTRY_TERM()
    24822482};
     
    24872487static const SSMFIELD g_AcpiSavedStateFields8[] =
    24882488{
    2489     SSMFIELD_ENTRY(ACPIState, pm1a_en),
    2490     SSMFIELD_ENTRY(ACPIState, pm1a_sts),
    2491     SSMFIELD_ENTRY(ACPIState, pm1a_ctl),
    2492     SSMFIELD_ENTRY(ACPIState, u64PmTimerInitial),
    2493     SSMFIELD_ENTRY(ACPIState, uPmTimerVal),
    2494     SSMFIELD_ENTRY(ACPIState, gpe0_en),
    2495     SSMFIELD_ENTRY(ACPIState, gpe0_sts),
    2496     SSMFIELD_ENTRY(ACPIState, uBatteryIndex),
    2497     SSMFIELD_ENTRY(ACPIState, uSystemInfoIndex),
    2498     SSMFIELD_ENTRY(ACPIState, uSleepState),
    2499     SSMFIELD_ENTRY(ACPIState, u8IndexShift),
    2500     SSMFIELD_ENTRY(ACPIState, uPmIoPortBase),
    2501     SSMFIELD_ENTRY(ACPIState, fSuspendToSavedState),
    2502     SSMFIELD_ENTRY(ACPIState, uSMBusIoPortBase),
    2503     SSMFIELD_ENTRY(ACPIState, u8SMBusHstSts),
    2504     SSMFIELD_ENTRY(ACPIState, u8SMBusSlvSts),
    2505     SSMFIELD_ENTRY(ACPIState, u8SMBusHstCnt),
    2506     SSMFIELD_ENTRY(ACPIState, u8SMBusHstCmd),
    2507     SSMFIELD_ENTRY(ACPIState, u8SMBusHstAdd),
    2508     SSMFIELD_ENTRY(ACPIState, u8SMBusHstDat0),
    2509     SSMFIELD_ENTRY(ACPIState, u8SMBusHstDat1),
    2510     SSMFIELD_ENTRY(ACPIState, u8SMBusSlvCnt),
    2511     SSMFIELD_ENTRY(ACPIState, u8SMBusShdwCmd),
    2512     SSMFIELD_ENTRY(ACPIState, u16SMBusSlvEvt),
    2513     SSMFIELD_ENTRY(ACPIState, u16SMBusSlvDat),
    2514     SSMFIELD_ENTRY(ACPIState, au8SMBusBlkDat),
    2515     SSMFIELD_ENTRY(ACPIState, u8SMBusBlkIdx),
     2489    SSMFIELD_ENTRY(ACPISTATE, pm1a_en),
     2490    SSMFIELD_ENTRY(ACPISTATE, pm1a_sts),
     2491    SSMFIELD_ENTRY(ACPISTATE, pm1a_ctl),
     2492    SSMFIELD_ENTRY(ACPISTATE, u64PmTimerInitial),
     2493    SSMFIELD_ENTRY(ACPISTATE, uPmTimerVal),
     2494    SSMFIELD_ENTRY(ACPISTATE, gpe0_en),
     2495    SSMFIELD_ENTRY(ACPISTATE, gpe0_sts),
     2496    SSMFIELD_ENTRY(ACPISTATE, uBatteryIndex),
     2497    SSMFIELD_ENTRY(ACPISTATE, uSystemInfoIndex),
     2498    SSMFIELD_ENTRY(ACPISTATE, uSleepState),
     2499    SSMFIELD_ENTRY(ACPISTATE, u8IndexShift),
     2500    SSMFIELD_ENTRY(ACPISTATE, uPmIoPortBase),
     2501    SSMFIELD_ENTRY(ACPISTATE, fSuspendToSavedState),
     2502    SSMFIELD_ENTRY(ACPISTATE, uSMBusIoPortBase),
     2503    SSMFIELD_ENTRY(ACPISTATE, u8SMBusHstSts),
     2504    SSMFIELD_ENTRY(ACPISTATE, u8SMBusSlvSts),
     2505    SSMFIELD_ENTRY(ACPISTATE, u8SMBusHstCnt),
     2506    SSMFIELD_ENTRY(ACPISTATE, u8SMBusHstCmd),
     2507    SSMFIELD_ENTRY(ACPISTATE, u8SMBusHstAdd),
     2508    SSMFIELD_ENTRY(ACPISTATE, u8SMBusHstDat0),
     2509    SSMFIELD_ENTRY(ACPISTATE, u8SMBusHstDat1),
     2510    SSMFIELD_ENTRY(ACPISTATE, u8SMBusSlvCnt),
     2511    SSMFIELD_ENTRY(ACPISTATE, u8SMBusShdwCmd),
     2512    SSMFIELD_ENTRY(ACPISTATE, u16SMBusSlvEvt),
     2513    SSMFIELD_ENTRY(ACPISTATE, u16SMBusSlvDat),
     2514    SSMFIELD_ENTRY(ACPISTATE, au8SMBusBlkDat),
     2515    SSMFIELD_ENTRY(ACPISTATE, u8SMBusBlkIdx),
    25162516    SSMFIELD_ENTRY_TERM()
    25172517};
     
    25412541     */
    25422542    int rc = acpiR3UnmapPmIoPorts(pDevIns, pThis);
    2543     if (RT_FAILURE(rc))
    2544         return rc;
     2543    AssertRCReturn(rc, rc);
    25452544
    25462545    /*
     
    25782577                              ("%#x\n", pThis->u8SMBusBlkIdx), VERR_SSM_LOAD_CONFIG_MISMATCH);
    25792578        rc = acpiR3MapPmIoPorts(pDevIns, pThis);
    2580         if (RT_FAILURE(rc))
    2581             return rc;
     2579        AssertRCReturn(rc, rc);
    25822580        rc = acpiR3MapSMBusIoPorts(pDevIns, pThis);
    2583         if (RT_FAILURE(rc))
    2584             return rc;
     2581        AssertRCReturn(rc, rc);
    25852582        rc = acpiR3FetchBatteryStatus(pThis);
    2586         if (RT_FAILURE(rc))
    2587             return rc;
     2583        AssertRCReturn(rc, rc);
    25882584        rc = acpiR3FetchBatteryInfo(pThis);
    2589         if (RT_FAILURE(rc))
    2590             return rc;
     2585        AssertRCReturn(rc, rc);
     2586
    25912587        PDMDevHlpTimerLock(pDevIns, pThis->hPmTimer, VERR_IGNORED);
    25922588        DEVACPI_LOCK_R3(pDevIns, pThis);
     
    26062602static DECLCALLBACK(void *) acpiR3QueryInterface(PPDMIBASE pInterface, const char *pszIID)
    26072603{
    2608     ACPIState *pThis = RT_FROM_MEMBER(pInterface, ACPIState, IBase);
     2604    PACPISTATE pThis = RT_FROM_MEMBER(pInterface, ACPISTATE, IBase);
    26092605    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pThis->IBase);
    26102606    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIACPIPORT, &pThis->IACPIPort);
     
    26332629 * Prepare a ACPI table header.
    26342630 */
    2635 static void acpiR3PrepareHeader(ACPIState *pThis, ACPITBLHEADER *header,
     2631static void acpiR3PrepareHeader(PACPISTATE pThis, ACPITBLHEADER *header,
    26362632                                const char au8Signature[4],
    26372633                                uint32_t u32Length, uint8_t u8Revision)
     
    27092705 * Plant the Fixed ACPI Description Table (FADT aka FACP).
    27102706 */
    2711 static void acpiR3SetupFadt(PPDMDEVINS pDevIns, ACPIState *pThis, RTGCPHYS32 GCPhysAcpi1, RTGCPHYS32 GCPhysAcpi2,
     2707static void acpiR3SetupFadt(PPDMDEVINS pDevIns, PACPISTATE pThis, RTGCPHYS32 GCPhysAcpi1, RTGCPHYS32 GCPhysAcpi2,
    27122708                            RTGCPHYS32 GCPhysFacs, RTGCPHYS GCPhysDsdt)
    27132709{
     
    27932789 * ACPI 2.0 and up.
    27942790 */
    2795 static int acpiR3SetupRsdt(PPDMDEVINS pDevIns, ACPIState *pThis, RTGCPHYS32 addr, unsigned int nb_entries, uint32_t *addrs)
     2791static int acpiR3SetupRsdt(PPDMDEVINS pDevIns, PACPISTATE pThis, RTGCPHYS32 addr, unsigned int nb_entries, uint32_t *addrs)
    27962792{
    27972793    ACPITBLRSDT *rsdt;
     
    28172813 * Plant the Extended System Description Table.
    28182814 */
    2819 static int acpiR3SetupXsdt(PPDMDEVINS pDevIns, ACPIState *pThis, RTGCPHYS32 addr, unsigned int nb_entries, uint32_t *addrs)
     2815static int acpiR3SetupXsdt(PPDMDEVINS pDevIns, PACPISTATE pThis, RTGCPHYS32 addr, unsigned int nb_entries, uint32_t *addrs)
    28202816{
    28212817    ACPITBLXSDT *xsdt;
     
    28452841 * Plant the Root System Description Pointer (RSDP).
    28462842 */
    2847 static void acpiR3SetupRsdp(ACPIState *pThis, ACPITBLRSDP *rsdp, RTGCPHYS32 GCPhysRsdt, RTGCPHYS GCPhysXsdt)
     2843static void acpiR3SetupRsdp(PACPISTATE pThis, ACPITBLRSDP *rsdp, RTGCPHYS32 GCPhysRsdt, RTGCPHYS GCPhysXsdt)
    28482844{
    28492845    memset(rsdp, 0, sizeof(*rsdp));
     
    29552951     * Size of MADT for given ACPI config, useful to compute layout.
    29562952     */
    2957     static uint32_t sizeFor(ACPIState *pThis, uint32_t cIsos)
     2953    static uint32_t sizeFor(PACPISTATE pThis, uint32_t cIsos)
    29582954    {
    29592955        return AcpiTableMadt(pThis->cCpus, cIsos).size();
     
    29862982 * @todo    All hardcoded, should set this up based on the actual VM config!!!!!
    29872983 */
    2988 static void acpiR3SetupMadt(PPDMDEVINS pDevIns, ACPIState *pThis, RTGCPHYS32 addr)
     2984static void acpiR3SetupMadt(PPDMDEVINS pDevIns, PACPISTATE pThis, RTGCPHYS32 addr)
    29892985{
    29902986    uint16_t cpus = pThis->cCpus;
     
    30573053 * Plant the High Performance Event Timer (HPET) descriptor.
    30583054 */
    3059 static void acpiR3SetupHpet(PPDMDEVINS pDevIns, ACPIState *pThis, RTGCPHYS32 addr)
     3055static void acpiR3SetupHpet(PPDMDEVINS pDevIns, PACPISTATE pThis, RTGCPHYS32 addr)
    30603056{
    30613057    ACPITBLHPET hpet;
     
    30903086 * @param   GCPhysDst   Where to plant it.
    30913087 */
    3092 static void acpiR3SetupMcfg(PPDMDEVINS pDevIns, ACPIState *pThis, RTGCPHYS32 GCPhysDst)
     3088static void acpiR3SetupMcfg(PPDMDEVINS pDevIns, PACPISTATE pThis, RTGCPHYS32 GCPhysDst)
    30933089{
    30943090    struct
     
    31763172 * Create the ACPI tables in guest memory.
    31773173 */
    3178 static int acpiR3PlantTables(PPDMDEVINS pDevIns, ACPIState *pThis)
     3174static int acpiR3PlantTables(PPDMDEVINS pDevIns, PACPISTATE pThis)
    31793175{
    31803176    int        rc;
     
    41074103
    41084104    rc = PDMDevHlpPCIRegister(pDevIns, pPciDev);
    4109     if (RT_FAILURE(rc))
    4110         return rc;
     4105    AssertRCReturn(rc, rc);
    41114106
    41124107    rc = PDMDevHlpPCIInterceptConfigAccesses(pDevIns, pPciDev, acpiR3PciConfigRead, acpiR3PciConfigWrite);
     
    41174112     */
    41184113    rc = PDMDevHlpSSMRegister(pDevIns, 8, sizeof(*pThis), acpiR3SaveState, acpiR3LoadState);
    4119     if (RT_FAILURE(rc))
    4120         return rc;
     4114    AssertRCReturn(rc, rc);
    41214115
    41224116   /*
     
    41794173    /* .cMaxInstances = */          ~0U,
    41804174    /* .uSharedVersion = */         42,
    4181     /* .cbInstanceShared = */       sizeof(ACPIState),
     4175    /* .cbInstanceShared = */       sizeof(ACPISTATE),
    41824176    /* .cbInstanceCC = */           0,
    41834177    /* .cbInstanceRC = */           0,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette