xref: /qemu/include/hw/qdev-properties-system.h (revision ce35e2295ea10caa97e223c1254e345a888e7ed8)
1*ce35e229SEduardo Habkost #ifndef HW_QDEV_PROPERTIES_SYSTEM_H
2*ce35e229SEduardo Habkost #define HW_QDEV_PROPERTIES_SYSTEM_H
3*ce35e229SEduardo Habkost 
4*ce35e229SEduardo Habkost #include "hw/qdev-properties.h"
5*ce35e229SEduardo Habkost 
6*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_chr;
7*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_macaddr;
8*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_reserved_region;
9*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_multifd_compression;
10*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_losttickpolicy;
11*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_blockdev_on_error;
12*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_bios_chs_trans;
13*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_fdc_drive_type;
14*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_drive;
15*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_drive_iothread;
16*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_netdev;
17*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_pci_devfn;
18*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_blocksize;
19*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_pci_host_devaddr;
20*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_uuid;
21*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_audiodev;
22*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_off_auto_pcibar;
23*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_pcie_link_speed;
24*ce35e229SEduardo Habkost extern const PropertyInfo qdev_prop_pcie_link_width;
25*ce35e229SEduardo Habkost 
26*ce35e229SEduardo Habkost #define DEFINE_PROP_PCI_DEVFN(_n, _s, _f, _d)                   \
27*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_pci_devfn, int32_t)
28*ce35e229SEduardo Habkost 
29*ce35e229SEduardo Habkost #define DEFINE_PROP_CHR(_n, _s, _f)             \
30*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_chr, CharBackend)
31*ce35e229SEduardo Habkost #define DEFINE_PROP_NETDEV(_n, _s, _f)             \
32*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_netdev, NICPeers)
33*ce35e229SEduardo Habkost #define DEFINE_PROP_DRIVE(_n, _s, _f) \
34*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_drive, BlockBackend *)
35*ce35e229SEduardo Habkost #define DEFINE_PROP_DRIVE_IOTHREAD(_n, _s, _f) \
36*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_drive_iothread, BlockBackend *)
37*ce35e229SEduardo Habkost #define DEFINE_PROP_MACADDR(_n, _s, _f)         \
38*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_macaddr, MACAddr)
39*ce35e229SEduardo Habkost #define DEFINE_PROP_RESERVED_REGION(_n, _s, _f)         \
40*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_reserved_region, ReservedRegion)
41*ce35e229SEduardo Habkost #define DEFINE_PROP_MULTIFD_COMPRESSION(_n, _s, _f, _d) \
42*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_multifd_compression, \
43*ce35e229SEduardo Habkost                        MultiFDCompression)
44*ce35e229SEduardo Habkost #define DEFINE_PROP_LOSTTICKPOLICY(_n, _s, _f, _d) \
45*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_losttickpolicy, \
46*ce35e229SEduardo Habkost                         LostTickPolicy)
47*ce35e229SEduardo Habkost #define DEFINE_PROP_BLOCKDEV_ON_ERROR(_n, _s, _f, _d) \
48*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_blockdev_on_error, \
49*ce35e229SEduardo Habkost                         BlockdevOnError)
50*ce35e229SEduardo Habkost #define DEFINE_PROP_BIOS_CHS_TRANS(_n, _s, _f, _d) \
51*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_bios_chs_trans, int)
52*ce35e229SEduardo Habkost #define DEFINE_PROP_BLOCKSIZE(_n, _s, _f) \
53*ce35e229SEduardo Habkost     DEFINE_PROP_UNSIGNED(_n, _s, _f, 0, qdev_prop_blocksize, uint32_t)
54*ce35e229SEduardo Habkost #define DEFINE_PROP_PCI_HOST_DEVADDR(_n, _s, _f) \
55*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_pci_host_devaddr, PCIHostDeviceAddress)
56*ce35e229SEduardo Habkost #define DEFINE_PROP_OFF_AUTO_PCIBAR(_n, _s, _f, _d) \
57*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_off_auto_pcibar, \
58*ce35e229SEduardo Habkost                         OffAutoPCIBAR)
59*ce35e229SEduardo Habkost #define DEFINE_PROP_PCIE_LINK_SPEED(_n, _s, _f, _d) \
60*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_pcie_link_speed, \
61*ce35e229SEduardo Habkost                         PCIExpLinkSpeed)
62*ce35e229SEduardo Habkost #define DEFINE_PROP_PCIE_LINK_WIDTH(_n, _s, _f, _d) \
63*ce35e229SEduardo Habkost     DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_pcie_link_width, \
64*ce35e229SEduardo Habkost                         PCIExpLinkWidth)
65*ce35e229SEduardo Habkost 
66*ce35e229SEduardo Habkost #define DEFINE_PROP_UUID(_name, _state, _field) {                  \
67*ce35e229SEduardo Habkost         .name      = (_name),                                      \
68*ce35e229SEduardo Habkost         .info      = &qdev_prop_uuid,                              \
69*ce35e229SEduardo Habkost         .offset    = offsetof(_state, _field)                      \
70*ce35e229SEduardo Habkost             + type_check(QemuUUID, typeof_field(_state, _field)),  \
71*ce35e229SEduardo Habkost         .set_default = true,                                       \
72*ce35e229SEduardo Habkost         }
73*ce35e229SEduardo Habkost #define DEFINE_PROP_AUDIODEV(_n, _s, _f) \
74*ce35e229SEduardo Habkost     DEFINE_PROP(_n, _s, _f, qdev_prop_audiodev, QEMUSoundCard)
75*ce35e229SEduardo Habkost 
76*ce35e229SEduardo Habkost #define DEFINE_PROP_UUID_NODEFAULT(_name, _state, _field) {        \
77*ce35e229SEduardo Habkost         .name      = (_name),                                      \
78*ce35e229SEduardo Habkost         .info      = &qdev_prop_uuid,                              \
79*ce35e229SEduardo Habkost         .offset    = offsetof(_state, _field)                      \
80*ce35e229SEduardo Habkost             + type_check(QemuUUID, typeof_field(_state, _field)),  \
81*ce35e229SEduardo Habkost         }
82*ce35e229SEduardo Habkost 
83*ce35e229SEduardo Habkost 
84*ce35e229SEduardo Habkost #endif
85