From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
deller@gmx.de, "Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PULL 2/2] hw/hppa: Move static variable lasi_dev into MachineState
Date: Tue, 19 May 2026 17:18:23 +0200 [thread overview]
Message-ID: <20260519151823.13878-3-deller@kernel.org> (raw)
In-Reply-To: <20260519151823.13878-1-deller@kernel.org>
From: Helge Deller <deller@gmx.de>
Avoid static variables, so move lasi_dev into the MachineState struct.
Signed-off-by: Helge Deller <deller@gmx.de>
Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/hppa/machine.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 0937d90ed2..d762163ddf 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -44,6 +44,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(HppaMachineState, HPPA_COMMON_MACHINE)
struct HppaMachineState {
MachineState parent_obj;
+ DeviceState *lasi_dev;
uint64_t memsplit_addr;
};
@@ -52,8 +53,6 @@ struct HppaMachineState {
#define HPA_POWER_BUTTON (FIRMWARE_END - 0x10)
static hwaddr soft_power_reg;
-static DeviceState *lasi_dev;
-
static void hppa_powerdown_req(Notifier *n, void *opaque)
{
uint32_t val;
@@ -399,7 +398,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
{
const char *kernel_filename = machine->kernel_filename;
MachineClass *mc = MACHINE_GET_CLASS(machine);
- DeviceState *dev;
+ HppaMachineState *hpm = HPPA_COMMON_MACHINE(machine);
+ DeviceState *dev, *lasi_dev;
PCIDevice *pci_dev;
long size;
uint64_t kernel_entry = 0;
@@ -408,6 +408,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
SysBusDevice *s;
/* Graphics setup. */
+ lasi_dev = hpm->lasi_dev;
if (lasi_dev && machine->enable_graphics &&
vga_interface_type != VGA_NONE) {
dev = qdev_new("artist");
@@ -576,7 +577,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
*/
static void machine_HP_715_init(MachineState *machine)
{
- DeviceState *dev;
+ HppaMachineState *hpm = HPPA_COMMON_MACHINE(machine);
+ DeviceState *dev, *lasi_dev;
MemoryRegion *addr_space = get_system_memory();
TranslateFn *translate;
ISABus *isa_bus;
@@ -596,6 +598,7 @@ static void machine_HP_715_init(MachineState *machine)
/* Init Lasi chip */
lasi_dev = DEVICE(lasi_init());
+ hpm->lasi_dev = lasi_dev;
memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA_715),
sysbus_mmio_get_region(
SYS_BUS_DEVICE(lasi_dev), 0));
@@ -652,7 +655,8 @@ static void machine_HP_715_init(MachineState *machine)
*/
static void machine_HP_B160L_init(MachineState *machine)
{
- DeviceState *dev, *dino_dev;
+ HppaMachineState *hpm = HPPA_COMMON_MACHINE(machine);
+ DeviceState *dev, *dino_dev, *lasi_dev;
MemoryRegion *addr_space = get_system_memory();
TranslateFn *translate;
ISABus *isa_bus;
@@ -669,6 +673,7 @@ static void machine_HP_B160L_init(MachineState *machine)
/* Init Lasi chip */
lasi_dev = DEVICE(lasi_init());
+ hpm->lasi_dev = lasi_dev;
memory_region_add_subregion(addr_space, translate(NULL, LASI_HPA),
sysbus_mmio_get_region(
SYS_BUS_DEVICE(lasi_dev), 0));
--
2.54.0
next prev parent reply other threads:[~2026-05-19 15:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 15:18 [PULL 0/2] Hppa post v11 patches patches Helge Deller
2026-05-19 15:18 ` [PULL 1/2] hw/pci-host/astro: Encode Astro version numbers Helge Deller
2026-05-19 15:18 ` Helge Deller [this message]
2026-05-19 20:51 ` [PULL 0/2] Hppa post v11 patches patches Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260519151823.13878-3-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.