]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
JIT: harmless changes in codegen_x86.cpp
authorFrode Solheim <frode@fs-uae.net>
Sun, 6 Sep 2015 20:39:05 +0000 (22:39 +0200)
committerFrode Solheim <frode@fs-uae.net>
Sun, 6 Sep 2015 20:39:05 +0000 (22:39 +0200)
jit/codegen_x86.cpp

index 3d7eb455d7cbdb390bf703231ca5718be07fd05a..1ef399c240a6ec54d6ce015714dc124b32a8f86a 100644 (file)
@@ -32,6 +32,8 @@
 /* This should eventually end up in machdep/, but for now, x86 is the
 only target, and it's easier this way... */
 
+#include "flags_x86.h"
+
 /*************************************************************************
 * Some basic information about the the target CPU                       *
 *************************************************************************/
@@ -80,16 +82,15 @@ only target, and it's easier this way... */
 #define REG_PAR2 EDX_INDEX
 #endif
 
-#if defined(_WIN32)
 #define REG_PC_PRE EAX_INDEX /* The register we use for preloading regs.pc_p */
+#if defined(_WIN32)
 #define REG_PC_TMP ECX_INDEX
-#define SHIFTCOUNT_NREG ECX_INDEX  /* Register that can be used for shiftcount. -1 if any reg will do */
 #else
-#define REG_PC_PRE EAX_INDEX /* The register we use for preloading regs.pc_p */
 #define REG_PC_TMP ECX_INDEX /* Another register that is not the above */
-#define SHIFTCOUNT_NREG ECX_INDEX  /* Register that can be used for shiftcount. -1 if any reg will do */
 #endif
 
+#define SHIFTCOUNT_NREG ECX_INDEX  /* Register that can be used for shiftcount.
+                             -1 if any reg will do */
 #define MUL_NREG1 EAX_INDEX /* %eax will hold the low 32 bits after a 32x32 mul */
 #define MUL_NREG2 EDX_INDEX /* %edx will hold the high 32 bits */
 
@@ -3257,10 +3258,20 @@ static void
 cpuid(uae_u32 op, uae_u32 *eax, uae_u32 *ebx, uae_u32 *ecx, uae_u32 *edx)
 {
        const int CPUID_SPACE = 4096;
+#ifdef UAE
        uae_u8* cpuid_space = (uae_u8 *)cache_alloc(CPUID_SPACE);
        if (cpuid_space == 0) {
+#else
+       uae_u8* cpuid_space = (uae_u8 *)vm_acquire(CPUID_SPACE);
+       if (cpuid_space == VM_MAP_FAILED)
+#endif
                jit_abort("Could not allocate cpuid_space");
+#ifdef UAE
        }
+#else
+       vm_protect(cpuid_space, CPUID_SPACE, VM_PAGE_READ | VM_PAGE_WRITE | VM_PAGE_EXECUTE);
+#endif
+
        static uae_u32 s_op, s_eax, s_ebx, s_ecx, s_edx;
        uae_u8* tmp=get_target();
 
@@ -3289,7 +3300,11 @@ cpuid(uae_u32 op, uae_u32 *eax, uae_u32 *ebx, uae_u32 *ecx, uae_u32 *edx)
        if (ecx != NULL) *ecx = s_ecx;
        if (edx != NULL) *edx = s_edx;
 
+#ifdef UAE
        cache_free (cpuid_space);
+#else
+       vm_release(cpuid_space, CPUID_SPACE);
+#endif
 }
 
 static void