diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-07-23 20:06:28 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-07-23 20:06:28 +0200 |
| commit | c0ebc4cbb09e2bc66137535c553d4860363add47 (patch) | |
| tree | 829f3ebbd73929b72548fc712862b94baea37299 /src/emu | |
| parent | e3b6d6e6b26ff7091fb58e08c67cb32270deee4a (diff) | |
| download | box64-c0ebc4cbb09e2bc66137535c553d4860363add47.tar.gz box64-c0ebc4cbb09e2bc66137535c553d4860363add47.zip | |
Some work around chromium / libcef / electron / nw (still not ok)
Diffstat (limited to 'src/emu')
| -rwxr-xr-x | src/emu/x64emu_private.h | 1 | ||||
| -rwxr-xr-x | src/emu/x64syscall.c | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/emu/x64emu_private.h b/src/emu/x64emu_private.h index cf81d316..114731eb 100755 --- a/src/emu/x64emu_private.h +++ b/src/emu/x64emu_private.h @@ -73,6 +73,7 @@ typedef struct x64emu_s { forkpty_t* forkpty_info; int exit; int quitonlongjmp; // quit if longjmp is called + int quitonexit; // quit if exit/_exit is called int longjmp; // if quit because of longjmp // scratch stack, used for alignement of double and 64bits ints on arm. 200 elements should be enough uint64_t scratch[200]; diff --git a/src/emu/x64syscall.c b/src/emu/x64syscall.c index fc237939..4ca3547e 100755 --- a/src/emu/x64syscall.c +++ b/src/emu/x64syscall.c @@ -54,6 +54,9 @@ void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot, int f int my_munmap(x64emu_t* emu, void* addr, unsigned long length); int my_mprotect(x64emu_t* emu, void *addr, unsigned long len, int prot); void* my_mremap(x64emu_t* emu, void* old_addr, size_t old_size, size_t new_size, int flags, void* new_addr); +#ifndef NO_ALIGN +int32_t my_epoll_wait(x64emu_t* emu, int32_t epfd, void* events, int32_t maxevents, int32_t timeout); +#endif // cannot include <fcntl.h>, it conflict with some asm includes... #ifndef O_NONBLOCK @@ -471,7 +474,7 @@ void EXPORT x64Syscall(x64emu_t *emu) break; #endif #ifndef __NR_rename - case 82: // sys_rename + case 82: // sys_rename *(int64_t*)&R_RAX = rename((void*)R_RDI, (void*)R_RSI); break; #endif @@ -499,6 +502,11 @@ void EXPORT x64Syscall(x64emu_t *emu) R_RAX = (uintptr_t)time((void*)R_RDI); break; #endif + #if !defined(__NR_epoll_wait) && !defined(NO_ALIGN) + case 232: + R_RAX = my_epoll_wait(emu, (int)R_EDI, (void*)R_RSI, (int)R_EDX, (int)R_R8d); + break; + #endif #ifndef __NR_inotify_init case 253: R_EAX = (int)syscall(__NR_inotify_init1, 0); @@ -698,6 +706,11 @@ uintptr_t EXPORT my_syscall(x64emu_t *emu) case 201: // sys_time return (uintptr_t)time((void*)R_RSI); #endif + #if !defined(__NR_epoll_wait) && !defined(NO_ALIGN) + case 232: + R_RAX = my_epoll_wait(emu, (int)R_ESI, (void*)R_RDX, (int)R_ECX, (int)R_R8d); + break; + #endif #ifndef __NR_inotify_init case 253: return (int)syscall(__NR_inotify_init1, 0); |