mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-21 21:07:20 +00:00
bb7b03f385
Devices in the ioport space may have fdt bindings (e.g. 8250, rtc) and on architectures where a fixed ioport is not defined, it is necessary to generate fdt nodes for them. This patch creates a new virtual bus (tree of device_headers) for ioport devices, allowing architecture code to callback to the emulation code when generating fdt nodes, as we do for virtio-mmio devices. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
30 lines
675 B
C
30 lines
675 B
C
#ifndef KVM__DEVICES_H
|
|
#define KVM__DEVICES_H
|
|
|
|
#include <linux/rbtree.h>
|
|
#include <linux/types.h>
|
|
|
|
enum device_bus_type {
|
|
DEVICE_BUS_PCI,
|
|
DEVICE_BUS_MMIO,
|
|
DEVICE_BUS_IOPORT,
|
|
DEVICE_BUS_MAX,
|
|
};
|
|
|
|
struct device_header {
|
|
enum device_bus_type bus_type;
|
|
void *data;
|
|
int dev_num;
|
|
struct rb_node node;
|
|
};
|
|
|
|
int device__register(struct device_header *dev);
|
|
void device__unregister(struct device_header *dev);
|
|
struct device_header *device__find_dev(enum device_bus_type bus_type,
|
|
u8 dev_num);
|
|
|
|
struct device_header *device__first_dev(enum device_bus_type bus_type);
|
|
struct device_header *device__next_dev(struct device_header *dev);
|
|
|
|
#endif /* KVM__DEVICES_H */
|