From nobody Mon Feb 9 21:00:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1526722377268688.9101525100773; Sat, 19 May 2018 02:32:57 -0700 (PDT) Received: from localhost ([::1]:42348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJyEJ-0000oj-7Z for importer@patchew.org; Sat, 19 May 2018 05:32:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJyCI-0008K8-5C for qemu-devel@nongnu.org; Sat, 19 May 2018 05:30:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJyCE-00037H-4L for qemu-devel@nongnu.org; Sat, 19 May 2018 05:30:42 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:38045) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJyCD-00036i-Q4 for qemu-devel@nongnu.org; Sat, 19 May 2018 05:30:38 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.183]) with ESMTPSA (Nemesis) id 0LpNe1-1eesDJ24ZR-00fEsj; Sat, 19 May 2018 11:30:12 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Sat, 19 May 2018 11:29:49 +0200 Message-Id: <20180519092956.15134-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180519092956.15134-1-laurent@vivier.eu> References: <20180519092956.15134-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:/zanXABvn2PHdRcQKg1M77aFmIFH0tHh10AuzLbxepdLGMpzeya 8f/LGVvqPlIwQOJMPfDtpf9ysum2nooRhHtwEszG+9CTho54SciZveuIGYXTT8+5GskzcQo 8Tax/vxB+uS5QivbcxiVSNwVE/yrlwaLAbh89/MScI0tkqsiD2+CsKqIjj41A19+A6EEj+W 6HlqNHbXnvvZhF1jLcsaA== X-UI-Out-Filterresults: notjunk:1;V01:K0:CW6V6+Tp9fY=:26+sAu4u3KXUXRT+FlRWyf 4d9qYYFniY5vQU9cQ+juZQ6dtLN5yA/Igy0L1jDDSd2E22h7pJbY0LhqpkwmVkXg014sVvd5l WH9cl8xhoFNh7hdVtl/V/XZKUD59EWkU7An9l+ta2amHKTr5Lag3WWomre7Mg5eLaVn7ORrg4 gE0eygyKpGhWkpYnsbVNIGsC2hbsMkNBzqanA0KiHiUi0PAXiyKDnex+HEzU+L943mgObAaOi 6knv5VYWZ4Z0D5IzgvmL0ouio4WCQPwC0UnUfxlnfewwFzUPr9sVsE0hOh1GPE9/IGjPfanye Te26YjJBGvoAI8Xc/Fgzr35jU9Kqe4AZBtyf/6OvA/z3Fc5aIrEzQY5rFpVlDUHU1Kim4zZMe EScTj4+d3dIroaUNlE2KLnV07rYgS3HBTT8wg2dYojkCRFJxW+696njeS7wS4xX8zy6Z3Vlqt oTVbSU21tiTFW4frmcgo2B/ddH0bvw5QdKGkXyWb1qqEu+10o8NTifg8n5AXI4Dr5hkmKXslw lxXCMdNgS1tfLx503XphO/cWh6PusmTdvvT9RYzER0pNQ/ouBHDXVcUyJp1xhzign7LUkd89b S/yA+1bKKNm+55seGcv5GPFa3NBCa7+BgI2iOWTtYPwn34+4tBel9/QbrOkOqOImIcT1bFbaq ka/JTRmHmPDWhWbM/CY5COpDei7AKto1L4cYjcm6WKzOM8o/cTlOtcIK+DV/PkPr2Ef8FLZi4 QzW/cN3n6ti1uHmw X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PATCH v3 1/8] linux-user: move mips socket.h definitions to mips/sockbits.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Riku Voipio , Mark Cave-Ayland , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yongbok Kim , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 No code change. Signed-off-by: Laurent Vivier Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- linux-user/mips/sockbits.h | 110 +++++++++++++++++++++++++++++++++++++++= ++++ linux-user/mips64/sockbits.h | 1 + linux-user/socket.h | 106 +--------------------------------------= -- 3 files changed, 113 insertions(+), 104 deletions(-) create mode 100644 linux-user/mips/sockbits.h create mode 100644 linux-user/mips64/sockbits.h diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h new file mode 100644 index 0000000000..3fe5ac88e7 --- /dev/null +++ b/linux-user/mips/sockbits.h @@ -0,0 +1,110 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation, or (at your option) any + * later version. See the COPYING file in the top-level directory. + */ + +#ifndef MIPS_SOCKBITS_H +#define MIPS_SOCKBITS_H +/* MIPS special values for constants */ + +/* + * For setsockopt(2) + * + * This defines are ABI conformant as far as Linux supports these ... + */ +#define TARGET_SOL_SOCKET 0xffff + +#define TARGET_SO_DEBUG 0x0001 /* Record debugging information. */ +#define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local addresses. = */ +#define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and send + SIGPIPE when they die. */ +#define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */ +#define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of + broadcast messages. */ +#define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable + * socket to transmit pending data. + */ +#define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-band. + */ +#if 0 +/* To add: Allow local address and port reuse. */ +#define TARGET_SO_REUSEPORT 0x0200 +#endif + +#define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE. */ +#define TARGET_SO_STYLE SO_TYPE /* Synonym */ +#define TARGET_SO_ERROR 0x1007 /* get error status and clear */ +#define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */ +#define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */ +#define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */ +#define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */ +#define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ +#define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ +#define TARGET_SO_ACCEPTCONN 0x1009 + +/* linux-specific, might as well be the same as on i386 */ +#define TARGET_SO_NO_CHECK 11 +#define TARGET_SO_PRIORITY 12 +#define TARGET_SO_BSDCOMPAT 14 + +#define TARGET_SO_PASSCRED 17 +#define TARGET_SO_PEERCRED 18 + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define TARGET_SO_SECURITY_AUTHENTICATION 22 +#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 + +#define TARGET_SO_BINDTODEVICE 25 + +/* Socket filtering */ +#define TARGET_SO_ATTACH_FILTER 26 +#define TARGET_SO_DETACH_FILTER 27 + +#define TARGET_SO_PEERNAME 28 +#define TARGET_SO_TIMESTAMP 29 +#define SCM_TIMESTAMP SO_TIMESTAMP + +#define TARGET_SO_PEERSEC 30 +#define TARGET_SO_SNDBUFFORCE 31 +#define TARGET_SO_RCVBUFFORCE 33 +#define TARGET_SO_PASSSEC 34 + +/** sock_type - Socket types + * + * Please notice that for binary compat reasons MIPS 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_DGRAM =3D 1, + TARGET_SOCK_STREAM =3D 2, + TARGET_SOCK_RAW =3D 3, + TARGET_SOCK_RDM =3D 4, + TARGET_SOCK_SEQPACKET =3D 5, + TARGET_SOCK_DCCP =3D 6, + TARGET_SOCK_PACKET =3D 10, + TARGET_SOCK_CLOEXEC =3D 02000000, + TARGET_SOCK_NONBLOCK =3D 0200, +}; + +#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) +#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */ +#endif diff --git a/linux-user/mips64/sockbits.h b/linux-user/mips64/sockbits.h new file mode 100644 index 0000000000..e6b6d31ac9 --- /dev/null +++ b/linux-user/mips64/sockbits.h @@ -0,0 +1 @@ +#include "../mips/sockbits.h" diff --git a/linux-user/socket.h b/linux-user/socket.h index 7051cd2cf4..9c57da7a61 100644 --- a/linux-user/socket.h +++ b/linux-user/socket.h @@ -1,106 +1,6 @@ =20 -#if defined(TARGET_MIPS) - /* MIPS special values for constants */ - - /* - * For setsockopt(2) - * - * This defines are ABI conformant as far as Linux supports these ... - */ - #define TARGET_SOL_SOCKET 0xffff - - #define TARGET_SO_DEBUG 0x0001 /* Record debugging information= . */ - #define TARGET_SO_REUSEADDR 0x0004 /* Allow reuse of local address= es. */ - #define TARGET_SO_KEEPALIVE 0x0008 /* Keep connections alive and s= end - SIGPIPE when they die. */ - #define TARGET_SO_DONTROUTE 0x0010 /* Don't do local routing. */ - #define TARGET_SO_BROADCAST 0x0020 /* Allow transmission of - broadcast messages. */ - #define TARGET_SO_LINGER 0x0080 /* Block on close of a reliable - * socket to transmit pending d= ata. - */ - #define TARGET_SO_OOBINLINE 0x0100 /* Receive out-of-band data in-= band. - */ - #if 0 - /* To add: Allow local address and port reuse. */ - #define TARGET_SO_REUSEPORT 0x0200 - #endif - - #define TARGET_SO_TYPE 0x1008 /* Compatible name for SO_STYLE= . */ - #define TARGET_SO_STYLE SO_TYPE /* Synonym */ - #define TARGET_SO_ERROR 0x1007 /* get error status and clear */ - #define TARGET_SO_SNDBUF 0x1001 /* Send buffer size. */ - #define TARGET_SO_RCVBUF 0x1002 /* Receive buffer. */ - #define TARGET_SO_SNDLOWAT 0x1003 /* send low-water mark */ - #define TARGET_SO_RCVLOWAT 0x1004 /* receive low-water mark */ - #define TARGET_SO_SNDTIMEO 0x1005 /* send timeout */ - #define TARGET_SO_RCVTIMEO 0x1006 /* receive timeout */ - #define TARGET_SO_ACCEPTCONN 0x1009 - - /* linux-specific, might as well be the same as on i386 */ - #define TARGET_SO_NO_CHECK 11 - #define TARGET_SO_PRIORITY 12 - #define TARGET_SO_BSDCOMPAT 14 - - #define TARGET_SO_PASSCRED 17 - #define TARGET_SO_PEERCRED 18 - - /* Security levels - as per NRL IPv6 - don't actually do anything */ - #define TARGET_SO_SECURITY_AUTHENTICATION 22 - #define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23 - #define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24 - - #define TARGET_SO_BINDTODEVICE 25 - - /* Socket filtering */ - #define TARGET_SO_ATTACH_FILTER 26 - #define TARGET_SO_DETACH_FILTER 27 - - #define TARGET_SO_PEERNAME 28 - #define TARGET_SO_TIMESTAMP 29 - #define SCM_TIMESTAMP SO_TIMESTAMP - - #define TARGET_SO_PEERSEC 30 - #define TARGET_SO_SNDBUFFORCE 31 - #define TARGET_SO_RCVBUFFORCE 33 - #define TARGET_SO_PASSSEC 34 - - /** sock_type - Socket types - * - * Please notice that for binary compat reasons MIPS 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 lev= el. - * 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_DGRAM =3D 1, - TARGET_SOCK_STREAM =3D 2, - TARGET_SOCK_RAW =3D 3, - TARGET_SOCK_RDM =3D 4, - TARGET_SOCK_SEQPACKET =3D 5, - TARGET_SOCK_DCCP =3D 6, - TARGET_SOCK_PACKET =3D 10, - TARGET_SOCK_CLOEXEC =3D 02000000, - TARGET_SOCK_NONBLOCK =3D 0200, - }; - - #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) - #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-= 1. */ - +#if defined(TARGET_MIPS) || defined(TARGET_HPPA) +#include "sockbits.h" #elif defined(TARGET_ALPHA) =20 /* For setsockopt(2) */ @@ -205,8 +105,6 @@ =20 #define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1) #define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-= 1. */ -#elif defined(TARGET_HPPA) -#include #else =20 #if defined(TARGET_SPARC) --=20 2.14.3