Changeset 15300 in vbox
- Timestamp:
- Dec 11, 2008 12:02:12 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 40723
- Location:
- trunk/src/recompiler_new
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler_new/Makefile.kmk
r15280 r15300 27 27 # 28 28 VBOX_PATH_RECOMPILER_SRC := $(PATH_SUB_CURRENT) 29 30 # For 32-bit targets when enabled 64-bit guests we build 2 REM DLLs: 31 # with 64-bit support (slow and buggy at the moment) VBOXREM64 32 # only 32-bit support (faster, stable, but not suitable for 64-bit guests) VBOXREM32 33 # During the runtime, we load appropriate library from VBOXREM, depending on guest settings. 34 # 64-bit targets have 64-bit enabled REM by default, so is not part of this mess 35 if1of (x86, $(KBUILD_TARGET_ARCH)) 36 ifdef VBOX_WITH_64_BITS_GUESTS 37 VBOX_USE_REM64 := 1 38 endif 39 endif 40 29 41 30 42 TEMPLATE_DUMMY = dummy template (move to kBuild) ## @todo Will be there in the next update, remove this. … … 59 71 endif 60 72 61 62 # VBOX_WITH_64_BITS_GUESTS = 163 64 # For 32-bit targets when enabled 64-bit guests we build 2 REM DLLs:65 # with 64-bit support (slow and buggy at the moment) VBOXREM6466 # only 32-bit support (faster, stable, but not suitable for 64-bit guests) VBOXREM67 # During the runtime, we load appropriate library, depending on guest settings.68 if1of (x86, $(KBUILD_TARGET_ARCH))69 ifdef VBOX_WITH_64_BITS_GUESTS70 USE_VBOXREM64 := 171 endif72 else73 USE_VBOXREM64 :=74 endif75 76 77 73 # 78 74 # Target lists (some of them anyways). … … 81 77 SYSMODS += VBoxREM2 82 78 endif 83 ifeq ($(KBUILD_TARGET),win) 84 DLLS += VBoxREM 85 else 86 ## @todo this is wrong, proper DLLS are DLLS not IMPORT_LIBS. nice try ;-) 87 IMPORT_LIBS += VBoxREM 79 80 ifndef VBOX_USE_REM64 81 ifeq ($(KBUILD_TARGET),win) 82 DLLS += VBoxREM 83 else 84 ## @todo this is wrong, proper DLLS are DLLS not IMPORT_LIBS. nice try ;-) 85 IMPORT_LIBS += VBoxREM 86 endif 88 87 endif 89 88 … … 199 198 200 199 201 ifdef USE_VBOXREM64 202 # 203 # The VBoxREM64 module, for targeting 64-bit guests on 32-bit systems. 204 # 205 # Currently we never mix USE_VBOXREM64 and VBoxREM2, so can always use VBoxREM 206 ## @todo: assert for that? use $(REM_MOD) instead? 207 # But loading logic got to be updated too. 208 ifeq ($(KBUILD_TARGET), win) 209 DLL += VBoxREM64 210 else 211 ## @todo see comment above. 212 IMPORT_LIBS += VBoxREM64 213 endif 214 VBoxREM64_EXTENDS = $(REM_MOD) 215 VBoxREM64_EXTENDS_BY = appending 216 VBoxREM64_DEFS = VBOX_ENABLE_VBOXREM64 200 ifdef VBOX_USE_REM64 201 # kmk doesn't work the way it should wrt EXTENDS and variable value evaluation 202 VBoxREM32_EXTENDS := $(REM_MOD) 203 VBoxREM32_EXTEND_BY := appending 204 VBoxREM32_TEMPLATE := $(VBoxREM_TEMPLATE) 205 VBoxREM32_DEFS := $($(REM_MOD)_DEFS) 206 VBoxREM32_INCS := $($(REM_MOD)_INCS) 207 VBoxREM32_SOURCES := $($(REM_MOD)_SOURCES) 208 VBoxREM32_LIBS := $($(REM_MOD)_LIBS) $(LIB_VMM) $(LIB_RUNTIME) 209 210 VBoxREM64_EXTENDS = $(REM_MOD) 211 VBoxREM64_EXTEND_BY = appending 212 VBoxREM64_TEMPLATE := $(VBoxREM_TEMPLATE) 213 VBoxREM64_DEFS := $($(REM_MOD)_DEFS) VBOX_ENABLE_VBOXREM64 214 VBoxREM64_INCS := $($(REM_MOD)_INCS) 215 VBoxREM64_SOURCES := $($(REM_MOD)_SOURCES) 216 VBoxREM64_LIBS := $($(REM_MOD)_LIBS) $(LIB_VMM) $(LIB_RUNTIME) 217 218 VBoxREMSel_TEMPLATE = VBOXR3 219 VBoxREMSel_NAME = VBoxREM 220 VBoxREMSel_DEFS = IN_REM_R3 $(if $(VBOX_WITH_VMI),VBOX_WITH_VMI,) \ 221 VBOX_WITH_NEW_RECOMPILER VBOX_USE_BITNESS_SELECTOR 222 VBoxREMSel_SOURCES = VBoxREMWrapper.cpp 223 224 ifeq ($(KBUILD_TARGET), win) 225 DLL += VBoxREM32 VBoxREM64 VBoxREMSel 226 else 227 IMPORT_LIBS += VBoxREM32 VBoxREM64 VBoxREMSel 228 endif 229 217 230 endif # USE_VBOXREM64 218 231 -
trunk/src/recompiler_new/VBoxREMWrapper.cpp
r15284 r15300 179 179 # define USE_REM_IMPORT_JUMP_GLUE 180 180 #endif 181 182 181 183 182 /******************************************************************************* … … 1944 1943 #endif 1945 1944 1945 #ifdef VBOX_USE_BITNESS_SELECTOR 1946 /** 1947 * Loads real REM object, resolves all exports (imports are done by native loader). 1948 * 1949 * @returns VBox status code. 1950 */ 1951 static int remLoadProperObj(PVM pVM) 1952 { 1953 size_t offFilename; 1954 char szPath[RTPATH_MAX]; 1955 bool use64 = true; 1956 int rc = RTPathAppPrivateArch(szPath, sizeof(szPath) - 32); 1957 AssertRCReturn(rc, rc); 1958 offFilename = strlen(szPath); 1959 1960 /* 1961 * Load the VBoxREM32/64 object/DLL. 1962 */ 1963 strcpy(&szPath[offFilename], use64 ? "/VBoxREM64" : "/VBoxREM32"); 1964 rc = RTLdrLoad(szPath, &g_ModREM2); 1965 if (RT_SUCCESS(rc)) 1966 { 1967 if (RT_SUCCESS(rc)) 1968 { 1969 /* 1970 * Resolve exports. 1971 */ 1972 unsigned i; 1973 for (i = 0; i < RT_ELEMENTS(g_aExports); i++) 1974 { 1975 void* Value; 1976 rc = RTLdrGetSymbol(g_ModREM2, g_aExports[i].pszName, &Value); 1977 AssertMsgRC(rc, ("%s rc=%Rrc\n", g_aExports[i].pszName, rc)); 1978 if (RT_FAILURE(rc)) 1979 break; 1980 *(void **)g_aExports[i].pv = Value; 1981 } 1982 } 1983 } 1984 1985 return rc; 1986 } 1987 1988 /** 1989 * Unloads the real REM object. 1990 */ 1991 static void remUnloadProperObj(void) 1992 { 1993 unsigned i; 1994 1995 /* close module. */ 1996 RTLdrClose(g_ModREM2); 1997 g_ModREM2 = NIL_RTLDRMOD; 1998 } 1999 #endif 2000 1946 2001 1947 2002 REMR3DECL(int) REMR3Init(PVM pVM) … … 1949 2004 #ifdef USE_REM_STUBS 1950 2005 return VINF_SUCCESS; 2006 #elif VBOX_USE_BITNESS_SELECTOR 2007 if (!pfnREMR3Init) 2008 { 2009 int rc = remLoadProperObj(pVM); 2010 if (RT_FAILURE(rc)) 2011 return rc; 2012 } 2013 return pfnREMR3Init(pVM); 1951 2014 #else 1952 2015 if (!pfnREMR3Init) … … 1964 2027 #ifdef USE_REM_STUBS 1965 2028 return VINF_SUCCESS; 2029 #elif VBOX_USE_BITNESS_SELECTOR 2030 int rc; 2031 Assert(VALID_PTR(pfnREMR3Term)); 2032 rc = pfnREMR3Term(pVM); 2033 remUnloadProperObj(); 2034 return rc; 1966 2035 #else 1967 2036 int rc; -
trunk/src/recompiler_new/VBoxRecompiler.c
r15284 r15300 245 245 uint32_t u32Dummy; 246 246 int rc; 247 248 #ifdef VBOX_ENABLE_VBOXREM64 249 LogRel(("Using 64-bit aware REM\n")); 250 #endif 247 251 248 252 /*
Note:
See TracChangeset
for help on using the changeset viewer.