X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=thunk.c;h=3cca047509e7483da2f45701b16055eb9f028cf6;hb=60aad298cb6de52f2716b2e82e1353ea9de95fd6;hp=6813c9ffa07dd819f341b939aaf25250b64f49b3;hpb=fad6cb1a565bb73f83fc0e2654489457b489e436;p=qemu.git diff --git a/thunk.c b/thunk.c index 6813c9ffa..3cca04750 100644 --- a/thunk.c +++ b/thunk.c @@ -14,15 +14,14 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + * License along with this library; if not, see . */ #include #include #include #include "qemu.h" -#include "thunk.h" +#include "exec/user/thunk.h" //#define DEBUG @@ -47,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); @@ -189,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;