Changeset 1590 in vbox for trunk/src/recompiler/new/cpu-all.h
- Timestamp:
- Mar 21, 2007 2:58:53 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 19699
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/new/cpu-all.h
r1589 r1590 181 181 #ifdef VBOX 182 182 183 #if !defined(REMR3PHYSREADWRITE_DEFINED) 184 #define REMR3PHYSREADWRITE_DEFINED 185 /* Header sharing between vbox & qemu is rather ugly. */ 183 void remR3PhysRead(RTGCPHYS SrcGCPhys, void *pvDst, unsigned cb); 184 uint8_t remR3PhysReadU8(RTGCPHYS SrcGCPhys); 185 int8_t remR3PhysReadS8(RTGCPHYS SrcGCPhys); 186 uint16_t remR3PhysReadU16(RTGCPHYS SrcGCPhys); 187 int16_t remR3PhysReadS16(RTGCPHYS SrcGCPhys); 188 uint32_t remR3PhysReadU32(RTGCPHYS SrcGCPhys); 189 int32_t remR3PhysReadS32(RTGCPHYS SrcGCPhys); 190 uint64_t remR3PhysReadU64(RTGCPHYS SrcGCPhys); 191 int64_t remR3PhysReadS64(RTGCPHYS SrcGCPhys); 192 void remR3PhysWrite(RTGCPHYS DstGCPhys, const void *pvSrc, unsigned cb); 193 void remR3PhysWriteU8(RTGCPHYS DstGCPhys, uint8_t val); 194 void remR3PhysWriteU16(RTGCPHYS DstGCPhys, uint16_t val); 195 void remR3PhysWriteU32(RTGCPHYS DstGCPhys, uint32_t val); 196 void remR3PhysWriteU64(RTGCPHYS DstGCPhys, uint64_t val); 197 198 #ifndef REM_PHYS_ADDR_IN_TLB 186 199 void remR3PhysReadHCPtr(uint8_t *pbSrcPhys, void *pvDst, unsigned cb); 187 200 uint8_t remR3PhysReadHCPtrU8(uint8_t *pbSrcPhys); … … 198 211 void remR3PhysWriteHCPtrU32(uint8_t *pbDstPhys, uint32_t val); 199 212 void remR3PhysWriteHCPtrU64(uint8_t *pbDstPhys, uint64_t val); 200 # ifdef PGM_DYNAMIC_RAM_ALLOC 213 #endif 214 215 #ifdef PGM_DYNAMIC_RAM_ALLOC 216 # ifndef REM_PHYS_ADDR_IN_TLB 201 217 void *remR3GCPhys2HCVirt(void *env, target_ulong addr); 202 218 target_ulong remR3HCVirt2GCPhys(void *env, void *addr); 219 # endif 203 220 void remR3GrowDynRange(unsigned long physaddr); 204 # endif 205 #endif 221 #endif 222 #if defined(__AMD64__) 223 # define VBOX_CHECK_ADDR(ptr) do { if ((uintptr_t)(ptr) >= _4G) __asm__("int3"); } while (0) 224 #else 225 # define VBOX_CHECK_ADDR(ptr) (void) 226 #endif 206 227 207 228 static inline int ldub_p(void *ptr) 208 229 { 230 #ifdef REM_PHYS_ADDR_IN_TLB 231 VBOX_CHECK_ADDR(ptr); 232 return remR3PhysReadU8((uintptr_t)ptr); 233 #else 209 234 return remR3PhysReadHCPtrU8(ptr); 235 #endif 210 236 } 211 237 212 238 static inline int ldsb_p(void *ptr) 213 239 { 240 #ifdef REM_PHYS_ADDR_IN_TLB 241 VBOX_CHECK_ADDR(ptr); 242 return remR3PhysReadS8((uintptr_t)ptr); 243 #else 214 244 return remR3PhysReadHCPtrS8(ptr); 245 #endif 215 246 } 216 247 217 248 static inline void stb_p(void *ptr, int v) 218 249 { 250 #ifdef REM_PHYS_ADDR_IN_TLB 251 VBOX_CHECK_ADDR(ptr); 252 remR3PhysWriteU8((uintptr_t)ptr, v); 253 #else 219 254 remR3PhysWriteHCPtrU8(ptr, v); 255 #endif 220 256 } 221 257 222 258 static inline int lduw_le_p(void *ptr) 223 259 { 260 #ifdef REM_PHYS_ADDR_IN_TLB 261 VBOX_CHECK_ADDR(ptr); 262 return remR3PhysReadU16((uintptr_t)ptr); 263 #else 224 264 return remR3PhysReadHCPtrU16(ptr); 265 #endif 225 266 } 226 267 227 268 static inline int ldsw_le_p(void *ptr) 228 269 { 270 #ifdef REM_PHYS_ADDR_IN_TLB 271 VBOX_CHECK_ADDR(ptr); 272 return remR3PhysReadS16((uintptr_t)ptr); 273 #else 229 274 return remR3PhysReadHCPtrS16(ptr); 275 #endif 230 276 } 231 277 232 278 static inline void stw_le_p(void *ptr, int v) 233 279 { 280 #ifdef REM_PHYS_ADDR_IN_TLB 281 VBOX_CHECK_ADDR(ptr); 282 remR3PhysWriteU16((uintptr_t)ptr, v); 283 #else 234 284 remR3PhysWriteHCPtrU16(ptr, v); 285 #endif 235 286 } 236 287 237 288 static inline int ldl_le_p(void *ptr) 238 289 { 290 #ifdef REM_PHYS_ADDR_IN_TLB 291 VBOX_CHECK_ADDR(ptr); 292 return remR3PhysReadU32((uintptr_t)ptr); 293 #else 239 294 return remR3PhysReadHCPtrU32(ptr); 295 #endif 240 296 } 241 297 242 298 static inline void stl_le_p(void *ptr, int v) 243 299 { 300 #ifdef REM_PHYS_ADDR_IN_TLB 301 VBOX_CHECK_ADDR(ptr); 302 remR3PhysWriteU32((uintptr_t)ptr, v); 303 #else 244 304 remR3PhysWriteHCPtrU32(ptr, v); 305 #endif 245 306 } 246 307 247 308 static inline void stq_le_p(void *ptr, uint64_t v) 248 309 { 310 #ifdef REM_PHYS_ADDR_IN_TLB 311 VBOX_CHECK_ADDR(ptr); 312 remR3PhysWriteU64((uintptr_t)ptr, v); 313 #else 249 314 remR3PhysWriteHCPtrU64(ptr, v); 315 #endif 250 316 } 251 317 252 318 static inline uint64_t ldq_le_p(void *ptr) 253 319 { 320 #ifdef REM_PHYS_ADDR_IN_TLB 321 VBOX_CHECK_ADDR(ptr); 322 return remR3PhysReadU64((uintptr_t)ptr); 323 #else 254 324 return remR3PhysReadHCPtrU64(ptr); 255 } 325 #endif 326 } 327 328 #undef VBOX_CHECK_ADDR 256 329 257 330 /* float access */ … … 973 1046 extern uint32_t phys_ram_dirty_size; 974 1047 #endif /* VBOX */ 975 #if !defined(VBOX) || ! defined(PGM_DYNAMIC_RAM_ALLOC)1048 #if !defined(VBOX) || !(defined(PGM_DYNAMIC_RAM_ALLOC) || defined(REM_PHYS_ADDR_IN_TLB)) 976 1049 extern uint8_t *phys_ram_base; 977 1050 #endif
Note:
See TracChangeset
for help on using the changeset viewer.