OSDN Git Service

target/riscv: Declare csr_ops[] with a known size
authorBin Meng <bin.meng@windriver.com>
Tue, 19 Jan 2021 02:52:03 +0000 (10:52 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Thu, 4 Mar 2021 14:43:29 +0000 (09:43 -0500)
csr_ops[] is currently declared with an unknown size in cpu.h.
Since the array size is known, let's do a complete declaration.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 1611024723-14293-1-git-send-email-bmeng.cn@gmail.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.h

index 02758ae..419a214 100644 (file)
@@ -487,7 +487,7 @@ enum {
 };
 
 /* CSR function table */
-extern riscv_csr_operations csr_ops[];
+extern riscv_csr_operations csr_ops[CSR_TABLE_SIZE];
 
 void riscv_get_csr_ops(int csrno, riscv_csr_operations *ops);
 void riscv_set_csr_ops(int csrno, riscv_csr_operations *ops);