On 15/6/23 00:40, Alexander Graf wrote:
In addition to the ISA and PCI variants of pvpanic, let's add an MMIO
platform device that we can use in embedded arm environments.
Signed-off-by: Alexander Graf <g...@amazon.com>
---
hw/misc/Kconfig | 4 +++
hw/misc/meson.build | 1 +
hw/misc/pvpanic-mmio.c | 66 +++++++++++++++++++++++++++++++++++++++
include/hw/misc/pvpanic.h | 1 +
4 files changed, 72 insertions(+)
create mode 100644 hw/misc/pvpanic-mmio.c
diff --git a/hw/misc/pvpanic-mmio.c b/hw/misc/pvpanic-mmio.c
new file mode 100644
index 0000000000..aebe7227e6
--- /dev/null
+++ b/hw/misc/pvpanic-mmio.c
@@ -0,0 +1,66 @@
+/*
+ * QEMU simulated pvpanic device (MMIO frontend)
+ *
+ * Copyright © 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
Preferably SPDX tag.
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/module.h"
Unused header.
+#include "sysemu/runstate.h"
+
+#include "hw/nvram/fw_cfg.h"
Ditto.
+#include "hw/qdev-properties.h"
+#include "hw/misc/pvpanic.h"
+#include "qom/object.h"
Ditto.
+#include "hw/isa/isa.h"
Ditto.
+#include "standard-headers/linux/pvpanic.h"
+
+OBJECT_DECLARE_SIMPLE_TYPE(PVPanicMMIOState, PVPANIC_MMIO_DEVICE)
+
+#define PVPANIC_MMIO_SIZE 0x2
+
+struct PVPanicMMIOState {
+ SysBusDevice parent_obj;
Mising "sysbus.h"
+
+ PVPanicState pvpanic;
+};
This worked for me:
-- >8 --
--- a/hw/misc/pvpanic-mmio.c
+++ b/hw/misc/pvpanic-mmio.c
@@ -3,19 +3,13 @@
*
* Copyright © 2023 Amazon.com, Inc. or its affiliates. All Rights
Reserved.
*
- * This work is licensed under the terms of the GNU GPL, version 2 or
later.
- * See the COPYING file in the top-level directory.
+ * SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "qemu/osdep.h"
-#include "qemu/module.h"
-#include "sysemu/runstate.h"
-
-#include "hw/nvram/fw_cfg.h"
#include "hw/qdev-properties.h"
#include "hw/misc/pvpanic.h"
-#include "qom/object.h"
-#include "hw/isa/isa.h"
+#include "hw/sysbus.h"
#include "standard-headers/linux/pvpanic.h"
---
Fixing the includes:
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Tested-by: Philippe Mathieu-Daudé <phi...@linaro.org>