mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
More linux...
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@122 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -38,7 +38,7 @@
|
||||
// This is purposedely not a full wrapper for virtualalloc/mmap, but it
|
||||
// provides exactly the primitive operations that Dolphin needs.
|
||||
|
||||
void* AllocateExecutableMemory(int size)
|
||||
void* AllocateExecutableMemory(int size, bool low)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
void* ptr = VirtualAlloc(0, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
|
||||
@ -55,7 +55,7 @@ void* AllocateExecutableMemory(int size)
|
||||
void* retval = mmap(0, size, PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
MAP_ANONYMOUS | MAP_PRIVATE
|
||||
#ifdef __x86_64__
|
||||
| MAP_32BIT
|
||||
| (low ? MAP_32BIT : 0)
|
||||
#endif
|
||||
, -1, 0); // | MAP_FIXED
|
||||
printf("mappah exe %p %i\n", retval, size);
|
||||
|
@ -18,7 +18,7 @@
|
||||
#ifndef _MEMORYUTIL_H
|
||||
#define _MEMORYUTIL_H
|
||||
|
||||
void* AllocateExecutableMemory(int size);
|
||||
void* AllocateExecutableMemory(int size, bool low = true);
|
||||
void* AllocateMemoryPages(int size);
|
||||
void FreeMemoryPages(void* ptr, int size);
|
||||
void WriteProtectMemory(void* ptr, int size, bool executable = false);
|
||||
|
@ -313,7 +313,7 @@ namespace Gen
|
||||
s64 fn = (s64)fnptr;
|
||||
s64 c = (s64)code;
|
||||
if (myabs(fn - c) >= 0x80000000ULL) {
|
||||
PanicAlert("CALL out of range, %p, %p", fn, c);
|
||||
PanicAlert("CALL out of range (%p calls %p)", c, fn);
|
||||
}
|
||||
s32 distance = (s32)(fn - ((u64)code + 5));
|
||||
Write8(0xE8);
|
||||
@ -325,7 +325,8 @@ namespace Gen
|
||||
//TODO fix
|
||||
u64 jump = (code - (u8*)j8) - 1;
|
||||
|
||||
if (jump > 0x7f) _assert_msg_(DYNA_REC, 0, "j8 greater than 0x7f!!");
|
||||
if (jump > 0x7f)
|
||||
_assert_msg_(DYNA_REC, 0, "j8 greater than 0x7f!!");
|
||||
*j8 = (u8)jump;
|
||||
}
|
||||
|
||||
@ -1107,7 +1108,8 @@ namespace Gen
|
||||
else
|
||||
{
|
||||
// Simulate this instruction with SSE2 instructions
|
||||
MOVAPD(regOp, arg);
|
||||
if (!arg.IsSimpleReg(regOp))
|
||||
MOVAPD(regOp, arg);
|
||||
UNPCKLPD(regOp, R(regOp));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user