diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-23 10:14:17 +0100 |
|---|---|---|
| committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-06 15:46:18 +0100 |
| commit | e3a575f5609569400da628d384b32f5e3cf58745 (patch) | |
| tree | e9bfaa800033709612bb2c3072e82bffab5ee549 /hw/core/cpu-user.c | |
| parent | 530c7139f64aa0e45b61ce9abecb7df8c55b3f12 (diff) | |
| download | focaccia-qemu-e3a575f5609569400da628d384b32f5e3cf58745.tar.gz focaccia-qemu-e3a575f5609569400da628d384b32f5e3cf58745.zip | |
cpus: Have cpu_class_init_props() per user / system emulation
Rather than maintaining a mix of system / user code for CPU class properties, move system properties to cpu-system.c and user ones to the new cpu-user.c unit. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20250123234415.59850-18-philmd@linaro.org>
Diffstat (limited to 'hw/core/cpu-user.c')
| -rw-r--r-- | hw/core/cpu-user.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hw/core/cpu-user.c b/hw/core/cpu-user.c new file mode 100644 index 0000000000..e5ccf6bf13 --- /dev/null +++ b/hw/core/cpu-user.c @@ -0,0 +1,27 @@ +/* + * QEMU CPU model (user specific) + * + * Copyright (c) Linaro, Ltd. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/qdev-core.h" +#include "hw/qdev-properties.h" +#include "hw/core/cpu.h" + +static const Property cpu_user_props[] = { + /* + * Create a property for the user-only object, so users can + * adjust prctl(PR_SET_UNALIGN) from the command-line. + * Has no effect if the target does not support the feature. + */ + DEFINE_PROP_BOOL("prctl-unalign-sigbus", CPUState, + prctl_unalign_sigbus, false), +}; + +void cpu_class_init_props(DeviceClass *dc) +{ + device_class_set_props(dc, cpu_user_props); +} |