qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/riscv: Declare csr_ops[] with a known size
@ 2021-01-19  2:52 Bin Meng
  2021-01-19  2:59 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bin Meng @ 2021-01-19  2:52 UTC (permalink / raw)
  To: Richard Henderson, Alistair Francis; +Cc: Bin Meng, qemu-riscv, qemu-devel

From: Bin Meng <bin.meng@windriver.com>

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>
---

 target/riscv/cpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 02758ae..419a214 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -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);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] target/riscv: Declare csr_ops[] with a known size
  2021-01-19  2:52 [PATCH] target/riscv: Declare csr_ops[] with a known size Bin Meng
@ 2021-01-19  2:59 ` Philippe Mathieu-Daudé
  2021-01-19 16:33 ` Alistair Francis
  2021-01-19 17:08 ` Alistair Francis
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-01-19  2:59 UTC (permalink / raw)
  To: Bin Meng, Richard Henderson, Alistair Francis
  Cc: Bin Meng, qemu-riscv, qemu-devel

On 1/19/21 3:52 AM, Bin Meng wrote:
> From: Bin Meng <bin.meng@windriver.com>
> 
> 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>
> ---
> 
>  target/riscv/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target/riscv: Declare csr_ops[] with a known size
  2021-01-19  2:52 [PATCH] target/riscv: Declare csr_ops[] with a known size Bin Meng
  2021-01-19  2:59 ` Philippe Mathieu-Daudé
@ 2021-01-19 16:33 ` Alistair Francis
  2021-01-19 17:08 ` Alistair Francis
  2 siblings, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2021-01-19 16:33 UTC (permalink / raw)
  To: Bin Meng
  Cc: Alistair Francis, Bin Meng, Richard Henderson, open list:RISC-V,
	qemu-devel@nongnu.org Developers

On Mon, Jan 18, 2021 at 6:52 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Bin Meng <bin.meng@windriver.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

>
> 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>
> ---
>
>  target/riscv/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> index 02758ae..419a214 100644
> --- a/target/riscv/cpu.h
> +++ b/target/riscv/cpu.h
> @@ -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);
> --
> 2.7.4
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target/riscv: Declare csr_ops[] with a known size
  2021-01-19  2:52 [PATCH] target/riscv: Declare csr_ops[] with a known size Bin Meng
  2021-01-19  2:59 ` Philippe Mathieu-Daudé
  2021-01-19 16:33 ` Alistair Francis
@ 2021-01-19 17:08 ` Alistair Francis
  2 siblings, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2021-01-19 17:08 UTC (permalink / raw)
  To: Bin Meng
  Cc: Alistair Francis, Bin Meng, Richard Henderson, open list:RISC-V,
	qemu-devel@nongnu.org Developers

On Mon, Jan 18, 2021 at 6:52 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> From: Bin Meng <bin.meng@windriver.com>
>
> 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>

Thanks!

Applied to riscv-to-apply.next

Alistair

> ---
>
>  target/riscv/cpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> index 02758ae..419a214 100644
> --- a/target/riscv/cpu.h
> +++ b/target/riscv/cpu.h
> @@ -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);
> --
> 2.7.4
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-19 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19  2:52 [PATCH] target/riscv: Declare csr_ops[] with a known size Bin Meng
2021-01-19  2:59 ` Philippe Mathieu-Daudé
2021-01-19 16:33 ` Alistair Francis
2021-01-19 17:08 ` Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).