mirror of https://github.com/xemu-project/xemu.git
hw/misc/pvpanic: Use standard headers instead
QEMU side has already imported pvpanic.h from linux, remove bit definitions from include/hw/misc/pvpanic.h, and use include/standard-headers/linux/pvpanic.h instead. Also minor changes for PVPANIC_CRASHLOADED -> PVPANIC_CRASH_LOADED. Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20220221122717.1371010-2-pizhenwei@bytedance.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
fcbd14db63
commit
45d8c0520b
|
@ -21,6 +21,7 @@
|
||||||
#include "hw/misc/pvpanic.h"
|
#include "hw/misc/pvpanic.h"
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
#include "hw/isa/isa.h"
|
#include "hw/isa/isa.h"
|
||||||
|
#include "standard-headers/linux/pvpanic.h"
|
||||||
|
|
||||||
OBJECT_DECLARE_SIMPLE_TYPE(PVPanicISAState, PVPANIC_ISA_DEVICE)
|
OBJECT_DECLARE_SIMPLE_TYPE(PVPanicISAState, PVPANIC_ISA_DEVICE)
|
||||||
|
|
||||||
|
@ -64,7 +65,8 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
static Property pvpanic_isa_properties[] = {
|
static Property pvpanic_isa_properties[] = {
|
||||||
DEFINE_PROP_UINT16(PVPANIC_IOPORT_PROP, PVPanicISAState, ioport, 0x505),
|
DEFINE_PROP_UINT16(PVPANIC_IOPORT_PROP, PVPanicISAState, ioport, 0x505),
|
||||||
DEFINE_PROP_UINT8("events", PVPanicISAState, pvpanic.events, PVPANIC_PANICKED | PVPANIC_CRASHLOADED),
|
DEFINE_PROP_UINT8("events", PVPanicISAState, pvpanic.events,
|
||||||
|
PVPANIC_PANICKED | PVPANIC_CRASH_LOADED),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "hw/misc/pvpanic.h"
|
#include "hw/misc/pvpanic.h"
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
#include "hw/pci/pci.h"
|
#include "hw/pci/pci.h"
|
||||||
|
#include "standard-headers/linux/pvpanic.h"
|
||||||
|
|
||||||
OBJECT_DECLARE_SIMPLE_TYPE(PVPanicPCIState, PVPANIC_PCI_DEVICE)
|
OBJECT_DECLARE_SIMPLE_TYPE(PVPanicPCIState, PVPANIC_PCI_DEVICE)
|
||||||
|
|
||||||
|
@ -53,7 +54,8 @@ static void pvpanic_pci_realizefn(PCIDevice *dev, Error **errp)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Property pvpanic_pci_properties[] = {
|
static Property pvpanic_pci_properties[] = {
|
||||||
DEFINE_PROP_UINT8("events", PVPanicPCIState, pvpanic.events, PVPANIC_PANICKED | PVPANIC_CRASHLOADED),
|
DEFINE_PROP_UINT8("events", PVPanicPCIState, pvpanic.events,
|
||||||
|
PVPANIC_PANICKED | PVPANIC_CRASH_LOADED),
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,13 @@
|
||||||
#include "hw/qdev-properties.h"
|
#include "hw/qdev-properties.h"
|
||||||
#include "hw/misc/pvpanic.h"
|
#include "hw/misc/pvpanic.h"
|
||||||
#include "qom/object.h"
|
#include "qom/object.h"
|
||||||
|
#include "standard-headers/linux/pvpanic.h"
|
||||||
|
|
||||||
static void handle_event(int event)
|
static void handle_event(int event)
|
||||||
{
|
{
|
||||||
static bool logged;
|
static bool logged;
|
||||||
|
|
||||||
if (event & ~(PVPANIC_PANICKED | PVPANIC_CRASHLOADED) && !logged) {
|
if (event & ~(PVPANIC_PANICKED | PVPANIC_CRASH_LOADED) && !logged) {
|
||||||
qemu_log_mask(LOG_GUEST_ERROR, "pvpanic: unknown event %#x.\n", event);
|
qemu_log_mask(LOG_GUEST_ERROR, "pvpanic: unknown event %#x.\n", event);
|
||||||
logged = true;
|
logged = true;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +37,7 @@ static void handle_event(int event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event & PVPANIC_CRASHLOADED) {
|
if (event & PVPANIC_CRASH_LOADED) {
|
||||||
qemu_system_guest_crashloaded(NULL);
|
qemu_system_guest_crashloaded(NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,6 @@
|
||||||
|
|
||||||
#define PVPANIC_IOPORT_PROP "ioport"
|
#define PVPANIC_IOPORT_PROP "ioport"
|
||||||
|
|
||||||
/* The bit of supported pv event, TODO: include uapi header and remove this */
|
|
||||||
#define PVPANIC_F_PANICKED 0
|
|
||||||
#define PVPANIC_F_CRASHLOADED 1
|
|
||||||
|
|
||||||
/* The pv event value */
|
|
||||||
#define PVPANIC_PANICKED (1 << PVPANIC_F_PANICKED)
|
|
||||||
#define PVPANIC_CRASHLOADED (1 << PVPANIC_F_CRASHLOADED)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PVPanicState for any device type
|
* PVPanicState for any device type
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue