qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties(


From: Richard Henderson
Subject: Re: [PATCH 03/19] target/riscv: introduce riscv_cpu_add_misa_properties()
Date: Mon, 27 Mar 2023 15:27:49 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/27/23 15:15, Daniel Henrique Barboza wrote:


On 3/27/23 15:52, Richard Henderson wrote:
On 3/27/23 05:42, Daniel Henrique Barboza wrote:
+static void cpu_set_misa_ext_cfg(Object *obj, Visitor *v, const char *name,
+                                 void *opaque, Error **errp)
+{
+    RISCVCPUMisaExtConfig *misa_ext_cfg = opaque;

const

+static void cpu_get_misa_ext_cfg(Object *obj, Visitor *v, const char *name,
+                                 void *opaque, Error **errp)
+{
+    RISCVCPUMisaExtConfig *misa_ext_cfg = opaque;

const

+static RISCVCPUMisaExtConfig misa_ext_cfgs[] = {};

const

It seems that I can't use 'const' because the object_property_add() API uses a 
'void *opaque'
pointer and it won't take a "const RISCVCPUMisaExtConfig *":

../target/riscv/cpu.c:1454:35: error: passing argument 7 of ‘object_property_add’ discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
  1454 |                             NULL, misa_cfg);
       |                                   ^~~~~~~~

You can cast away the const. There's no need for this array to be outside of .rodata (or .data.rel.ro).


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]