diff options
| author | Yang Liu <liuyang22@iscas.ac.cn> | 2025-04-17 18:30:59 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-17 12:30:59 +0200 |
| commit | 882d933d8494a44cb03c0db8705ca0c96117aeeb (patch) | |
| tree | 844683440aaac55697b8829e9f0bf6f7b19d81f8 /src/include | |
| parent | 9579dd9ff14282cb9674e8cf08064220013fb46b (diff) | |
| download | box64-882d933d8494a44cb03c0db8705ca0c96117aeeb.tar.gz box64-882d933d8494a44cb03c0db8705ca0c96117aeeb.zip | |
[WOW64] Finished skeleton code for PE build (#2542)
* [WOW64] Finished skeleton code for PE build * move musl to external
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/box64context.h | 3 | ||||
| -rw-r--r-- | src/include/mypthread.h | 29 | ||||
| -rw-r--r-- | src/include/mysignal.h | 4 |
3 files changed, 35 insertions, 1 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h index a3d651d2..e7c7b0cc 100644 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -1,7 +1,8 @@ #ifndef __BOX64CONTEXT_H_ #define __BOX64CONTEXT_H_ #include <stdint.h> -#include <pthread.h> + +#include "mypthread.h" #include "pathcoll.h" #include "dictionnary.h" #ifdef DYNAREC diff --git a/src/include/mypthread.h b/src/include/mypthread.h new file mode 100644 index 00000000..ce9ea86c --- /dev/null +++ b/src/include/mypthread.h @@ -0,0 +1,29 @@ +#ifndef __MYPTHREAD_H_ +#define __MYPTHREAD_H_ + +#ifndef _WIN32 +#include <pthread.h> +#else +#include <windows.h> + +NTSTATUS WINAPI RtlEnterCriticalSection(RTL_CRITICAL_SECTION *); +NTSTATUS WINAPI RtlLeaveCriticalSection(RTL_CRITICAL_SECTION *); +BOOL WINAPI RtlTryEnterCriticalSection(RTL_CRITICAL_SECTION *); +NTSTATUS WINAPI RtlInitializeCriticalSection(RTL_CRITICAL_SECTION *); + +typedef void* pthread_key_t; +typedef void* pthread_mutexattr_t; +#define pthread_mutex_t RTL_CRITICAL_SECTION +#define pthread_mutex_init(x, y) RtlInitializeCriticalSection(x) +#define pthread_mutex_lock(x) RtlEnterCriticalSection(x) +#define pthread_mutex_unlock(x) RtlLeaveCriticalSection(x) +#define pthread_mutex_trylock(x) !RtlTryEnterCriticalSection(x) + +#define pthread_mutex_destroy(x) 0 +#define pthread_mutexattr_init(x) 0 +#define pthread_mutexattr_destroy(x) 0 +#define pthread_mutexattr_settype(x, y) 0 +#define pthread_atfork(a, b, c) 0 +#endif + +#endif // __MYPTHREAD_H_ \ No newline at end of file diff --git a/src/include/mysignal.h b/src/include/mysignal.h index 22861634..6f3548ad 100644 --- a/src/include/mysignal.h +++ b/src/include/mysignal.h @@ -12,7 +12,11 @@ typedef sigset_t __sigset_t; #define sigfillset(x) +#define SIGILL 4 #define SIGTRAP 5 +#define SIGSEGV 11 + +#define pthread_sigmask(a, b, c) 0 #endif #endif // __MYSIGNAL_H_ \ No newline at end of file |