#include "uae/log.h"
#include "uae/vm.h"
-#define vm_acquire(size) uae_vm_alloc(size, UAE_VM_32BIT, UAE_VM_READ_WRITE)
-#define vm_protect(address, size, protect) uae_vm_protect(address, size, protect)
-#define vm_release(address, size) uae_vm_free(address, size)
#define VM_PAGE_READ UAE_VM_READ
#define VM_PAGE_WRITE UAE_VM_WRITE
#define VM_PAGE_EXECUTE UAE_VM_EXECUTE
#define VM_MAP_FAILED UAE_VM_ALLOC_FAILED
+#define VM_MAP_DEFAULT 1
+#define VM_MAP_32BIT 1
+#define vm_protect(address, size, protect) uae_vm_protect(address, size, protect)
+#define vm_release(address, size) uae_vm_free(address, size)
+
+static inline void *vm_acquire(size_t size, int options = VM_MAP_DEFAULT)
+{
+ assert(options == (VM_MAP_DEFAULT | VM_MAP_32BIT));
+ return uae_vm_alloc(size, UAE_VM_32BIT, UAE_VM_READ_WRITE);
+}
#define UNUSED(x)
#include "uae.h"
#define uint32 uae_u32
#define uint8 uae_u8
-static inline int distrust_byte(void)
+static inline int distrust_check(int value)
{
- int distrust = currprefs.comptrustbyte;
#ifdef JIT_ALWAYS_DISTRUST
- distrust = 1;
-#endif
+ return 1;
+#else
+ int distrust = value;
return distrust;
+#endif
+}
+
+static inline int distrust_byte(void)
+{
+ return distrust_check(currprefs.comptrustbyte);
}
static inline int distrust_word(void)
{
- int distrust = currprefs.comptrustword;
-#ifdef JIT_ALWAYS_DISTRUST
- distrust = 1;
-#endif
- return distrust;
+ return distrust_check(currprefs.comptrustword);
}
static inline int distrust_long(void)
{
- int distrust = currprefs.comptrustlong;
-#ifdef JIT_ALWAYS_DISTRUST
- distrust = 1;
-#endif
- return distrust;
+ return distrust_check(currprefs.comptrustlong);
}
static inline int distrust_addr(void)
{
- int distrust = currprefs.comptrustnaddr;
-#ifdef JIT_ALWAYS_DISTRUST
- distrust = 1;
-#endif
- return distrust;
+ return distrust_check(currprefs.comptrustnaddr);
}
#else
if (!mChunks) {
// There is no chunk left, allocate a new pool and link the
// chunks into the free list
-#ifdef UAE
- Pool * newPool = (Pool *)vm_acquire(sizeof(Pool));
-#else
Pool * newPool = (Pool *)vm_acquire(sizeof(Pool), VM_MAP_DEFAULT | VM_MAP_32BIT);
-#endif
if (newPool == VM_MAP_FAILED) {
jit_abort("Could not allocate block pool!");
}
return do_alloc_code(size, depth + 1);
#else
UNUSED(depth);
-#ifdef UAE
- return (uae_u8*) vm_acquire(size);
-#else
uint8 *code = (uint8 *)vm_acquire(size, VM_MAP_DEFAULT | VM_MAP_32BIT);
return code == VM_MAP_FAILED ? NULL : code;
#endif
-#endif
}
static inline uint8 *alloc_code(uint32 size)
raw_pop_preserved_regs();
compemu_raw_jmp(uae_p32(check_checksum));
+#if defined(USE_DATA_BUFFER)
+ reset_data_buffer();
+#endif
+
#ifdef UAE
#ifdef USE_UDIS86
UDISFN(pushall_call_handler, get_target());
#define TARGET_NATIVE TARGET_ARM
#endif
+#ifdef UAE
static
+#endif
void disasm_block(int /* target */, uint8 * /* start */, size_t /* length */)
{
if (!JITDebug)
#endif
#ifdef UAE
-void compile_block(cpu_history* pc_hist, int blocklen, int totcycles)
+void compile_block(cpu_history *pc_hist, int blocklen, int totcycles)
{
- if (letit && compiled_code && currprefs.cpu_model>=68020) {
+ if (letit && compiled_code && currprefs.cpu_model >= 68020) {
#else
static void compile_block(cpu_history* pc_hist, int blocklen)
{
max_pcp=(uintptr)currpcp;
#endif
+#ifdef UAE
if (currprefs.compnf) {
+#endif
liveflags[i]=((liveflags[i+1]&
(~prop[op].set_flags))|
prop[op].use_flags);
if (prop[op].is_addx && (liveflags[i+1]&FLAG_Z)==0)
liveflags[i]&= ~FLAG_Z;
+#ifdef UAE
}
else {
liveflags[i]=0x1f;
}
+#endif
}
#if USE_CHECKSUM_INFO