]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
RISC-V: Use address for vlenb CSR
authorHongren Zheng <i@zenithal.me>
Tue, 2 Sep 2025 14:00:10 +0000 (22:00 +0800)
committerTomas Mraz <tomas@openssl.org>
Tue, 9 Sep 2025 09:18:42 +0000 (11:18 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28422)

crypto/riscv32cpuid.pl
crypto/riscv64cpuid.pl

index 5ee7df0ea63b35a9706ab876b073c71180d9c739..b693412b600ef414179ea69f4daff74859952252 100644 (file)
@@ -94,7 +94,8 @@ $code .= <<___;
 .globl riscv_vlen_asm
 .type riscv_vlen_asm,\@function
 riscv_vlen_asm:
-    csrr $ret, vlenb
+    # 0xc22 is CSR vlenb
+    csrr $ret, 0xc22
     slli $ret, $ret, 3
     ret
 .size riscv_vlen_asm,.-riscv_vlen_asm
index 5dcdc5c584cda59d8c494010741a9e2d884187aa..59e785348179b1cecf28ddb3698513216fce37b8 100644 (file)
@@ -94,7 +94,8 @@ $code .= <<___;
 .globl riscv_vlen_asm
 .type riscv_vlen_asm,\@function
 riscv_vlen_asm:
-    csrr $ret, vlenb
+    # 0xc22 is CSR vlenb
+    csrr $ret, 0xc22
     slli $ret, $ret, 3
     ret
 .size riscv_vlen_asm,.-riscv_vlen_asm