VirtualBox

Changeset 2422

Show
Ignore:
Timestamp:
04/30/07 14:03:47 (2 years ago)
Author:
vboxsync
Message:

Removed the old recompiler code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/Makefile

    r1697 r2422  
    3131endif 
    3232 
    33 SUBDIRS += bldprogs libs VBox 
    34 #ifeq ($(filter linux.x86 l4.x86 win.x86 os2.x86,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),) 
    35  SUBDIRS += recompiler/new 
    36 #else 
    37 # SUBDIRS += recompiler 
    38 #endif 
     33SUBDIRS += bldprogs libs VBox recompiler 
    3934ifneq ($(wildcard apps),) 
    4035 SUBDIRS += apps 
  • trunk/src/recompiler/InnoTek/Makefile.kmk

    r1 r2422  
    1818DEPTH = ../../.. 
    1919include $(PATH_KBUILD)/up.kmk 
    20  
  • trunk/src/recompiler/InnoTek/config-host.h

    r1 r2422  
     1/* $Id$ */ 
    12/** @file 
    23 * Innotek Host Config - Maintained by hand 
     
    1920 */ 
    2021 
    21 #define HOST_I386 1 
    22 #ifdef __WIN32__ 
    23 # define CONFIG_WIN32 1 
    24 #elif defined(__OS2__) 
    25 # define CONFIG_OS2 
    26 #elif defined(__DARWIN__) 
    27 # define CONFIG_DARWIN 
     22 
     23#if defined(__amd64__) || defined(HOST_X86_64) /* latter, for dyngen on win64. */ 
     24# define HOST_X86_64 1 
     25# define HOST_LONG_BITS 64 
    2826#else 
    29 # define HAVE_BYTESWAP_H 1 
     27# define HOST_I386 1 
     28# define HOST_LONG_BITS 32 
     29# ifdef __WIN32__ 
     30#  define CONFIG_WIN32 1 
     31# elif defined(__OS2__) 
     32#  define CONFIG_OS2 
     33# elif defined(__DARWIN__) 
     34#  define CONFIG_DARWIN 
     35# elif defined(__FREEBSD__) || defined(__NETBSD__) || defined(__OPENBSD__) 
     36/*#  define CONFIG_BSD*/ 
     37# elif defined(__SOLARIS__) 
     38/*#  define CONFIG_SUN*/ 
     39# elif !defined(IPRT_NO_CRT) 
     40#  define HAVE_BYTESWAP_H 1 
     41# endif 
    3042#endif 
    31 #define CONFIG_SOFTMMU 1 
     43#define QEMU_VERSION "0.8.1" 
     44#define CONFIG_UNAME_RELEASE "" 
     45#define CONFIG_QEMU_SHAREDIR "." 
    3246 
    33 #define CONFIG_SDL 1 
    34 #define CONFIG_SLIRP 1 
    35  
    36 #ifdef __LINUX__ 
    37 #define CONFIG_GDBSTUB 1 
    38 #endif 
    39 /* #define HAVE_GPROF 1 */ 
    40 /* #define CONFIG_STATIC 1 */ 
    41 #define QEMU_VERSION "0.6.1" 
    42 #define CONFIG_QEMU_SHAREDIR "." 
  • trunk/src/recompiler/InnoTek/config.h

    r1 r2422  
     1/* $Id$ */ 
    12/** @file 
    23 * Innotek Config - Maintained by hand 
     
    2425#define TARGET_I386 1 
    2526#define CONFIG_SOFTMMU 1 
     27 
  • trunk/src/recompiler/Makefile.kmk

    r1 r2422  
     1# $Id$ 
    12## @file 
    2 
    3 # !GNU MAKE! 
     3# The Recompiler Makefile. 
     4
     5# There are a few of complicating factors here, esp. on AMD64 systems: 
     6
     7#   * op.c doesn't compile work correctly with gcc 4. For this we've 
     8#     checked in op.S, which is the reason why we don't compile op.c 
     9#     directly but always compile via the assembly file.s 
     10#   * On 64-bit Windows we lack a compiler and have to resort to a 
     11#     linux cross compiler building an ELF relocatable module which 
     12#     we then load using a wrapper module. Thus the REM_MOD mess. 
     13#   * On platforms using the 64-bit GCC ABI, we're not allowed to 
     14#     generate non-PIC shared objects, and op.c requires the code 
     15#     to be non-PIC. We apply the same trick as we developed for 
     16#     64-bit windows. 
     17
     18 
    419# 
    520# Copyright (C) 2006 InnoTek Systemberatung GmbH 
     
    2237include $(PATH_KBUILD)/header.kmk 
    2338 
     39 
    2440# todo this is a BUILD_PLATFORM binary, to a target binary! 
    25 ifeq ($(filter darwin,$(BUILD_TARGET)),) 
    26  ifeq ($(VBOX_USING_GCC4),) 
    27   BLDPROGS            = dyngen 
    28  endif 
    29  DLLS                 = VBoxREM 
    30  ifeq ($(BUILD_TARGET_ARCH),amd64) 
    31   SYSMODS             = VBoxREM2 
    32   REM_MOD             = VBoxREM2 
    33  else 
    34   REM_MOD             = VBoxREM 
    35  endif 
    36 endif # !darwin 
     41BLDPROGS              = dyngen 
     42ifeq ($(BUILD_TARGET_ARCH),amd64) 
     43 SYSMODS              = VBoxREM2 
     44 REM_MOD              = VBoxREM2 
     45else 
     46 REM_MOD              = VBoxREM 
     47endif 
     48DLLS                  = VBoxREM 
    3749IMPORT_LIBS           = VBoxREMImp 
    38 GPLEXPORTS            = qemu-source-drop 
    3950 
    4051OTHER_CLEAN           = \ 
     
    4253        $(PATH_$(REM_MOD))/opc.h \ 
    4354        $(PATH_$(REM_MOD))/gen-op.h \ 
    44         $(PATH_$(REM_MOD))/opc.h \ 
    45         $(PATH_TARGET)/VBoxREMImp.c 
    46  
    47 #DEFS += DEBUG_DISAS 
    48  
    49 # private hack for gcc 4.1 
    50 ifeq ($(USERNAME).$(BUILD_TARGET),bird.linux) 
    51  TOOL_GCC3_CC = gcc-3.4.6 
    52  override VBOX_GCC_Wno-variadic-macros= 
    53  override VBOX_USING_GCC4= 
    54 endif 
    55  
     55        $(PATH_$(REM_MOD))/opc.h 
     56 
     57DEFS.amd64 += REM_PHYS_ADDR_IN_TLB 
     58 
     59
     60# L4 must use the no-crt path because it's lacking math stuff it seems... 
     61# Darwin must use the non-crt path because it can't compile op.c nativly. 
     62# All the AMD64 target must use the no-crt path because ELF doesn't like op.c 
     63# when stuffed into a shared library and windows doesn't have 64-bit gcc (yet). 
     64
     65ifeq ($(filter-out l4 darwin freebsd,$(BUILD_TARGET)),) 
     66 REM_USE_NOCRT := 1 
     67endif 
     68ifeq ($(BUILD_TARGET_ARCH),amd64) 
     69 REM_USE_NOCRT := 1 
     70endif 
     71 
     72 
     73
     74# The dyngen build tool. 
     75
    5676ifeq ($(BUILD_PLATFORM),win) 
    5777 dyngen_TOOL          = MINGW32 
     
    6080 dyngen_BLD_TRG_ARCH  = x86 
    6181 dyngen_BLD_TRG_CPU   = i386 
    62  dyngen_CFLAGS        = -Wall -g -fno-strict-aliasing 
     82 dyngen_CFLAGS        = -Wall -g -fno-strict-aliasing  
     83 ifeq ($(BUILD_TARGET_ARCH),amd64) 
     84  dyngen_DEFS        += HOST_X86_64=1 
     85 endif 
    6386else 
    64  dyngen_TEMPLATE      = VBOXBLDPRO 
    65 endif 
     87 dyngen_TEMPLATE      = VBOXBLDPROG 
     88endif 
     89dyngen_CFLAGS        += -Wno-missing-prototypes -Wno-missing-declarations 
    6690dyngen_INCS           = \ 
    6791        InnoTek \ 
    6892        target-i386 \ 
    69         fpu \ 
    70         $(PATH_ROOT)/ ## @todo what is $(PATH_ROOT) doing here? 
     93        fpu 
    7194dyngen_SOURCES        = dyngen.c 
    7295 
    7396 
    7497# 
    75 # The VBoxREM or VBoxREM2 DLL/SO. 
    76 
    77 $(REM_MOD)_TOOL          = GCC3 
    78 $(REM_MOD)_TOOL.win.x86  = MINGW32 
    79 $(REM_MOD)_TOOL.win.amd64= XGCCAMD64LINUX 
    80 $(REM_MOD)_SDKS.win.x86  = W32API                                                       ## @todo do we really need this now? 
    81 $(REM_MOD)_ASFLAGS       = -x assembler-with-cpp                        ## @todo didn't I make this default already? 
    82 $(REM_MOD)_SYSSUFF       = .rel                             # amd64 
    83  
    84 $(REM_MOD)_CFLAGS        = -Wall -g 
    85 ifdef ($(BUILD_TARGET),win64) # with -O1 and higher, it generates incorrect code for double and long double constants. ## @todo didn't I fix this yet? 
    86  REMNoCRT_CFLAGS.release  = -O0 
    87  $(REM_MOD)_CFLAGS.amd64  = -mcmodel=medium -fno-common -O0 -fno-strict-aliasing -fno-math-errno -fno-peephole2 
    88 else 
    89 $(REM_MOD)_CFLAGS.amd64  = -mcmodel=medium -fno-common -O2 -fno-strict-aliasing 
    90 endif 
    91 $(REM_MOD)_CFLAGS.debug  = -O0 
    92 ifdef ($(BUILD_TARGET_ARCH),x86) 
    93 $(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse 
    94 endif 
    95 $(REM_MOD)_CFLAGS.profile = $($(REM_MOD)_CFLAGS.release) 
    96 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) 
    97 $(REM_MOD)_CFLAGS.l4     = -nostdinc 
    98 $(REM_MOD)_INCS          = \ 
     98# The VBoxREM.[dll|so|..] or VBoxREM2.rel. 
     99
     100$(REM_MOD)_DEFS             = IN_REM_R3 REM_INCLUDE_CPU_H 
     101#$(REM_MOD)_DEFS          += DEBUG_ALL_LOGGING 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. 
     102 
     103$(REM_MOD)_INCS             = \ 
    99104        InnoTek \ 
    100         InnoTek/crt
     105        InnoTek/crt
    101106        target-i386 \ 
    102107        fpu \ 
    103108        $(PATH_$(REM_MOD)) \ 
    104109        $(PATH_ROOT)/src/VBox/VMM 
    105 ifeq ($(BUILD_TARGET),l4) 
    106 $(REM_MOD)_INCS         += $(VBOX_L4_GCC3_INCS) $(L4_INCDIR) 
    107 endif 
    108 $(REM_MOD)_DEFS          = IN_RING3 IN_REM_R3 REM_INCLUDE_CPU_H #LOG_USE_C99 
    109 #$(REM_MOD)_DEFS          += DEBUG_PCALL DEBUG_EXEC DEBUG_FLUSH DEBUG_IOPORT DEBUG_SIGNAL DEBUG_TLB_CHECK DEBUG_TB_INVALIDATE DEBUG_TLB  # Enables huge amounts of debug logging. 
    110 # these defines are probably all irrelevant now: 
    111 $(REM_MOD)_DEFS         += _GNU_SOURCE _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE _REENTRANT 
    112 ifeq ($(VBOX_USING_GCC4),) 
    113  $(REM_MOD)_SOURCES      = \ 
     110 
     111$(REM_MOD)_SOURCES          = \ 
    114112        VBoxRecompiler.c \ 
    115113        cpu-exec.c \ 
    116114        exec.c \ 
    117115        translate-all.c \ 
     116        translate-op.c \ 
     117        fpu/softfloat-native.c \ 
    118118        target-i386/helper.c \ 
    119119        target-i386/helper2.c \ 
    120         target-i386/translate.c 
    121 #       translate-op.c \ 
    122 #       fpu/softfloat-native.c \ 
    123 #       InnoTek/testmath.c 
    124  
    125 # ***hacking*** 
    126 # ifeq ($(filter-out win os2,$(BUILD_TARGET)),) 
    127   $(REM_MOD)_SOURCES    += target-i386/op.c 
    128   FILE_OP_OBJ            = $(PATH_$(REM_MOD)_target-i386/op.c)/op.o 
    129 # else # The remaining targets can be using gcc-4 and needs checking. 
    130 #  $(REM_MOD)_SOURCES    += $(PATH_$(REM_MOD))/op.S 
    131 #  FILE_OP_OBJ            = $(PATH_$(REM_MOD)_$(PATH_$(REM_MOD))/op.S)/op.o 
    132 #  $(REM_MOD)_CLEAN       = $(FILE_OP_OBJ) 
    133 # endif 
    134  $(REM_MOD)_SOURCES     += InnoTek/loghack.c                                                            # this will be obsoleted soon. 
    135 else 
    136  $(REM_MOD)_SOURCES      = \ 
    137         precompiled/VBoxRecompiler.o \ 
    138         precompiled/cpu-exec.o \ 
    139         precompiled/exec.o \ 
    140         precompiled/translate-all.o \ 
    141         precompiled/op.o \ 
    142         precompiled/helper.o \ 
    143         precompiled/helper2.o \ 
    144         precompiled/translate.o \ 
    145         precompiled/loghack.o 
    146  FILE_OP_OBJ             = precompiled/op.o 
    147 endif 
    148 $(REM_MOD)_DEFS         += fprintf=hacked_fprintf printf=hacked_printf      # ditto 
    149 ifneq ($(BUILD_TYPE),debug) 
    150 $(REM_MOD)_SOURCES.win.x86 = $(REM_MOD).def 
    151 else 
    152 $(REM_MOD)_LDFLAGS.win.x86 = --export-all-symbols --output-def $(PATH_TARGET)/$(REM_MOD)-new.def \ 
    153         --exclude-symbols=console_main --exclude-symbols=WinMain@16 
    154 endif 
    155 $(REM_MOD)_SOURCES.os2   = $(PATH_TARGET)/VBoxREMOS2.def 
    156 $(REM_MOD)_LDFLAGS.linux = -Wl,--no-undefined 
    157 $(REM_MOD)_LDFLAGS.l4    = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined 
    158  
    159 ifeq ($(BUILD_TARGET_ARCH),amd64) 
    160 $(REM_MOD)_LIBS           = \ 
    161         $(LIB_RUNTIME_NOCRT_GCC64) # !create this! 
    162 #       $(VBOX_GCC_LIBGCC)  - fix this 
    163 else # x86 
    164 $(REM_MOD)_LIBS           = \ 
    165         $(LIB_VMM) \ 
    166         $(LIB_RUNTIME) 
    167 $(REM_MOD)_LIBS.win       = \ 
    168         mingw32 \ 
    169         user32 gdi32 winmm ws2_32 iphlpapi dxguid 
    170 $(REM_MOD)_LIBS.linux     = \ 
    171         $(LIB_UUID) \ 
    172         m \ 
    173         util \ 
    174         rt \ 
    175         $(LIB_PTHREAD) 
    176 $(REM_MOD)_LIBS.l4        = \ 
    177         gcc \ 
    178         $(L4_LIBDIR)/libvboxserver.s.so \ 
    179         $(L4_LIBDIR)/libdl.s.so \ 
    180         $(L4_LIBDIR)/libuc.0.s.so 
    181 endif # x86 
     120        target-i386/translate.c \ 
     121        InnoTek/testmath.c 
     122ifeq ($(filter-out win os2,$(BUILD_TARGET)),) 
     123 $(REM_MOD)_SOURCES        += target-i386/op.c 
     124 FILE_OP_OBJ                = $(PATH_$(REM_MOD)_target-i386/op.c)/op.o 
     125else # The remaining targets can be using gcc-4 and needs checking. 
     126 $(REM_MOD)_SOURCES        += $(PATH_$(REM_MOD))/op.S 
     127 FILE_OP_OBJ                = $(PATH_$(REM_MOD)_$(PATH_$(REM_MOD))/op.S)/op.o 
     128 $(REM_MOD)_CLEAN           = $(FILE_OP_OBJ) $(PATH_$(REM_MOD))/op.S.dep 
     129endif 
     130#$(REM_MOD)_SOURCES.os2      = $(PATH_TARGET)/$(REM_MOD).def 
     131$(REM_MOD)_SOURCES.win.x86  = $(REM_MOD).def 
     132 
     133 
     134ifdef REM_USE_NOCRT 
     135 $(REM_MOD)_TEMPLATE        = VBOXNOCRTGAS 
     136 $(REM_MOD)_DEFS           += LOG_USE_C99 
     137 $(REM_MOD)_CFLAGS.amd64    = -O2 
     138 $(REM_MOD)_CFLAGS.debug    = -O0 
     139 $(REM_MOD)_CFLAGS.darwin   = -fno-common -mdynamic-no-pic 
     140 ifdef ($(BUILD_TARGET_ARCH),x86) 
     141  $(REM_MOD)_CFLAGS.release+= -fomit-frame-pointer -fno-gcse 
     142 endif 
     143 
     144 # This doesn't fit in IPRT because it requires GAS and is LGPL. 
     145 $(REM_MOD)_SOURCES        += \ 
     146        InnoTek/e_powl-$(BUILD_TARGET_ARCH).S 
     147 
     148 ifeq ($(REM_MOD),VBoxREM) 
     149  $(REM_MOD)_LIBS           = \ 
     150        $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB) \ 
     151        $(LIB_VMM) \ 
     152        $(LIB_RUNTIME) 
     153  $(REM_MOD)_LIBS.darwin    = \ 
     154        $(TARGET_VBoxREMImp) 
     155#       $(PATH_BIN)/VBoxREMImp.dylib 
     156  $(REM_MOD)_LDFLAGS.darwin  = -read_only_relocs suppress -multiply_defined warning  #-install_name @executable_path/$(REM_MOD).dylib# 
     157 else 
     158  $(REM_MOD)_LIBS           = \ 
     159        $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB) 
     160  $(REM_MOD)_SYSSUFF        = .rel 
     161 endif 
     162 
     163else # !REM_USE_NOCRT 
     164 
     165 $(REM_MOD)_TOOL            = GCC3 
     166 $(REM_MOD)_TOOL.win.x86    = MINGW32 
     167 $(REM_MOD)_TOOL.win.amd64  = XGCCAMD64LINUX 
     168 $(REM_MOD)_SDKS.win.x86    = W32API                                                    ## @todo do we really need this now? 
     169 $(REM_MOD)_ASFLAGS         = -x assembler-with-cpp                     ## @todo didn't I make this default already? 
     170 $(REM_MOD)_CFLAGS          = -Wall -g 
     171 $(REM_MOD)_CFLAGS.debug    = -O0 
     172 $(REM_MOD)_CFLAGS.release += -fomit-frame-pointer -fno-gcse 
     173 $(REM_MOD)_CFLAGS.profile  = $($(REM_MOD)_CFLAGS.release) 
     174 $(REM_MOD)_CFLAGS.kprofile = $($(REM_MOD)_CFLAGS.release) 
     175 $(REM_MOD)_CFLAGS.l4       = -nostdinc 
     176 ifeq ($(BUILD_TARGET),l4) 
     177  $(REM_MOD)_INCS          += $(VBOX_L4_GCC3_INCS) $(L4_INCDIR) 
     178 endif 
     179 
     180 $(REM_MOD)_DEFS           += IN_RING3 LOG_USE_C99 
     181 #$(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. 
     182 # these defines are probably all irrelevant now: 
     183 $(REM_MOD)_DEFS           += _GNU_SOURCE _FILE_OFFSET_BITS=64 _LARGEFILE_SOURCE _REENTRANT 
     184 
     185 $(REM_MOD)_LDFLAGS.darwin  = -read_only_relocs suppress -install_name @executable_path/$(REM_MOD).dylib -multiple_defined warning 
     186 $(REM_MOD)_LDFLAGS.l4      = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib -Wl,--no-undefined 
     187 $(REM_MOD)_LDFLAGS.os2     = -Zomf 
     188 $(REM_MOD)_LDFLAGS.debug   = -g 
     189 ifeq ($(BUILD_TARGET_ARCH),amd64) 
     190  $(REM_MOD)_LIBS           = $(FILE_TOOL_GCC3_LIBGCC) 
     191 else # x86 
     192  $(REM_MOD)_LIBS           = \ 
     193        $(LIB_VMM) \ 
     194        $(LIB_RUNTIME) 
     195  $(REM_MOD)_LIBS.win.x86   = \ 
     196        mingw32 \ 
     197        user32 gdi32 winmm ws2_32 iphlpapi dxguid 
     198  $(REM_MOD)_LIBS.linux     = \ 
     199        $(LIB_UUID) \ 
     200        m \ 
     201        util \ 
     202        rt \ 
     203        $(LIB_PTHREAD) 
     204  $(REM_MOD)_LIBS.l4        = \ 
     205        gcc \ 
     206        $(L4_LIBDIR)/libvboxserver.s.so \ 
     207        $(L4_LIBDIR)/libdl.s.so \ 
     208        $(L4_LIBDIR)/libuc.0.s.so 
     209 endif # x86 
     210 
     211endif # !REM_USE_NOCRT 
    182212 
    183213# Extra flags for these source modules. 
    184214target-i386/op.c_CFLAGS         = -O2 -fno-strict-aliasing -fomit-frame-pointer -falign-functions=0 -fno-reorder-blocks -fno-optimize-sibling-calls 
    185215target-i386/op.c_CFLAGS.x86     = -fno-gcse -fno-instrument-functions -mpreferred-stack-boundary=2 
     216target-i386/op.c_CFLAGS.darwin.x86 = -m128bit-long-double -mpreferred-stack-boundary=4 ## @todo This means we can't use staged/op-elf-x86.s... 
    186217target-i386/helper.c_CFLAGS.x86 = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse 
    187218cpu-exec.c_CFLAGS.x86           = -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-gcse 
     219 
     220 
     221# 
     222# The math testcase as a standalone program for testing and debugging purposes. 
     223# 
     224## @todo This is a bit messy because of MINGW32. 
     225#BLDPROGS += testmath 
     226testmath_TOOL           = GCC3 
     227testmath_TOOL.win.x86   = MINGW32 
     228testmath_SDKS.win.x86   = W32API 
     229ifeq ($(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH),win.amd64) 
     230 # 64-bit windows: Pretend to be 32-bit. 
     231 testmath_BLD_TRG       = win32 
     232 testmath_BLD_TRG_ARCH  = x86 
     233 testmath_BLD_TRG_CPU   = i386 
     234endif 
     235testmath_ASTOOL         = $(VBOX_ASTOOL) 
     236ifeq ($(filter-out win32 win64,$(BUILD_PLATFORM)),) 
     237 testmath_ASFLAGS        = -f win32 -DNASM_FORMAT_PE $(VBOX_ASFLAGS) -w+orphan-labels 
     238else 
     239 testmath_ASFLAGS        = -f elf -DNASM_FORMAT_ELF $(VBOX_ASFLAGS) -w+orphan-labels 
     240endif 
     241testmath_ASFLAGS.amd64  = -m amd64 
     242testmath_CFLAGS         = -Wall -g 
     243testmath_CFLAGS.release = -O3 
     244testmath_LDFLAGS        = -g 
     245testmath_DEFS           = MATHTEST_STANDALONE 
     246testmath_SOURCES        = InnoTek/testmath.c 
     247#testmath_SOURCES        += $(PATH_LIB)/RuntimeR3NoCRTGCC$(VBOX_SUFF_LIB) 
    188248 
    189249 
     
    197257        VBoxREMWrapper.cpp \ 
    198258        VBoxREMWrapperA.asm 
     259VBoxREM_LDFLAGS.darwin = -install_name @executable_path/VBoxREM.dylib 
    199260VBoxREM_LIBS           = \ 
    200261        $(LIB_VMM) \ 
     
    207268# 
    208269VBoxREMImp_TEMPLATE         = VBOXR3 
     270ifeq ($(BUILD_TARGET),darwin) 
     271VBoxREMImp_INST             = $(INST_LIB) 
     272endif 
    209273VBoxREMImp_SOURCES.win      = VBoxREM.def 
    210274VBoxREMImp_SOURCES.os2      = $(PATH_TARGET)/VBoxREMOS2.def 
    211275ifeq ($(filter win os2,$(BUILD_TARGET)),) 
    212276VBoxREMImp_SOURCES          = $(PATH_TARGET)/VBoxREMImp.c 
     277VBoxREMImp_CLEAN            = $(PATH_TARGET)/VBoxREMImp.c 
    213278endif 
    214279VBoxREMImp_SONAME.linux     = VBoxREM.so 
    215280VBoxREMImp_SONAME.l4        = VBoxREM.s.so 
    216 VBoxREMImp_LDFLAGS.darwin   = -install_name VBoxREM.dylib 
     281VBoxREMImp_LDFLAGS.darwin   = -install_name @executable_path/VBoxREM.dylib 
     282#VBoxREMImp_LDFLAGS.darwin   = -install_name VBoxREM.dylib 
    217283VBoxREMImp_LDFLAGS.l4       = -T$(L4_LIBDIR)/../main_rel.ld -nostdlib 
    218284 
     
    238304# Generate the op.S file somehow... 
    239305# 
    240 # Gathering the flags, defines and include dirs for the command is a lot  
    241 # of work. Unfortunately, there is only a highly specialized kBuild function  
     306# Gathering the flags, defines and include dirs for the command is a lot 
     307# of work. Unfortunately, there is only a highly specialized kBuild function 
    242308# for doing this, so we're currently left to our own devices here. 
    243309# 
    244  
     310# Add something like VBOX_RECOMPILER_OP_GCC = gcc-3.4.6 to LocalConfig.kmk 
     311# to be 100% sure that you get a working op.S. My gcc 4.1.1 seems to work 
     312# fine, so feel free to try VBOX_RECOMPILER_OP_GCC = gcc. 
     313
     314# The op-undefined.lst is generated by finding all the undefined symbols 
     315# in one (or more) ELF op.o files using nm. 
     316
    245317ifndef VBOX_RECOMPILER_OP_GCC 
    246318 ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),darwin.x86) 
    247   VBOX_RECOMPILER_OP_GCC ?= gcc-elf-something 
    248  endif 
    249  ifeq ($(USERNAME).$(BUILD_TARGET),bird.linux) 
    250   VBOX_RECOMPILER_OP_GCC ?= gcc-3.4.6 
    251  endif 
    252  VBOX_RECOMPILER_OP_GCC ?= $(TOOL_$(VBOX_GCC_TOOL)_CC) 
    253  VBOX_RECOMPILER_OP_GCC ?= false 
    254 endif 
    255  
    256 ## @todo Check gcc version if plain gcc, gcc32 or gcc64. 
    257 ## @todo minimal dependencies. 
    258  
    259 $(PATH_$(REM_MOD))/op.S: target-i386/op.c staged/op-elf-$(BUILD_TARGET_ARCH).S | $(call DIRDEP,$(PATH_$(REM_MOD))) 
    260         $(RM) -f $@ $@.tmp $@.tmp2 
    261         $(VBOX_RECOMPILER_OP_GCC) $(addsuffix $(SP)\$(NL)$(TAB),\ 
    262                 -S -s \ 
    263                 $(filter-out -g -O0, \ 
    264                         $($(REM_MOD)_CFLAGS) $($(REM_MOD)_CFLAGS.$(BUILD_TYPE)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET_ARCH)) \ 
    265                         $(target-i386/op.c_CFLAGS) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET_ARCH)) \ 
    266                         ) \ 
    267                 $(addprefix -I, \ 
    268                         $($(REM_MOD)_CINCS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CINCS.$(BUILD_TARGET)) $($(REM_MOD)_CINCS) $(CINCS) \ 
    269                         $($(REM_MOD)_INCS.$(BUILD_TARGET_ARCH))  $($(REM_MOD)_INCS.$(BUILD_TARGET))  $($(REM_MOD)_INCS) $(INCS) \ 
    270                         ) \ 
    271                 $(addprefix -D, \ 
    272                         $($(REM_MOD)_CDEFS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CDEFS.$(BUILD_TARGET)) $($(REM_MOD)_CDEFS) $(CDEFS.$(BUILD_TARGET)) $(CDEFS.release) $(CDEFS) \ 
    273                         $($(REM_MOD)_DEFS.$(BUILD_TARGET_ARCH))  $($(REM_MOD)_DEFS.$(BUILD_TARGET))  $($(REM_MOD)_DEFS)  $(DEFS.$(BUILD_TARGET))  $(DEFS.release)  $(DEFS) \ 
    274                         ) \ 
     319  VBOX_RECOMPILER_OP_GCC ?= i386-elf-gcc-3.4.3 # (port install i386-gcc-elf) 
     320  VBOX_RECOMPILER_OP_GCC_OK := yes 
     321  VBOX_RECOMPILER_OP_GCC_INCS ?= $(abspath $(dir $(shell LC_ALL=C $(VBOX_RECOMPILER_OP_GCC) -print-libgcc-file-name)))/include 
     322 endif 
     323 ifndef VBOX_RECOMPILER_OP_GCC 
     324  VBOX_RECOMPILER_OP_GCC := $(TOOL_$(VBOX_GCC_TOOL)_CC) 
     325  VBOX_RECOMPILER_OP_GCC_OK := dunno 
     326 endif 
     327else 
     328 # If set, assume it's an OK compiler. 
     329 VBOX_RECOMPILER_OP_GCC_OK := yes 
     330endif 
     331 
     332 
     333# The command sans -o op.S.tmp. 
     334COMPILE_OP_CMDS = $(VBOX_RECOMPILER_OP_GCC) \ 
     335        -S -s \ 
     336        $(filter-out -g -O0, \ 
     337                $($(REM_MOD)_CFLAGS) $($(REM_MOD)_CFLAGS.$(BUILD_TYPE)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CFLAGS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \ 
     338                $(target-i386/op.c_CFLAGS) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET)) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET_ARCH)) $(target-i386/op.c_CFLAGS.$(BUILD_TARGET).$(BUILD_TARGET_ARCH)) \ 
     339                ) \ 
     340        $(addprefix -I, \ 
     341                $($(REM_MOD)_CINCS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CINCS.$(BUILD_TARGET)) $($(REM_MOD)_CINCS) $(CINCS) \ 
     342                $($(REM_MOD)_INCS.$(BUILD_TARGET_ARCH))  $($(REM_MOD)_INCS.$(BUILD_TARGET))  $($(REM_MOD)_INCS) $(INCS) \ 
     343                ) \ 
     344        $(addprefix -D, \ 
     345                $($(REM_MOD)_CDEFS.$(BUILD_TARGET_ARCH)) $($(REM_MOD)_CDEFS.$(BUILD_TARGET)) $($(REM_MOD)_CDEFS) $(CDEFS.$(BUILD_TARGET)) $(CDEFS.$(BUILD_TARGET_ARCH)) $(CDEFS.$(BUILD_TYPE)) $(CDEFS) \ 
     346                $($(REM_MOD)_DEFS.$(BUILD_TARGET_ARCH))  $($(REM_MOD)_DEFS.$(BUILD_TARGET))  $($(REM_MOD)_DEFS)  $(DEFS.$(BUILD_TARGET))  $(DEFS.$(BUILD_TARGET_ARCH))  $(DEFS.$(BUILD_TYPE))  $(DEFS) \ 
     347                ) \ 
     348        -Wp,-MD,$(PATH_$(REM_MOD))/op.S.dep \ 
     349        -Wp,-MT,$(PATH_$(REM_MOD))/op.S \ 
     350        -Wp,-MP \ 
     351        target-i386/op.c 
     352 
     353# Use the right GCC includes. 
     354ifdef VBOX_RECOMPILER_OP_GCC_INCS 
     355COMPILE_OP_CMDS := $(subst $(VBOX_PATH_GCC_INCS),$(VBOX_RECOMPILER_OP_GCC_INCS),$(COMPILE_OP_CMDS)) 
     356endif 
     357 
     358# Drop incompatible options when using the cross-compiler on darwin. 
     359ifeq ($(BUILD_TARGET),darwin) 
     360 ifeq ($(filter-out i386-elf-gcc%, $(VBOX_RECOMPILER_OP_GCC)),) 
     361  COMPILE_OP_CMDS := $(filter-out -mdynamic-no-pic, $(COMPILE_OP_CMDS)) 
     362 endif 
     363endif 
     364 
     365# include the dependencies 
     366-include $(PATH_$(REM_MOD))/op.S.dep 
     367 
     368# The rule. 
     369$(PATH_$(REM_MOD))/op.S: \ 
    275370                target-i386/op.c \ 
    276                 ) -o $@.tmp \ 
    277                 || $(CP) staged/op-elf-$(BUILD_TARGET_ARCH).S $@.tmp # @todo only do this with gcc-4. 
    278         $(SED) -f op-validate.sed $@.tmp || $(CP) staged/op-elf-$(BUILD_TARGET_ARCH).S $@.tmp # This isn't good enough yet. 
     371                staged/op-elf-$(BUILD_TARGET_ARCH).S \ 
     372                op-validate.sed \ 
     373                op-darwin.sed \ 
     374                op-undefined.lst \ 
     375                Makefile.kmk \ 
     376                $(comp-cmds COMPILE_OP_CMDS,COMPILE_OP_CMDS_PREV,FORCE) \ 
     377                | $(call DIRDEP,$(PATH_$(REM_MOD))) 
     378        $(RM) -f $@ $@.tmp $@.tmp2 $@.dep 
     379ifeq ($(VBOX_RECOMPILER_OP_GCC_OK),yes) 
     380        $(call MSG_COMPILE,VBoxREM,$<,$@,AS) 
     381        $(addsuffix $(SP)\$(NL)$(TAB)  ,$(COMPILE_OP_CMDS)) -o $@.tmp 
     382else ifeq ($(VBOX_RECOMPILER_OP_GCC_OK),dunno) # (permit 3.x.x and 4.1.x+ for now) 
     383        major_ver=`$(VBOX_RECOMPILER_OP_GCC) -dumpversion | $(SED) -e 's/^\([2-9]\)\..*$$/\1/'`; \ 
     384        minor_ver=`$(VBOX_RECOMPILER_OP_GCC) -dumpversion | $(SED) -e 's/^[2-9]\.\([0-9]\)\..*$$/\1/'`; \ 
     385        bugfix_ver=`$(VBOX_RECOMPILER_OP_GCC) -dumpversion | $(SED) -e 's/^[2-9]\.[0-9]\.\([0-9]\).*$$/\1/'`; \ 
     386        if test "$$major_ver" = "3" -o "(" "$$major_ver" = "4" -a "$$minor_ver" != "0" ")"; then \ 
     387                $(ECHO_EXT) "Compiling $< => $@ [gcc v$${major_ver}.$${minor_ver}.$${bugfix_ver}]" && \ 
     388                $(addsuffix $(SP)\$(NL)$(TAB)$(TAB)  ,$(COMPILE_OP_CMDS)) -o $@.tmp; \ 
     389        else \ 
     390                $(ECHO_EXT) "Using staged op.S [gcc v$${major_ver}.$${minor_ver}.$${bugfix_ver}]" && \ 
     391                $(CP_EXT) -f staged/op-elf-$(BUILD_TARGET_ARCH).S $@.tmp; \ 
     392        fi 
     393else 
     394        $(CP) staged/op-elf-$(BUILD_TARGET_ARCH).S $@.tmp 
     395endif 
     396        $(SED) -f op-validate.sed $@.tmp 
    279397ifeq ($(BUILD_TARGET),darwin) 
    280398        $(SED) -f op-darwin.sed $@.tmp > $@.tmp2 
    281         $(MV) -f $@.tmp2 $@.tmp 
     399        $(SED) -e 's/^\(.*\)$$/#define \1 _\1/' op-undefined.lst > $@.tmp 
     400        $(CAT_EXT) $@.tmp2 >> $@.tmp 
    282401endif 
    283402        $(MV) -f $@.tmp $@ 
    284          
    285  
    286 # predefined dependencies to the headers are generated. 
    287 translate-all.c:             $(PATH_$(REM_MOD))/op.h     $(PATH_$(REM_MOD))/opc.h 
    288 target-i386/translate.c:     $(PATH_$(REM_MOD))/gen-op.h $(PATH_$(REM_MOD))/opc.h 
    289  
    290 # atm this will be build because of the direct dependency
     403        $(QUIET2)$(APPEND) "$@.dep" 
     404        $(QUIET2)$(APPEND) "$@.dep" 'define COMPILE_OP_CMDS_PREV' 
     405        $(QUIET2)$(APPEND) "$@.dep" '$(subst $(NL),'$(NL)$(TAB)@$(APPEND) "$@.dep" ',$(COMPILE_OP_CMDS))' 
     406        $(QUIET2)$(APPEND) "$@.dep" 'endef' 
     407 
     408 
     409# Hack for crosscompiling
    291410DYNGEN = $(PATH_dyngen)/dyngen$(HOSTSUFF_EXE) 
    292411DYNGEN_EXEC = $(DYNGEN) 
     
    298417endif 
    299418 
    300  
     419# The dyngen rules. 
    301420$(PATH_$(REM_MOD))/op.h:     $(FILE_OP_OBJ) $(DYNGEN) 
    302421        $(call MSG_L1,dyngen => $@) 
     
    311430        $(QUIET)$(DYNGEN_EXEC) -g -o $@ $< 
    312431 
     432# Dyngen dependants (sp?). 
     433translate-all.c \ 
     434translate-op.c \ 
     435target-i386/translate.c \ 
     436        : $(PATH_$(REM_MOD))/op.h $(PATH_$(REM_MOD))/opc.h $(PATH_$(REM_MOD))/gen-op.h 
     437 
     438 
     439# Some aliases 
     440do_dyngen: $(PATH_$(REM_MOD))/gen-op.h $(PATH_$(REM_MOD))/opc.h $(PATH_$(REM_MOD))/op.h 
    313441importlib: $(LIB_REM) 
    314  
    315  
    316 
    317 # Phony rule for making the qemu source drop. 
    318 # This is just an incomplete EXAMPLE. It does NOT include all we have to ship! 
    319 
    320 .PHONY: qemu-source-drop 
    321 qemu-source-drop: 
    322         $(RM) -f $(PATH_BIN)/qemu-source.zip 
    323         zip -9 $(PATH_BIN)/qemu-source.zip \ 
    324                 target-i386/op.c \ 
    325                 target-i386/helper.c \ 
    326                 target-i386/ops_template_mem.h \ 
    327                 target-i386/ops_sse.h \ 
    328                 target-i386/helper2.c \ 
    329                 target-i386/ops_template.h \ 
    330                 target-i386/ops_mem.h \ 
    331                 target-i386/translate-copy.c \ 
    332                 target-i386/exec.h \ 
    333                 target-i386/cpu.h \ 
    334                 target-i386/opreg_template.h \ 
    335                 target-i386/translate.c \ 
    336                 \ 
    337                 a.out.h \ 
    338                 COPYING.LIB \ 
    339                 cpu-defs.h \ 
    340                 dyngen.c \ 
    341                 dyngen.h \ 
    342                 elf.h \ 
    343                 exec.c \ 
    344                 softmmu_header.h \ 
    345                 translate-all.c \ 
    346                 bswap.h \ 
    347                 cpu-all.h \ 
    348                 cpu-exec.c \ 
    349                 disas.h \ 
    350                 dyngen-exec.h \ 
    351                 dyngen-op.h \ 
    352                 exec-all.h \ 
    353                 osdep.h \ 
    354                 softmmu_template.h \ 
    355                 vl.h \ 
    356                 \ 
    357                 tests/hello-arm.c \ 
    358                 tests/hello-i386.c \ 
    359                 tests/linux-test.c \ 
    360                 tests/Makefile \ 
    361                 tests/pi_10.com \ 
    362                 tests/qruncom.c \ 
    363                 tests/runcom.c \ 
    364                 tests/sha1.c \ 
    365                 tests/test-i386.c \ 
    366                 tests/test-i386-code16.S \ 
    367                 tests/test-i386.h \ 
    368                 tests/test-i386-muldiv.h \ 
    369                 tests/test-i386-shift.h \ 
    370                 tests/test-i386-vm86.S \ 
    371                 tests/test_path.c \ 
    372                 tests/testthread.c 
    373  
     442op.S: $(PATH_$(REM_MOD))/op.S 
     443 
     444 
  • trunk/src/recompiler/VBoxREM.def

    r1 r2422  
     1; $Id$ 
    12;; @file 
    23; 
  • trunk/src/recompiler/VBoxRecompiler.c

    r2223 r2422  
     1/* $Id$ */ 
    12/** @file 
    2  * 
    33 * VBox Recompiler - QEMU. 
    44 */ 
     
    2424*   Header Files                                                               * 
    2525*******************************************************************************/ 
     26#define LOG_GROUP LOG_GROUP_REM 
    2627#include "vl.h" 
    2728#include "exec-all.h" 
     
    4748#include <VBox/err.h> 
    4849 
    49 #define LOG_GROUP LOG_GROUP_REM 
    5050#include <VBox/log.h> 
    5151#include <iprt/semaphore.h> 
     
    5454#include <iprt/thread.h> 
    5555#include <iprt/string.h> 
    56  
    5756 
    5857/* Don't wanna include everything. */ 
     
    8887static DECLCALLBACK(int) remR3Load(PVM pVM, PSSMHANDLE pSSM, uint32_t u32Version); 
    8988static void     remR3StateUpdate(PVM pVM); 
     89 
     90#if defined(PGM_DYNAMIC_RAM_ALLOC) && !defined(REM_PHYS_ADDR_IN_TLB) 
     91DECLINLINE(target_ulong) remR3HCVirt2GCPhysInlined(PVM pVM, void *addr); 
     92DECLINLINE(void *) remR3GCPhys2HCVirtInlined(PVM pVM, target_ulong addr); 
     93#endif  
     94 
    9095static uint32_t remR3MMIOReadU8(void *pvVM, target_phys_addr_t GCPhys); 
    9196static uint32_t remR3MMIOReadU16(void *pvVM, target_phys_addr_t GCPhys); 
     
    106111*   Global Variables                                                           * 
    107112*******************************************************************************/ 
    108  
    109 /** The log level of the recompiler. */ 
    110 #if 1 
    111 extern int loglevel; 
    112 #else 
    113 int loglevel = ~0; 
    114 FILE *logfile = NULL; 
    115 #endif 
    116  
    117113 
    118114/** @todo Move stats to REM::s some rainy day we have nothing do to. */ 
     
    128124static STAMPROFILEADV gStatMemRead; 
    129125static STAMPROFILEADV gStatMemWrite; 
     126#ifndef REM_PHYS_ADDR_IN_TLB 
     127static STAMPROFILEADV gStatMemReadHCPtr; 
     128static STAMPROFILEADV gStatMemWriteHCPtr; 
     129#endif  
     130#ifdef PGM_DYNAMIC_RAM_ALLOC 
     131static STAMPROFILE    gStatGCPhys2HCVirt; 
     132static STAMPROFILE    gStatHCVirt2GCPhys; 
     133#endif  
     134static STAMCOUNTER    gStatCpuGetTSC; 
    130135static STAMCOUNTER    gStatRefuseTFInhibit; 
    131136static STAMCOUNTER    gStatRefuseVM86; 
     
    182187}; 
    183188 
    184 #ifndef PGM_DYNAMIC_RAM_ALLOC 
    185 /* Guest physical RAM base. Not to be used in external code. */ 
    186 static uint8_t *phys_ram_base; 
    187 #endif 
    188  
    189 /* 
    190  * Instance stuff. 
    191  */ 
    192 /** Pointer to the cpu state. */ 
    193 CPUState       *cpu_single_env; 
    194  
    195189 
    196190#ifdef VBOX_WITH_DEBUGGER 
     
    227221 
    228222 
     223/* Instantiate the structure signatures. */ 
     224#define REM_STRUCT_OP 0 
     225#include "InnoTek/structs.h" 
     226 
     227 
     228 
    229229/******************************************************************************* 
    230230*   Internal Functions                                                         * 
    231231*******************************************************************************/ 
    232232static void remAbort(int rc, const char *pszTip); 
    233  
     233extern int testmath(void); 
    234234 
    235235/* Put them here to avoid unused variable warning. */ 
    236236AssertCompile(RT_SIZEOFMEMB(VM, rem.padding) >= RT_SIZEOFMEMB(VM, rem.s)); 
    237 //AssertCompileMemberSize(REM, Env, REM_ENV_SIZE); 
    238 //AssertCompile(RT_SIZEOFMEMB(REM, Env) <= REM_ENV_SIZE); 
     237#if !defined(IPRT_NO_CRT) && (defined(__LINUX__) || defined(__DARWIN__) || defined(__WIN__)) 
     238AssertCompileMemberSize(REM, Env, REM_ENV_SIZE); 
     239#else 
     240AssertCompile(RT_SIZEOFMEMB(REM, Env) <= REM_ENV_SIZE); 
     241#endif 
     242 
    239243 
    240244/** 
     
    247251{ 
    248252    uint32_t u32Dummy; 
     253    unsigned i; 
     254 
     255    /* 
     256     * Assert sanity. 
     257     */ 
    249258    AssertReleaseMsg(sizeof(pVM->rem.padding) >= sizeof(pVM->rem.s), ("%#x >= %#x; sizeof(Env)=%#x\n", sizeof(pVM->rem.padding), sizeof(pVM->rem.s), sizeof(pVM->rem.s.Env))); 
    250     //AssertReleaseMsg(sizeof(pVM->rem.s.Env) <= REM_ENV_SIZE, ("%#x == %#x\n", sizeof(pVM->rem.s.Env), REM_ENV_SIZE)); 
     259    AssertReleaseMsg(sizeof(pVM->rem.s.Env) <= REM_ENV_SIZE, ("%#x == %#x\n", sizeof(pVM->rem.s.Env), REM_ENV_SIZE)); 
    251260    AssertReleaseMsg(!(RT_OFFSETOF(VM, rem) & 31), ("off=%#x\n", RT_OFFSETOF(VM, rem))); 
    252 #if 0 /* not merged yet */ 
    253261    Assert(!testmath()); 
    254 #endif  
     262    ASSERT_STRUCT_TABLE(Misc); 
     263    ASSERT_STRUCT_TABLE(TLB); 
     264    ASSERT_STRUCT_TABLE(SegmentCache); 
     265    ASSERT_STRUCT_TABLE(XMMReg); 
     266    ASSERT_STRUCT_TABLE(MMXReg); 
     267    ASSERT_STRUCT_TABLE(float_status); 
     268    ASSERT_STRUCT_TABLE(float32u); 
     269    ASSERT_STRUCT_TABLE(float64u); 
     270    ASSERT_STRUCT_TABLE(floatx80u); 
     271    ASSERT_STRUCT_TABLE(CPUState); 
    255272 
    256273    /* 
     
    272289    AssertMsg(MMR3PhysGetRamSize(pVM) == 0, ("Init order have changed! REM depends on notification about ALL physical memory registrations\n")); 
    273290 
     291    /* ignore all notifications */ 
     292    pVM->rem.s.fIgnoreAll = true; 
     293 
    274294    /* 
    275295     * Init the recompiler. 
     
    280300        return VERR_GENERAL_FAILURE; 
    281301    } 
    282     CPUMGetGuestCpuId(pVM, 1, &u32Dummy, &u32Dummy, &pVM->rem.s.Env.cpuid_ext_features, &pVM->rem.s.Env.cpuid_features); 
     302    CPUMGetGuestCpuId(pVM,          1, &u32Dummy, &u32Dummy, &pVM->rem.s.Env.cpuid_ext_features, &pVM->rem.s.Env.cpuid_features); 
     303    CPUMGetGuestCpuId(pVM, 0x80000001, &u32Dummy, &u32Dummy, &u32Dummy, &pVM->rem.s.Env.cpuid_ext2_features); 
    283304 
    284305    /* allocate code buffer for single instruction emulation. */ 
     
    293314    pVM->rem.s.u32PendingInterrupt = REM_NO_PENDING_IRQ; 
    294315 
    295 #ifdef DEBUG_bird 
    296     //cpu_breakpoint_insert(&pVM->rem.s.Env, some-address); 
    297 #endif 
    298  
    299316    /* 
    300317     * Register ram types. 
    301318     */ 
    302     pVM->rem.s.iMMIOMemType    = cpu_register_io_memory(0, g_apfnMMIORead, g_apfnMMIOWrite, pVM); 
    303     AssertReleaseMsg(pVM->rem.s.iMMIOMemType > 0, ("pVM->rem.s.iMMIOMemType=%d\n", pVM->rem.s.iMMIOMemType)); 
    304     pVM->rem.s.iHandlerMemType = cpu_register_io_memory(0, g_apfnHandlerRead, g_apfnHandlerWrite, pVM); 
    305     AssertReleaseMsg(pVM->rem.s.iHandlerMemType > 0, ("pVM->rem.s.iHandlerMemType=%d\n", pVM->rem.s.iHandlerMemType)); 
     319    pVM->rem.s.iMMIOMemType    = cpu_register_io_memory(-1, g_apfnMMIORead, g_apfnMMIOWrite, pVM); 
     320    AssertReleaseMsg(pVM->rem.s.iMMIOMemType >= 0, ("pVM->rem.s.iMMIOMemType=%d\n", pVM->rem.s.iMMIOMemType)); 
     321    pVM->rem.s.iHandlerMemType = cpu_register_io_memory(-1, g_apfnHandlerRead, g_apfnHandlerWrite, pVM); 
     322    AssertReleaseMsg(pVM->rem.s.iHandlerMemType >= 0, ("pVM->rem.s.iHandlerMemType=%d\n", pVM->rem.s.iHandlerMemType)); 
    306323    Log2(("REM: iMMIOMemType=%d iHandlerMemType=%d\n", pVM->rem.s.iMMIOMemType, pVM->rem.s.iHandlerMemType)); 
     324 
     325    /* stop ignoring. */ 
     326    pVM->rem.s.fIgnoreAll = false; 
    307327 
    308328    /* 
     
    342362    STAM_REG(pVM, &gStatMemRead,            STAMTYPE_PROFILE, "/PROF/REM/MemRead",    STAMUNIT_TICKS_PER_CALL, "Profiling memory access."); 
    343363    STAM_REG(pVM, &gStatMemWrite,           STAMTYPE_PROFILE, "/PROF/REM/MemWrite",   STAMUNIT_TICKS_PER_CALL, "Profiling memory access."); 
     364