X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/d06cddf517d2b33389c02971b353d10dd4edda1a..8c116b0e4141400f8d43a7e6dac8ff3adcc8aadd:/thunk.c diff --git a/thunk.c b/thunk.c index 06571889ae..3cca047509 100644 --- a/thunk.c +++ b/thunk.c @@ -21,7 +21,7 @@ #include #include "qemu.h" -#include "thunk.h" +#include "exec/user/thunk.h" //#define DEBUG @@ -46,6 +46,7 @@ static inline const argtype *thunk_type_next(const argtype *type_ptr) case TYPE_LONG: case TYPE_ULONG: case TYPE_PTRVOID: + case TYPE_OLDDEVT: return type_ptr; case TYPE_PTR: return thunk_type_next_ptr(type_ptr); @@ -188,6 +189,33 @@ const argtype *thunk_convert(void *dst, const void *src, #else #warning unsupported conversion #endif + case TYPE_OLDDEVT: + { + uint64_t val = 0; + switch (thunk_type_size(type_ptr - 1, !to_host)) { + case 2: + val = *(uint16_t *)src; + break; + case 4: + val = *(uint32_t *)src; + break; + case 8: + val = *(uint64_t *)src; + break; + } + switch (thunk_type_size(type_ptr - 1, to_host)) { + case 2: + *(uint16_t *)dst = tswap16(val); + break; + case 4: + *(uint32_t *)dst = tswap32(val); + break; + case 8: + *(uint64_t *)dst = tswap64(val); + break; + } + break; + } case TYPE_ARRAY: { int array_length, i, dst_size, src_size;