From patchwork Wed Dec 12 15:07:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 1012043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dvQ71XyT"; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43FKv636dYz9s47 for ; Thu, 13 Dec 2018 02:08:15 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 7F785100AA; Wed, 12 Dec 2018 16:08:11 +0100 (CET) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by helium.openadk.org (Postfix) with ESMTPS id E7EDF100A8 for ; Wed, 12 Dec 2018 16:08:06 +0100 (CET) Received: by mail-lj1-f195.google.com with SMTP id v1-v6so16621133ljd.0 for ; Wed, 12 Dec 2018 07:08:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5erSrJ1xNSIxggjRytHp9NjtoGEaBficER6qJZDBZI=; b=dvQ71XyTcw0BZvg6adu+VmhxNzupRojEaP/JWDXq4gqxNsKPntO74z82fwnBMYrLhb Wawmr3TEp6G+olxZmdXtRQaILstEUCe6XFCoOpx0sJLOwj5pugSwufGzpfXoqAPvZZtf lXEcxCl/+5DA8cx91EcXiUAIaMyQoDP1mh6f4K+opU8DO7pusHuXSD8ikq3gRkiL9UpY N3iWYyHncWfkRCgImXKqXimpulUbP3BI4Ibvx/zO77LHclohe8VGGhiPUMTvvKMizF/a Vd+n8LsTxyKF3POcEeDIfwBEgB64Yl0MKfQdsmpR/jKzgIPtgHSdrWjiz8ddsEE7kyOy as3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=K5erSrJ1xNSIxggjRytHp9NjtoGEaBficER6qJZDBZI=; b=Ee7PugQCoHW9u/bDefP+Rqfafze5GcUXgnEUNtoW9+2hswEi7LXbzxYyc/3lxIole+ wpCX3JRvCyLQZ3jNzYDi/ChG8FYp3o8UoNwYZ1F74fXwKVAYy4tnvy7wYd8cdzspwSVb wFPICiSpo8QHZVjEPvDt/Ftad9R5yG8/a7tWTSs4wnB3oY1uxiIRDRmQGUQIFOV+AoDT EqsBG1DT0FoWl7EEjYfwihOZjl0+cEdatMvPcBuRSxWD9mmUxERO0G3K9jogj9lLHK11 VGkVzuGSYhcAQqTk9sSVTM5wCPebUYa2JK1Y7srWLChEc3uTO9So9CXe4Z5tepYhwEXQ +aqQ== X-Gm-Message-State: AA+aEWaDGJH1MfDy5n948++WKInZCTsvsWgkmTBUEzTDwonx8pLq/s81 AvKgg9clnav/mFX+VcRXdtw7eoRC X-Google-Smtp-Source: AFSGD/WARx2Lr8OtpvVxEIZ0l5GXe9iAA31yYi9nw0YTFV08g5tEFQtEMCTpVnuae78IgP/SSTIPtA== X-Received: by 2002:a2e:4819:: with SMTP id v25-v6mr13620233lja.2.1544627286032; Wed, 12 Dec 2018 07:08:06 -0800 (PST) Received: from octofox.cadence.com (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id x21sm3267869lfe.6.2018.12.12.07.08.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Dec 2018 07:08:05 -0800 (PST) From: Max Filippov To: devel@uclibc-ng.org Date: Wed, 12 Dec 2018 07:07:40 -0800 Message-Id: <20181212150740.19432-1-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: linux-xtensa@linux-xtensa.org, Chris Zankel Subject: [uclibc-ng-devel] [PATCH] xtensa: add custom bits/poll.h X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Definitions of POLLWRNORM, POLLWRBAND and POLLREMOVE in xtensa linux kernel are non-standard. Provide bits/poll.h with correct values for these constants. This fixes the following strace build errors: In file included from xlat/pollflags.h:4:0, from poll.c:34: ./static_assert.h:40:24: error: static assertion failed: "POLLWRBAND != 0x0100" # define static_assert _Static_assert ^ xlat/pollflags.h:75:1: note: in expansion of macro ‘static_assert’ static_assert((POLLWRBAND) == (0x0100), "POLLWRBAND != 0x0100"); ^~~~~~~~~~~~~ ./static_assert.h:40:24: error: static assertion failed: "POLLREMOVE != 0x0800" # define static_assert _Static_assert ^ xlat/pollflags.h:117:1: note: in expansion of macro ‘static_assert’ static_assert((POLLREMOVE) == (0x0800), "POLLREMOVE != 0x0800"); ^~~~~~~~~~~~~ Signed-off-by: Max Filippov --- libc/sysdeps/linux/xtensa/bits/poll.h | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libc/sysdeps/linux/xtensa/bits/poll.h diff --git a/libc/sysdeps/linux/xtensa/bits/poll.h b/libc/sysdeps/linux/xtensa/bits/poll.h new file mode 100644 index 000000000000..4588cc326006 --- /dev/null +++ b/libc/sysdeps/linux/xtensa/bits/poll.h @@ -0,0 +1,49 @@ +/* Copyright (C) 1997, 2001, 2006 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_POLL_H +# error "Never use directly; include instead." +#endif + +/* Event types that can be polled for. These bits may be set in `events' + to indicate the interesting event types; they will appear in `revents' + to indicate the status of the file descriptor. */ +#define POLLIN 0x001 /* There is data to read. */ +#define POLLPRI 0x002 /* There is urgent data to read. */ +#define POLLOUT 0x004 /* Writing now will not block. */ + +#ifdef __USE_XOPEN +/* These values are defined in XPG4.2. */ +# define POLLRDNORM 0x040 /* Normal data may be read. */ +# define POLLRDBAND 0x080 /* Priority data may be read. */ +# define POLLWRNORM POLLOUT /* Writing now will not block. */ +# define POLLWRBAND 0x100 /* Priority data may be written. */ +#endif + +#ifdef __USE_GNU +/* These are extensions for Linux. */ +# define POLLMSG 0x400 +# define POLLREMOVE 0x800 +# define POLLRDHUP 0x2000 +#endif + +/* Event types always implicitly polled for. These bits need not be set in + `events', but they will appear in `revents' to indicate the status of + the file descriptor. */ +#define POLLERR 0x008 /* Error condition. */ +#define POLLHUP 0x010 /* Hung up. */ +#define POLLNVAL 0x020 /* Invalid polling request. */