crueter
4 months ago
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
1 changed files with
7 additions and
1 deletions
-
src/dynarmic/src/dynarmic/common/spin_lock_x64.cpp
|
|
@ -11,6 +11,12 @@ |
|
|
#include "dynarmic/backend/x64/hostloc.h"
|
|
|
#include "dynarmic/backend/x64/hostloc.h"
|
|
|
#include "dynarmic/common/spin_lock.h"
|
|
|
#include "dynarmic/common/spin_lock.h"
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT
|
|
|
|
|
|
static const auto default_cg_mode = Xbyak::DontSetProtectRWE; |
|
|
|
|
|
#else
|
|
|
|
|
|
static const auto default_cg_mode = nullptr; //Allow RWE
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
namespace Dynarmic { |
|
|
namespace Dynarmic { |
|
|
|
|
|
|
|
|
void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Reg64 ptr, Xbyak::Reg32 tmp) { |
|
|
void EmitSpinLockLock(Xbyak::CodeGenerator& code, Xbyak::Reg64 ptr, Xbyak::Reg32 tmp) { |
|
|
@ -37,7 +43,7 @@ namespace { |
|
|
struct SpinLockImpl { |
|
|
struct SpinLockImpl { |
|
|
void Initialize(); |
|
|
void Initialize(); |
|
|
|
|
|
|
|
|
Xbyak::CodeGenerator code = Xbyak::CodeGenerator(4096, Xbyak::DontSetProtectRWE); |
|
|
|
|
|
|
|
|
Xbyak::CodeGenerator code = Xbyak::CodeGenerator(4096, default_cg_mode); |
|
|
|
|
|
|
|
|
void (*lock)(volatile int*); |
|
|
void (*lock)(volatile int*); |
|
|
void (*unlock)(volatile int*); |
|
|
void (*unlock)(volatile int*); |
|
|
|