[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 4/6] linux-user: refactor socket.h for sparc
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [RFC 4/6] linux-user: refactor socket.h for sparc |
Date: |
Fri, 22 Sep 2017 18:51:37 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
Le 22/09/2017 à 16:02, Carlo Marcelo Arenas Belón a écrit :
> fixes SOL_SOCKET and SO_LINGER at least
And fix TARGET_SOCK_NONBLOCK and TARGET_SOCK_CLOEXEC values.
>
> Signed-off-by: Carlo Marcelo Arenas Belón <address@hidden>
> ---
> linux-user/socket.h | 46 ++------------------
> linux-user/sparc/sockbits.h | 104
> ++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 107 insertions(+), 43 deletions(-)
> create mode 100644 linux-user/sparc/sockbits.h
>
> diff --git a/linux-user/socket.h b/linux-user/socket.h
> index 036270a6e4..dfa692286b 100644
> --- a/linux-user/socket.h
> +++ b/linux-user/socket.h
> @@ -4,50 +4,10 @@
> #include "alpha/sockbits.h"
> #elif defined(TARGET_HPPA)
> #include "hppa/sockbits.h"
> +#elif defined(TARGET_SPARC)
> +#include "sparc/sockbits.h"
> #else
>
> -#if defined(TARGET_SPARC)
> - /** sock_type - Socket types
> - *
> - * Please notice that for binary compat reasons SPARC has to
> - * override the enum sock_type in include/linux/net.h, so
> - * we define ARCH_HAS_SOCKET_TYPES here.
> - *
> - * @SOCK_DGRAM - datagram (conn.less) socket
> - * @SOCK_STREAM - stream (connection) socket
> - * @SOCK_RAW - raw socket
> - * @SOCK_RDM - reliably-delivered message
> - * @SOCK_SEQPACKET - sequential packet socket
> - * @SOCK_DCCP - Datagram Congestion Control Protocol socket
> - * @SOCK_PACKET - linux specific way of getting packets at the dev level.
> - * For writing rarp and other similar things on the user
> - * level.
> - * @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
> - * @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
> - */
> -
> - #define ARCH_HAS_SOCKET_TYPES 1
> -
> - enum sock_type {
> - TARGET_SOCK_STREAM = 1,
> - TARGET_SOCK_DGRAM = 2,
> - TARGET_SOCK_RAW = 3,
> - TARGET_SOCK_RDM = 4,
> - TARGET_SOCK_SEQPACKET = 5,
> - TARGET_SOCK_DCCP = 6,
> - TARGET_SOCK_PACKET = 10,
> - TARGET_SOCK_CLOEXEC = 020000000,
> - TARGET_SOCK_NONBLOCK = 040000,
> - };
...
> +enum sock_type {
> + TARGET_SOCK_STREAM = 1,
> + TARGET_SOCK_DGRAM = 2,
> + TARGET_SOCK_RAW = 3,
> + TARGET_SOCK_RDM = 4,
> + TARGET_SOCK_SEQPACKET = 5,
> + TARGET_SOCK_DCCP = 6,
> + TARGET_SOCK_PACKET = 10,
> + TARGET_SOCK_CLOEXEC = 0x400000,
> + TARGET_SOCK_NONBLOCK = 0x4000,
> +};
> +
> +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
> +#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX - 1. */
> +
> +#define ARCH_HAS_SOCKET_TYPES 1
>
Reviewed-by: Laurent Vivier <address@hidden>
- Re: [Qemu-devel] [RFC 2/6] linux-user: refactor socket.h for alpha, (continued)
- [Qemu-devel] [RFC 1/6] linux-user: update hppa sockbits, Carlo Marcelo Arenas Belón, 2017/09/22
- [Qemu-devel] [RFC 5/6] linux-user: fix 64bit versions of sparc and mips, Carlo Marcelo Arenas Belón, 2017/09/22
- [Qemu-devel] [RFC 3/6] linux-user: refactor socket.h for mips, Carlo Marcelo Arenas Belón, 2017/09/22
- [Qemu-devel] [RFC 4/6] linux-user: refactor socket.h for sparc, Carlo Marcelo Arenas Belón, 2017/09/22
- Re: [Qemu-devel] [RFC 4/6] linux-user: refactor socket.h for sparc,
Laurent Vivier <=
- [Qemu-devel] [RFC 6/6] linux-user: update default socket.h, Carlo Marcelo Arenas Belón, 2017/09/22