Changeset 22480 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Aug 26, 2009 5:14:13 PM (15 years ago)
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevACPI.cpp
r21855 r22480 1774 1774 1775 1775 static DECLCALLBACK(int) acpi_load_state(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, 1776 uint32_t u 32Version)1776 uint32_t uVersion, uint32_t uPhase) 1777 1777 { 1778 1778 ACPIState *s = PDMINS_2_DATA(pDevIns, ACPIState *); 1779 int rc; 1779 1780 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 1780 1781 1781 1782 /* … … 1783 1784 * after state successfully loaded. 1784 1785 */ 1785 rc = acpiUnregisterPmHandlers(s);1786 int rc = acpiUnregisterPmHandlers(s); 1786 1787 if (RT_FAILURE(rc)) 1787 1788 return rc; 1788 1789 1789 switch (u 32Version)1790 switch (uVersion) 1790 1791 { 1791 1792 case 4: … … 2182 2183 acpiPciConfigWrite, &s->pfnAcpiPciConfigWrite); 2183 2184 2184 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 5, sizeof(*s), 2185 NULL, acpi_save_state, NULL, NULL, acpi_load_state, NULL); 2185 rc = PDMDevHlpSSMRegister(pDevIns, 5, sizeof(*s), acpi_save_state, acpi_load_state); 2186 2186 if (RT_FAILURE(rc)) 2187 2187 return rc; -
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r21389 r22480 2357 2357 * @copydoc FNSSMDEVLOADEXEC 2358 2358 */ 2359 static DECLCALLBACK(int) apicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u 32Version)2359 static DECLCALLBACK(int) apicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase) 2360 2360 { 2361 2361 APICDeviceInfo *dev = PDMINS_2_DATA(pDevIns, APICDeviceInfo *); 2362 /* load all APICs data, @todo: is it correct? */ 2362 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 2363 2364 /* load all APICs data */ /** @todo: is it correct? */ 2363 2365 foreach_apic(dev, 0xffffffff, 2364 if (apic_load(pSSMHandle, apic, u 32Version))2366 if (apic_load(pSSMHandle, apic, uVersion)) 2365 2367 { 2366 2368 AssertFailed(); … … 2640 2642 * Saved state. 2641 2643 */ 2642 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 2 /* version */, 2643 sizeof(*pThis), NULL, apicSaveExec, NULL, NULL, apicLoadExec, NULL); 2644 rc = PDMDevHlpSSMRegister(pDevIns, 2 /* version */, sizeof(*pThis), apicSaveExec, apicLoadExec); 2644 2645 if (RT_FAILURE(rc)) 2645 2646 return rc; … … 2807 2808 * @copydoc FNSSMDEVLOADEXEC 2808 2809 */ 2809 static DECLCALLBACK(int) ioapicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u 32Version)2810 static DECLCALLBACK(int) ioapicLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase) 2810 2811 { 2811 2812 IOAPICState *s = PDMINS_2_DATA(pDevIns, IOAPICState *); 2812 2813 2813 if (ioapic_load(pSSMHandle, s, u 32Version)) {2814 if (ioapic_load(pSSMHandle, s, uVersion)) { 2814 2815 AssertFailed(); 2815 2816 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 2816 2817 } 2818 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 2817 2819 2818 2820 return VINF_SUCCESS; … … 2919 2921 } 2920 2922 2921 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, 2922 sizeof(*s), NULL, ioapicSaveExec, NULL, NULL, ioapicLoadExec, NULL); 2923 rc = PDMDevHlpSSMRegister(pDevIns, 1 /* version */, sizeof(*s), ioapicSaveExec, ioapicLoadExec); 2923 2924 if (RT_FAILURE(rc)) 2924 2925 return rc; -
trunk/src/VBox/Devices/PC/DevDMA.cpp
r12978 r22480 846 846 } 847 847 848 static void DMAReset (PPDMDEVINS pDevIns)848 static void dmaReset (PPDMDEVINS pDevIns) 849 849 { 850 850 DMAState *s = PDMINS_2_DATA (pDevIns, DMAState *); … … 853 853 } 854 854 855 static DECLCALLBACK(int) SaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)855 static DECLCALLBACK(int) dmaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle) 856 856 { 857 857 DMAState *s = PDMINS_2_DATA (pDevIns, DMAState *); … … 861 861 } 862 862 863 static DECLCALLBACK(int) LoadExec (PPDMDEVINS pDevIns, 864 PSSMHANDLE pSSMHandle, 865 uint32_t u32Version) 863 static DECLCALLBACK(int) dmaLoadExec (PPDMDEVINS pDevIns, 864 PSSMHANDLE pSSMHandle, 865 uint32_t uVersion, 866 uint32_t uPhase) 866 867 { 867 868 DMAState *s = PDMINS_2_DATA (pDevIns, DMAState *); 868 869 869 if (u32Version != 1) { 870 AssertFailed (); 871 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 872 } 873 874 dma_load (pSSMHandle, &s->dma_controllers[0], u32Version); 875 return dma_load (pSSMHandle, &s->dma_controllers[1], u32Version); 870 AssertMsgReturn (uVersion == 1, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION); 871 Assert (uPhase == SSM_PHASE_FINAL); 872 873 dma_load (pSSMHandle, &s->dma_controllers[0], uVersion); 874 return dma_load (pSSMHandle, &s->dma_controllers[1], uVersion); 876 875 } 877 876 … … 889 888 * iInstance it's expected to be used a bit in this function. 890 889 */ 891 static DECLCALLBACK(int) DMAConstruct(PPDMDEVINS pDevIns,890 static DECLCALLBACK(int) dmaConstruct(PPDMDEVINS pDevIns, 892 891 int iInstance, 893 892 PCFGMNODE pCfgHandle) … … 932 931 } 933 932 934 rc = PDMDevHlpSSMRegister (pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1, sizeof (*s), 935 NULL, SaveExec, NULL, NULL, LoadExec, NULL); 933 rc = PDMDevHlpSSMRegister (pDevIns, 1 /*uVersion*/, sizeof (*s), dmaSaveExec, dmaLoadExec); 936 934 if (RT_FAILURE(rc)) 937 935 return rc; … … 964 962 sizeof(DMAState), 965 963 /* pfnConstruct */ 966 DMAConstruct,964 dmaConstruct, 967 965 /* pfnDestruct */ 968 966 NULL, … … 974 972 NULL, 975 973 /* pfnReset */ 976 DMAReset,974 dmaReset, 977 975 /* pfnSuspend */ 978 976 NULL, -
trunk/src/VBox/Devices/PC/DevPIC.cpp
r20572 r22480 828 828 * @param pDevIns The device instance. 829 829 * @param pSSMHandle The handle to the saved state. 830 * @param u32Version The data unit version number. 831 */ 832 static DECLCALLBACK(int) picLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version) 830 * @param uVersion The data unit version number. 831 * @param uPhase The data phase. 832 */ 833 static DECLCALLBACK(int) picLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase) 833 834 { 834 835 PDEVPIC pThis = PDMINS_2_DATA(pDevIns, PDEVPIC); 835 836 836 if (u 32Version != 1)837 if (uVersion != 1) 837 838 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 839 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 838 840 839 841 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aPics); i++) … … 1041 1043 } 1042 1044 1043 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, sizeof(*pThis), 1044 NULL, picSaveExec, NULL, 1045 NULL, picLoadExec, NULL); 1045 rc = PDMDevHlpSSMRegister(pDevIns, 1 /* uVersion */, sizeof(*pThis), picSaveExec, picLoadExec); 1046 1046 if (RT_FAILURE(rc)) 1047 1047 return rc; -
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r20374 r22480 759 759 * @param pDevIns The device instance. 760 760 * @param pSSMHandle The handle to the saved state. 761 * @param u32Version The data unit version number. 762 */ 763 static DECLCALLBACK(int) pitLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version) 761 * @param uVersion The data unit version number. 762 * @param uPhase The data phase. 763 */ 764 static DECLCALLBACK(int) pitLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase) 764 765 { 765 766 PITState *pThis = PDMINS_2_DATA(pDevIns, PITState *); 766 unsigned i; 767 768 if (u32Version != PIT_SAVED_STATE_VERSION) 767 768 if (uVersion != PIT_SAVED_STATE_VERSION) 769 769 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 770 771 for (i = 0; i < RT_ELEMENTS(pThis->channels); i++) 770 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 771 772 for (unsigned i = 0; i < RT_ELEMENTS(pThis->channels); i++) 772 773 { 773 774 PITChannelState *s = &pThis->channels[i]; … … 1034 1035 } 1035 1036 1036 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, PIT_SAVED_STATE_VERSION, sizeof(*pThis), 1037 NULL, pitSaveExec, NULL, 1038 NULL, pitLoadExec, NULL); 1037 rc = PDMDevHlpSSMRegister(pDevIns, PIT_SAVED_STATE_VERSION, sizeof(*pThis), pitSaveExec, pitLoadExec); 1039 1038 if (RT_FAILURE(rc)) 1040 1039 return rc; -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r20374 r22480 628 628 * @param pDevIns The device instance. 629 629 * @param pSSMHandle The handle to the saved state. 630 * @param u32Version The data unit version number. 631 */ 632 static DECLCALLBACK(int) rtcLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t u32Version) 630 * @param uVersion The data unit version number. 631 * @param uPhase The data phase. 632 */ 633 static DECLCALLBACK(int) rtcLoadExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle, uint32_t uVersion, uint32_t uPhase) 633 634 { 634 635 RTCState *pThis = PDMINS_2_DATA(pDevIns, RTCState *); 635 636 636 if (u 32Version != 1)637 if (uVersion != 1) 637 638 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 639 Assert(uPhase == SSM_PHASE_FINAL); NOREF(uPhase); 638 640 639 641 SSMR3GetMem(pSSMHandle, pThis->cmos_data, 128); … … 916 918 } 917 919 918 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, sizeof(*pThis), 919 NULL, rtcSaveExec, NULL, 920 NULL, rtcLoadExec, NULL); 920 rc = PDMDevHlpSSMRegister(pDevIns, 1 /* version */, sizeof(*pThis), rtcSaveExec, rtcLoadExec); 921 921 if (RT_FAILURE(rc)) 922 922 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.