From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 799BDECAAD3 for ; Sun, 4 Sep 2022 07:38:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbiIDHi5 (ORCPT ); Sun, 4 Sep 2022 03:38:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbiIDHi4 (ORCPT ); Sun, 4 Sep 2022 03:38:56 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84D714620A for ; Sun, 4 Sep 2022 00:38:55 -0700 (PDT) Received: from localhost.localdomain (unknown [182.2.71.200]) by gnuweeb.org (Postfix) with ESMTPSA id 303C4804FD; Sun, 4 Sep 2022 07:38:50 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1662277135; bh=kVhMCfSnTCGom1GFmJrKOwFCKw+V0su6J6zGYu2I3Lk=; h=From:To:Cc:Subject:Date:From; b=LYXvk/SYWePgm6YYb+73Nfls4t/CcqPOWIIMuhnbNgClOV8NU0bCIuWTvYAnzTNGK wmtMMUo5RvMD+Wf5LFDu0OX42Fm4Sm8Mt4KGnxqVQy6pzkDgO+BXnUKtjbZMxnX7e4 XYSONGUbXuel9LxKjZ+uXJZz2eIHl0pdGAqU29/qdtJhR3rLblTdn5Z6v//+Tk75ZV NEXGiftDWor1b4Xvk07435UCDVxgtPF/+1rVNdvNkrxxzCWUtwDokKNzACaQkWKxeT 5FIMQxw79ZIhZ1WMGoK1sxX1VQBD90gdY1xslF76enSUbHT5Z2FQkzAeA4o6O9/jWg bhaqgsdEXkSyg== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , io-uring Mailing List , GNU/Weeb Mailing List , Kanna Scarlet , Muhammad Rizki Subject: [PATCH liburing v2] liburing: Export `__NR_io_uring_{setup,enter,register}` to user Date: Sun, 4 Sep 2022 14:38:45 +0700 Message-Id: <20220904073817.1950991-1-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org These macros are not defined in an old file. Allow liburing users to get io_uring syscall numbers by including . Signed-off-by: Ammar Faizi --- v2: - Fix typo in the commit message: s/in a old/in an old/ src/include/liburing.h | 38 ++++++++++++++++++++++++++++++++++++++ src/syscall.h | 37 ------------------------------------- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/include/liburing.h b/src/include/liburing.h index 6040a06..cceab6b 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -33,6 +33,44 @@ #define uring_likely(cond) __builtin_expect(!!(cond), 1) #endif + +#ifdef __alpha__ +/* + * alpha and mips are exception, other architectures have + * common numbers for new system calls. + */ +#ifndef __NR_io_uring_setup +#define __NR_io_uring_setup 535 +#endif +#ifndef __NR_io_uring_enter +#define __NR_io_uring_enter 536 +#endif +#ifndef __NR_io_uring_register +#define __NR_io_uring_register 537 +#endif +#elif defined __mips__ +#ifndef __NR_io_uring_setup +#define __NR_io_uring_setup (__NR_Linux + 425) +#endif +#ifndef __NR_io_uring_enter +#define __NR_io_uring_enter (__NR_Linux + 426) +#endif +#ifndef __NR_io_uring_register +#define __NR_io_uring_register (__NR_Linux + 427) +#endif +#else /* !__alpha__ and !__mips__ */ +#ifndef __NR_io_uring_setup +#define __NR_io_uring_setup 425 +#endif +#ifndef __NR_io_uring_enter +#define __NR_io_uring_enter 426 +#endif +#ifndef __NR_io_uring_register +#define __NR_io_uring_register 427 +#endif +#endif + + #ifdef __cplusplus extern "C" { #endif diff --git a/src/syscall.h b/src/syscall.h index ba008ea..f750782 100644 --- a/src/syscall.h +++ b/src/syscall.h @@ -10,45 +10,8 @@ #include #include #include - #include -#ifdef __alpha__ -/* - * alpha and mips are exception, other architectures have - * common numbers for new system calls. - */ -#ifndef __NR_io_uring_setup -#define __NR_io_uring_setup 535 -#endif -#ifndef __NR_io_uring_enter -#define __NR_io_uring_enter 536 -#endif -#ifndef __NR_io_uring_register -#define __NR_io_uring_register 537 -#endif -#elif defined __mips__ -#ifndef __NR_io_uring_setup -#define __NR_io_uring_setup (__NR_Linux + 425) -#endif -#ifndef __NR_io_uring_enter -#define __NR_io_uring_enter (__NR_Linux + 426) -#endif -#ifndef __NR_io_uring_register -#define __NR_io_uring_register (__NR_Linux + 427) -#endif -#else /* !__alpha__ and !__mips__ */ -#ifndef __NR_io_uring_setup -#define __NR_io_uring_setup 425 -#endif -#ifndef __NR_io_uring_enter -#define __NR_io_uring_enter 426 -#endif -#ifndef __NR_io_uring_register -#define __NR_io_uring_register 427 -#endif -#endif - /* * Don't put this below the #include "arch/$arch/syscall.h", that * file may need it. base-commit: 42ee2bdb76022fc11d7a0ad8ec5cca6de73501e9 -- Ammar Faizi