aboutsummaryrefslogtreecommitdiff
path: root/ARMeilleure/State/NativeContext.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ARMeilleure/State/NativeContext.cs')
-rw-r--r--ARMeilleure/State/NativeContext.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/ARMeilleure/State/NativeContext.cs b/ARMeilleure/State/NativeContext.cs
index 9df69a4e..09ec6cde 100644
--- a/ARMeilleure/State/NativeContext.cs
+++ b/ARMeilleure/State/NativeContext.cs
@@ -15,6 +15,9 @@ namespace ARMeilleure.State
public fixed uint FpFlags[RegisterConsts.FpFlagsCount];
public int Counter;
public ulong CallAddress;
+ public ulong ExclusiveAddress;
+ public ulong ExclusiveValueLow;
+ public ulong ExclusiveValueHigh;
}
private static NativeCtxStorage _dummyStorage = new NativeCtxStorage();
@@ -26,6 +29,8 @@ namespace ARMeilleure.State
public NativeContext(IJitMemoryAllocator allocator)
{
_block = allocator.Allocate((ulong)Unsafe.SizeOf<NativeCtxStorage>());
+
+ GetStorage().ExclusiveAddress = ulong.MaxValue;
}
public unsafe ulong GetX(int index)
@@ -162,6 +167,16 @@ namespace ARMeilleure.State
return StorageOffset(ref _dummyStorage, ref _dummyStorage.CallAddress);
}
+ public static int GetExclusiveAddressOffset()
+ {
+ return StorageOffset(ref _dummyStorage, ref _dummyStorage.ExclusiveAddress);
+ }
+
+ public static int GetExclusiveValueOffset()
+ {
+ return StorageOffset(ref _dummyStorage, ref _dummyStorage.ExclusiveValueLow);
+ }
+
private static int StorageOffset<T>(ref NativeCtxStorage storage, ref T target)
{
return (int)Unsafe.ByteOffset(ref Unsafe.As<NativeCtxStorage, T>(ref storage), ref target);