From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 5C9AE38356B9; Wed, 9 Nov 2022 14:41:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C9AE38356B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668004915; bh=4/cVJn1uizlNB5QRawBvieaHluQk3evbGqf6k4wrenY=; h=From:To:Subject:Date:From; b=I236OMZuCUtl6UiJiLdpKunqXUBOrr43J7gycUEf8XQwkobDJsZ0BNLurlFVrW2QI QOuG+5QTHPeyoTi2i7YqAEwD7U10GRHlVWKsG+Nqh6sHJhjBFc58EfxoiysPW6FqUW 2jvdwCvgX3r6oZajAdHSaarjHyI/gf6nlnvuBxOw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] riscv: Get level 3 cache's information X-Act-Checkin: glibc X-Git-Author: Zong Li X-Git-Refname: refs/heads/master X-Git-Oldrev: 1a8335a408430517001a0660f5c7787223ce85e4 X-Git-Newrev: 38caf7a1cc92e6a546ea655701c8237ee727d0d3 Message-Id: <20221109144155.5C9AE38356B9@sourceware.org> Date: Wed, 9 Nov 2022 14:41:54 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=38caf7a1cc92e6a546ea655701c8237ee727d0d3 commit 38caf7a1cc92e6a546ea655701c8237ee727d0d3 Author: Zong Li Date: Wed Nov 9 11:40:59 2022 -0300 riscv: Get level 3 cache's information RISC-V architecture extends the cache information for level 3 cache in AUX vector in Linux v.6.1-rc1. This patch supports sysconf to get the level 3 cache information. Reviewed-by: Palmer Dabbelt Acked-by: Palmer Dabbelt Diff: --- sysdeps/unix/sysv/linux/riscv/sysconf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sysdeps/unix/sysv/linux/riscv/sysconf.c b/sysdeps/unix/sysv/linux/riscv/sysconf.c index b768ebf781..85b9faff71 100644 --- a/sysdeps/unix/sysv/linux/riscv/sysconf.c +++ b/sysdeps/unix/sysv/linux/riscv/sysconf.c @@ -90,6 +90,12 @@ __sysconf (int name) return sysconf_get_cache_associativity (AT_L2_CACHEGEOMETRY); case _SC_LEVEL2_CACHE_LINESIZE: return sysconf_get_cache_linesize (AT_L2_CACHEGEOMETRY); + case _SC_LEVEL3_CACHE_SIZE: + return sysconf_get_cache_size (AT_L3_CACHESIZE); + case _SC_LEVEL3_CACHE_ASSOC: + return sysconf_get_cache_associativity (AT_L3_CACHEGEOMETRY); + case _SC_LEVEL3_CACHE_LINESIZE: + return sysconf_get_cache_linesize (AT_L3_CACHEGEOMETRY); default: return linux_sysconf (name); }