VirtualBox

Changeset 18661 in vbox for trunk/src/recompiler


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

src/recompiler: Clean out the VBOX_WITH_NEW_PHYS_CODE #ifdefs.

Location:
trunk/src/recompiler
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/recompiler/VBoxREMWrapper.cpp

    r17537 r18661  
    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);
     
    10291026    { "REMR3ReplayHandlerNotifications",        (void *)&pfnREMR3ReplayHandlerNotifications,        &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    10301027    { "REMR3NotifyPhysRamRegister",             (void *)&pfnREMR3NotifyPhysRamRegister,             &g_aArgsNotifyPhysRamRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRamRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    1031 #ifndef VBOX_WITH_NEW_PHYS_CODE
    1032     { "REMR3NotifyPhysRamChunkRegister",        (void *)&pfnREMR3NotifyPhysRamChunkRegister,        &g_aArgsNotifyPhysRamChunkRegister[0],      RT_ELEMENTS(g_aArgsNotifyPhysRamChunkRegister),        REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    1033 #endif
    10341028    { "REMR3NotifyPhysRamDeregister",           (void *)&pfnREMR3NotifyPhysRamDeregister,           &g_aArgsNotifyPhysRamDeregister[0],         RT_ELEMENTS(g_aArgsNotifyPhysRamDeregister),           REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
    10351029    { "REMR3NotifyPhysRomRegister",             (void *)&pfnREMR3NotifyPhysRomRegister,             &g_aArgsNotifyPhysRomRegister[0],           RT_ELEMENTS(g_aArgsNotifyPhysRomRegister),             REMFNDESC_FLAGS_RET_VOID,   0,              NULL },
     
    11151109    { "PGMGstGetPage",                          (void *)(uintptr_t)&PGMGstGetPage,                  &g_aArgsPGMGstGetPage[0],                   RT_ELEMENTS(g_aArgsPGMGstGetPage),                     REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    11161110    { "PGMInvalidatePage",                      (void *)(uintptr_t)&PGMInvalidatePage,              &g_aArgsPGMInvalidatePage[0],               RT_ELEMENTS(g_aArgsPGMInvalidatePage),                 REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    1117 #ifndef VBOX_WITH_NEW_PHYS_CODE
    1118     { "PGM3PhysGrowRange",                      (void *)(uintptr_t)&PGM3PhysGrowRange,              &g_aArgsPGM3PhysGrowRange[0],               RT_ELEMENTS(g_aArgsPGM3PhysGrowRange),                 REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },
    1119 #endif
    11201111    { "PGMPhysIsGCPhysValid",                   (void *)(uintptr_t)&PGMPhysIsGCPhysValid,           &g_aArgsPGMPhysIsGCPhysValid[0],            RT_ELEMENTS(g_aArgsPGMPhysIsGCPhysValid),              REMFNDESC_FLAGS_RET_INT,    sizeof(bool),       NULL },
    11211112    { "PGMPhysIsA20Enabled",                    (void *)(uintptr_t)&PGMPhysIsA20Enabled,            &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_INT,    sizeof(bool),       NULL },
     
    21632154}
    21642155
    2165 #ifndef VBOX_WITH_NEW_PHYS_CODE
    2166 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)
    2167 {
    2168 #ifndef USE_REM_STUBS
    2169     Assert(VALID_PTR(pfnREMR3NotifyPhysRamChunkRegister));
    2170     pfnREMR3NotifyPhysRamChunkRegister(pVM, GCPhys, cb, pvRam, fFlags);
    2171 #endif
    2172 }
    2173 #endif
    2174 
    21752156REMR3DECL(void) REMR3NotifyPhysRomRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, void *pvCopy, bool fShadow)
    21762157{
  • trunk/src/recompiler/VBoxRecompiler.c

    r18650 r18661  
    28052805    Assert(cb);
    28062806    Assert(RT_ALIGN_Z(cb, PAGE_SIZE) == cb);
    2807 #ifdef VBOX_WITH_NEW_PHYS_CODE
    28082807    AssertMsg(fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_RAM || fFlags == REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2, ("#x\n", fFlags));
    2809 #endif
    28102808
    28112809    /*
    28122810     * Base ram? Update GCPhysLastRam.
    28132811     */
    2814 #ifdef VBOX_WITH_NEW_PHYS_CODE
    28152812    if (fFlags & REM_NOTIFY_PHYS_RAM_FLAGS_RAM)
    2816 #else
    2817     if (!GCPhys)
    2818 #endif
    28192813    {
    28202814        if (GCPhys + (cb - 1) > pVM->rem.s.GCPhysLastRam)
     
    28312825    pVM->rem.s.fIgnoreAll = true;
    28322826
    2833 #ifdef VBOX_WITH_NEW_PHYS_CODE
    28342827    cpu_register_physical_memory(GCPhys, cb, GCPhys);
    2835 #else
    2836     if (!GCPhys)
    2837         cpu_register_physical_memory(GCPhys, cb, GCPhys | IO_MEM_RAM_MISSING);
    2838     else
    2839     {
    2840         if (fFlags & MM_RAM_FLAGS_RESERVED)
    2841             cpu_register_physical_memory(GCPhys, cb, IO_MEM_UNASSIGNED);
    2842         else
    2843             cpu_register_physical_memory(GCPhys, cb, GCPhys);
    2844     }
    2845 #endif
    28462828    Assert(pVM->rem.s.fIgnoreAll);
    28472829    pVM->rem.s.fIgnoreAll = false;
    28482830}
    28492831
    2850 #ifndef VBOX_WITH_NEW_PHYS_CODE
    2851 
    2852 /**
    2853  * Notification about a successful PGMR3PhysRegisterChunk() call.
    2854  *
    2855  * @param   pVM         VM handle.
    2856  * @param   GCPhys      The physical address the RAM.
    2857  * @param   cb          Size of the memory.
    2858  * @param   pvRam       The HC address of the RAM.
    2859  * @param   fFlags      Flags of the MM_RAM_FLAGS_* defines.
    2860  */
    2861 REMR3DECL(void) REMR3NotifyPhysRamChunkRegister(PVM pVM, RTGCPHYS GCPhys, RTUINT cb, RTHCUINTPTR pvRam, unsigned fFlags)
    2862 {
    2863     Log(("REMR3NotifyPhysRamChunkRegister: GCPhys=%RGp cb=%d pvRam=%p fFlags=%d\n", GCPhys, cb, pvRam, fFlags));
    2864     VM_ASSERT_EMT(pVM);
    2865 
    2866     /*
    2867      * Validate input - we trust the caller.
    2868      */
    2869     Assert(pvRam);
    2870     Assert(RT_ALIGN(pvRam, PAGE_SIZE) == pvRam);
    2871     Assert(RT_ALIGN_T(GCPhys, PAGE_SIZE, RTGCPHYS) == GCPhys);
    2872     Assert(cb == PGM_DYNAMIC_CHUNK_SIZE);
    2873     Assert(fFlags == 0 /* normal RAM */);
    2874     Assert(!pVM->rem.s.fIgnoreAll);
    2875     pVM->rem.s.fIgnoreAll = true;
    2876 
    2877     cpu_register_physical_memory(GCPhys, cb, GCPhys);
    2878 
    2879     Assert(pVM->rem.s.fIgnoreAll);
    2880     pVM->rem.s.fIgnoreAll = false;
    2881 }
    2882 
    2883 
    2884 /**
    2885  *  Grows dynamically allocated guest RAM.
    2886  *  Will raise a fatal error if the operation fails.
    2887  *
    2888  * @param   physaddr    The physical address.
    2889  */
    2890 void remR3GrowDynRange(unsigned long physaddr)
    2891 {
    2892     int rc;
    2893     PVM pVM = cpu_single_env->pVM;
    2894 
    2895     LogFlow(("remR3GrowDynRange %RGp\n", (RTGCPHYS)physaddr));
    2896     const RTGCPHYS GCPhys = physaddr;
    2897     rc = PGM3PhysGrowRange(pVM, &GCPhys);
    2898     if (RT_SUCCESS(rc))
    2899         return;
    2900 
    2901     LogRel(("\nUnable to allocate guest RAM chunk at %RGp\n", (RTGCPHYS)physaddr));
    2902     cpu_abort(cpu_single_env, "Unable to allocate guest RAM chunk at %RGp\n", (RTGCPHYS)physaddr);
    2903     AssertFatalFailed();
    2904 }
    2905 
    2906 #endif /* !VBOX_WITH_NEW_PHYS_CODE */
    29072832
    29082833/**
  • trunk/src/recompiler/cpu-all.h

    r13839 r18661  
    205205void     remR3PhysWriteU64(RTGCPHYS DstGCPhys, uint64_t val);
    206206
    207 #ifndef VBOX_WITH_NEW_PHYS_CODE
    208 void     remR3GrowDynRange(unsigned long physaddr);
    209 #endif
    210207#if 0 /*defined(RT_ARCH_AMD64) && defined(VBOX_STRICT)*/
    211208# define VBOX_CHECK_ADDR(ptr) do { if ((uintptr_t)(ptr) >= _4G) __asm__("int3"); } while (0)
     
    10081005#define IO_MEM_UNASSIGNED  (2 << IO_MEM_SHIFT)
    10091006#define IO_MEM_NOTDIRTY    (4 << IO_MEM_SHIFT) /* used internally, never use directly */
    1010 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)
    1011 #define IO_MEM_RAM_MISSING (5 << IO_MEM_SHIFT) /* used internally, never use directly */
    1012 #endif
    10131007/* acts like a ROM when read and like a device when written. As an
    10141008   exception, the write memory callback gets the ram offset instead of
  • trunk/src/recompiler/exec.c

    r13185 r18661  
    292292          pd[i].phys_offset = IO_MEM_UNASSIGNED;
    293293    }
    294 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)
    295     pd = ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1));
    296     if (RT_UNLIKELY((pd->phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING))
    297         remR3GrowDynRange(pd->phys_offset & TARGET_PAGE_MASK);
    298     return pd;
    299 #else
    300294    return ((PhysPageDesc *)pd) + (index & (L2_SIZE - 1));
    301 #endif
    302295}
    303296
     
    19721965        p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1);
    19731966        p->phys_offset = phys_offset;
    1974 #if !defined(VBOX) || defined(VBOX_WITH_NEW_PHYS_CODE)
    19751967        if ((phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM ||
    19761968            (phys_offset & IO_MEM_ROMD))
    1977 #else
    1978         if (   (phys_offset & ~TARGET_PAGE_MASK) <= IO_MEM_ROM
    1979             || (phys_offset & IO_MEM_ROMD)
    1980             || (phys_offset & ~TARGET_PAGE_MASK) == IO_MEM_RAM_MISSING)
    1981 #endif
    1982 
    19831969            phys_offset += TARGET_PAGE_SIZE;
    19841970    }
     
    21822168    cpu_register_io_memory(IO_MEM_UNASSIGNED >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);
    21832169    cpu_register_io_memory(IO_MEM_NOTDIRTY >> IO_MEM_SHIFT, error_mem_read, notdirty_mem_write, NULL);
    2184 #if defined(VBOX) && !defined(VBOX_WITH_NEW_PHYS_CODE)
    2185     cpu_register_io_memory(IO_MEM_RAM_MISSING >> IO_MEM_SHIFT, unassigned_mem_read, unassigned_mem_write, NULL);
    2186     io_mem_nb = 6;
    2187 #else
    21882170    io_mem_nb = 5;
    2189 #endif
    21902171
    21912172#ifndef VBOX /* VBOX: we do this later when the RAM is allocated. */
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