diff mbox series

[4/9] target: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint

Message ID 20230721205827.7502-5-anjo@rev.ng (mailing list archive)
State New, archived
Headers show
Series Replace remaining target_ulong in system-mode accel | expand

Commit Message

Anton Johansson July 21, 2023, 8:58 p.m. UTC
Changes the signature of the target-defined functions for
inserting/removing hvf hw breakpoints. The address and length arguments
are now of vaddr type, which both matches the type used internally in
accel/hvf/hvf-all.c and makes the api target-agnostic.

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 include/sysemu/hvf.h  |  6 ++----
 target/arm/hvf/hvf.c  | 14 ++++++++------
 target/i386/hvf/hvf.c |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

Comments

Richard Henderson July 27, 2023, 7:29 p.m. UTC | #1
On 7/21/23 13:58, Anton Johansson wrote:
> -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type)
> +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
>   {
>       switch (type) {
>       case GDB_BREAKPOINT_HW:
> -        return insert_hw_breakpoint(addr);
> +        return insert_hw_breakpoint((target_ulong) addr);

No need for the casts.


r~
diff mbox series

Patch

diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h
index 4cbae87ced..4037cd6a73 100644
--- a/include/sysemu/hvf.h
+++ b/include/sysemu/hvf.h
@@ -51,10 +51,8 @@  int hvf_sw_breakpoints_active(CPUState *cpu);
 
 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
 int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp);
-int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len,
-                                  int type);
-int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len,
-                                  int type);
+int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type);
+int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type);
 void hvf_arch_remove_all_hw_breakpoints(void);
 
 /*
diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 8fce64bbf6..f8649bdb1b 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -2063,29 +2063,31 @@  int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
     return 0;
 }
 
-int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type)
+int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
 {
     switch (type) {
     case GDB_BREAKPOINT_HW:
-        return insert_hw_breakpoint(addr);
+        return insert_hw_breakpoint((target_ulong) addr);
     case GDB_WATCHPOINT_READ:
     case GDB_WATCHPOINT_WRITE:
     case GDB_WATCHPOINT_ACCESS:
-        return insert_hw_watchpoint(addr, len, type);
+        return insert_hw_watchpoint((target_ulong) addr,
+                                    (target_ulong) len, type);
     default:
         return -ENOSYS;
     }
 }
 
-int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int type)
+int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
 {
     switch (type) {
     case GDB_BREAKPOINT_HW:
-        return delete_hw_breakpoint(addr);
+        return delete_hw_breakpoint((target_ulong) addr);
     case GDB_WATCHPOINT_READ:
     case GDB_WATCHPOINT_WRITE:
     case GDB_WATCHPOINT_ACCESS:
-        return delete_hw_watchpoint(addr, len, type);
+        return delete_hw_watchpoint((target_ulong) addr,
+                                    (target_ulong) len, type);
     default:
         return -ENOSYS;
     }
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index b9cbcc02a8..cb2cd0b02f 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -690,12 +690,12 @@  int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint *bp)
     return -ENOSYS;
 }
 
-int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type)
+int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type)
 {
     return -ENOSYS;
 }
 
-int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int type)
+int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type)
 {
     return -ENOSYS;
 }