xref: /kvmtool/include/kvm/ioport.h (revision beb095eb19b0ca82e85d7c3524e5b33334e459e5)
113a7760fSPekka Enberg #ifndef KVM__IOPORT_H
213a7760fSPekka Enberg #define KVM__IOPORT_H
313a7760fSPekka Enberg 
413a7760fSPekka Enberg #include <stdbool.h>
513a7760fSPekka Enberg #include <stdint.h>
613a7760fSPekka Enberg 
7*beb095ebSCyrill Gorcunov /* some ports we reserve for own use */
8*beb095ebSCyrill Gorcunov #define IOPORT_DBG	0xe0
9*beb095ebSCyrill Gorcunov #define IOPORT_VIRTIO	0xea
10*beb095ebSCyrill Gorcunov 
1113a7760fSPekka Enberg struct kvm;
1213a7760fSPekka Enberg 
1313a7760fSPekka Enberg struct ioport_operations {
1413a7760fSPekka Enberg 	bool (*io_in)(struct kvm *self, uint16_t port, void *data, int size, uint32_t count);
1513a7760fSPekka Enberg 	bool (*io_out)(struct kvm *self, uint16_t port, void *data, int size, uint32_t count);
1613a7760fSPekka Enberg };
1713a7760fSPekka Enberg 
1813a7760fSPekka Enberg void ioport__register(uint16_t port, struct ioport_operations *ops);
1913a7760fSPekka Enberg 
2013a7760fSPekka Enberg #endif /* KVM__IOPORT_H */
21