VirtualBox

Changeset 18662 in vbox for trunk/src/recompiler_new


Ignore:
Timestamp:
Apr 2, 2009 6:35:32 PM (16 years ago)
Author:
vboxsync
Message:

src/recompiler_new: Clean out the VBOX_WITH_NEW_PHYS_CODE #ifdefs.

Location:
trunk/src/recompiler_new
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler_new/Makefile.kmk

    r17897 r18662  
    284284
    285285$$(PATH_VBoxREMImp)/VBoxREMWin.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@)
    286 ifdef VBOX_WITH_NEW_PHYS_CODE
    287         $(SED) -e '/REMR3NotifyPhysRamChunkRegister/d'  --output $@ $<
    288 else
    289286        $(CP) -f $< $@
    290 endif
    291287
    292288
     
    305301
    306302include $(KBUILD_PATH)/subfooter.kmk
     303
  • trunk/src/recompiler_new/VBoxREM.def

    r17537 r18662  
    4040    REMR3ReplayHandlerNotifications
    4141    REMR3NotifyPhysRamRegister
    42     REMR3NotifyPhysRamChunkRegister
    4342    REMR3NotifyPhysRamDeregister
    4443    REMR3NotifyPhysRomRegister
  • trunk/src/recompiler_new/VBoxREMWrapper.cpp

    r17537 r18662  
    348348static DECLCALLBACKPTR(void, pfnREMR3ReplayHandlerNotifications)(PVM pVM);
    349349static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamRegister)(PVM, RTGCPHYS, RTGCPHYS, unsigned);
    350 #ifndef VBOX_WITH_NEW_PHYS_CODE
    351 static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamChunkRegister)(PVM, RTGCPHYS, RTUINT, RTHCUINTPTR, unsigned);
    352 #endif
    353350static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRamDeregister)(PVM, RTGCPHYS, RTUINT);
    354351static DECLCALLBACKPTR(void, pfnREMR3NotifyPhysRomRegister)(PVM, RTGCPHYS, RTUINT, void *, bool);
     
    10351032    { "REMR3ReplayHandlerNotifications",        (void *)&pfnREMR3ReplayHandlerNotifications,        &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    10361033    { "REMR3NotifyPhysRamRegister",             (void *)&pfnREMR3NotifyPhysRamRegister,             &g_aArgsNotifyPhysRamRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRamRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    1037 #ifndef VBOX_WITH_NEW_PHYS_CODE
    1038     { "REMR3NotifyPhysRamChunkRegister",        (void *)&pfnREMR3NotifyPhysRamChunkRegister,        &g_aArgsNotifyPhysRamChunkRegister[0],      RT_ELEMENTS(g_aArgsNotifyPhysRamChunkRegister),        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    1039 #endif
    10401034    { "REMR3NotifyPhysRamDeregister",           (void *)&pfnREMR3NotifyPhysRamDeregister,           &g_aArgsNotifyPhysRamDeregister[0],         RT_ELEMENTS(g_aArgsNotifyPhysRamDeregister),           REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    10411035    { "REMR3NotifyPhysRomRegister",             (void *)&pfnREMR3NotifyPhysRomRegister,             &g_aArgsNotifyPhysRomRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRomRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     
    11211115    { "PGMGstGetPage",                          (void *)(uintptr_t)&PGMGstGetPage,                  &g_aArgsPGMGstGetPage[0],                   RT_ELEMENTS(g_aArgsPGMGstGetPage),                     REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    11221116    { "PGMInvalidatePage",                      (void *)(uintptr_t)&PGMInvalidatePage,              &g_aArgsPGMInvalidatePage[0],               RT_ELEMENTS(g_aArgsPGMInvalidatePage),                 REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    1123 #ifndef VBOX_WITH_NEW_PHYS_CODE
    1124     { "PGM3PhysGrowRange",                      (void *)(uintptr_t)&PGM3PhysGrowRange,              &g_aArgsPGM3PhysGrowRange[0],               RT_ELEMENTS(g_aArgsPGM3PhysGrowRange),                 REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    1125 #endif
    11261117    { "PGMPhysIsGCPhysValid",                   (void *)(uintptr_t)&PGMPhysIsGCPhysValid,           &g_aArgsPGMPhysIsGCPhysValid[0],            RT_ELEMENTS(g_aArgsPGMPhysIsGCPhysValid),              REMFNDESC_FLAGS_RET_INT,    sizeof(bool),       NULL },
    11271118    { "PGMPhysIsA20Enabled",                    (void *)(uintptr_t)&PGMPhysIsA20Enabled,            &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_INT,    sizeof(bool),       NULL },
     
    21752166}
    21762167
    2177 #ifndef VBOX_WITH_NEW_PHYS_CODE
    2178 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)
    2179 {
    2180 #ifndef USE_REM_STUBS
    2181     Assert(VALID_PTR(pfnREMR3NotifyPhysRamChunkRegister));
    2182     pfnREMR3NotifyPhysRamChunkRegister(pVM, GCPhys, cb, pvRam, fFlags);
    2183 #endif
    2184 }
    2185 #endif
    2186 
    21872168REMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy, bool fShadow)
    21882169{
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r18650 r18662  
    27552755    Assert(cb);
    27562756    Assert(RT_ALIGN_Z(cb, PAGE_SIZE) == cb);
    2757 #ifdef VBOX_WITH_NEW_PHYS_CODE
    27582757    AssertMsg(fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_RAM || fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2, ("#x\n", fFlags));
    2759 #endif
    27602758
    27612759    /*
    27622760     * Base ram? Update GCPhysLastRam.
    27632761     */
    2764 #ifdef VBOX_WITH_NEW_PHYS_CODE
    27652762    if (fFlags & REM_NOTIFY_PHYS_RAM_FLAGS_RAM)
    2766 #else
    2767     if (!GCPhys)
    2768 #endif
    27692763    {
    27702764        if (GCPhys + (cb - 1) > pVM->rem.s.GCPhysLastRam)
     
    27812775    pVM->rem.s.fIgnoreAll = true;
    27822776
    2783 #ifdef VBOX_WITH_NEW_PHYS_CODE
    2784     cpu_register_physical_memory(GCPhys, cb, GCPhys);
    2785 #else
    2786     if (!GCPhys)
    2787         cpu_register_physical_memory(GCPhys, cb, GCPhys | IO_MEM_RAM_MISSING);
    2788     else
    2789     {
    2790         if (fFlags & MM_RAM_FLAGS_RESERVED)
    2791             cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);
    2792         else
    2793             cpu_register_physical_memory(GCPhys, cb, GCPhys);
    2794     }
    2795 #endif
    2796     Assert(pVM->rem.s.fIgnoreAll);
    2797     pVM->rem.s.fIgnoreAll = false;
    2798 }
    2799 
    2800 #ifndef VBOX_WITH_NEW_PHYS_CODE
    2801 
    2802 /**
    2803  * Notification about a successful PGMR3PhysRegisterChunk() call.
    2804  *
    2805  * @param   pVM         VM handle.
    2806  * @param   GCPhys      The physical address the RAM.
    2807  * @param   cb          Size of the memory.
    2808  * @param   pvRam       The HC address of the RAM.
    2809  * @param   fFlags      Flags of the MM_RAM_FLAGS_* defines.
    2810  */
    2811 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)
    2812 {
    2813     Log(("REMR3NotifyPhysRamChunkRegister: GCPhys=%RGp cb=%d pvRam=%p fFlags=%d\n", GCPhys, cb, pvRam, fFlags));
    2814     VM_ASSERT_EMT(pVM);
    2815 
    2816     /*
    2817      * Validate input - we trust the caller.
    2818      */
    2819     Assert(pvRam);
    2820     Assert(RT_ALIGN(pvRam, PAGE_SIZE) == pvRam);
    2821     Assert(RT_ALIGN_T(GCPhys, PAGE_SIZE, RTGCPHYS) == GCPhys);
    2822     Assert(cb == PGM_DYNAMIC_CHUNK_SIZE);
    2823     Assert(fFlags == 0 /* normal RAM */);
    2824     Assert(!pVM->rem.s.fIgnoreAll);
    2825     pVM->rem.s.fIgnoreAll = true;
    28262777    cpu_register_physical_memory(GCPhys, cb, GCPhys);
    28272778    Assert(pVM->rem.s.fIgnoreAll);
     
    28292780}
    28302781
    2831 
    2832 /**
    2833  *  Grows dynamically allocated guest RAM.
    2834  *  Will raise a fatal error if the operation fails.
    2835  *
    2836  * @param   physaddr    The physical address.
    2837  */
    2838 void remR3GrowDynRange(unsigned long physaddr) /** @todo Needs fixing for MSC... */
    2839 {
    2840     int rc;
    2841     PVM pVM = cpu_single_env->pVM;
    2842     const RTGCPHYS GCPhys = physaddr;
    2843 
    2844     LogFlow(("remR3GrowDynRange %RGp\n", (RTGCPTR)physaddr));
    2845     rc = PGM3PhysGrowRange(pVM, &GCPhys);
    2846     if (RT_SUCCESS(rc))
    2847         return;
    2848 
    2849     LogRel(("\nUnable to allocate guest RAM chunk at %RGp\n", (RTGCPTR)physaddr));
    2850     cpu_abort(cpu_single_env, "Unable to allocate guest RAM chunk at %RGp\n", (RTGCPTR)physaddr);
    2851     AssertFatalFailed();
    2852 }
    2853 
    2854 #endif /* !VBOX_WITH_NEW_PHYS_CODE */
    28552782
    28562783/**
  • trunk/src/recompiler_new/cpu-all.h

    r17420 r18662  
    249249
    250250#ifdef VBOX
    251 void remAbort(int rc, const char *pszTip) __attribute__((__noreturn__));
    252 
    253 #ifndef VBOX_WITH_NEW_PHYS_CODE
    254 void     remR3GrowDynRange(unsigned long physaddr);
    255 #endif
     251void        remAbort(int rc, const char *pszTip) __attribute__((__noreturn__));
    256252
    257253void        remR3PhysRead(RTGCPHYS SrcGCPhys, void *pvDst, unsigned cb);
     
    12061202#define IO_MEM_UNASSIGNED  (2 << IO_MEM_SHIFT)
    12071203#define IO_MEM_NOTDIRTY    (3 << IO_MEM_SHIFT)
    1208 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)
    1209 #define IO_MEM_RAM_MISSING (5 << IO_MEM_SHIFT) /* used internally, never use directly */
    1210 #endif
    12111204
    12121205/* Acts like a ROM when read and like a device when written.  */
  • trunk/src/recompiler_new/exec.c

    r18611 r18662  
    493493          pd[i].phys_offset = IO_MEM_UNASSIGNED;
    494494    }
    495 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)
    496     pd = ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1));
    497     if (RT_UNLIKELY((pd->phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING))
    498         remR3GrowDynRange(pd->phys_offset & TARGET_PAGE_MASK);
    499     return pd;
    500 #else
    501495    return ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1));
    502 #endif
    503496}
    504497
     
    21212114    start1 = start + (unsigned long)phys_ram_base;
    21222115#else
    2123     start1 = (unsigned long)remR3TlbGCPhys2Ptr(first_cpu, start, 1 /*fWritable*/); /** @todo this can be harmful with VBOX_WITH_NEW_PHYS_CODE, fix interface/whatever. */
     2116    start1 = (unsigned long)remR3TlbGCPhys2Ptr(first_cpu, start, 1 /*fWritable*/); /** @todo page replacing (sharing or read only) may cause trouble, fix interface/whatever. */
    21242117#endif
    21252118    for(env = first_cpu; env != NULL; env = env->next_cpu) {
     
    27092702            } else {
    27102703                p->phys_offset = phys_offset;
    2711 #if !defined(VBOX) || defined(VBOX_WITH_NEW_PHYS_CODE)
    27122704        if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
    27132705            (phys_offset & IO_MEM_ROMD))
    2714 #else
    2715         if (   (phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM
    2716             || (phys_offset & IO_MEM_ROMD)
    2717             || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING)
    2718 #endif
    27192706                    phys_offset += TARGET_PAGE_SIZE;
    27202707            }
     
    27222709            p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1);
    27232710            p->phys_offset = phys_offset;
    2724 #if !defined(VBOX) || defined(VBOX_WITH_NEW_PHYS_CODE)
    27252711        if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
    27262712            (phys_offset & IO_MEM_ROMD))
    2727 #else
    2728         if (   (phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM
    2729             || (phys_offset & IO_MEM_ROMD)
    2730             || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING)
    2731 #endif
    27322713                phys_offset += TARGET_PAGE_SIZE;
    27332714            else {
     
    32373218    cpu_register_io_memory(IO_MEM_UNASSIGNED >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);
    32383219    cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL);
    3239 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)
    3240     cpu_register_io_memory(IO_MEM_RAM_MISSING >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);
    3241     io_mem_nb = 6;
    3242 #else
    32433220    io_mem_nb = 5;
    3244 #endif
    32453221
    32463222    io_mem_watch = cpu_register_io_memory(0, watch_mem_read,
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