[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/38] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoi
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 31/38] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header |
Date: |
Fri, 26 Apr 2024 21:41:51 +0200 |
The CPUBreakpoint and CPUWatchpoint structures are declared
in "hw/core/cpu.h", which contains declarations related to
CPUState and CPUClass. Some source files only require the
BP/WP definitions and don't need to pull in all CPU* API.
In order to simplify, create a new "exec/breakpoint.h" header.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20240418192525.97451-3-philmd@linaro.org>
---
include/exec/breakpoint.h | 30 ++++++++++++++++++++++++++++++
include/hw/core/cpu.h | 16 +---------------
target/arm/internals.h | 1 +
target/ppc/internal.h | 1 +
target/riscv/debug.h | 2 ++
5 files changed, 35 insertions(+), 15 deletions(-)
create mode 100644 include/exec/breakpoint.h
diff --git a/include/exec/breakpoint.h b/include/exec/breakpoint.h
new file mode 100644
index 0000000000..95f0482e6d
--- /dev/null
+++ b/include/exec/breakpoint.h
@@ -0,0 +1,30 @@
+/*
+ * QEMU breakpoint & watchpoint definitions
+ *
+ * Copyright (c) 2012 SUSE LINUX Products GmbH
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef EXEC_BREAKPOINT_H
+#define EXEC_BREAKPOINT_H
+
+#include "qemu/queue.h"
+#include "exec/vaddr.h"
+#include "exec/memattrs.h"
+
+typedef struct CPUBreakpoint {
+ vaddr pc;
+ int flags; /* BP_* */
+ QTAILQ_ENTRY(CPUBreakpoint) entry;
+} CPUBreakpoint;
+
+typedef struct CPUWatchpoint {
+ vaddr vaddr;
+ vaddr len;
+ vaddr hitaddr;
+ MemTxAttrs hitattrs;
+ int flags; /* BP_* */
+ QTAILQ_ENTRY(CPUWatchpoint) entry;
+} CPUWatchpoint;
+
+#endif
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index 759c3e7d89..46b99a7ea5 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -22,6 +22,7 @@
#include "hw/qdev-core.h"
#include "disas/dis-asm.h"
+#include "exec/breakpoint.h"
#include "exec/hwaddr.h"
#include "exec/vaddr.h"
#include "exec/memattrs.h"
@@ -347,21 +348,6 @@ typedef struct CPUNegativeOffsetState {
bool can_do_io;
} CPUNegativeOffsetState;
-typedef struct CPUBreakpoint {
- vaddr pc;
- int flags; /* BP_* */
- QTAILQ_ENTRY(CPUBreakpoint) entry;
-} CPUBreakpoint;
-
-struct CPUWatchpoint {
- vaddr vaddr;
- vaddr len;
- vaddr hitaddr;
- MemTxAttrs hitattrs;
- int flags; /* BP_* */
- QTAILQ_ENTRY(CPUWatchpoint) entry;
-};
-
struct KVMState;
struct kvm_run;
diff --git a/target/arm/internals.h b/target/arm/internals.h
index b53f5e8ff2..e40ec453d5 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -25,6 +25,7 @@
#ifndef TARGET_ARM_INTERNALS_H
#define TARGET_ARM_INTERNALS_H
+#include "exec/breakpoint.h"
#include "hw/registerfields.h"
#include "tcg/tcg-gvec-desc.h"
#include "syndrome.h"
diff --git a/target/ppc/internal.h b/target/ppc/internal.h
index 5b20ecbd33..601c0b533f 100644
--- a/target/ppc/internal.h
+++ b/target/ppc/internal.h
@@ -18,6 +18,7 @@
#ifndef PPC_INTERNAL_H
#define PPC_INTERNAL_H
+#include "exec/breakpoint.h"
#include "hw/registerfields.h"
/* PM instructions */
diff --git a/target/riscv/debug.h b/target/riscv/debug.h
index 5794aa6ee5..c347863578 100644
--- a/target/riscv/debug.h
+++ b/target/riscv/debug.h
@@ -22,6 +22,8 @@
#ifndef RISCV_DEBUG_H
#define RISCV_DEBUG_H
+#include "exec/breakpoint.h"
+
#define RV_MAX_TRIGGERS 2
/* register index of tdata CSRs */
--
2.41.0
- [PULL 23/38] exec/cpu-all: Reduce 'qemu/rcu.h' header inclusion, (continued)
- [PULL 23/38] exec/cpu-all: Reduce 'qemu/rcu.h' header inclusion, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 21/38] accel/nvmm: Use accel-specific per-vcpu @dirty field, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 22/38] accel/hvf: Use accel-specific per-vcpu @dirty field, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 24/38] exec/cpu-all: Remove unused 'qemu/thread.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 25/38] exec/cpu-all: Remove unused tswapls() definitions, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 26/38] exec: Declare target_words_bigendian() in 'exec/tswap.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 27/38] exec: Move [b]tswapl() declarations to 'exec/user/tswap-target.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 28/38] exec/user: Do not include 'cpu.h' in 'abitypes.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 29/38] exec: Declare abi_ptr type in its own 'abi_ptr.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 30/38] exec: Declare MMUAccessType type in 'mmu-access-type.h' header, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 31/38] exec: Declare CPUBreakpoint/CPUWatchpoint type in 'breakpoint.h' header,
Philippe Mathieu-Daudé <=
- [PULL 32/38] exec: Restrict TCG specific declarations of 'cputlb.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 33/38] exec: Restrict 'cpu_ldst.h' to TCG accelerator, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 34/38] exec: Rename 'exec/user/guest-base.h' as 'user/guest-base.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 35/38] exec: Restrict inclusion of 'user/guest-base.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 36/38] exec: Move CPUTLBEntry helpers to cputlb.c, Philippe Mathieu-Daudé, 2024/04/26
- [PULL 37/38] hw/core: Avoid including the full 'hw/core/cpu.h' in 'tcg-cpu-ops.h', Philippe Mathieu-Daudé, 2024/04/26
- [PULL 38/38] plugins: Include missing 'qemu/bitmap.h' header, Philippe Mathieu-Daudé, 2024/04/26
- Re: [PULL 00/38] Exec / accelerators patches, Richard Henderson, 2024/04/27