Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.1-sf1-v3' into...
[qemu/ar7.git] / include / hw / misc / vmcoreinfo.h
blob0d1157805958ebd1b23ea8a9b4172863c29cf557
1 /*
2 * Virtual Machine coreinfo device
4 * Copyright (C) 2017 Red Hat, Inc.
6 * Authors: Marc-André Lureau <marcandre.lureau@redhat.com>
8 * This work is licensed under the terms of the GNU GPL, version 2 or later.
9 * See the COPYING file in the top-level directory.
12 #ifndef VMCOREINFO_H
13 #define VMCOREINFO_H
15 #include "hw/qdev.h"
16 #include "standard-headers/linux/qemu_fw_cfg.h"
18 #define VMCOREINFO_DEVICE "vmcoreinfo"
19 #define VMCOREINFO(obj) OBJECT_CHECK(VMCoreInfoState, (obj), VMCOREINFO_DEVICE)
21 typedef struct fw_cfg_vmcoreinfo FWCfgVMCoreInfo;
23 typedef struct VMCoreInfoState {
24 DeviceClass parent_obj;
26 bool has_vmcoreinfo;
27 FWCfgVMCoreInfo vmcoreinfo;
28 } VMCoreInfoState;
30 /* returns NULL unless there is exactly one device */
31 static inline VMCoreInfoState *vmcoreinfo_find(void)
33 Object *o = object_resolve_path_type("", VMCOREINFO_DEVICE, NULL);
35 return o ? VMCOREINFO(o) : NULL;
38 #endif