2017-02-17 02:15:36 +03:00
|
|
|
#ifndef ACPI_VMGENID_H
|
|
|
|
#define ACPI_VMGENID_H
|
|
|
|
|
|
|
|
#include "hw/acpi/bios-linker-loader.h"
|
2019-08-12 08:23:51 +03:00
|
|
|
#include "hw/qdev-core.h"
|
2017-02-17 02:15:36 +03:00
|
|
|
#include "qemu/uuid.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2017-02-17 02:15:36 +03:00
|
|
|
|
2020-09-03 01:42:18 +03:00
|
|
|
#define TYPE_VMGENID "vmgenid"
|
2017-02-17 02:15:36 +03:00
|
|
|
#define VMGENID_GUID "guid"
|
|
|
|
#define VMGENID_GUID_FW_CFG_FILE "etc/vmgenid_guid"
|
|
|
|
#define VMGENID_ADDR_FW_CFG_FILE "etc/vmgenid_addr"
|
|
|
|
|
|
|
|
#define VMGENID_FW_CFG_SIZE 4096 /* Occupy a page of memory */
|
|
|
|
#define VMGENID_GUID_OFFSET 40 /* allow space for
|
|
|
|
* OVMF SDT Header Probe Supressor
|
|
|
|
*/
|
|
|
|
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(VmGenIdState, VMGENID)
|
2017-02-17 02:15:36 +03:00
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct VmGenIdState {
|
2017-02-17 02:15:36 +03:00
|
|
|
DeviceClass parent_obj;
|
|
|
|
QemuUUID guid; /* The 128-bit GUID seen by the guest */
|
|
|
|
uint8_t vmgenid_addr_le[8]; /* Address of the GUID (little-endian) */
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2017-02-17 02:15:36 +03:00
|
|
|
|
2017-03-20 20:05:57 +03:00
|
|
|
/* returns NULL unless there is exactly one device */
|
2017-02-17 02:15:36 +03:00
|
|
|
static inline Object *find_vmgenid_dev(void)
|
|
|
|
{
|
2020-09-03 01:42:18 +03:00
|
|
|
return object_resolve_path_type("", TYPE_VMGENID, NULL);
|
2017-02-17 02:15:36 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
|
|
|
|
BIOSLinker *linker);
|
|
|
|
void vmgenid_add_fw_cfg(VmGenIdState *vms, FWCfgState *s, GArray *guid);
|
|
|
|
|
|
|
|
#endif
|