qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v7 9/9] linux-user/syscall: Align target_sockaddr fields


From: Laurent Vivier
Subject: Re: [RFC PATCH v7 9/9] linux-user/syscall: Align target_sockaddr fields using ABI types
Date: Mon, 21 Oct 2019 11:59:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0

Le 15/09/2019 à 23:39, Philippe Mathieu-Daudé a écrit :
> Target architectures align types differently for instance
> m68k aligns on 16bit whereas others on 32bit).
> Use ABI types to keep alignments good.
> 
> Suggested-by: Laurent Vivier <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> RFC: Is target_sockaddr_ll.sll_ifindex of type abi_int?
> 
>  linux-user/syscall_defs.h | 34 +++++++++++++++++-----------------
>  1 file changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
> index 7694d72446..852d4498e0 100644
> --- a/linux-user/syscall_defs.h
> +++ b/linux-user/syscall_defs.h
> @@ -134,22 +134,22 @@
>  #define TARGET_IOWRU(type,nr)        
> TARGET_IOC(TARGET_IOC_READ|TARGET_IOC_WRITE,(type),(nr),TARGET_IOC_SIZEMASK)
>  
>  struct target_sockaddr {
> -    uint16_t sa_family;
> +    abi_ushort sa_family;
>      uint8_t sa_data[14];
>  };
>  
>  struct target_sockaddr_ll {
> -    uint16_t sll_family;   /* Always AF_PACKET */
> -    uint16_t sll_protocol; /* Physical layer protocol */
> -    int      sll_ifindex;  /* Interface number */
> -    uint16_t sll_hatype;   /* ARP hardware type */
> -    uint8_t  sll_pkttype;  /* Packet type */
> -    uint8_t  sll_halen;    /* Length of address */
> -    uint8_t  sll_addr[8];  /* Physical layer address */
> +    abi_ushort sll_family;   /* Always AF_PACKET */
> +    abi_ushort sll_protocol; /* Physical layer protocol */
> +    int        sll_ifindex;  /* Interface number */

abi_int would be better.

Thanks,
Laurent



reply via email to

[Prev in Thread] Current Thread [Next in Thread]