[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/24] user: Forward declare TaskState type definition
|
From: |
Philippe Mathieu-Daudé |
|
Subject: |
[PATCH 08/24] user: Forward declare TaskState type definition |
|
Date: |
Mon, 29 Apr 2024 00:14:34 +0200 |
Forward declare TaskState in "qemu/typedefs.h" so we can
use it in generic headers like "hw/cpu/core.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
bsd-user/qemu.h | 4 ++--
include/qemu/typedefs.h | 1 +
linux-user/qemu.h | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index e562adde65..be57374b41 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -76,7 +76,7 @@ struct emulated_sigtable {
/*
* NOTE: we force a big alignment so that the stack stored after is aligned too
*/
-typedef struct TaskState {
+struct TaskState {
pid_t ts_tid; /* tid (or pid) of this task */
struct TaskState *next;
@@ -114,7 +114,7 @@ typedef struct TaskState {
/* This thread's sigaltstack, if it has one */
struct target_sigaltstack sigaltstack_used;
-} __attribute__((aligned(16))) TaskState;
+} __attribute__((aligned(16)));
static inline TaskState *get_task_state(CPUState *cs)
{
diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h
index 50c277cf0b..36f2825725 100644
--- a/include/qemu/typedefs.h
+++ b/include/qemu/typedefs.h
@@ -134,6 +134,7 @@ typedef struct SHPCDevice SHPCDevice;
typedef struct SSIBus SSIBus;
typedef struct TCGCPUOps TCGCPUOps;
typedef struct TCGHelperInfo TCGHelperInfo;
+typedef struct TaskState TaskState;
typedef struct TranslationBlock TranslationBlock;
typedef struct VirtIODevice VirtIODevice;
typedef struct Visitor Visitor;
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 4777856b52..16d9f6ae8c 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -95,7 +95,7 @@ struct emulated_sigtable {
target_siginfo_t info;
};
-typedef struct TaskState {
+struct TaskState {
pid_t ts_tid; /* tid (or pid) of this task */
#ifdef TARGET_ARM
# ifdef TARGET_ABI32
@@ -158,7 +158,7 @@ typedef struct TaskState {
/* Start time of task after system boot in clock ticks */
uint64_t start_boottime;
-} TaskState;
+};
static inline TaskState *get_task_state(CPUState *cs)
{
--
2.41.0
- [PATCH 03/24] accel/tcg: Move user definition of cpu_interrupt() to user-exec.c, (continued)
- [PATCH 03/24] accel/tcg: Move user definition of cpu_interrupt() to user-exec.c, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 04/24] accel/tcg: Duplicate cpu_exit() for user / system, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 05/24] accel/tcg: Extract tcg_cpu_exit() from cpu_exit(), Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 06/24] accel: Introduce AccelOpsClass::exit_vcpu_thread() handler, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 07/24] accel/tcg: Implement AccelOpsClass::exit_vcpu_thread() handler, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 08/24] user: Forward declare TaskState type definition,
Philippe Mathieu-Daudé <=
- [PATCH 09/24] user: Declare get_task_state() once in 'accel/tcg/vcpu-state.h', Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 10/24] user: Use get_task_state() helper, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 11/24] accel/tcg: Allocate per-vCPU accel state in create_vcpu_thread(), Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 12/24] accel/tcg: Move TaskState from CPUState to TCG AccelCPUState, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH 13/24] accel/tcg: Update CPUNegativeOffsetState::can_do_io field documentation, Philippe Mathieu-Daudé, 2024/04/28