Changeset 45305 in vbox for trunk/src/recompiler/VBoxRecompiler.c
- Timestamp:
- Apr 3, 2013 11:15:02 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/VBoxRecompiler.c
r45276 r45305 93 93 static int remR3InitPhysRamSizeAndDirtyMap(PVM pVM, bool fGuarded); 94 94 95 static uint32_t remR3MMIOReadU8(void *pv VM, target_phys_addr_t GCPhys);96 static uint32_t remR3MMIOReadU16(void *pv VM, target_phys_addr_t GCPhys);97 static uint32_t remR3MMIOReadU32(void *pv VM, target_phys_addr_t GCPhys);98 static void remR3MMIOWriteU8(void *pv VM, target_phys_addr_t GCPhys, uint32_t u32);99 static void remR3MMIOWriteU16(void *pv VM, target_phys_addr_t GCPhys, uint32_t u32);100 static void remR3MMIOWriteU32(void *pv VM, target_phys_addr_t GCPhys, uint32_t u32);95 static uint32_t remR3MMIOReadU8(void *pvEnv, target_phys_addr_t GCPhys); 96 static uint32_t remR3MMIOReadU16(void *pvEnv, target_phys_addr_t GCPhys); 97 static uint32_t remR3MMIOReadU32(void *pvEnv, target_phys_addr_t GCPhys); 98 static void remR3MMIOWriteU8(void *pvEnv, target_phys_addr_t GCPhys, uint32_t u32); 99 static void remR3MMIOWriteU16(void *pvEnv, target_phys_addr_t GCPhys, uint32_t u32); 100 static void remR3MMIOWriteU32(void *pvEnv, target_phys_addr_t GCPhys, uint32_t u32); 101 101 102 102 static uint32_t remR3HandlerReadU8(void *pvVM, target_phys_addr_t GCPhys); … … 334 334 * Register ram types. 335 335 */ 336 pVM->rem.s.iMMIOMemType = cpu_register_io_memory(g_apfnMMIORead, g_apfnMMIOWrite, pVM);336 pVM->rem.s.iMMIOMemType = cpu_register_io_memory(g_apfnMMIORead, g_apfnMMIOWrite, &pVM->rem.s.Env); 337 337 AssertReleaseMsg(pVM->rem.s.iMMIOMemType >= 0, ("pVM->rem.s.iMMIOMemType=%d\n", pVM->rem.s.iMMIOMemType)); 338 338 pVM->rem.s.iHandlerMemType = cpu_register_io_memory(g_apfnHandlerRead, g_apfnHandlerWrite, pVM); … … 3785 3785 3786 3786 /** Read MMIO memory. */ 3787 static uint32_t remR3MMIOReadU8(void *pvVM, target_phys_addr_t GCPhys) 3788 { 3789 uint32_t u32 = 0; 3790 int rc = IOMMMIORead((PVM)pvVM, GCPhys, &u32, 1); 3787 static uint32_t remR3MMIOReadU8(void *pvEnv, target_phys_addr_t GCPhys) 3788 { 3789 CPUX86State *env = (CPUX86State *)pvEnv; 3790 uint32_t u32 = 0; 3791 int rc = IOMMMIORead(env->pVM, env->pVCpu, GCPhys, &u32, 1); 3791 3792 AssertMsg(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc)); NOREF(rc); 3792 3793 Log2(("remR3MMIOReadU8: GCPhys=%RGp -> %02x\n", (RTGCPHYS)GCPhys, u32)); … … 3795 3796 3796 3797 /** Read MMIO memory. */ 3797 static uint32_t remR3MMIOReadU16(void *pvVM, target_phys_addr_t GCPhys) 3798 { 3799 uint32_t u32 = 0; 3800 int rc = IOMMMIORead((PVM)pvVM, GCPhys, &u32, 2); 3798 static uint32_t remR3MMIOReadU16(void *pvEnv, target_phys_addr_t GCPhys) 3799 { 3800 CPUX86State *env = (CPUX86State *)pvEnv; 3801 uint32_t u32 = 0; 3802 int rc = IOMMMIORead(env->pVM, env->pVCpu, GCPhys, &u32, 2); 3801 3803 AssertMsg(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc)); NOREF(rc); 3802 3804 Log2(("remR3MMIOReadU16: GCPhys=%RGp -> %04x\n", (RTGCPHYS)GCPhys, u32)); … … 3805 3807 3806 3808 /** Read MMIO memory. */ 3807 static uint32_t remR3MMIOReadU32(void *pvVM, target_phys_addr_t GCPhys) 3808 { 3809 uint32_t u32 = 0; 3810 int rc = IOMMMIORead((PVM)pvVM, GCPhys, &u32, 4); 3809 static uint32_t remR3MMIOReadU32(void *pvEnv, target_phys_addr_t GCPhys) 3810 { 3811 CPUX86State *env = (CPUX86State *)pvEnv; 3812 uint32_t u32 = 0; 3813 int rc = IOMMMIORead(env->pVM, env->pVCpu, GCPhys, &u32, 4); 3811 3814 AssertMsg(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc)); NOREF(rc); 3812 3815 Log2(("remR3MMIOReadU32: GCPhys=%RGp -> %08x\n", (RTGCPHYS)GCPhys, u32)); … … 3815 3818 3816 3819 /** Write to MMIO memory. */ 3817 static void remR3MMIOWriteU8(void *pvVM, target_phys_addr_t GCPhys, uint32_t u32) 3818 { 3819 int rc; 3820 static void remR3MMIOWriteU8(void *pvEnv, target_phys_addr_t GCPhys, uint32_t u32) 3821 { 3822 CPUX86State *env = (CPUX86State *)pvEnv; 3823 int rc; 3820 3824 Log2(("remR3MMIOWriteU8: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32)); 3821 rc = IOMMMIOWrite( (PVM)pvVM, GCPhys, u32, 1);3825 rc = IOMMMIOWrite(env->pVM, env->pVCpu, GCPhys, u32, 1); 3822 3826 AssertMsg(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc)); NOREF(rc); 3823 3827 } 3824 3828 3825 3829 /** Write to MMIO memory. */ 3826 static void remR3MMIOWriteU16(void *pvVM, target_phys_addr_t GCPhys, uint32_t u32) 3827 { 3828 int rc; 3830 static void remR3MMIOWriteU16(void *pvEnv, target_phys_addr_t GCPhys, uint32_t u32) 3831 { 3832 CPUX86State *env = (CPUX86State *)pvEnv; 3833 int rc; 3829 3834 Log2(("remR3MMIOWriteU16: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32)); 3830 rc = IOMMMIOWrite( (PVM)pvVM, GCPhys, u32, 2);3835 rc = IOMMMIOWrite(env->pVM, env->pVCpu, GCPhys, u32, 2); 3831 3836 AssertMsg(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc)); NOREF(rc); 3832 3837 } 3833 3838 3834 3839 /** Write to MMIO memory. */ 3835 static void remR3MMIOWriteU32(void *pvVM, target_phys_addr_t GCPhys, uint32_t u32) 3836 { 3837 int rc; 3840 static void remR3MMIOWriteU32(void *pvEnv, target_phys_addr_t GCPhys, uint32_t u32) 3841 { 3842 CPUX86State *env = (CPUX86State *)pvEnv; 3843 int rc; 3838 3844 Log2(("remR3MMIOWriteU32: GCPhys=%RGp u32=%#x\n", (RTGCPHYS)GCPhys, u32)); 3839 rc = IOMMMIOWrite( (PVM)pvVM, GCPhys, u32, 4);3845 rc = IOMMMIOWrite(env->pVM, env->pVCpu, GCPhys, u32, 4); 3840 3846 AssertMsg(rc == VINF_SUCCESS, ("rc=%Rrc\n", rc)); NOREF(rc); 3841 3847 } … … 4557 4563 Log2(("cpu_outb: addr=%#06x val=%#x\n", addr, val)); 4558 4564 4559 rc = IOMIOPortWrite(env->pVM, (RTIOPORT)addr, val, 1);4565 rc = IOMIOPortWrite(env->pVM, env->pVCpu, (RTIOPORT)addr, val, 1); 4560 4566 if (RT_LIKELY(rc == VINF_SUCCESS)) 4561 4567 return; … … 4572 4578 { 4573 4579 //Log2(("cpu_outw: addr=%#06x val=%#x\n", addr, val)); 4574 int rc = IOMIOPortWrite(env->pVM, (RTIOPORT)addr, val, 2);4580 int rc = IOMIOPortWrite(env->pVM, env->pVCpu, (RTIOPORT)addr, val, 2); 4575 4581 if (RT_LIKELY(rc == VINF_SUCCESS)) 4576 4582 return; … … 4588 4594 int rc; 4589 4595 Log2(("cpu_outl: addr=%#06x val=%#x\n", addr, val)); 4590 rc = IOMIOPortWrite(env->pVM, (RTIOPORT)addr, val, 4);4596 rc = IOMIOPortWrite(env->pVM, env->pVCpu, (RTIOPORT)addr, val, 4); 4591 4597 if (RT_LIKELY(rc == VINF_SUCCESS)) 4592 4598 return; … … 4603 4609 { 4604 4610 uint32_t u32 = 0; 4605 int rc = IOMIOPortRead(env->pVM, (RTIOPORT)addr, &u32, 1);4611 int rc = IOMIOPortRead(env->pVM, env->pVCpu, (RTIOPORT)addr, &u32, 1); 4606 4612 if (RT_LIKELY(rc == VINF_SUCCESS)) 4607 4613 { … … 4623 4629 { 4624 4630 uint32_t u32 = 0; 4625 int rc = IOMIOPortRead(env->pVM, (RTIOPORT)addr, &u32, 2);4631 int rc = IOMIOPortRead(env->pVM, env->pVCpu, (RTIOPORT)addr, &u32, 2); 4626 4632 if (RT_LIKELY(rc == VINF_SUCCESS)) 4627 4633 { … … 4642 4648 { 4643 4649 uint32_t u32 = 0; 4644 int rc = IOMIOPortRead(env->pVM, (RTIOPORT)addr, &u32, 4);4650 int rc = IOMIOPortRead(env->pVM, env->pVCpu, (RTIOPORT)addr, &u32, 4); 4645 4651 if (RT_LIKELY(rc == VINF_SUCCESS)) 4646 4652 {
Note:
See TracChangeset
for help on using the changeset viewer.