xref: /qemu/include/hw/acpi/vmclock.h (revision 0e3327b690b76b7c3966b028110ee053cc16a385)
1*3634039bSDavid Woodhouse #ifndef ACPI_VMCLOCK_H
2*3634039bSDavid Woodhouse #define ACPI_VMCLOCK_H
3*3634039bSDavid Woodhouse 
4*3634039bSDavid Woodhouse #include "hw/acpi/bios-linker-loader.h"
5*3634039bSDavid Woodhouse #include "hw/qdev-core.h"
6*3634039bSDavid Woodhouse #include "qemu/uuid.h"
7*3634039bSDavid Woodhouse #include "qom/object.h"
8*3634039bSDavid Woodhouse 
9*3634039bSDavid Woodhouse #define TYPE_VMCLOCK    "vmclock"
10*3634039bSDavid Woodhouse 
11*3634039bSDavid Woodhouse #define VMCLOCK_ADDR    0xfeffb000
12*3634039bSDavid Woodhouse #define VMCLOCK_SIZE    0x1000
13*3634039bSDavid Woodhouse 
14*3634039bSDavid Woodhouse OBJECT_DECLARE_SIMPLE_TYPE(VmclockState, VMCLOCK)
15*3634039bSDavid Woodhouse 
16*3634039bSDavid Woodhouse struct vmclock_abi;
17*3634039bSDavid Woodhouse 
18*3634039bSDavid Woodhouse struct VmclockState {
19*3634039bSDavid Woodhouse     DeviceState parent_obj;
20*3634039bSDavid Woodhouse     MemoryRegion clk_page;
21*3634039bSDavid Woodhouse     uint64_t physaddr;
22*3634039bSDavid Woodhouse     struct vmclock_abi *clk;
23*3634039bSDavid Woodhouse };
24*3634039bSDavid Woodhouse 
25*3634039bSDavid Woodhouse /* returns NULL unless there is exactly one device */
find_vmclock_dev(void)26*3634039bSDavid Woodhouse static inline Object *find_vmclock_dev(void)
27*3634039bSDavid Woodhouse {
28*3634039bSDavid Woodhouse     return object_resolve_path_type("", TYPE_VMCLOCK, NULL);
29*3634039bSDavid Woodhouse }
30*3634039bSDavid Woodhouse 
31*3634039bSDavid Woodhouse void vmclock_build_acpi(VmclockState *vms, GArray *table_data,
32*3634039bSDavid Woodhouse                         BIOSLinker *linker, const char *oem_id);
33*3634039bSDavid Woodhouse 
34*3634039bSDavid Woodhouse #endif
35