For now, we keep the global cpu_get_note_size symbol defined.

Reviewed-by: Anton Johansson <[email protected]>
Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
Signed-off-by: Pierrick Bouvier <[email protected]>
---
 target/loongarch/arch_dump.c | 8 +++++++-
 target/loongarch/cpu.c       | 1 +
 target/loongarch/internals.h | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/target/loongarch/arch_dump.c b/target/loongarch/arch_dump.c
index 853a60d7b89..47036105e0a 100644
--- a/target/loongarch/arch_dump.c
+++ b/target/loongarch/arch_dump.c
@@ -150,7 +150,8 @@ void loongarch_get_dump_info(const CPUState *cs, 
ArchDumpInfo *info,
     info->d_class = ELFCLASS64;
 }
 
-ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
+size_t loongarch_get_note_size(const CPUState *cs, int class,
+                               int machine, int nr_cpus)
 {
     size_t note_size = 0;
 
@@ -160,3 +161,8 @@ ssize_t cpu_get_note_size(int class, int machine, int 
nr_cpus)
 
     return note_size * nr_cpus;
 }
+
+ssize_t cpu_get_note_size(int class, int machine, int nr_cpus)
+{
+    return loongarch_get_note_size(first_cpu, class, machine, nr_cpus);
+}
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 65772f30947..5e182922b7d 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -842,6 +842,7 @@ static const struct SysemuCPUOps loongarch_sysemu_ops = {
     .has_work = loongarch_cpu_has_work,
     .write_elf64_note = loongarch_cpu_write_elf64_note,
     .get_dump_info = loongarch_get_dump_info,
+    .get_note_size = loongarch_get_note_size,
     .get_phys_addr_debug = loongarch_cpu_get_phys_addr_debug,
 };
 
diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h
index 041d07442fd..952c98f74ae 100644
--- a/target/loongarch/internals.h
+++ b/target/loongarch/internals.h
@@ -53,5 +53,7 @@ int loongarch_cpu_write_elf64_note(WriteCoreDumpFunction f, 
CPUState *cpu,
 
 void loongarch_get_dump_info(const CPUState *cs, ArchDumpInfo *info,
                              const GuestPhysBlockList *guest_phys_blocks);
+size_t loongarch_get_note_size(const CPUState *cs, int class,
+                               int machine, int nr_cpus);
 
 #endif
-- 
2.47.3


Reply via email to