From patchwork Tue Feb 7 00:16:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 64397 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D7028393BA5A for ; Tue, 7 Feb 2023 00:20:06 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 93E783858C20 for ; Tue, 7 Feb 2023 00:16:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93E783858C20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-wm1-x32a.google.com with SMTP id hn2-20020a05600ca38200b003dc5cb96d46so12012912wmb.4 for ; Mon, 06 Feb 2023 16:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DlRBv+g2/GvW8WIJFIk6smVkrd3o3vNOVA1dOGbuqTo=; b=s4oiNbAH0ybZpdZNDNJ1gkuZCQOHI2GFH8OlmbzO6OnWJghLZT2+D9KlvuaJzcXwvV P5zopKz5dDcQf5Lin+j/4r9v5E+7LZcX+KOMl4cqUTduQPb9cN+ehyo4/EVHeqCWps+v yjFs2jcmw+E9T/Z8YCFnPKGiyLxYEq9Wu28h5TTfsBlyLTWnlTsKXRCCZ5DmrOF3Mqc1 WCfMWS1KeVWN5GeLOfSD5pxWlBWShrguSjN9OasC6AM2wDRfbnHrHr5irWWkpQbM37Ok Inc4WCBA7OazawlWJpJnkPVooj2u7WAgI0za0KesbJ+qJuYVHLJAmZQ+pAckxgTyXNZf gujg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DlRBv+g2/GvW8WIJFIk6smVkrd3o3vNOVA1dOGbuqTo=; b=nWDFQlVjNT0NC6QclqDNeF9sUp+mEoNlWf01sGOjoY278MVTw0pD0Ff4G79u2odw4w rFHghTOqd1tnWB49fEJijjCslurEjLVJ+VzfgVCxjR+IDCsVJ7CWaMX33dxzHSi3e42Z Py2LdoFrtVLBvHpJ7RxBPC70+9GgXQycRwKXiFY4QOgtM2QxfZ5FQADB5wZWDY58DiUt UFf+KpE/7onpF8qFWe03hHwkGpELnbELdO4bv2vSTNnVoeQiNAx/5ANXjHYZS4mkz9hj QtKT/KyiCvXr0erR5T0XDtKj4RytfhG5jZGLaLNh1uyjRCgcgXEaz7ntiAj8J7kcwFm7 4QaA== X-Gm-Message-State: AO0yUKWCYUeW4ifLWwxUW7+Dj2YGGZdS/sAPiNVGtFnc4lnnL6AYvGyk F2/sC6Na4pDXDkgkr7lA0nSpBuS24y66Dhta X-Google-Smtp-Source: AK7set9lHqkGtkWr9X/Eak0nRTPNnyKGvA/GzKT+xzih57s/iWIXIW8XST4W+yQbwC/ocabB5s+8Yg== X-Received: by 2002:a05:600c:755:b0:3e0:6c4:6a3a with SMTP id j21-20020a05600c075500b003e006c46a3amr1276186wmn.22.1675729002079; Mon, 06 Feb 2023 16:16:42 -0800 (PST) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id f1-20020a1cc901000000b003df14531724sm16862050wmb.21.2023.02.06.16.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Feb 2023 16:16:41 -0800 (PST) From: Christoph Muellner To: libc-alpha@sourceware.org, Palmer Dabbelt , Darius Rad , Andrew Waterman , DJ Delorie , Vineet Gupta , Kito Cheng , Jeff Law , Philipp Tomsich , Heiko Stuebner Cc: =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [RFC PATCH 08/19] riscv: Add (empty) ifunc framework Date: Tue, 7 Feb 2023 01:16:07 +0100 Message-Id: <20230207001618.458947-9-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230207001618.458947-1-christoph.muellner@vrull.eu> References: <20230207001618.458947-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_MANYTO, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" From: Christoph Müllner This patch adds the missing pieces to add ifunc implementations of routines. No optimized code is added as part of this patch. Signed-off-by: Christoph Müllner --- sysdeps/riscv/multiarch/Makefile | 4 +++ sysdeps/riscv/multiarch/ifunc-impl-list.c | 39 +++++++++++++++++++++++ sysdeps/riscv/multiarch/init-arch.h | 24 ++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 sysdeps/riscv/multiarch/Makefile create mode 100644 sysdeps/riscv/multiarch/ifunc-impl-list.c create mode 100644 sysdeps/riscv/multiarch/init-arch.h diff --git a/sysdeps/riscv/multiarch/Makefile b/sysdeps/riscv/multiarch/Makefile new file mode 100644 index 0000000000..68d3f5192f --- /dev/null +++ b/sysdeps/riscv/multiarch/Makefile @@ -0,0 +1,4 @@ +ifeq ($(subdir),string) +sysdep_routines += \ + +endif diff --git a/sysdeps/riscv/multiarch/ifunc-impl-list.c b/sysdeps/riscv/multiarch/ifunc-impl-list.c new file mode 100644 index 0000000000..c0cdca45fd --- /dev/null +++ b/sysdeps/riscv/multiarch/ifunc-impl-list.c @@ -0,0 +1,39 @@ +/* Enumerate available IFUNC implementations of a function. RISC-V version. + Copyright (C) 2022 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 + . */ + +#include +#include +#include +#include +#include +#include +#include + +/* Maximum number of IFUNC implementations. */ +#define MAX_IFUNC 7 + +size_t +__libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, + size_t max) +{ + assert (max >= MAX_IFUNC); + + size_t i = 0; + + return i; +} diff --git a/sysdeps/riscv/multiarch/init-arch.h b/sysdeps/riscv/multiarch/init-arch.h new file mode 100644 index 0000000000..c9afeec07b --- /dev/null +++ b/sysdeps/riscv/multiarch/init-arch.h @@ -0,0 +1,24 @@ +/* Define INIT_ARCH for RISC-V. + This file is part of the GNU C Library. + Copyright (C) 2022 Free Software Foundation, Inc. + + 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 _INIT_ARCH_RISCV +#define _INIT_ARCH_RISCV + +#define INIT_ARCH() + +#endif /* _INIT_ARCH_RISCV */