VirtualBox

Changeset 14475

Show
Ignore:
Timestamp:
11/21/08 17:49:38 (2 months ago)
Author:
vboxsync
Message:

new REM works on Win/amd64 hosts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/recompiler_new/Makefile.kmk

    r14447 r14475  
    2424 
    2525# For 64-bit Windows we currently use gcc (due to MSVC unaware of such a novel  
    26 # thing as C99, a lot of GCC extensions deployed by QEMU 
    27 # and calling convention differences) to cross-compile code to Linux/ELF  
    28 # and generate invocation wrappers. 
     26# thing as C99, a lot of GCC extensions deployed by QEMU and calling convention  
     27# differences) to cross-compile code to Linux/ELF and dynamically generate invocation wrappers. 
    2928if1of (win.amd64, $(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)) 
    3029 REM_MOD              += VBoxREM2 
    3130 SYSMODS              += VBoxREM2 
    3231 DLLS                 += VBoxREM 
    33 # IMPORT_LIBS          += VBoxREMImp 
    3432else 
    3533 REM_MOD              += VBoxREM 
    36  IMPORT_LIBS          += VBoxREM 
    3734endif 
    3835 
     
    4946 $(REM_MOD)_CFLAGS.profile  = $($(REM_MOD)_CFLAGS.release) 
    5047 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) 
     48 
     49 IMPORT_LIBS          += VBoxREMImp 
    5150else 
    5251 $(REM_MOD)_TEMPLATE  = VBOXR3NP 
     52 
     53 IMPORT_LIBS          += VBoxREM 
    5354endif 
    5455 
     
    152153#$(REM_MOD)_DEFS          += DEBUG_DISAS DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB  # Enables huge amounts of debug logging. 
    153154 
    154 $(REM_MOD)_LDFLAGS.darwin  = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -undefined dynamic_lookup 
     155$(REM_MOD)_LDFLAGS.darwin  = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(REM_MOD).dylib -undefined dynamic_lookup 
    155156$(REM_MOD)_LDFLAGS.l4      = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined 
    156157$(REM_MOD)_LDFLAGS.linux   = $(VBOX_LD_as_needed) 
     
    163164        $(LIB_RUNTIME) 
    164165 
     166# 
     167# The VBoxREM import library. 
     168# 
     169# This is a HACK to get around (a) the cyclic dependency between VBoxVMM and 
     170# VBoxREM during linking and (b) the recursive build ordering which means VBoxREM 
     171# won't be built until after all the other DLLs. 
     172# 
     173VBoxREMImp_TEMPLATE         = VBOXR3 
     174if1of ($(KBUILD_TARGET), os2 win) 
     175VBoxREMImp_INST             = $(INST_LIB) 
     176else 
     177VBoxREMImp_NAME             = VBoxREM 
     178VBoxREMImp_INST             = $(INST_LIB) 
     179endif 
     180VBoxREMImp_SOURCES.win      = VBoxREM.def 
     181VBoxREMImp_SOURCES.os2      = $(PATH_VBoxREMImp)/VBoxREMOS2.def 
     182ifeq ($(filter win os2,$(KBUILD_TARGET)),) 
     183VBoxREMImp_SOURCES          = $(PATH_VBoxREMImp)/VBoxREMImp.c 
     184VBoxREMImp_CLEAN            = $(PATH_VBoxREMImp)/VBoxREMImp.c 
     185endif 
     186ifneq ($(filter-out darwin os2 win,$(KBUILD_TARGET)),) 
     187VBoxREMImp_SONAME           = VBoxREM$(SUFF_DLL) 
     188endif 
     189VBoxREMImp_LDFLAGS.darwin   = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/VBoxREM.dylib 
     190VBoxREMImp_LDFLAGS.l4       = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib 
     191 
     192$$(PATH_VBoxREMImp)/VBoxREMImp.c: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed $(MAKEFILE_CURRENT) | $$(dir $$@) 
     193        $(call MSG_GENERATE,,$@) 
     194        $(QUIET)$(APPEND) -t $@ '#ifdef VBOX_HAVE_VISIBILITY_HIDDEN' 
     195        $(QUIET)$(APPEND)    $@ '# define EXPORT __attribute__((visibility("default")))' 
     196        $(QUIET)$(APPEND)    $@ '#else' 
     197        $(QUIET)$(APPEND)    $@ '# define EXPORT' 
     198        $(QUIET)$(APPEND)    $@ '#endif' 
     199        $(QUIET)$(APPEND)    $@ '' 
     200        $(QUIET)$(SED) -f $(VBOX_PATH_RECOMPILER_SRC)/Sun/deftoimp.sed --append $@ $< 
     201 
     202$$(PATH_VBoxREMImp)/VBoxREMOS2.def: $(VBOX_PATH_RECOMPILER_SRC)/VBoxREM.def $(MAKEFILE_CURRENT) | $$(dir $$@) 
     203        $(SED) \ 
     204                -e 's/^[ \t][ \t]*REMR3/    _REMR3/' \ 
     205                -e 's/\.[Dd][Ll][Ll]//' \ 
     206                -e 's/^LIBRARY .*/LIBRARY VBoxREM INITINSTANCE TERMINSTANCE\nDATA MULTIPLE\n/' \ 
     207                --output $@ \ 
     208                $< 
    165209 
    166210 
  • trunk/src/recompiler_new/VBoxREMWrapper.cpp

    r14426 r14475  
    799799    { REMPARMDESC_FLAGS_INT,        sizeof(uint64_t), NULL } 
    800800}; 
     801static const REMPARMDESC g_aArgsPGMR3DbgR3Ptr2GCPhys[] = 
     802{ 
     803    { REMPARMDESC_FLAGS_INT,        sizeof(PVM), NULL }, 
     804    { REMPARMDESC_FLAGS_INT,        sizeof(void*), NULL }, 
     805    { REMPARMDESC_FLAGS_INT,        sizeof(PRTGCPHYS), NULL }    
     806}; 
     807static const REMPARMDESC g_aArgsPGMHandlerIsAddressMonitored[] = 
     808{ 
     809    { REMPARMDESC_FLAGS_INT,        sizeof(PVM), NULL }, 
     810    { REMPARMDESC_FLAGS_INT,        sizeof(RTHCUINTPTR), NULL } 
     811}; 
     812static const REMPARMDESC g_aArgsRTMemRealloc[] = 
     813{ 
     814    { REMPARMDESC_FLAGS_INT,        sizeof(void*), NULL }, 
     815    { REMPARMDESC_FLAGS_INT,        sizeof(size_t) } 
     816}; 
    801817static const REMPARMDESC g_aArgsSSMR3GetGCPtr[] = 
    802818{ 
     
    11321148    { "PGMR3PhysWriteU32",                      (void *)(uintptr_t)&PGMR3PhysWriteU32,              &g_aArgsPGMR3PhysWriteU32[0],               RT_ELEMENTS(g_aArgsPGMR3PhysWriteU32),                 REMFNDESC_FLAGS_RET_VOID,   0,                  NULL }, 
    11331149    { "PGMR3PhysWriteU64",                      (void *)(uintptr_t)&PGMR3PhysWriteU64,              &g_aArgsPGMR3PhysWriteU64[0],               RT_ELEMENTS(g_aArgsPGMR3PhysWriteU32),                 REMFNDESC_FLAGS_RET_VOID,   0,                  NULL }, 
     1150    { "PGMR3DbgR3Ptr2GCPhys",                   (void *)(uintptr_t)&PGMR3DbgR3Ptr2GCPhys,              &g_aArgsPGMR3DbgR3Ptr2GCPhys[0],               RT_ELEMENTS(g_aArgsPGMR3DbgR3Ptr2GCPhys),                 REMFNDESC_FLAGS_RET_INT,   sizeof(uint64_t),                  NULL }, 
     1151    { "PGMHandlerIsAddressMonitored",          (void *)(uintptr_t)&PGMHandlerIsAddressMonitored,              &g_aArgsPGMHandlerIsAddressMonitored[0],               RT_ELEMENTS(g_aArgsPGMHandlerIsAddressMonitored),                 REMFNDESC_FLAGS_RET_INT,   sizeof(bool),                  NULL }, 
    11341152    { "SSMR3GetGCPtr",                          (void *)(uintptr_t)&SSMR3GetGCPtr,                  &g_aArgsSSMR3GetGCPtr[0],                   RT_ELEMENTS(g_aArgsSSMR3GetGCPtr),                     REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
    11351153    { "SSMR3GetMem",                            (void *)(uintptr_t)&SSMR3GetMem,                    &g_aArgsSSMR3GetMem[0],                     RT_ELEMENTS(g_aArgsSSMR3GetMem),                       REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
     
    11621180    { "VMR3ReqCall",                            (void *)(uintptr_t)&VMR3ReqCall,                    &g_aArgsVMR3ReqCall[0],                     RT_ELEMENTS(g_aArgsVMR3ReqCall),                       REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
    11631181    { "VMR3ReqFree",                            (void *)(uintptr_t)&VMR3ReqFree,                    &g_aArgsVMR3ReqFree[0],                     RT_ELEMENTS(g_aArgsVMR3ReqFree),                       REMFNDESC_FLAGS_RET_INT | REMFNDESC_FLAGS_ELLIPSIS, sizeof(int), NULL }, 
    1164     { "VMR3GetVMCPUId",                         (void *)(uintptr_t)&VMR3GetVMCPUId,                 &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL }, 
     1182    { "VMR3GetVMCPUId",                         (void *)(uintptr_t)&VMR3GetVMCPUId,                 &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_INT,    sizeof(int),        NULL },     
    11651183    { "VMR3GetVMCPUNativeThread",               (void *)(uintptr_t)&VMR3GetVMCPUNativeThread,       &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_INT,    sizeof(void *),     NULL }, 
    11661184//    { "",                        (void *)(uintptr_t)&,                &g_aArgsVM[0],                              RT_ELEMENTS(g_aArgsVM),                                REMFNDESC_FLAGS_RET_INT,    sizeof(int),   NULL }, 
     
    11841202    { "RTLogPrintf",                            (void *)(uintptr_t)&RTLogPrintf,                    &g_aArgsRTLogPrintf[0],                     RT_ELEMENTS(g_aArgsRTLogPrintf),                       REMFNDESC_FLAGS_RET_VOID,   0,                  NULL }, 
    11851203    { "RTMemAlloc",                             (void *)(uintptr_t)&RTMemAlloc,                     &g_aArgsSIZE_T[0],                          RT_ELEMENTS(g_aArgsSIZE_T),                            REMFNDESC_FLAGS_RET_INT,    sizeof(void *),     NULL }, 
     1204    { "RTMemAllocZ",                            (void *)(uintptr_t)&RTMemAllocZ,                     &g_aArgsSIZE_T[0],                          RT_ELEMENTS(g_aArgsSIZE_T),                            REMFNDESC_FLAGS_RET_INT,    sizeof(void *),     NULL }, 
     1205    { "RTMemRealloc",                           (void *)(uintptr_t)&RTMemRealloc,                     &g_aArgsRTMemRealloc[0],                          RT_ELEMENTS(g_aArgsRTMemRealloc),                            REMFNDESC_FLAGS_RET_INT,    sizeof(void *),     NULL }, 
    11861206    { "RTMemExecAlloc",                         (void *)(uintptr_t)&RTMemExecAlloc,                 &g_aArgsSIZE_T[0],                          RT_ELEMENTS(g_aArgsSIZE_T),                            REMFNDESC_FLAGS_RET_INT,    sizeof(void *),     NULL }, 
     1207 
    11871208    { "RTMemExecFree",                          (void *)(uintptr_t)&RTMemExecFree,                  &g_aArgsPTR[0],                             RT_ELEMENTS(g_aArgsPTR),                               REMFNDESC_FLAGS_RET_VOID,   0,                  NULL }, 
    11881209    { "RTMemFree",                              (void *)(uintptr_t)&RTMemFree,                      &g_aArgsPTR[0],                             RT_ELEMENTS(g_aArgsPTR),                               REMFNDESC_FLAGS_RET_VOID,   0,                  NULL }, 
  • trunk/src/recompiler_new/VBoxRecompiler.c

    r14425 r14475  
    218218*   Internal Functions                                                         * 
    219219*******************************************************************************/ 
    220 static void remAbort(int rc, const char *pszTip); 
     220void remAbort(int rc, const char *pszTip); 
    221221extern int testmath(void); 
    222222 
     
    44564456 * @param   pszTip  Hint about why/when this happend. 
    44574457 */ 
    4458 static void remAbort(int rc, const char *pszTip) 
     4458void remAbort(int rc, const char *pszTip) 
    44594459{ 
    44604460    PVM pVM; 
  • trunk/src/recompiler_new/cpu-all.h

    r14277 r14475  
    249249 
    250250#ifdef VBOX 
     251void remAbort(int rc, const char *pszTip) __attribute__((__noreturn__)); 
     252 
    251253#ifndef VBOX_WITH_NEW_PHYS_CODE 
    252254void     remR3GrowDynRange(unsigned long physaddr); 
  • trunk/src/recompiler_new/osdep.h

    r14447 r14475  
    1616#endif 
    1717#define qemu_vsnprintf(pszBuf, cbBuf, pszFormat, args) \ 
    18                             RTStrPrintfV((pszBuf), (cbBuf), (pszFormat), (args)) 
     18                               RTStrPrintfV((pszBuf), (cbBuf), (pszFormat), (args)) 
    1919#define qemu_vprintf(pszFormat, args) \ 
    20                             RTLogPrintfV((pszFormat), (args)) 
    21 #define qemu_printf         RTLogPrintf 
    22 #define qemu_malloc(cb)     RTMemAlloc(cb) 
    23 #define qemu_mallocz(cb)    RTMemAllocZ(cb) 
     20                               RTLogPrintfV((pszFormat), (args)) 
     21#define qemu_printf            RTLogPrintf 
     22#define qemu_malloc(cb)        RTMemAlloc(cb) 
     23#define qemu_mallocz(cb)       RTMemAllocZ(cb) 
     24#define qemu_realloc(ptr, cb)  RTMemRealloc(ptr, cb) 
     25 
    2426#define qemu_free(pv)       RTMemFree(pv) 
    2527#define qemu_strdup(psz)    RTStrDup(psz) 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy