From c2a77fca277a96a49e45788601a4afc9570b1eb2 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Tue, 1 Apr 2025 19:50:49 +0800 Subject: Added os.h for future usage (#2488) --- src/include/box64context.h | 1 - src/include/os.h | 6 ++++++ src/include/x64run.h | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 src/include/os.h (limited to 'src/include') diff --git a/src/include/box64context.h b/src/include/box64context.h index d2c1d23a..2d554703 100644 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -245,7 +245,6 @@ typedef struct box64context_s { #define mutex_trylock(A) pthread_mutex_trylock(A) #define mutex_unlock(A) pthread_mutex_unlock(A) #else -int GetTID(void); #define mutex_lock(A) {uint32_t tid = (uint32_t)GetTID(); while(native_lock_storeifnull_d(A, tid)) sched_yield();} #define mutex_trylock(A) native_lock_storeifnull_d(A, (uint32_t)GetTID()) #define mutex_unlock(A) native_lock_storeifref_d(A, 0, (uint32_t)GetTID()) diff --git a/src/include/os.h b/src/include/os.h new file mode 100644 index 00000000..1387255b --- /dev/null +++ b/src/include/os.h @@ -0,0 +1,6 @@ +#ifndef __OS_H_ +#define __OS_H_ + +int GetTID(void); + +#endif //__OS_H_ diff --git a/src/include/x64run.h b/src/include/x64run.h index 823a990c..c89e0786 100644 --- a/src/include/x64run.h +++ b/src/include/x64run.h @@ -8,6 +8,4 @@ int Run(x64emu_t *emu, int step); // 0 if run was successfull, 1 if error in x86 int RunTest(x64test_t *test); void DynaRun(x64emu_t *emu); -int GetTID(void); - #endif //__X64RUN_H_ -- cgit 1.4.1