From 9c16ab1514d024dd8cdc7371a4ab88ae6ce5a32f Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Sun, 3 Jul 2005 13:39:06 +0000 Subject: [PATCH] Remove obsolete and broken Cygwin/X11 hacks. Forbid builds of the Windows version from within the Unix/ directory. --- SheepShaver/src/Unix/configure.ac | 46 ++++++++------------------ SheepShaver/src/Unix/sysdeps.h | 14 -------- SheepShaver/src/kpx_cpu/src/cpu/vm.hpp | 8 ----- 3 files changed, 14 insertions(+), 54 deletions(-) diff --git a/SheepShaver/src/Unix/configure.ac b/SheepShaver/src/Unix/configure.ac index 735a9271..dcb8d225 100644 --- a/SheepShaver/src/Unix/configure.ac +++ b/SheepShaver/src/Unix/configure.ac @@ -14,6 +14,13 @@ dnl Some systems do not put corefiles in the currect directory, avoid saving dnl cores for the configure tests since some are intended to dump core. ulimit -c 0 +dnl Invite Cygwin users to build within the Windows/ directory +case $target_os in +*cygwin* | *mingw32*) + AC_MSG_ERROR([You can only build the Windows version from its directory, Cygwin/X11 is not supported.]) + ;; +esac + dnl Options. AC_ARG_ENABLE(jit, [ --enable-jit enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes]) AC_ARG_ENABLE(ppc-emulator, [ --enable-ppc-emulator use the selected PowerPC emulator [default=auto]], [WANT_EMULATED_PPC=$enableval], [WANT_EMULATED_PPC=auto]) @@ -135,21 +142,12 @@ fi if [[ "x$WANT_SDL" = "xyes" ]]; then AC_PATH_PROG(sdl_config, "sdl-config") if [[ -n "$sdl_config" ]]; then - case $target_os in - # Special treatment for Cygwin so that we can still use the POSIX layer - *cygwin*) - sdl_cflags="-I`$sdl_config --prefix`/include/SDL" - sdl_libs="-L`$sdl_config --exec-prefix`/lib -lSDL" - ;; - *) - sdl_cflags=`$sdl_config --cflags` - if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then - sdl_libs=`$sdl_config --static-libs` - else - sdl_libs=`$sdl_config --libs` - fi - ;; - esac + sdl_cflags=`$sdl_config --cflags` + if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then + sdl_libs=`$sdl_config --static-libs` + else + sdl_libs=`$sdl_config --libs` + fi CFLAGS="$CFLAGS $sdl_cflags" CXXFLAGS="$CXXFLAGS $sdl_cflags" LIBS="$LIBS $sdl_libs" @@ -475,9 +473,6 @@ darwin*) EXTFSSRC=../MacOSX/extfs_macosx.mm fi ;; -cygwin*) - SERIALSRC="../dummy/serial_dummy.cpp" - ;; esac dnl Is the slirp library supported? @@ -504,14 +499,7 @@ if [[ "x$WANT_SDL_VIDEO" = "xyes" ]]; then if [[ "x$ac_cv_framework_Carbon" = "xyes" ]]; then EXTRASYSSRCS="$EXTRASYSSRCS ../MacOSX/clip_macosx.cpp" else - case "$target_os" in - cygwin*) - EXTRASYSSRCS="$EXTRASYSSRCS ../Windows/clip_windows.cpp" - ;; - *) - EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" - ;; - esac + EXTRASYSSRCS="$EXTRASYSSRCS ../dummy/clip_dummy.cpp" fi else VIDEOSRCS="video_x.cpp" @@ -939,12 +927,6 @@ fi dnl Check addressing mode to use AC_MSG_CHECKING([for addressing mode to use]) -case "$os_target" in -cygwin*) - WANT_ADDRESSING_MODE="direct,cygwin-hack" - NATMEM_OFFSET= - ;; -esac if [[ "$EMULATED_PPC" != "yes" ]]; then if [[ "$WANT_ADDRESSING_MODE" != "real" ]]; then AC_MSG_WARN([Running in native PowerPC mode, force use of Real Addressing.]) diff --git a/SheepShaver/src/Unix/sysdeps.h b/SheepShaver/src/Unix/sysdeps.h index ead34d50..4afbc95a 100644 --- a/SheepShaver/src/Unix/sysdeps.h +++ b/SheepShaver/src/Unix/sysdeps.h @@ -83,20 +83,6 @@ #if !defined(EMULATED_PPC) #define REAL_ADDRESSING 1 #include "ppc_asm.tmpl" -#elif defined(__CYGWIN__) -#define DIRECT_ADDRESSING 1 -#define DIRECT_ADDRESSING_HACK 1 -/* - The following address translation functions were empirically - determined on a Windows XP system running Cygwin 1.5.12-1 so - that RAM size can be maximized (up to 960 MB) and avoiding - the use of a TLB. This also takes into account reduced address - space available when the Cygwin runtime is used. -*/ -#define DIRECT_ADDRESSING_VIRT2PHYS(ADDR) \ - ((ADDR) + (((ADDR) < 0x41000000) ? 0x39000000 : 0xcf800000)) -#define DIRECT_ADDRESSING_PHYS2VIRT(ADDR) \ - ((ADDR) - (((ADDR) >= 0x39000000) ? 0x39000000 : 0xcf800000)) #elif defined(NATMEM_OFFSET) #define DIRECT_ADDRESSING 1 #else diff --git a/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp b/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp index ad5bff68..55f30ec3 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/vm.hpp @@ -205,19 +205,11 @@ const uintptr VMBaseDiff = NATMEM_OFFSET; #if REAL_ADDRESSING || DIRECT_ADDRESSING static inline uint8 * vm_do_get_real_address(vm_addr_t addr) { -#if DIRECT_ADDRESSING_HACK - return (uint8 *)vm_wrap_address(DIRECT_ADDRESSING_VIRT2PHYS(addr)); -#else return (uint8 *)vm_wrap_address(VMBaseDiff + addr); -#endif } static inline vm_addr_t vm_do_get_virtual_address(uint8 *addr) { -#if DIRECT_ADDRESSING_HACK - return vm_wrap_address(DIRECT_ADDRESSING_PHYS2VIRT((uintptr)addr)); -#else return vm_wrap_address((uintptr)addr - VMBaseDiff); -#endif } static inline uint32 vm_read_memory_1(vm_addr_t addr) {