- Timestamp:
- Dec 15, 2008 4:58:50 PM (16 years ago)
- Location:
- trunk/src/recompiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/recompiler/Sun/config.h
r9143 r15520 27 27 28 28 #ifdef VBOX_WITH_64_BITS_GUESTS 29 #define TARGET_X86_64 29 # if defined(__x86_64__) || defined (VBOX_ENABLE_VBOXREM64) 30 # define TARGET_X86_64 31 # endif 30 32 #endif -
trunk/src/recompiler/VBoxREMWrapper.cpp
r14755 r15520 1919 1919 # endif 1920 1920 } 1921 #endif 1922 1921 1922 #endif /* USE_REM_STUBS */ 1923 #ifdef VBOX_USE_BITNESS_SELECTOR 1924 1925 /** 1926 * Checks if 64-bit support is enabled. 1927 * 1928 * @returns true / false. 1929 * @param pVM Pointer to the shared VM structure. 1930 */ 1931 static bool remIs64bitEnabled(PVM pVM) 1932 { 1933 bool f; 1934 int rc = CFGMR3QueryBoolDef(CFGMR3GetChild(CFGMR3GetRoot(pVM), "REM"), "64bitEnabled", &f, false); 1935 AssertRCReturn(rc, false); 1936 return f; 1937 } 1938 1939 1940 /** 1941 * Loads real REM object, resolves all exports (imports are done by native loader). 1942 * 1943 * @returns VBox status code. 1944 */ 1945 static int remLoadProperObj(PVM pVM) 1946 { 1947 /* 1948 * Load the VBoxREM32/64 object/DLL. 1949 */ 1950 int rc = SUPR3HardenedLdrLoadAppPriv(remIs64bitEnabled(pVM) ? "VBoxREM64" : "VBoxREM32", &g_ModREM2); 1951 if (RT_SUCCESS(rc)) 1952 { 1953 /* 1954 * Resolve exports. 1955 */ 1956 unsigned i; 1957 for (i = 0; i < RT_ELEMENTS(g_aExports); i++) 1958 { 1959 void *pvValue; 1960 rc = RTLdrGetSymbol(g_ModREM2, g_aExports[i].pszName, &pvValue); 1961 AssertLogRelMsgRCBreak(rc, ("%s rc=%Rrc\n", g_aExports[i].pszName, rc)); 1962 *(void **)g_aExports[i].pv = pvValue; 1963 } 1964 } 1965 1966 return rc; 1967 } 1968 1969 1970 /** 1971 * Unloads the real REM object. 1972 */ 1973 static void remUnloadProperObj(void) 1974 { 1975 /* close module. */ 1976 RTLdrClose(g_ModREM2); 1977 g_ModREM2 = NIL_RTLDRMOD; 1978 } 1979 1980 #endif /* VBOX_USE_BITNESS_SELECTOR */ 1923 1981 1924 1982 REMR3DECL(int) REMR3Init(PVM pVM) … … 1926 1984 #ifdef USE_REM_STUBS 1927 1985 return VINF_SUCCESS; 1986 1987 #elif defined(VBOX_USE_BITNESS_SELECTOR) 1988 if (!pfnREMR3Init) 1989 { 1990 int rc = remLoadProperObj(pVM); 1991 if (RT_FAILURE(rc)) 1992 return rc; 1993 } 1994 return pfnREMR3Init(pVM); 1995 1928 1996 #else 1929 1997 if (!pfnREMR3Init) … … 1941 2009 #ifdef USE_REM_STUBS 1942 2010 return VINF_SUCCESS; 2011 2012 #elif defined(VBOX_USE_BITNESS_SELECTOR) 2013 int rc; 2014 Assert(VALID_PTR(pfnREMR3Term)); 2015 rc = pfnREMR3Term(pVM); 2016 remUnloadProperObj(); 2017 return rc; 2018 1943 2019 #else 1944 2020 int rc;
Note:
See TracChangeset
for help on using the changeset viewer.