[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/61] target/hppa: Implement hppa_cpu_class_by_name
|
From: |
Richard Henderson |
|
Subject: |
[PATCH 15/61] target/hppa: Implement hppa_cpu_class_by_name |
|
Date: |
Wed, 18 Oct 2023 14:50:49 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/hppa/target_elf.h | 2 +-
target/hppa/cpu.c | 10 +++++++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/linux-user/hppa/target_elf.h b/linux-user/hppa/target_elf.h
index 82b4e9535e..9bb865ae92 100644
--- a/linux-user/hppa/target_elf.h
+++ b/linux-user/hppa/target_elf.h
@@ -9,6 +9,6 @@
#define HPPA_TARGET_ELF_H
static inline const char *cpu_get_model(uint32_t eflags)
{
- return "any";
+ return TYPE_HPPA_CPU;
}
#endif
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 1975aa9621..6bf415139f 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -159,7 +159,15 @@ static void hppa_cpu_initfn(Object *obj)
static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model)
{
- return object_class_by_name(TYPE_HPPA_CPU);
+ g_autofree char *typename = g_strconcat(cpu_model, "-cpu", NULL);
+ ObjectClass *oc = object_class_by_name(typename);
+
+ if (oc &&
+ !object_class_is_abstract(oc) &&
+ object_class_dynamic_cast(oc, TYPE_HPPA_CPU)) {
+ return oc;
+ }
+ return NULL;
}
static void hppa_cpu_list_entry(gpointer data, gpointer user_data)
--
2.34.1
- [PATCH 27/61] linux-user/hppa: Fixes for TARGET_ABI32, (continued)
- [PATCH 27/61] linux-user/hppa: Fixes for TARGET_ABI32, Richard Henderson, 2023/10/18
- [PATCH 36/61] target/hppa: Decode d for cmpb instructions, Richard Henderson, 2023/10/18
- [PATCH 38/61] target/hppa: Decode ADDB double-word, Richard Henderson, 2023/10/18
- [PATCH 19/61] hw/hppa: Translate phys addresses for the cpu, Richard Henderson, 2023/10/18
- [PATCH 04/61] target/hppa: Remove load_const, Richard Henderson, 2023/10/18
- [PATCH 20/61] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/10/18
- [PATCH 25/61] target/hppa: Pass d to do_sed_cond, Richard Henderson, 2023/10/18
- [PATCH 29/61] target/hppa: Remove TARGET_HPPA64, Richard Henderson, 2023/10/18
- [PATCH 34/61] target/hppa: Decode d for sub instructions, Richard Henderson, 2023/10/18
- [PATCH 37/61] target/hppa: Decode CMPIB double-word, Richard Henderson, 2023/10/18
- [PATCH 15/61] target/hppa: Implement hppa_cpu_class_by_name,
Richard Henderson <=
- [PATCH 16/61] target/hppa: Update cpu_hppa_get/put_psw for hppa64, Richard Henderson, 2023/10/18
- [PATCH 22/61] target/hppa: Pass d to do_cond, Richard Henderson, 2023/10/18
- [PATCH 23/61] target/hppa: Pass d to do_sub_cond, Richard Henderson, 2023/10/18
- [PATCH 24/61] target/hppa: Pass d to do_log_cond, Richard Henderson, 2023/10/18
- [PATCH 10/61] target/hppa: Fix bb_sar for hppa64, Richard Henderson, 2023/10/18
- [PATCH 21/61] target/hppa: sar register allows only 5 bits on 32-bit CPU, Richard Henderson, 2023/10/18
- [PATCH 26/61] target/hppa: Pass d to do_unit_cond, Richard Henderson, 2023/10/18
- [PATCH 33/61] target/hppa: Decode d for add instructions, Richard Henderson, 2023/10/18
- [PATCH 32/61] target/hppa: Decode d for cmpclr instructions, Richard Henderson, 2023/10/18
- [PATCH 35/61] target/hppa: Decode d for bb instructions, Richard Henderson, 2023/10/18