diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-11-22 13:18:23 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-11-22 13:18:23 +0100 |
| commit | 299c911330c1133af48aae2e82d1dd04d5b09ca5 (patch) | |
| tree | 4f29a2a5606bdd978376a0df8439b8d1a8878945 /src/libtools | |
| parent | 6318b592a3514f7c92c81c920966c64208e1f2ea (diff) | |
| download | box64-299c911330c1133af48aae2e82d1dd04d5b09ca5.tar.gz box64-299c911330c1133af48aae2e82d1dd04d5b09ca5.zip | |
Simplified alignment of stat64 structure
Diffstat (limited to 'src/libtools')
| -rwxr-xr-x | src/libtools/myalign.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libtools/myalign.c b/src/libtools/myalign.c index 12eae94c..3d2e49a0 100755 --- a/src/libtools/myalign.c +++ b/src/libtools/myalign.c @@ -11,6 +11,7 @@ #include "x64emu.h" #include "emu/x64emu_private.h" #include "myalign.h" +#include "debug.h" static int regs_abi[] = {_DI, _SI, _DX, _CX, _R8, _R9}; @@ -550,16 +551,9 @@ void AlignStat64(const void* source, void* dest) st->st_ctim = x64st->st_ctim; } -typedef union __attribute__((packed)) x64_epoll_data { - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; -} x64_epoll_data_t; - struct __attribute__((packed)) x64_epoll_event { uint32_t events; - x64_epoll_data_t data; + uint64_t data; }; // Arm -> x64 void UnalignEpollEvent(void* dest, void* source, int nbr) @@ -568,7 +562,7 @@ void UnalignEpollEvent(void* dest, void* source, int nbr) struct epoll_event *arm_struct = (struct epoll_event*)source; while(nbr) { x64_struct->events = arm_struct->events; - x64_struct->data.u64 = arm_struct->data.u64; + x64_struct->data = arm_struct->data.u64; ++x64_struct; ++arm_struct; --nbr; @@ -582,7 +576,7 @@ void AlignEpollEvent(void* dest, void* source, int nbr) struct epoll_event *arm_struct = (struct epoll_event*)dest; while(nbr) { arm_struct->events = x64_struct->events; - arm_struct->data.u64 = x64_struct->data.u64; + arm_struct->data.u64 = x64_struct->data; ++x64_struct; ++arm_struct; --nbr; |