2017-02-17 00:15:36 +01:00
|
|
|
#ifndef ACPI_VMGENID_H
|
|
|
|
#define ACPI_VMGENID_H
|
|
|
|
|
|
|
|
#include "hw/acpi/bios-linker-loader.h"
|
2019-08-12 07:23:51 +02:00
|
|
|
#include "hw/qdev-core.h"
|
2017-02-17 00:15:36 +01:00
|
|
|
#include "qemu/uuid.h"
|
2020-09-03 22:43:22 +02:00
|
|
|
#include "qom/object.h"
|
2017-02-17 00:15:36 +01:00
|
|
|
|
2020-09-03 00:42:18 +02:00
|
|
|
#define TYPE_VMGENID "vmgenid"
|
2017-02-17 00:15:36 +01: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 20:25:19 +02:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(VmGenIdState, VMGENID)
|
2017-02-17 00:15:36 +01:00
|
|
|
|
2020-09-03 22:43:22 +02:00
|
|
|
struct VmGenIdState {
|
2020-10-07 18:23:56 +02:00
|
|
|
DeviceState parent_obj;
|
2017-02-17 00:15:36 +01:00
|
|
|
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 22:43:22 +02:00
|
|
|
};
|
2017-02-17 00:15:36 +01:00
|
|
|
|
2017-03-20 18:05:57 +01:00
|
|
|
/* returns NULL unless there is exactly one device */
|
2017-02-17 00:15:36 +01:00
|
|
|
static inline Object *find_vmgenid_dev(void)
|
|
|
|
{
|
2020-09-03 00:42:18 +02:00
|
|
|
return object_resolve_path_type("", TYPE_VMGENID, NULL);
|
2017-02-17 00:15:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
|
2021-01-19 01:32:13 +01:00
|
|
|
BIOSLinker *linker, const char *oem_id);
|
2017-02-17 00:15:36 +01:00
|
|
|
void vmgenid_add_fw_cfg(VmGenIdState *vms, FWCfgState *s, GArray *guid);
|
|
|
|
|
|
|
|
#endif
|