qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/hexagon: switch to dc set_props() list
@ 2024-07-31  1:12 Brian Cain
  2024-07-31  8:41 ` Philippe Mathieu-Daudé
  2024-07-31 16:40 ` ltaylorsimpson
  0 siblings, 2 replies; 3+ messages in thread
From: Brian Cain @ 2024-07-31  1:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: bcain, quic_mathbern, sidneym, quic_mliebel, ltaylorsimpson

Define a hexagon_cpu_properties list to match the idiom used
by other targets.

Signed-off-by: Brian Cain <bcain@quicinc.com>
---
 target/hexagon/cpu.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c
index 64cc05cca7..93579fbb15 100644
--- a/target/hexagon/cpu.c
+++ b/target/hexagon/cpu.c
@@ -47,13 +47,13 @@ static ObjectClass *hexagon_cpu_class_by_name(const char *cpu_model)
     return oc;
 }
 
-static Property hexagon_lldb_compat_property =
-    DEFINE_PROP_BOOL("lldb-compat", HexagonCPU, lldb_compat, false);
-static Property hexagon_lldb_stack_adjust_property =
-    DEFINE_PROP_UNSIGNED("lldb-stack-adjust", HexagonCPU, lldb_stack_adjust,
-                         0, qdev_prop_uint32, target_ulong);
-static Property hexagon_short_circuit_property =
-    DEFINE_PROP_BOOL("short-circuit", HexagonCPU, short_circuit, true);
+static Property hexagon_cpu_properties[] = {
+    DEFINE_PROP_BOOL("lldb-compat", HexagonCPU, lldb_compat, false),
+    DEFINE_PROP_UNSIGNED("lldb-stack-adjust", HexagonCPU, lldb_stack_adjust, 0,
+                         qdev_prop_uint32, target_ulong),
+    DEFINE_PROP_BOOL("short-circuit", HexagonCPU, short_circuit, true),
+    DEFINE_PROP_END_OF_LIST()
+};
 
 const char * const hexagon_regnames[TOTAL_PER_THREAD_REGS] = {
    "r0", "r1",  "r2",  "r3",  "r4",   "r5",  "r6",  "r7",
@@ -316,9 +316,6 @@ static void hexagon_cpu_realize(DeviceState *dev, Error **errp)
 
 static void hexagon_cpu_init(Object *obj)
 {
-    qdev_property_add_static(DEVICE(obj), &hexagon_lldb_compat_property);
-    qdev_property_add_static(DEVICE(obj), &hexagon_lldb_stack_adjust_property);
-    qdev_property_add_static(DEVICE(obj), &hexagon_short_circuit_property);
 }
 
 #include "hw/core/tcg-cpu-ops.h"
@@ -339,6 +336,7 @@ static void hexagon_cpu_class_init(ObjectClass *c, void *data)
     device_class_set_parent_realize(dc, hexagon_cpu_realize,
                                     &mcc->parent_realize);
 
+    device_class_set_props(dc, hexagon_cpu_properties);
     resettable_class_set_parent_phases(rc, NULL, hexagon_cpu_reset_hold, NULL,
                                        &mcc->parent_phases);
 
-- 
2.34.1


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

* Re: [PATCH] target/hexagon: switch to dc set_props() list
  2024-07-31  1:12 [PATCH] target/hexagon: switch to dc set_props() list Brian Cain
@ 2024-07-31  8:41 ` Philippe Mathieu-Daudé
  2024-07-31 16:40 ` ltaylorsimpson
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-31  8:41 UTC (permalink / raw)
  To: Brian Cain, qemu-devel
  Cc: quic_mathbern, sidneym, quic_mliebel, ltaylorsimpson

On 31/7/24 03:12, Brian Cain wrote:
> Define a hexagon_cpu_properties list to match the idiom used
> by other targets.
> 
> Signed-off-by: Brian Cain <bcain@quicinc.com>
> ---
>   target/hexagon/cpu.c | 18 ++++++++----------
>   1 file changed, 8 insertions(+), 10 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



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

* RE: [PATCH] target/hexagon: switch to dc set_props() list
  2024-07-31  1:12 [PATCH] target/hexagon: switch to dc set_props() list Brian Cain
  2024-07-31  8:41 ` Philippe Mathieu-Daudé
@ 2024-07-31 16:40 ` ltaylorsimpson
  1 sibling, 0 replies; 3+ messages in thread
From: ltaylorsimpson @ 2024-07-31 16:40 UTC (permalink / raw)
  To: 'Brian Cain', qemu-devel; +Cc: quic_mathbern, sidneym, quic_mliebel



> -----Original Message-----
> From: Brian Cain <bcain@quicinc.com>
> Sent: Tuesday, July 30, 2024 7:13 PM
> To: qemu-devel@nongnu.org
> Cc: bcain@quicinc.com; quic_mathbern@quicinc.com;
> sidneym@quicinc.com; quic_mliebel@quicinc.com;
> ltaylorsimpson@gmail.com
> Subject: [PATCH] target/hexagon: switch to dc set_props() list
> 
> Define a hexagon_cpu_properties list to match the idiom used by other
> targets.
> 
> Signed-off-by: Brian Cain <bcain@quicinc.com>
> ---
>  target/hexagon/cpu.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)

Reviewed-by: Taylor Simpson <ltaylorsimpson@gmail.com>



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

end of thread, other threads:[~2024-07-31 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31  1:12 [PATCH] target/hexagon: switch to dc set_props() list Brian Cain
2024-07-31  8:41 ` Philippe Mathieu-Daudé
2024-07-31 16:40 ` ltaylorsimpson

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