[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu v2 10/42] kvm: Change kvm_{insert, remove}_b
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu v2 10/42] kvm: Change kvm_{insert, remove}_breakpoint() argument to CPUState |
Date: |
Sun, 7 Jul 2013 20:25:59 +0200 |
CPUArchState is no longer directly used since converting CPU loops to
CPUState.
Prepares for changing GDBState::c_cpu to CPUState.
Signed-off-by: Andreas Färber <address@hidden>
---
gdbstub.c | 12 ++++++++----
include/sysemu/kvm.h | 4 ++--
kvm-all.c | 10 ++++------
kvm-stub.c | 4 ++--
4 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 17da380..b77cd3e 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1954,8 +1954,10 @@ static int gdb_breakpoint_insert(target_ulong addr,
target_ulong len, int type)
CPUArchState *env;
int err = 0;
- if (kvm_enabled())
- return kvm_insert_breakpoint(gdbserver_state->c_cpu, addr, len, type);
+ if (kvm_enabled()) {
+ return kvm_insert_breakpoint(ENV_GET_CPU(gdbserver_state->c_cpu),
+ addr, len, type);
+ }
switch (type) {
case GDB_BREAKPOINT_SW:
@@ -1991,8 +1993,10 @@ static int gdb_breakpoint_remove(target_ulong addr,
target_ulong len, int type)
CPUArchState *env;
int err = 0;
- if (kvm_enabled())
- return kvm_remove_breakpoint(gdbserver_state->c_cpu, addr, len, type);
+ if (kvm_enabled()) {
+ return kvm_remove_breakpoint(ENV_GET_CPU(gdbserver_state->c_cpu),
+ addr, len, type);
+ }
switch (type) {
case GDB_BREAKPOINT_SW:
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 1e08a85..f8ac448 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -169,9 +169,9 @@ void *kvm_arch_ram_alloc(ram_addr_t size);
void kvm_setup_guest_memory(void *start, size_t size);
void kvm_flush_coalesced_mmio_buffer(void);
-int kvm_insert_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type);
-int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type);
void kvm_remove_all_breakpoints(CPUState *cpu);
int kvm_update_guest_debug(CPUArchState *env, unsigned long reinject_trap);
diff --git a/kvm-all.c b/kvm-all.c
index 0c16a44..2263c48 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1903,10 +1903,9 @@ int kvm_update_guest_debug(CPUArchState *env, unsigned
long reinject_trap)
return data.err;
}
-int kvm_insert_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type)
{
- CPUState *cpu = ENV_GET_CPU(env);
struct kvm_sw_breakpoint *bp;
int err;
@@ -1949,10 +1948,9 @@ int kvm_insert_breakpoint(CPUArchState *env,
target_ulong addr,
return 0;
}
-int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type)
{
- CPUState *cpu = ENV_GET_CPU(env);
struct kvm_sw_breakpoint *bp;
int err;
@@ -2025,13 +2023,13 @@ int kvm_update_guest_debug(CPUArchState *env, unsigned
long reinject_trap)
return -EINVAL;
}
-int kvm_insert_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type)
{
return -EINVAL;
}
-int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type)
{
return -EINVAL;
diff --git a/kvm-stub.c b/kvm-stub.c
index 370c837..7b2233a 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -83,13 +83,13 @@ int kvm_update_guest_debug(CPUArchState *env, unsigned long
reinject_trap)
return -ENOSYS;
}
-int kvm_insert_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_insert_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type)
{
return -EINVAL;
}
-int kvm_remove_breakpoint(CPUArchState *env, target_ulong addr,
+int kvm_remove_breakpoint(CPUState *cpu, target_ulong addr,
target_ulong len, int type)
{
return -EINVAL;
--
1.8.1.4
- [Qemu-devel] [PATCH qom-cpu v2 00/42] QOM CPUState, part 11: GDB stub, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 01/42] cpu: Introduce vaddr type, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 04/42] target-moxie: Implement CPUClass::set_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 03/42] target-m68k: Implement CPUClass::set_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 05/42] target-unicore32: Implement CPUClass::set_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 02/42] cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 08/42] gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 09/42] cpu: Change cpu_single_step() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 11/42] gdbstub: Change syscall callback argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 10/42] kvm: Change kvm_{insert, remove}_breakpoint() argument to CPUState,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu v2 06/42] cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 14/42] gdbstub: Change gdb_{read, write}_register() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 13/42] gdbstub: Change GDBState::c_cpu to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 12/42] gdbstub: Change gdb_handlesig() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 18/42] gdbstub: Change GDBState::g_cpu to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 07/42] cpu: Move singlestep_enabled field from CPU_COMMON to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 19/42] cpu: Move gdb_regs field from CPU_COMMON to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 20/42] gdbstub: Change gdb_register_coprocessor() argument to CPUState, Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 17/42] cpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug(), Andreas Färber, 2013/07/07
- [Qemu-devel] [PATCH qom-cpu v2 16/42] exec: Change cpu_memory_rw_debug() argument to CPUState, Andreas Färber, 2013/07/07