Changeset 18143 in vbox
- Timestamp:
- Mar 23, 2009 3:10:24 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
include/VBox/pdmdev.h (modified) (72 diffs)
-
include/VBox/pgm.h (modified) (1 diff)
-
src/VBox/Devices/Graphics/DevVGA.cpp (modified) (1 diff)
-
src/VBox/Devices/PC/DevACPI.cpp (modified) (2 diffs)
-
src/VBox/Devices/PC/DevPcBios.cpp (modified) (8 diffs)
-
src/VBox/VMM/PDMDevHlp.cpp (modified) (1 diff)
-
src/VBox/VMM/PGMInternal.h (modified) (2 diffs)
-
src/VBox/VMM/PGMPhys.cpp (modified) (19 diffs)
-
src/VBox/VMM/VMMAll/PGMAllPhys.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmdev.h
r18101 r18143 1898 1898 * This must be cbRange bytes big. 1899 1899 * It will be copied and doesn't have to stick around if fShadow is clear. 1900 * @param fShadow Whether to emulate ROM shadowing. This involves leaving 1901 * the ROM writable for a while during the POST and refreshing 1902 * it at reset. When this flag is set, the memory pointed to by 1903 * pvBinary has to stick around for the lifespan of the VM. 1900 * @param fFlags Shadow ROM flags, PGMPHYS_ROM_FLAGS_* in pgm.h. 1904 1901 * @param pszDesc Pointer to description string. This must not be freed. 1905 1902 * … … 1907 1904 * manually from the device yet. At present I doubt we need such features... 1908 1905 */ 1909 DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc));1906 DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, uint32_t fFlags, const char *pszDesc)); 1910 1907 1911 1908 /** … … 1913 1910 * 1914 1911 * @returns VBox status. 1915 * @param pDevIns Device instance.1916 * @param pszName Data unit name.1917 * @param u32Instance The instance identifier of the data unit.1918 * This must together with the name be unique.1919 * @param u32Version Data layout version number.1920 * @param cbGuess The approximate amount of data in the unit.1921 * Only for progress indicators.1922 * @param pfnSavePrep Prepare save callback, optional.1923 * @param pfnSaveExec Execute save callback, optional.1924 * @param pfnSaveDone Done save callback, optional.1925 * @param pfnLoadPrep Prepare load callback, optional.1926 * @param pfnLoadExec Execute load callback, optional.1927 * @param pfnLoadDone Done load callback, optional.1912 * @param pDevIns Device instance. 1913 * @param pszName Data unit name. 1914 * @param u32Instance The instance identifier of the data unit. 1915 * This must together with the name be unique. 1916 * @param u32Version Data layout version number. 1917 * @param cbGuess The approximate amount of data in the unit. 1918 * Only for progress indicators. 1919 * @param pfnSavePrep Prepare save callback, optional. 1920 * @param pfnSaveExec Execute save callback, optional. 1921 * @param pfnSaveDone Done save callback, optional. 1922 * @param pfnLoadPrep Prepare load callback, optional. 1923 * @param pfnLoadExec Execute load callback, optional. 1924 * @param pfnLoadDone Done load callback, optional. 1928 1925 */ 1929 1926 DECLR3CALLBACKMEMBER(int, pfnSSMRegister,(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess, … … 1935 1932 * 1936 1933 * @returns VBox status. 1937 * @param pDevIns Device instance.1938 * @param enmClock The clock to use on this timer.1939 * @param pfnCallback Callback function.1940 * @param pszDesc Pointer to description string which must stay around1941 * until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()).1942 * @param ppTimer Where to store the timer on success.1934 * @param pDevIns Device instance. 1935 * @param enmClock The clock to use on this timer. 1936 * @param pfnCallback Callback function. 1937 * @param pszDesc Pointer to description string which must stay around 1938 * until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()). 1939 * @param ppTimer Where to store the timer on success. 1943 1940 */ 1944 1941 DECLR3CALLBACKMEMBER(int, pfnTMTimerCreate,(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer)); … … 1948 1945 * 1949 1946 * @returns timer pointer 1950 * @param pDevIns Device instance.1951 * @param enmClock The clock to use on this timer.1952 * @param pfnCallback Callback function.1953 * @param pvUser User pointer1954 * @param pszDesc Pointer to description string which must stay around1955 * until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()).1947 * @param pDevIns Device instance. 1948 * @param enmClock The clock to use on this timer. 1949 * @param pfnCallback Callback function. 1950 * @param pvUser User pointer 1951 * @param pszDesc Pointer to description string which must stay around 1952 * until the timer is fully destroyed (i.e. a bit after TMTimerDestroy()). 1956 1953 */ 1957 1954 DECLR3CALLBACKMEMBER(PTMTIMERR3, pfnTMTimerCreateExternal,(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc)); … … 1961 1958 * 1962 1959 * @returns VBox status code. 1963 * @param pDevIns Device instance.1964 * @param pPciDev The PCI device structure.1965 * Any PCI enabled device must keep this in it's instance data!1966 * Fill in the PCI data config before registration, please.1960 * @param pDevIns Device instance. 1961 * @param pPciDev The PCI device structure. 1962 * Any PCI enabled device must keep this in it's instance data! 1963 * Fill in the PCI data config before registration, please. 1967 1964 * @remark This is the simple interface, a Ex interface will be created if 1968 1965 * more features are needed later. … … 1974 1971 * 1975 1972 * @returns VBox status code. 1976 * @param pDevIns Device instance.1977 * @param iRegion The region number.1978 * @param cbRegion Size of the region.1979 * @param enmType PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or PCI_ADDRESS_SPACE_MEM_PREFETCH.1980 * @param pfnCallback Callback for doing the mapping.1973 * @param pDevIns Device instance. 1974 * @param iRegion The region number. 1975 * @param cbRegion Size of the region. 1976 * @param enmType PCI_ADDRESS_SPACE_MEM, PCI_ADDRESS_SPACE_IO or PCI_ADDRESS_SPACE_MEM_PREFETCH. 1977 * @param pfnCallback Callback for doing the mapping. 1981 1978 */ 1982 1979 DECLR3CALLBACKMEMBER(int, pfnPCIIORegionRegister,(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)); … … 1985 1982 * Register PCI configuration space read/write callbacks. 1986 1983 * 1987 * @param pDevIns Device instance.1988 * @param pPciDev The PCI device structure.1989 * If NULL the default PCI device for this device instance is used.1990 * @param pfnRead Pointer to the user defined PCI config read function.1991 * @param ppfnReadOld Pointer to function pointer which will receive the old (default)1992 * PCI config read function. This way, user can decide when (and if)1993 * to call default PCI config read function. Can be NULL.1994 * @param pfnWrite Pointer to the user defined PCI config write function.1995 * @param pfnWriteOld Pointer to function pointer which will receive the old (default)1996 * PCI config write function. This way, user can decide when (and if)1997 * to call default PCI config write function. Can be NULL.1984 * @param pDevIns Device instance. 1985 * @param pPciDev The PCI device structure. 1986 * If NULL the default PCI device for this device instance is used. 1987 * @param pfnRead Pointer to the user defined PCI config read function. 1988 * @param ppfnReadOld Pointer to function pointer which will receive the old (default) 1989 * PCI config read function. This way, user can decide when (and if) 1990 * to call default PCI config read function. Can be NULL. 1991 * @param pfnWrite Pointer to the user defined PCI config write function. 1992 * @param pfnWriteOld Pointer to function pointer which will receive the old (default) 1993 * PCI config write function. This way, user can decide when (and if) 1994 * to call default PCI config write function. Can be NULL. 1998 1995 * @thread EMT 1999 1996 */ … … 2004 2001 * Set the IRQ for a PCI device. 2005 2002 * 2006 * @param pDevIns Device instance.2007 * @param iIrq IRQ number to set.2008 * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.2003 * @param pDevIns Device instance. 2004 * @param iIrq IRQ number to set. 2005 * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines. 2009 2006 * @thread Any thread, but will involve the emulation thread. 2010 2007 */ … … 2015 2012 * the request when not called from EMT. 2016 2013 * 2017 * @param pDevIns Device instance.2018 * @param iIrq IRQ number to set.2019 * @param iLevel IRQ level.2014 * @param pDevIns Device instance. 2015 * @param iIrq IRQ number to set. 2016 * @param iLevel IRQ level. 2020 2017 * @thread Any thread, but will involve the emulation thread. 2021 2018 */ … … 2025 2022 * Set ISA IRQ for a device. 2026 2023 * 2027 * @param pDevIns Device instance.2028 * @param iIrq IRQ number to set.2029 * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.2024 * @param pDevIns Device instance. 2025 * @param iIrq IRQ number to set. 2026 * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines. 2030 2027 * @thread Any thread, but will involve the emulation thread. 2031 2028 */ … … 2036 2033 * the request when not called from EMT. 2037 2034 * 2038 * @param pDevIns Device instance.2039 * @param iIrq IRQ number to set.2040 * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines.2035 * @param pDevIns Device instance. 2036 * @param iIrq IRQ number to set. 2037 * @param iLevel IRQ level. See the PDM_IRQ_LEVEL_* \#defines. 2041 2038 * @thread Any thread, but will involve the emulation thread. 2042 2039 */ … … 2064 2061 * 2065 2062 * @returns Pointer to allocated memory. The memory is *NOT* zero-ed. 2066 * @param pDevIns Device instance.2067 * @param cb Number of bytes to allocate.2063 * @param pDevIns Device instance. 2064 * @param cb Number of bytes to allocate. 2068 2065 */ 2069 2066 DECLR3CALLBACKMEMBER(void *, pfnMMHeapAlloc,(PPDMDEVINS pDevIns, size_t cb)); … … 2074 2071 * 2075 2072 * @returns Pointer to allocated memory. The memory is *NOT* zero-ed. 2076 * @param pDevIns Device instance.2077 * @param cb Number of bytes to allocate.2073 * @param pDevIns Device instance. 2074 * @param cb Number of bytes to allocate. 2078 2075 */ 2079 2076 DECLR3CALLBACKMEMBER(void *, pfnMMHeapAllocZ,(PPDMDEVINS pDevIns, size_t cb)); … … 2082 2079 * Free memory allocated with pfnMMHeapAlloc() and pfnMMHeapAllocZ(). 2083 2080 * 2084 * @param pDevIns Device instance.2085 * @param pv Pointer to the memory to free.2081 * @param pDevIns Device instance. 2082 * @param pv Pointer to the memory to free. 2086 2083 */ 2087 2084 DECLR3CALLBACKMEMBER(void, pfnMMHeapFree,(PPDMDEVINS pDevIns, void *pv)); … … 2091 2088 * 2092 2089 * @returns rc. 2093 * @param pDevIns Device instance.2094 * @param rc VBox status code.2095 * @param RT_SRC_POS_DECL Use RT_SRC_POS.2096 * @param pszFormat Error message format string.2097 * @param ... Error message arguments.2090 * @param pDevIns Device instance. 2091 * @param rc VBox status code. 2092 * @param RT_SRC_POS_DECL Use RT_SRC_POS. 2093 * @param pszFormat Error message format string. 2094 * @param ... Error message arguments. 2098 2095 */ 2099 2096 DECLR3CALLBACKMEMBER(int, pfnVMSetError,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)); … … 2103 2100 * 2104 2101 * @returns rc. 2105 * @param pDevIns Device instance.2106 * @param rc VBox status code.2107 * @param RT_SRC_POS_DECL Use RT_SRC_POS.2108 * @param pszFormat Error message format string.2109 * @param va Error message arguments.2102 * @param pDevIns Device instance. 2103 * @param rc VBox status code. 2104 * @param RT_SRC_POS_DECL Use RT_SRC_POS. 2105 * @param pszFormat Error message format string. 2106 * @param va Error message arguments. 2110 2107 */ 2111 2108 DECLR3CALLBACKMEMBER(int, pfnVMSetErrorV,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va)); … … 2115 2112 * 2116 2113 * @returns VBox status code. 2117 * @param pDevIns Device instance.2118 * @param fFatal Whether it is a fatal error or not.2119 * @param pszErrorID Error ID string.2120 * @param pszFormat Error message format string.2121 * @param ... Error message arguments.2114 * @param pDevIns Device instance. 2115 * @param fFatal Whether it is a fatal error or not. 2116 * @param pszErrorID Error ID string. 2117 * @param pszFormat Error message format string. 2118 * @param ... Error message arguments. 2122 2119 */ 2123 2120 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, ...)); … … 2127 2124 * 2128 2125 * @returns VBox status code. 2129 * @param pDevIns Device instance.2130 * @param fFatal Whether it is a fatal error or not.2131 * @param pszErrorID Error ID string.2132 * @param pszFormat Error message format string.2133 * @param va Error message arguments.2126 * @param pDevIns Device instance. 2127 * @param fFatal Whether it is a fatal error or not. 2128 * @param pszErrorID Error ID string. 2129 * @param pszFormat Error message format string. 2130 * @param va Error message arguments. 2134 2131 */ 2135 2132 DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, bool fFatal, const char *pszErrorID, const char *pszFormat, va_list va)); … … 2140 2137 * @returns True if correct. 2141 2138 * @returns False if wrong. 2142 * @param pDevIns Device instance.2143 * @param pszFile Filename of the assertion location.2144 * @param iLine The linenumber of the assertion location.2145 * @param pszFunction Function of the assertion location.2139 * @param pDevIns Device instance. 2140 * @param pszFile Filename of the assertion location. 2141 * @param iLine The linenumber of the assertion location. 2142 * @param pszFunction Function of the assertion location. 2146 2143 */ 2147 2144 DECLR3CALLBACKMEMBER(bool, pfnAssertEMT,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction)); … … 2152 2149 * @returns True if correct. 2153 2150 * @returns False if wrong. 2154 * @param pDevIns Device instance.2155 * @param pszFile Filename of the assertion location.2156 * @param iLine The linenumber of the assertion location.2157 * @param pszFunction Function of the assertion location.2151 * @param pDevIns Device instance. 2152 * @param pszFile Filename of the assertion location. 2153 * @param iLine The linenumber of the assertion location. 2154 * @param pszFunction Function of the assertion location. 2158 2155 */ 2159 2156 DECLR3CALLBACKMEMBER(bool, pfnAssertOther,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction)); … … 2166 2163 * 2167 2164 * @returns VBox status code which must be passed up to the VMM. 2168 * @param pDevIns Device instance.2169 * @param pszFile Filename of the assertion location.2170 * @param iLine The linenumber of the assertion location.2171 * @param pszFunction Function of the assertion location.2172 * @param pszFormat Message. (optional)2173 * @param args Message parameters.2165 * @param pDevIns Device instance. 2166 * @param pszFile Filename of the assertion location. 2167 * @param iLine The linenumber of the assertion location. 2168 * @param pszFunction Function of the assertion location. 2169 * @param pszFormat Message. (optional) 2170 * @param args Message parameters. 2174 2171 */ 2175 2172 DECLR3CALLBACKMEMBER(int, pfnDBGFStopV,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction, const char *pszFormat, va_list args)); … … 2179 2176 * 2180 2177 * @returns VBox status code. 2181 * @param pDevIns Device instance. 2182 * @param pszName The identifier of the info. 2183 * @param pszDesc The description of the info and any arguments the handler may take. 2184 * @param pfnHandler The handler function to be called to display the info. 2178 * @param pDevIns Device instance. 2179 * @param pszName The identifier of the info. 2180 * @param pszDesc The description of the info and any arguments 2181 * the handler may take. 2182 * @param pfnHandler The handler function to be called to display the 2183 * info. 2185 2184 */ 2186 2185 DECLR3CALLBACKMEMBER(int, pfnDBGFInfoRegister,(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler)); … … 2189 2188 * Registers a statistics sample if statistics are enabled. 2190 2189 * 2191 * @param pDevIns Device instance of the DMA. 2192 * @param pvSample Pointer to the sample. 2193 * @param enmType Sample type. This indicates what pvSample is pointing at. 2194 * @param pszName Sample name. The name is on this form "/<component>/<sample>". 2195 * Further nesting is possible. 2196 * @param enmUnit Sample unit. 2197 * @param pszDesc Sample description. 2190 * @param pDevIns Device instance of the DMA. 2191 * @param pvSample Pointer to the sample. 2192 * @param enmType Sample type. This indicates what pvSample is 2193 * pointing at. 2194 * @param pszName Sample name. The name is on this form 2195 * "/<component>/<sample>". Further nesting is 2196 * possible. 2197 * @param enmUnit Sample unit. 2198 * @param pszDesc Sample description. 2198 2199 */ 2199 2200 DECLR3CALLBACKMEMBER(void, pfnSTAMRegister,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc)); … … 2204 2205 * 2205 2206 * @returns VBox status. 2206 * @param pDevIns Device instance of the DMA. 2207 * @param pvSample Pointer to the sample. 2208 * @param enmType Sample type. This indicates what pvSample is pointing at. 2209 * @param enmVisibility Visibility type specifying whether unused statistics should be visible or not. 2210 * @param enmUnit Sample unit. 2211 * @param pszDesc Sample description. 2212 * @param pszName The sample name format string. 2213 * @param ... Arguments to the format string. 2207 * @param pDevIns Device instance of the DMA. 2208 * @param pvSample Pointer to the sample. 2209 * @param enmType Sample type. This indicates what pvSample is 2210 * pointing at. 2211 * @param enmVisibility Visibility type specifying whether unused 2212 * statistics should be visible or not. 2213 * @param enmUnit Sample unit. 2214 * @param pszDesc Sample description. 2215 * @param pszName The sample name format string. 2216 * @param ... Arguments to the format string. 2214 2217 */ 2215 2218 DECLR3CALLBACKMEMBER(void, pfnSTAMRegisterF,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, … … 2221 2224 * 2222 2225 * @returns VBox status. 2223 * @param pDevIns Device instance of the DMA. 2224 * @param pvSample Pointer to the sample. 2225 * @param enmType Sample type. This indicates what pvSample is pointing at. 2226 * @param enmVisibility Visibility type specifying whether unused statistics should be visible or not. 2227 * @param enmUnit Sample unit. 2228 * @param pszDesc Sample description. 2229 * @param pszName The sample name format string. 2230 * @param args Arguments to the format string. 2226 * @param pDevIns Device instance of the DMA. 2227 * @param pvSample Pointer to the sample. 2228 * @param enmType Sample type. This indicates what pvSample is 2229 * pointing at. 2230 * @param enmVisibility Visibility type specifying whether unused 2231 * statistics should be visible or not. 2232 * @param enmUnit Sample unit. 2233 * @param pszDesc Sample description. 2234 * @param pszName The sample name format string. 2235 * @param args Arguments to the format string. 2231 2236 */ 2232 2237 DECLR3CALLBACKMEMBER(void, pfnSTAMRegisterV,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, … … 2237 2242 * 2238 2243 * @returns VBox status code. 2239 * @param pDevIns Device instance. 2240 * @param pRtcReg Pointer to a RTC registration structure. 2241 * @param ppRtcHlp Where to store the pointer to the helper functions. 2244 * @param pDevIns Device instance. 2245 * @param pRtcReg Pointer to a RTC registration structure. 2246 * @param ppRtcHlp Where to store the pointer to the helper 2247 * functions. 2242 2248 */ 2243 2249 DECLR3CALLBACKMEMBER(int, pfnRTCRegister,(PPDMDEVINS pDevIns, PCPDMRTCREG pRtcReg, PCPDMRTCHLP *ppRtcHlp)); … … 2267 2273 * 2268 2274 * @returns VBox status code. 2269 * @param pDevIns Device instance. 2270 * @param pCritSect Pointer to the critical section. 2271 * @param pszName The name of the critical section (for statistics). 2275 * @param pDevIns Device instance. 2276 * @param pCritSect Pointer to the critical section. 2277 * @param pszName The name of the critical section (for 2278 * statistics). 2272 2279 */ 2273 2280 DECLR3CALLBACKMEMBER(int, pfnCritSectInit,(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName)); … … 2277 2284 * 2278 2285 * @returns pTime. 2279 * @param pDevIns Device instance.2280 * @param pTime Where to store the time.2286 * @param pDevIns Device instance. 2287 * @param pTime Where to store the time. 2281 2288 */ 2282 2289 DECLR3CALLBACKMEMBER(PRTTIMESPEC, pfnUTCNow,(PPDMDEVINS pDevIns, PRTTIMESPEC pTime)); … … 2289 2296 * 2290 2297 * @returns VBox status code. 2291 * @param pDevIns The device instance.2292 * @param ppThread Where to store the thread 'handle'.2293 * @param pvUser The user argument to the thread function.2294 * @param pfnThread The thread function.2295 * @param pfnWakeup The wakup callback. This is called on the EMT thread when2296 * a state change is pending.2297 * @param cbStack See RTThreadCreate.2298 * @param enmType See RTThreadCreate.2299 * @param pszName See RTThreadCreate.2298 * @param pDevIns The device instance. 2299 * @param ppThread Where to store the thread 'handle'. 2300 * @param pvUser The user argument to the thread function. 2301 * @param pfnThread The thread function. 2302 * @param pfnWakeup The wakup callback. This is called on the EMT 2303 * thread when a state change is pending. 2304 * @param cbStack See RTThreadCreate. 2305 * @param enmType See RTThreadCreate. 2306 * @param pszName See RTThreadCreate. 2300 2307 */ 2301 2308 DECLR3CALLBACKMEMBER(int, pfnPDMThreadCreate,(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread, … … 2306 2313 * 2307 2314 * @returns VBox status code. 2308 * @param pDevIns Device instance. 2309 * @param GCPtr Guest virtual address. 2310 * @param pGCPhys Where to store the GC physical address corresponding to GCPtr. 2315 * @param pDevIns Device instance. 2316 * @param GCPtr Guest virtual address. 2317 * @param pGCPhys Where to store the GC physical address 2318 * corresponding to GCPtr. 2311 2319 * @thread The emulation thread. 2312 2320 * @remark Careful with page boundraries. … … 2318 2326 * 2319 2327 * @returns VM state. 2320 * @param pDevIns The device instance.2328 * @param pDevIns The device instance. 2321 2329 * @thread Any thread (just keep in mind that it's volatile info). 2322 2330 */ … … 2346 2354 * 2347 2355 * @returns VM Handle. 2348 * @param pDevIns Device instance.2356 * @param pDevIns Device instance. 2349 2357 */ 2350 2358 DECLR3CALLBACKMEMBER(PVM, pfnGetVM,(PPDMDEVINS pDevIns)); … … 2354 2362 * 2355 2363 * @returns VBox status code. 2356 * @param pDevIns Device instance. 2357 * @param pPciBusReg Pointer to PCI bus registration structure. 2358 * @param ppPciHlpR3 Where to store the pointer to the PCI Bus helpers. 2364 * @param pDevIns Device instance. 2365 * @param pPciBusReg Pointer to PCI bus registration structure. 2366 * @param ppPciHlpR3 Where to store the pointer to the PCI Bus 2367 * helpers. 2359 2368 */ 2360 2369 DECLR3CALLBACKMEMBER(int, pfnPCIBusRegister,(PPDMDEVINS pDevIns, PPDMPCIBUSREG pPciBusReg, PCPDMPCIHLPR3 *ppPciHlpR3)); … … 2364 2373 * 2365 2374 * @returns VBox status code. 2366 * @param pDevIns Device instance. 2367 * @param pPicReg Pointer to a PIC registration structure. 2368 * @param ppPicHlpR3 Where to store the pointer to the PIC HC helpers. 2375 * @param pDevIns Device instance. 2376 * @param pPicReg Pointer to a PIC registration structure. 2377 * @param ppPicHlpR3 Where to store the pointer to the PIC HC 2378 * helpers. 2369 2379 */ 2370 2380 DECLR3CALLBACKMEMBER(int, pfnPICRegister,(PPDMDEVINS pDevIns, PPDMPICREG pPicReg, PCPDMPICHLPR3 *ppPicHlpR3)); … … 2374 2384 * 2375 2385 * @returns VBox status code. 2376 * @param pDevIns Device instance.2377 * @param pApicReg Pointer to a APIC registration structure.2378 * @param ppApicHlpR3 Where to store the pointer to the APIC helpers.2386 * @param pDevIns Device instance. 2387 * @param pApicReg Pointer to a APIC registration structure. 2388 * @param ppApicHlpR3 Where to store the pointer to the APIC helpers. 2379 2389 */ 2380 2390 DECLR3CALLBACKMEMBER(int, pfnAPICRegister,(PPDMDEVINS pDevIns, PPDMAPICREG pApicReg, PCPDMAPICHLPR3 *ppApicHlpR3)); … … 2384 2394 * 2385 2395 * @returns VBox status code. 2386 * @param pDevIns Device instance. 2387 * @param pIoApicReg Pointer to a I/O APIC registration structure. 2388 * @param ppIoApicHlpR3 Where to store the pointer to the IOAPIC helpers. 2396 * @param pDevIns Device instance. 2397 * @param pIoApicReg Pointer to a I/O APIC registration structure. 2398 * @param ppIoApicHlpR3 Where to store the pointer to the IOAPIC 2399 * helpers. 2389 2400 */ 2390 2401 DECLR3CALLBACKMEMBER(int, pfnIOAPICRegister,(PPDMDEVINS pDevIns, PPDMIOAPICREG pIoApicReg, PCPDMIOAPICHLPR3 *ppIoApicHlpR3)); … … 2394 2405 * 2395 2406 * @returns VBox status code. 2396 * @param pDevIns Device instance.2397 * @param pDmacReg Pointer to a DMAC registration structure.2398 * @param ppDmacHlp Where to store the pointer to the DMA helpers.2407 * @param pDevIns Device instance. 2408 * @param pDmacReg Pointer to a DMAC registration structure. 2409 * @param ppDmacHlp Where to store the pointer to the DMA helpers. 2399 2410 */ 2400 2411 DECLR3CALLBACKMEMBER(int, pfnDMACRegister,(PPDMDEVINS pDevIns, PPDMDMACREG pDmacReg, PCPDMDMACHLP *ppDmacHlp)); … … 2402 2413 /** 2403 2414 * Read physical memory. 2404 * 2415 * 2405 2416 * @returns VINF_SUCCESS (for now). 2406 * @param pDevIns Device instance.2407 * @param GCPhys Physical address start reading from.2408 * @param pvBuf Where to put the read bits.2409 * @param cbRead How many bytes to read.2417 * @param pDevIns Device instance. 2418 * @param GCPhys Physical address start reading from. 2419 * @param pvBuf Where to put the read bits. 2420 * @param cbRead How many bytes to read. 2410 2421 * @thread Any thread, but the call may involve the emulation thread. 2411 2422 */ … … 2416 2427 * 2417 2428 * @returns VINF_SUCCESS for now, and later maybe VERR_EM_MEMORY. 2418 * @param pDevIns Device instance.2419 * @param GCPhys Physical address to write to.2420 * @param pvBuf What to write.2421 * @param cbWrite How many bytes to write.2429 * @param pDevIns Device instance. 2430 * @param GCPhys Physical address to write to. 2431 * @param pvBuf What to write. 2432 * @param cbWrite How many bytes to write. 2422 2433 * @thread Any thread, but the call may involve the emulation thread. 2423 2434 */ … … 2428 2439 * 2429 2440 * When you're done with the page, call pfnPhysReleasePageMappingLock() ASAP to 2430 * release it. 2431 * 2432 * This API will assume your intention is to write to the page, and will 2433 * therefore replace shared and zero pages. If you do not intend to modify the 2434 * page, use the pfnPhysGCPhys2CCPtrReadOnly() API. 2441 * release it. 2442 * 2443 * This API will assume your intention is to write to the page, and will 2444 * therefore replace shared and zero pages. If you do not intend to modify the 2445 * page, use the pfnPhysGCPhys2CCPtrReadOnly() API. 2435 2446 * 2436 2447 * @returns VBox status code. 2437 2448 * @retval VINF_SUCCESS on success. 2438 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 2449 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 2439 2450 * backing or if the page has any active access handlers. The caller 2440 2451 * must fall back on using PGMR3PhysWriteExternal. 2441 2452 * @retval VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS if it's not a valid physical address. 2442 2453 * 2443 * @param pVM The VM handle. 2444 * @param GCPhys The guest physical address of the page that should be mapped. 2445 * @param fFlags Flags reserved for future use, MBZ. 2446 * @param ppv Where to store the address corresponding to GCPhys. 2447 * @param pLock Where to store the lock information that 2448 * pfnPhysReleasePageMappingLock needs. 2454 * @param pVM The VM handle. 2455 * @param GCPhys The guest physical address of the page that 2456 * should be mapped. 2457 * @param fFlags Flags reserved for future use, MBZ. 2458 * @param ppv Where to store the address corresponding to 2459 * GCPhys. 2460 * @param pLock Where to store the lock information that 2461 * pfnPhysReleasePageMappingLock needs. 2449 2462 * 2450 2463 * @remark Avoid calling this API from within critical sections (other than the … … 2457 2470 /** 2458 2471 * Requests the mapping of a guest page into ring-3, external threads. 2459 * 2472 * 2460 2473 * When you're done with the page, call pfnPhysReleasePageMappingLock() ASAP to 2461 2474 * release it. … … 2463 2476 * @returns VBox status code. 2464 2477 * @retval VINF_SUCCESS on success. 2465 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 2478 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 2466 2479 * backing or if the page as an active ALL access handler. The caller 2467 2480 * must fall back on using PGMPhysRead. 2468 2481 * @retval VERR_PGM_INVALID_GC_PHYSICAL_ADDRESS if it's not a valid physical address. 2469 2482 * 2470 * @param pDevIns Device instance. 2471 * @param GCPhys The guest physical address of the page that should be mapped. 2472 * @param fFlags Flags reserved for future use, MBZ. 2473 * @param ppv Where to store the address corresponding to GCPhys. 2474 * @param pLock Where to store the lock information that 2475 * pfnPhysReleasePageMappingLock needs. 2476 * 2477 * @remark Avoid calling this API from within critical sections. 2483 * @param pDevIns Device instance. 2484 * @param GCPhys The guest physical address of the page that 2485 * should be mapped. 2486 * @param fFlags Flags reserved for future use, MBZ. 2487 * @param ppv Where to store the address corresponding to 2488 * GCPhys. 2489 * @param pLock Where to store the lock information that 2490 * pfnPhysReleasePageMappingLock needs. 2491 * 2492 * @remark Avoid calling this API from within critical sections. 2478 2493 * @thread Any. 2479 2494 */ … … 2483 2498 * Release the mapping of a guest page. 2484 2499 * 2485 * This is the counter part of pfnPhysGCPhys2CCPtr and 2486 * pfnPhysGCPhys2CCPtrReadOnly. 2487 * 2488 * @param pDevIns Device instance. 2489 * @param pLock The lock structure initialized by the mapping function. 2500 * This is the counter part of pfnPhysGCPhys2CCPtr and 2501 * pfnPhysGCPhys2CCPtrReadOnly. 2502 * 2503 * @param pDevIns Device instance. 2504 * @param pLock The lock structure initialized by the mapping 2505 * function. 2490 2506 */ 2491 2507 DECLR3CALLBACKMEMBER(void, pfnPhysReleasePageMappingLock,(PPDMDEVINS pDevIns, PPGMPAGEMAPLOCK pLock)); … … 2494 2510 * Read guest physical memory by virtual address. 2495 2511 * 2496 * @param pDevIns Device instance.2497 * @param pvDst Where to put the read bits.2498 * @param GCVirtSrc Guest virtual address to start reading from.2499 * @param cb How many bytes to read.2512 * @param pDevIns Device instance. 2513 * @param pvDst Where to put the read bits. 2514 * @param GCVirtSrc Guest virtual address to start reading from. 2515 * @param cb How many bytes to read. 2500 2516 * @thread The emulation thread. 2501 2517 */ … … 2505 2521 * Write to guest physical memory by virtual address. 2506 2522 * 2507 * @param pDevIns Device instance.2508 * @param GCVirtDst Guest virtual address to write to.2509 * @param pvSrc What to write.2510 * @param cb How many bytes to write.2523 * @param pDevIns Device instance. 2524 * @param GCVirtDst Guest virtual address to write to. 2525 * @param pvSrc What to write. 2526 * @param cb How many bytes to write. 2511 2527 * @thread The emulation thread. 2512 2528 */ … … 2518 2534 * @returns true if A20 is enabled. 2519 2535 * @returns false if A20 is disabled. 2520 * @param pDevIns Device instance.2536 * @param pDevIns Device instance. 2521 2537 * @thread The emulation thread. 2522 2538 */ … … 2526 2542 * Enables or disables the Gate A20. 2527 2543 * 2528 * @param pDevIns Device instance. 2529 * @param fEnable Set this flag to enable the Gate A20; clear it to disable. 2544 * @param pDevIns Device instance. 2545 * @param fEnable Set this flag to enable the Gate A20; clear it 2546 * to disable. 2530 2547 * @thread The emulation thread. 2531 2548 */ … … 2536 2553 * 2537 2554 * @returns The appropriate VBox status code to pass around on reset. 2538 * @param pDevIns Device instance.2555 * @param pDevIns Device instance. 2539 2556 * @thread The emulation thread. 2540 2557 */ … … 2545 2562 * 2546 2563 * @returns The appropriate VBox status code to pass around on suspend. 2547 * @param pDevIns Device instance.2564 * @param pDevIns Device instance. 2548 2565 * @thread The emulation thread. 2549 2566 */ … … 2554 2571 * 2555 2572 * @returns The appropriate VBox status code to pass around on power off. 2556 * @param pDevIns Device instance.2573 * @param pDevIns Device instance. 2557 2574 * @thread The emulation thread. 2558 2575 */ … … 2563 2580 * 2564 2581 * @returns VBox status code 2565 * @param pDevIns Device instance.2582 * @param pDevIns Device instance. 2566 2583 */ 2567 2584 DECLR3CALLBACKMEMBER(int , pfnLockVM,(PPDMDEVINS pDevIns)); … … 2571 2588 * 2572 2589 * @returns VBox status code 2573 * @param pDevIns Device instance.2590 * @param pDevIns Device instance. 2574 2591 */ 2575 2592 DECLR3CALLBACKMEMBER(int, pfnUnlockVM,(PPDMDEVINS pDevIns)); … … 2579 2596 * 2580 2597 * @returns boolean 2581 * @param pDevIns Device instance.2582 * @param pszFile Filename of the assertion location.2583 * @param iLine Linenumber of the assertion location.2584 * @param pszFunction Function of the assertion location.2598 * @param pDevIns Device instance. 2599 * @param pszFile Filename of the assertion location. 2600 * @param iLine Linenumber of the assertion location. 2601 * @param pszFunction Function of the assertion location. 2585 2602 */ 2586 2603 DECLR3CALLBACKMEMBER(bool, pfnAssertVMLock,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction)); … … 2602 2619 * 2603 2620 * @returns VBox status code. 2604 * @param pDevIns Device instance. 2605 * @param uChannel Channel number. 2606 * @param pvBuffer Pointer to target buffer. 2607 * @param off DMA position. 2608 * @param cbBlock Block size. 2609 * @param pcbRead Where to store the number of bytes which was read. optional. 2621 * @param pDevIns Device instance. 2622 * @param uChannel Channel number. 2623 * @param pvBuffer Pointer to target buffer. 2624 * @param off DMA position. 2625 * @param cbBlock Block size. 2626 * @param pcbRead Where to store the number of bytes which was 2627 * read. optional. 2610 2628 * @thread EMT 2611 2629 */ … … 2616 2634 * 2617 2635 * @returns VBox status code. 2618 * @param pDevIns Device instance. 2619 * @param uChannel Channel number. 2620 * @param pvBuffer Memory to write. 2621 * @param off DMA position. 2622 * @param cbBlock Block size. 2623 * @param pcbWritten Where to store the number of bytes which was written. optional. 2636 * @param pDevIns Device instance. 2637 * @param uChannel Channel number. 2638 * @param pvBuffer Memory to write. 2639 * @param off DMA position. 2640 * @param cbBlock Block size. 2641 * @param pcbWritten Where to store the number of bytes which was 2642 * written. optional. 2624 2643 * @thread EMT 2625 2644 */ … … 2630 2649 * 2631 2650 * @returns VBox status code. 2632 * @param pDevIns Device instance.2633 * @param uChannel Channel number.2634 * @param uLevel Level of the line.2651 * @param pDevIns Device instance. 2652 * @param uChannel Channel number. 2653 * @param uLevel Level of the line. 2635 2654 * @thread EMT 2636 2655 */ … … 2641 2660 * 2642 2661 * @returns Channel mode. See specs. 2643 * @param pDevIns Device instance.2644 * @param uChannel Channel number.2662 * @param pDevIns Device instance. 2663 * @param uChannel Channel number. 2645 2664 * @thread EMT 2646 2665 */ … … 2650 2669 * Schedule DMA execution. 2651 2670 * 2652 * @param pDevIns Device instance.2671 * @param pDevIns Device instance. 2653 2672 * @thread Any thread. 2654 2673 */ … … 2659 2678 * 2660 2679 * @returns VBox status code. 2661 * @param pDevIns Device instance.2662 * @param iReg The CMOS register index.2663 * @param u8Value The CMOS register value.2680 * @param pDevIns Device instance. 2681 * @param iReg The CMOS register index. 2682 * @param u8Value The CMOS register value. 2664 2683 * @thread EMT 2665 2684 */ … … 2670 2689 * 2671 2690 * @returns VBox status code. 2672 * @param pDevIns Device instance.2673 * @param iReg The CMOS register index.2674 * @param pu8Value Where to store the CMOS register value.2691 * @param pDevIns Device instance. 2692 * @param iReg The CMOS register index. 2693 * @param pu8Value Where to store the CMOS register value. 2675 2694 * @thread EMT 2676 2695 */ … … 2680 2699 * Get CPUID. 2681 2700 * 2682 * @param pDevIns Device instance.2683 * @param iLeaf The CPUID leaf to get.2684 * @param pEax Where to store the EAX value.2685 * @param pEbx Where to store the EBX value.2686 * @param pEcx Where to store the ECX value.2687 * @param pEdx Where to store the EDX value.2701 * @param pDevIns Device instance. 2702 * @param iLeaf The CPUID leaf to get. 2703 * @param pEax Where to store the EAX value. 2704 * @param pEbx Where to store the EBX value. 2705 * @param pEcx Where to store the ECX value. 2706 * @param pEdx Where to store the EDX value. 2688 2707 */ 2689 2708 DECLR3CALLBACKMEMBER(void, pfnGetCpuId,(PPDMDEVINS pDevIns, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)); … … 2695 2714 * change the protection of shadowed ROM code after init and on reset. 2696 2715 * 2697 * @param pDevIns Device instance.2698 * @param GCPhysStart Where the mapping starts.2699 * @param cbRange The size of the mapping.2700 * @param enmProt The new protection type.2716 * @param pDevIns Device instance. 2717 * @param GCPhysStart Where the mapping starts. 2718 * @param cbRange The size of the mapping. 2719 * @param enmProt The new protection type. 2701 2720 */ 2702 2721 DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)); … … 2710 2729 * 2711 2730 * @returns VBox status. 2712 * @param pDevIns The device instance. 2713 * @param iRegion The region number. Use the PCI region number as 2714 * this must be known to the PCI bus device too. If it's not associated 2715 * with the PCI device, then any number up to UINT8_MAX is fine. 2716 * @param cb The size (in bytes) of the region. 2717 * @param fFlags Reserved for future use, must be zero. 2718 * @param ppv Where to store the address of the ring-3 mapping of the memory. 2719 * @param pszDesc Pointer to description string. This must not be freed. 2731 * @param pDevIns The device instance. 2732 * @param iRegion The region number. Use the PCI region number as 2733 * this must be known to the PCI bus device too. If 2734 * it's not associated with the PCI device, then 2735 * any number up to UINT8_MAX is fine. 2736 * @param cb The size (in bytes) of the region. 2737 * @param fFlags Reserved for future use, must be zero. 2738 * @param ppv Where to store the address of the ring-3 mapping 2739 * of the memory. 2740 * @param pszDesc Pointer to description string. This must not be 2741 * freed. 2720 2742 * @thread EMT. 2721 2743 */ … … 2729 2751 * 2730 2752 * @returns VBox status code. 2731 * @param pDevIns The device instance.2732 * @param iRegion The region number used during registration.2753 * @param pDevIns The device instance. 2754 * @param iRegion The region number used during registration. 2733 2755 * @thread EMT. 2734 2756 */ … … 2746 2768 * 2747 2769 * @returns VBox status code. 2748 * @param pDevIns The device instance.2749 * @param iRegion The region number used during registration.2750 * @param GCPhys The physical address to map it at.2770 * @param pDevIns The device instance. 2771 * @param iRegion The region number used during registration. 2772 * @param GCPhys The physical address to map it at. 2751 2773 * @thread EMT. 2752 2774 */ … … 2757 2779 * 2758 2780 * @returns VBox status code. 2759 * @param pDevIns The device instance.2760 * @param iRegion The region number used during registration.2761 * @param GCPhys The physical address it's currently mapped at.2781 * @param pDevIns The device instance. 2782 * @param iRegion The region number used during registration. 2783 * @param GCPhys The physical address it's currently mapped at. 2762 2784 * @thread EMT. 2763 2785 */ … … 2771 2793 * 2772 2794 * @return VBox status code. 2773 * @param pDevIns The device owning the MMIO2 memory. 2774 * @param iRegion The region. 2775 * @param off The offset into the region. Will be rounded down to closest page boundrary. 2776 * @param cb The number of bytes to map. Will be rounded up to the closest page boundrary. 2777 * @param pszDesc Mapping description. 2778 * @param pRCPtr Where to store the RC address. 2795 * @param pDevIns The device owning the MMIO2 memory. 2796 * @param iRegion The region. 2797 * @param off The offset into the region. Will be rounded down 2798 * to closest page boundrary. 2799 * @param cb The number of bytes to map. Will be rounded up 2800 * to the closest page boundrary. 2801 * @param pszDesc Mapping description. 2802 * @param pRCPtr Where to store the RC address. 2779 2803 */ 2780 2804 DECLR3CALLBACKMEMBER(int, pfnMMHyperMapMMIO2,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, … … 2788 2812 * 2789 2813 * @return VBox status code. 2790 * @param pDevIns The device owning the MMIO2 memory. 2791 * @param iRegion The region. 2792 * @param off The offset into the region. Must be page aligned. 2793 * @param cb The number of bytes to map. Must be page aligned. 2794 * @param pszDesc Mapping description. 2795 * @param pR0Ptr Where to store the R0 address. 2814 * @param pDevIns The device owning the MMIO2 memory. 2815 * @param iRegion The region. 2816 * @param off The offset into the region. Must be page 2817 * aligned. 2818 * @param cb The number of bytes to map. Must be page 2819 * aligned. 2820 * @param pszDesc Mapping description. 2821 * @param pR0Ptr Where to store the R0 address. 2796 2822 */ 2797 2823 DECLR3CALLBACKMEMBER(int, pfnMMIO2MapKernel,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb, … … 2802 2828 * 2803 2829 * @returns VBox status code. 2804 * @param pDevIns The device instance.2805 * @param GCPhys The physical address.2806 * @param pvHeap Ring 3 heap pointer.2807 * @param cbSize Size of the heap.2830 * @param pDevIns The device instance. 2831 * @param GCPhys The physical address. 2832 * @param pvHeap Ring 3 heap pointer. 2833 * @param cbSize Size of the heap. 2808 2834 * @thread EMT. 2809 2835 */ … … 2814 2840 * 2815 2841 * @returns VBox status code. 2816 * @param pDevIns The device instance.2817 * @param GCPhys The physical address.2842 * @param pDevIns The device instance. 2843 * @param GCPhys The physical address. 2818 2844 * @thread EMT. 2819 2845 */ … … 3329 3355 * @copydoc PDMDEVHLPR3::pfnROMRegister 3330 3356 */ 3331 DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc)3332 { 3333 return pDevIns->pDevHlpR3->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, f Shadow, pszDesc);3357 DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, uint32_t fFlags, const char *pszDesc) 3358 { 3359 return pDevIns->pDevHlpR3->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fFlags, pszDesc); 3334 3360 } 3335 3361 /** -
trunk/include/VBox/pgm.h
r18101 r18143 496 496 * @{ */ 497 497 /** Inidicates that ROM shadowing should be enabled. */ 498 #define PGMPHYS_ROM_FLAG _SHADOWEDRT_BIT_32(0)498 #define PGMPHYS_ROM_FLAGS_SHADOWED RT_BIT_32(0) 499 499 /** Indicates that what pvBinary points to won't go away 500 500 * and can be used for strictness checks. */ 501 #define PGMPHYS_ROM_FLAG _PERMANENT_BINARYRT_BIT_32(1)501 #define PGMPHYS_ROM_FLAGS_PERMANENT_BINARY RT_BIT_32(1) 502 502 /** @} */ 503 503 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r18133 r18143 5780 5780 AssertReleaseMsg(RT_ALIGN_Z(g_cbVgaBiosBinary, PAGE_SIZE) == g_cbVgaBiosBinary, ("g_cbVgaBiosBinary=%#x\n", g_cbVgaBiosBinary)); 5781 5781 rc = PDMDevHlpROMRegister(pDevIns, 0x000c0000, g_cbVgaBiosBinary, &g_abVgaBiosBinary[0], 5782 false /* fShadow */, "VGA BIOS");5782 PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "VGA BIOS"); 5783 5783 if (RT_FAILURE(rc)) 5784 5784 return rc; -
trunk/src/VBox/Devices/PC/DevACPI.cpp
r17607 r18143 25 25 #define LOG_GROUP LOG_GROUP_DEV_ACPI 26 26 #include <VBox/pdmdev.h> 27 #include <VBox/pgm.h> 27 28 #include <VBox/log.h> 28 29 #include <VBox/param.h> … … 1915 1916 return rc; 1916 1917 1917 rc = PDMDevHlpROMRegister(pDevIns, rsdp_addr, 0x1000, s->au8RSDPPage, false /* fShadow */, "ACPI RSDP"); 1918 rc = PDMDevHlpROMRegister(pDevIns, rsdp_addr, 0x1000, s->au8RSDPPage, 1919 PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "ACPI RSDP"); 1918 1920 if (RT_FAILURE(rc)) 1919 1921 return rc; -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r17597 r18143 26 26 #include <VBox/pdmdev.h> 27 27 #include <VBox/mm.h> 28 #include <VBox/pgm.h> 28 29 29 30 #include <VBox/log.h> … … 165 166 /** The name of the LAN boot ROM file. */ 166 167 char *pszLanBootFile; 168 /** The size of the LAN boot ROM. */ 169 uint64_t cbLanBoot; 167 170 /** The DMI tables. */ 168 171 uint8_t au8DMIPage[0x1000]; … … 1221 1224 if (pThis->u8IOAPIC) 1222 1225 pcbiosPlantMPStable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus); 1226 1227 #ifdef VBOX_WITH_NEW_PHYS_CODE 1228 /* 1229 * Re-shadow the LAN ROM image and make it RAM/RAM. 1230 * 1231 * This is normally done by the BIOS code, but since we're currently lacking 1232 * the chipset support for this we do it here (and in the constructor). 1233 */ 1234 uint32_t cPages = RT_ALIGN_64(pThis->cbLanBoot, PAGE_SIZE) >> PAGE_SHIFT; 1235 RTGCPHYS GCPhys = VBOX_LANBOOT_SEG << 4; 1236 while (cPages > 0) 1237 { 1238 uint8_t abPage[PAGE_SIZE]; 1239 int rc; 1240 1241 /* Read the (original) ROM page and write it back to the RAM page. */ 1242 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_ROM_WRITE_RAM); 1243 AssertLogRelRC(rc); 1244 1245 rc = PDMDevHlpPhysRead(pDevIns, GCPhys, abPage, PAGE_SIZE); 1246 AssertLogRelRC(rc); 1247 if (RT_FAILURE(rc)) 1248 memset(abPage, 0xcc, sizeof(abPage)); 1249 1250 rc = PDMDevHlpPhysWrite(pDevIns, GCPhys, abPage, PAGE_SIZE); 1251 AssertLogRelRC(rc); 1252 1253 /* Switch to the RAM/RAM mode. */ 1254 rc = PDMDevHlpROMProtectShadow(pDevIns, GCPhys, PAGE_SIZE, PGMROMPROT_READ_RAM_WRITE_RAM); 1255 AssertLogRelRC(rc); 1256 1257 /* Advance */ 1258 GCPhys += PAGE_SIZE; 1259 cPages--; 1260 } 1261 #endif 1223 1262 } 1224 1263 … … 1474 1513 pcbiosPlantMPStable(pDevIns, pThis->au8DMIPage + VBOX_DMI_TABLE_SIZE, pThis->cCpus); 1475 1514 1476 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, _4K, pThis->au8DMIPage, false /* fShadow */, "DMI tables"); 1515 rc = PDMDevHlpROMRegister(pDevIns, VBOX_DMI_TABLE_BASE, _4K, pThis->au8DMIPage, 1516 PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "DMI tables"); 1477 1517 if (RT_FAILURE(rc)) 1478 1518 return rc; … … 1570 1610 1571 1611 /* If we were unable to get the data from file for whatever reason, fall 1572 * back to the built-in ROM image.1573 */1612 back to the built-in ROM image. */ 1613 uint32_t fFlags = 0; 1574 1614 if (pThis->pu8PcBios == NULL) 1575 1615 { 1576 1616 pu8PcBiosBinary = g_abPcBiosBinary; 1577 1617 cbPcBiosBinary = g_cbPcBiosBinary; 1618 fFlags = PGMPHYS_ROM_FLAGS_PERMANENT_BINARY; 1578 1619 } 1579 1620 else … … 1595 1636 cb = RT_MIN(cbPcBiosBinary, 128 * _1K); /* Effectively either 64 or 128K. */ 1596 1637 rc = PDMDevHlpROMRegister(pDevIns, 0x00100000 - cb, cb, &pu8PcBiosBinary[cbPcBiosBinary - cb], 1597 f alse /* fShadow */, "PC BIOS - 0xfffff");1638 fFlags, "PC BIOS - 0xfffff"); 1598 1639 if (RT_FAILURE(rc)) 1599 1640 return rc; 1600 1641 rc = PDMDevHlpROMRegister(pDevIns, (uint32_t)-(int32_t)cbPcBiosBinary, cbPcBiosBinary, pu8PcBiosBinary, 1601 f alse /* fShadow */, "PC BIOS - 0xffffffff");1642 fFlags, "PC BIOS - 0xffffffff"); 1602 1643 if (RT_FAILURE(rc)) 1603 1644 return rc; … … 1608 1649 */ 1609 1650 AssertReleaseMsg(g_cbVmiBiosBinary == _4K, ("cbVmiBiosBinary=%#x\n", g_cbVmiBiosBinary)); 1610 rc = PDMDevHlpROMRegister(pDevIns, VBOX_VMI_BIOS_BASE, g_cbVmiBiosBinary, g_abVmiBiosBinary, false, "VMI BIOS"); 1651 rc = PDMDevHlpROMRegister(pDevIns, VBOX_VMI_BIOS_BASE, g_cbVmiBiosBinary, g_abVmiBiosBinary, 1652 PGMPHYS_ROM_FLAGS_PERMANENT_BINARY, "VMI BIOS"); 1611 1653 if (RT_FAILURE(rc)) 1612 1654 return rc; … … 1721 1763 */ 1722 1764 if (pu8LanBootBinary) 1765 { 1766 pThis->cbLanBoot = cbLanBootBinary; 1767 1723 1768 rc = PDMDevHlpROMRegister(pDevIns, VBOX_LANBOOT_SEG << 4, cbLanBootBinary, pu8LanBootBinary, 1724 true /* fShadow */, "Net Boot ROM"); 1769 PGMPHYS_ROM_FLAGS_SHADOWED, "Net Boot ROM"); 1770 #ifdef VBOX_WITH_NEW_PHYS_CODE 1771 if (RT_SUCCESS(rc)) 1772 { 1773 rc = PDMDevHlpROMProtectShadow(pDevIns, VBOX_LANBOOT_SEG << 4, cbLanBootBinary, PGMROMPROT_READ_RAM_WRITE_RAM); 1774 AssertRCReturn(rc, rc); 1775 rc = PDMDevHlpPhysWrite(pDevIns, VBOX_LANBOOT_SEG << 4, pu8LanBootBinary, cbLanBootBinary); 1776 AssertRCReturn(rc, rc); 1777 } 1778 #endif 1779 } 1725 1780 1726 1781 rc = CFGMR3QueryU8Def(pCfgHandle, "DelayBoot", &pThis->uBootDelay, 0); -
trunk/src/VBox/VMM/PDMDevHlp.cpp
r18101 r18143 336 336 337 337 /** @copydoc PDMDEVHLPR3::pfnROMRegister */ 338 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, bool fShadow, const char *pszDesc)338 static DECLCALLBACK(int) pdmR3DevHlp_ROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, uint32_t fFlags, const char *pszDesc) 339 339 { 340 340 PDMDEV_ASSERT_DEVINS(pDevIns); 341 341 VM_ASSERT_EMT(pDevIns->Internal.s.pVMR3); 342 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvBinary=%p f Shadow=%RTboolpszDesc=%p:{%s}\n",343 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, f Shadow, pszDesc, pszDesc));342 LogFlow(("pdmR3DevHlp_ROMRegister: caller='%s'/%d: GCPhysStart=%RGp cbRange=%#x pvBinary=%p fFlags=%#RX32 pszDesc=%p:{%s}\n", 343 pDevIns->pDevReg->szDeviceName, pDevIns->iInstance, GCPhysStart, cbRange, pvBinary, fFlags, pszDesc, pszDesc)); 344 344 345 345 #ifdef VBOX_WITH_NEW_PHYS_CODE 346 uint32_t fFlags = 0;347 if (fShadow)348 fFlags |= PGMPHYS_ROM_FLAG_SHADOWED;349 /** @todo PGMPHYS_ROM_FLAG_PERMANENT_BINARY */350 346 int rc = PGMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fFlags, pszDesc); 351 347 #else 352 int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, fShadow, pszDesc); 348 int rc = MMR3PhysRomRegister(pDevIns->Internal.s.pVMR3, pDevIns, GCPhysStart, cbRange, pvBinary, 349 !!(fFlags & PGMPHYS_ROM_FLAGS_SHADOWED), pszDesc); 353 350 #endif 354 351 -
trunk/src/VBox/VMM/PGMInternal.h
r18125 r18143 1122 1122 /** Alignment padding ensuring that aPages is sizeof(PGMROMPAGE) aligned. */ 1123 1123 uint32_t au32Alignemnt[HC_ARCH_BITS == 32 ? 7 : 3]; 1124 /** Pointer to the original bits when PGMPHYS_ROM_FLAG _PERMANENT_BINARY was specified.1124 /** Pointer to the original bits when PGMPHYS_ROM_FLAGS_PERMANENT_BINARY was specified. 1125 1125 * This is used for strictness checks. */ 1126 1126 R3PTRTYPE(const void *) pvOriginal; … … 3646 3646 if (!pGuestPDPT) 3647 3647 pGuestPDPT = pgmGstLazyMapPaePDPT(pPGM); 3648 # endif 3648 # endif 3649 3649 # endif 3650 3650 #endif -
trunk/src/VBox/VMM/PGMPhys.cpp
r18101 r18143 347 347 348 348 #ifdef VBOX_WITH_NEW_PHYS_CODE 349 /** 349 /** 350 350 * VMR3ReqCall worker for PGMR3PhysGCPhys2CCPtrExternal to make pages writable. 351 * 351 * 352 352 * @returns see PGMR3PhysGCPhys2CCPtrExternal 353 353 * @param pVM The VM handle. … … 355 355 * @param ppv Where to store the mapping address. 356 356 * @param pLock Where to store the lock. 357 */ 357 */ 358 358 static DECLCALLBACK(int) pgmR3PhysGCPhys2CCPtrDelegated(PVM pVM, PRTGCPHYS pGCPhys, void **ppv, PPGMPAGEMAPLOCK pLock) 359 359 { 360 360 /* 361 * Just hand it to PGMPhysGCPhys2CCPtr and check that it's not a page with 361 * Just hand it to PGMPhysGCPhys2CCPtr and check that it's not a page with 362 362 * an access handler after it succeeds. 363 363 */ … … 392 392 * Requests the mapping of a guest page into ring-3, external threads. 393 393 * 394 * When you're done with the page, call PGMPhysReleasePageMappingLock() ASAP to 395 * release it. 396 * 397 * This API will assume your intention is to write to the page, and will 398 * therefore replace shared and zero pages. If you do not intend to modify the 399 * page, use the PGMR3PhysGCPhys2CCPtrReadOnlyExternal() API. 394 * When you're done with the page, call PGMPhysReleasePageMappingLock() ASAP to 395 * release it. 396 * 397 * This API will assume your intention is to write to the page, and will 398 * therefore replace shared and zero pages. If you do not intend to modify the 399 * page, use the PGMR3PhysGCPhys2CCPtrReadOnlyExternal() API. 400 400 * 401 401 * @returns VBox status code. 402 402 * @retval VINF_SUCCESS on success. 403 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 403 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 404 404 * backing or if the page has any active access handlers. The caller 405 405 * must fall back on using PGMR3PhysWriteExternal. … … 445 445 /* 446 446 * If the page is shared, the zero page, or being write monitored 447 * it must be converted to an page that's writable if possible. 447 * it must be converted to an page that's writable if possible. 448 448 * This has to be done on an EMT. 449 449 */ … … 451 451 { 452 452 pgmUnlock(pVM); 453 453 454 454 PVMREQ pReq = NULL; 455 455 rc = VMR3ReqCall(pVM, VMREQDEST_ANY, &pReq, RT_INDEFINITE_WAIT, … … 496 496 /** 497 497 * Requests the mapping of a guest page into ring-3, external threads. 498 * 498 * 499 499 * When you're done with the page, call PGMPhysReleasePageMappingLock() ASAP to 500 500 * release it. … … 502 502 * @returns VBox status code. 503 503 * @retval VINF_SUCCESS on success. 504 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 504 * @retval VERR_PGM_PHYS_PAGE_RESERVED it it's a valid page but has no physical 505 505 * backing or if the page as an active ALL access handler. The caller 506 506 * must fall back on using PGMPhysRead. … … 538 538 rc = VERR_PGM_PHYS_PAGE_RESERVED; 539 539 #endif 540 else 540 else 541 541 { 542 542 /* … … 1696 1696 * @param pvBinary Pointer to the binary data backing the ROM image. 1697 1697 * This must be exactly \a cbRange in size. 1698 * @param fFlags Mask of flags. PGMPHYS_ROM_FLAG _SHADOWED1699 * and/or PGMPHYS_ROM_FLAG _PERMANENT_BINARY.1698 * @param fFlags Mask of flags. PGMPHYS_ROM_FLAGS_SHADOWED 1699 * and/or PGMPHYS_ROM_FLAGS_PERMANENT_BINARY. 1700 1700 * @param pszDesc Pointer to description string. This must not be freed. 1701 1701 * … … 1720 1720 AssertPtrReturn(pvBinary, VERR_INVALID_PARAMETER); 1721 1721 AssertPtrReturn(pszDesc, VERR_INVALID_POINTER); 1722 AssertReturn(!(fFlags & ~(PGMPHYS_ROM_FLAG _SHADOWED | PGMPHYS_ROM_FLAG_PERMANENT_BINARY)), VERR_INVALID_PARAMETER);1722 AssertReturn(!(fFlags & ~(PGMPHYS_ROM_FLAGS_SHADOWED | PGMPHYS_ROM_FLAGS_PERMANENT_BINARY)), VERR_INVALID_PARAMETER); 1723 1723 VM_ASSERT_STATE_RETURN(pVM, VMSTATE_CREATING, VERR_VM_INVALID_VM_STATE); 1724 1724 … … 1794 1794 */ 1795 1795 uint32_t cExtraBaseCost = fRamExists ? cPages : 0; 1796 if (fFlags & PGMPHYS_ROM_FLAG _SHADOWED)1796 if (fFlags & PGMPHYS_ROM_FLAGS_SHADOWED) 1797 1797 cExtraBaseCost += cPages; 1798 1798 if (cExtraBaseCost) … … 1899 1899 * to PGM atm). 1900 1900 */ 1901 if (fFlags & PGMPHYS_ROM_FLAG _SHADOWED)1901 if (fFlags & PGMPHYS_ROM_FLAGS_SHADOWED) 1902 1902 { 1903 1903 REMR3NotifyPhysRomRegister(pVM, GCPhys, cb, NULL, true /* fShadowed */); 1904 1904 rc = PGMR3HandlerPhysicalRegister(pVM, 1905 fFlags & PGMPHYS_ROM_FLAG _SHADOWED1905 fFlags & PGMPHYS_ROM_FLAGS_SHADOWED 1906 1906 ? PGMPHYSHANDLERTYPE_PHYSICAL_ALL 1907 1907 : PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, … … 1914 1914 { 1915 1915 rc = PGMR3HandlerPhysicalRegister(pVM, 1916 fFlags & PGMPHYS_ROM_FLAG _SHADOWED1916 fFlags & PGMPHYS_ROM_FLAGS_SHADOWED 1917 1917 ? PGMPHYSHANDLERTYPE_PHYSICAL_ALL 1918 1918 : PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, … … 1954 1954 pRomNew->cb = cb; 1955 1955 pRomNew->fFlags = fFlags; 1956 pRomNew->pvOriginal = fFlags & PGMPHYS_ROM_FLAG _PERMANENT_BINARY ? pvBinary : NULL;1956 pRomNew->pvOriginal = fFlags & PGMPHYS_ROM_FLAGS_PERMANENT_BINARY ? pvBinary : NULL; 1957 1957 pRomNew->pszDesc = pszDesc; 1958 1958 … … 2037 2037 Assert(iPage < (pRom->cb >> PAGE_SHIFT)); 2038 2038 PPGMROMPAGE pRomPage = &pRom->aPages[iPage]; 2039 switch (pRomPage->enmProt) 2040 { 2041 /* 2042 * Ignore. 2043 */ 2044 case PGMROMPROT_READ_ROM_WRITE_IGNORE: 2045 case PGMROMPROT_READ_RAM_WRITE_IGNORE: 2046 return VINF_SUCCESS; 2047 2048 /* 2049 * Write to the ram page. 2050 */ 2051 case PGMROMPROT_READ_ROM_WRITE_RAM: 2052 case PGMROMPROT_READ_RAM_WRITE_RAM: /* yes this will get here too, it's *way* simpler that way. */ 2053 { 2054 /* This should be impossible now, pvPhys doesn't work cross page anylonger. */ 2055 Assert(((GCPhys - pRom->GCPhys + cbBuf - 1) >> PAGE_SHIFT) == iPage); 2056 2039 Log5(("pgmR3PhysRomWriteHandler: %d %c %#08RGp %#04zx\n", pRomPage->enmProt, enmAccessType == PGMACCESSTYPE_READ ? 'R' : 'W', GCPhys, cbBuf)); 2040 2041 if (enmAccessType == PGMACCESSTYPE_READ) 2042 { 2043 switch (pRomPage->enmProt) 2044 { 2057 2045 /* 2058 * Take the lock, do lazy allocation, map the page and copy the data. 2059 * 2060 * Note that we have to bypass the mapping TLB since it works on 2061 * guest physical addresses and entering the shadow page would 2062 * kind of screw things up... 2046 * Take the default action. 2063 2047 */ 2064 int rc = pgmLock(pVM); 2065 AssertRC(rc); 2066 2067 if (RT_UNLIKELY(PGM_PAGE_GET_STATE(&pRomPage->Shadow) != PGM_PAGE_STATE_ALLOCATED)) 2048 case PGMROMPROT_READ_ROM_WRITE_IGNORE: 2049 case PGMROMPROT_READ_RAM_WRITE_IGNORE: 2050 case PGMROMPROT_READ_ROM_WRITE_RAM: 2051 case PGMROMPROT_READ_RAM_WRITE_RAM: 2052 return VINF_PGM_HANDLER_DO_DEFAULT; 2053 2054 default: 2055 AssertMsgFailedReturn(("enmProt=%d iPage=%d GCPhys=%RGp\n", 2056 pRom->aPages[iPage].enmProt, iPage, GCPhys), 2057 VERR_INTERNAL_ERROR); 2058 } 2059 } 2060 else 2061 { 2062 Assert(enmAccessType == PGMACCESSTYPE_WRITE); 2063 switch (pRomPage->enmProt) 2064 { 2065 /* 2066 * Ignore writes. 2067 */ 2068 case PGMROMPROT_READ_ROM_WRITE_IGNORE: 2069 case PGMROMPROT_READ_RAM_WRITE_IGNORE: 2070 return VINF_SUCCESS; 2071 2072 /* 2073 * Write to the ram page. 2074 */ 2075 case PGMROMPROT_READ_ROM_WRITE_RAM: 2076 case PGMROMPROT_READ_RAM_WRITE_RAM: /* yes this will get here too, it's *way* simpler that way. */ 2068 2077 { 2069 rc = pgmPhysPageMakeWritable(pVM, &pRomPage->Shadow, GCPhys); 2070 if (RT_FAILURE(rc)) 2078 /* This should be impossible now, pvPhys doesn't work cross page anylonger. */ 2079 Assert(((GCPhys - pRom->GCPhys + cbBuf - 1) >> PAGE_SHIFT) == iPage); 2080 2081 /* 2082 * Take the lock, do lazy allocation, map the page and copy the data. 2083 * 2084 * Note that we have to bypass the mapping TLB since it works on 2085 * guest physical addresses and entering the shadow page would 2086 * kind of screw things up... 2087 */ 2088 int rc = pgmLock(pVM); 2089 AssertRC(rc); 2090 PPGMPAGE pShadowPage = &pRomPage->Shadow; 2091 if (!PGMROMPROT_IS_ROM(pRomPage->enmProt)) 2071 2092 { 2072 p gmUnlock(pVM);2073 return rc;2093 pShadowPage = pgmPhysGetPage(&pVM->pgm.s, GCPhys); 2094 AssertLogRelReturn(pShadowPage, VERR_INTERNAL_ERROR); 2074 2095 } 2075 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* returned */, ("%Rrc\n", rc)); 2096 2097 if (RT_UNLIKELY(PGM_PAGE_GET_STATE(pShadowPage) != PGM_PAGE_STATE_ALLOCATED)) 2098 { 2099 rc = pgmPhysPageMakeWritable(pVM, pShadowPage, GCPhys); 2100 if (RT_FAILURE(rc)) 2101 { 2102 pgmUnlock(pVM); 2103 return rc; 2104 } 2105 AssertMsg(rc == VINF_SUCCESS || rc == VINF_PGM_SYNC_CR3 /* returned */, ("%Rrc\n", rc)); 2106 } 2107 2108 void *pvDstPage; 2109 PPGMPAGEMAP pMapIgnored; 2110 int rc2 = pgmPhysPageMap(pVM, pShadowPage, GCPhys & X86_PTE_PG_MASK, &pMapIgnored, &pvDstPage); 2111 if (RT_SUCCESS(rc2)) 2112 memcpy((uint8_t *)pvDstPage + (GCPhys & PAGE_OFFSET_MASK), pvBuf, cbBuf); 2113 else 2114 rc = rc2; 2115 2116 pgmUnlock(pVM); 2117 return rc; 2076 2118 } 2077 2119 2078 void *pvDstPage; 2079 PPGMPAGEMAP pMapIgnored; 2080 int rc2 = pgmPhysPageMap(pVM, &pRomPage->Shadow, GCPhys & X86_PTE_PG_MASK, &pMapIgnored, &pvDstPage); 2081 if (RT_SUCCESS(rc2)) 2082 memcpy((uint8_t *)pvDstPage + (GCPhys & PAGE_OFFSET_MASK), pvBuf, cbBuf); 2083 else 2084 rc = rc2; 2085 2086 pgmUnlock(pVM); 2087 return rc; 2088 } 2089 2090 default: 2091 AssertMsgFailedReturn(("enmProt=%d iPage=%d GCPhys=%RGp\n", 2092 pRom->aPages[iPage].enmProt, iPage, GCPhys), 2093 VERR_INTERNAL_ERROR); 2120 default: 2121 AssertMsgFailedReturn(("enmProt=%d iPage=%d GCPhys=%RGp\n", 2122 pRom->aPages[iPage].enmProt, iPage, GCPhys), 2123 VERR_INTERNAL_ERROR); 2124 } 2094 2125 } 2095 2126 } … … 2112 2143 const uint32_t cPages = pRom->cb >> PAGE_SHIFT; 2113 2144 2114 if (pRom->fFlags & PGMPHYS_ROM_FLAG _SHADOWED)2145 if (pRom->fFlags & PGMPHYS_ROM_FLAGS_SHADOWED) 2115 2146 { 2116 2147 /* … … 2246 2277 if ( GCPhys <= pRom->GCPhysLast 2247 2278 && GCPhysLast >= pRom->GCPhys 2248 && (pRom->fFlags & PGMPHYS_ROM_FLAG _SHADOWED))2279 && (pRom->fFlags & PGMPHYS_ROM_FLAGS_SHADOWED)) 2249 2280 { 2250 2281 /* … … 2254 2285 uint32_t const cPages = pRom->GCPhysLast <= GCPhysLast 2255 2286 ? pRom->cb >> PAGE_SHIFT 2256 : (GCPhysLast - pRom->GCPhys ) >> PAGE_SHIFT;2287 : (GCPhysLast - pRom->GCPhys + 1) >> PAGE_SHIFT; 2257 2288 for (uint32_t iPage = (GCPhys - pRom->GCPhys) >> PAGE_SHIFT; 2258 2289 iPage < cPages; … … 2279 2310 /** @todo preserve the volatile flags (handlers) when these have been moved out of HCPhys! */ 2280 2311 } 2312 pRomPage->enmProt = enmProt; 2281 2313 } 2282 2314 -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r18125 r18143 115 115 rc = PGMHandlerPhysicalPageTempOff(pVM, pRom->GCPhys, GCPhysFault & X86_PTE_PG_MASK); 116 116 AssertRC(rc); 117 break; /** @todo Must restart the instruction, not use the interpreter! */117 break; /** @todo Must edit the shadow PT and restart the instruction, not use the interpreter! */ 118 118 119 119 case PGMROMPROT_READ_ROM_WRITE_RAM: … … 939 939 * @param ppv Where to store the address corresponding to GCPhys. 940 940 * @param pLock Where to store the lock information that PGMPhysReleasePageMappingLock needs. 941 * 942 * @remarks The caller is responsible for dealing with access handlers. 943 * @todo Add an informational return code for pages with access handlers? 944 * 941 * 942 * @remarks The caller is responsible for dealing with access handlers. 943 * @todo Add an informational return code for pages with access handlers? 944 * 945 945 * @remark Avoid calling this API from within critical sections (other than the 946 946 * PGM one) because of the deadlock risk. External threads may need to … … 1047 1047 * This API should only be used for very short term, as it will consume 1048 1048 * scarse resources (R0 and GC) in the mapping cache. When you're done 1049 * with the page, call PGMPhysReleasePageMappingLock() ASAP to release it. 1050 * 1049 * with the page, call PGMPhysReleasePageMappingLock() ASAP to release it. 1050 * 1051 1051 * @returns VBox status code. 1052 1052 * @retval VINF_SUCCESS on success. … … 1059 1059 * @param pLock Where to store the lock information that PGMPhysReleasePageMappingLock needs. 1060 1060 * 1061 * @remarks The caller is responsible for dealing with access handlers. 1062 * @todo Add an informational return code for pages with access handlers? 1063 * 1061 * @remarks The caller is responsible for dealing with access handlers. 1062 * @todo Add an informational return code for pages with access handlers? 1063 * 1064 1064 * @remark Avoid calling this API from within critical sections (other than 1065 1065 * the PGM one) because of the deadlock risk. … … 1109 1109 if (RT_UNLIKELY(PGM_PAGE_IS_MMIO(pPage))) 1110 1110 rc = VERR_PGM_PHYS_PAGE_RESERVED; 1111 else 1111 else 1112 1112 { 1113 1113 /*
Note:
See TracChangeset
for help on using the changeset viewer.

