diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-07 11:44:09 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-07 11:44:09 +0100 |
| commit | 2a514f14c13c93c32b5ba01a5a3cae811e9f3e0e (patch) | |
| tree | dd0e0f51100d8144fda9bb832bde9e8ff633e108 /src/include | |
| parent | 395d9eb6224841edf72d5494bf306cf1ff79915e (diff) | |
| download | box64-2a514f14c13c93c32b5ba01a5a3cae811e9f3e0e.tar.gz box64-2a514f14c13c93c32b5ba01a5a3cae811e9f3e0e.zip | |
Reworked FPU/MMX regs, added Context and Signal handling (and test13 works)
Diffstat (limited to 'src/include')
| -rwxr-xr-x | src/include/regs.h | 17 | ||||
| -rwxr-xr-x | src/include/signals.h | 41 |
2 files changed, 44 insertions, 14 deletions
diff --git a/src/include/regs.h b/src/include/regs.h index 84159d2b..f75624a0 100755 --- a/src/include/regs.h +++ b/src/include/regs.h @@ -127,19 +127,6 @@ typedef enum { #pragma pack(push, 1) typedef union { - double d; - struct { - uint32_t lower; - uint32_t upper; - } l; - struct { - float lower; - float upper; - } f; - int64_t ll; -} fpu_reg_t; - -typedef union { //long double ld; // works only if 80bits! struct { uint64_t lower; @@ -237,13 +224,15 @@ typedef union { typedef union { uint64_t q; int64_t sq; + double d; + float f[2]; uint32_t ud[2]; int32_t sd[2]; uint16_t uw[4]; int16_t sw[4]; uint8_t ub[8]; int8_t sb[8]; -} mmx_regs_t; +} mmx87_regs_t; typedef union { uint64_t q[2]; diff --git a/src/include/signals.h b/src/include/signals.h new file mode 100755 index 00000000..513e5812 --- /dev/null +++ b/src/include/signals.h @@ -0,0 +1,41 @@ +#ifndef __SIGNALS_H__ +#define __SIGNALS_H__ +#include <signal.h> + +typedef void (*sighandler_t)(int); + +typedef struct x64_sigaction_s { + union { + __sighandler_t _sa_handler; + void (*_sa_sigaction)(int, siginfo_t *, void *); + } _u; + sigset_t sa_mask; + uint32_t sa_flags; + void (*sa_restorer)(void); +} x64_sigaction_t; + +typedef struct x64_sigaction_restorer_s { + union { + __sighandler_t _sa_handler; + void (*_sa_sigaction)(int, siginfo_t *, void *); + } _u; + uint32_t sa_flags; + void (*sa_restorer)(void); + sigset_t sa_mask; +} x64_sigaction_restorer_t; + +sighandler_t my_signal(x64emu_t* emu, int signum, sighandler_t handler); +sighandler_t my___sysv_signal(x64emu_t* emu, int signum, sighandler_t handler); +sighandler_t my_sysv_signal(x64emu_t* emu, int signum, sighandler_t handler); + +int my_sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact); +int my___sigaction(x64emu_t* emu, int signum, const x64_sigaction_t *act, x64_sigaction_t *oldact); + +int my_syscall_rt_sigaction(x64emu_t* emu, int signum, const x64_sigaction_restorer_t *act, x64_sigaction_restorer_t *oldact, int sigsetsize); + +void init_signal_helper(box64context_t* context); +void fini_signal_helper(); + +void emit_signal(x64emu_t* emu, int sig, void* addr, int code); + +#endif //__SIGNALS_H__ \ No newline at end of file |