25#include <manux/types.h>
34#ifndef MANUX_VIRTIO_NB_MAX_FILES
35# define MANUX_VIRTIO_NB_MAX_FILES 3
41#define PCI_VENDEUR_VIRTIO 0x1AF4
42#define PCI_PERIPHERIQUE_VIRTIO_NET 0x1000
43#define PCI_PERIPHERIQUE_VIRTIO_CONSOLE 0x1003
48#define VIRTIO_RESET 0x00
49#define VIRTIO_ACKNOWLEDGE 0x01
50#define VIRTIO_DRIVER 0x02
51#define VIRTIO_DRIVER_OK 0x04
52#define VIRTIO_FEATURES_OK 0x08
57#define VIRTIO_F_RING_INDIRECT_DESC 0x10000000
58#define VIRTIO_F_RING_EVENT_IDX 0x20000000
65#define VIRTIO_HIST_CAPA_EQUIP 0x00
66#define VIRTIO_HIST_CAPA_PILOTE 0x04
67#define VIRTIO_HIST_ADDRESS_FILE 0x08
69#define VIRTIO_HIST_TAILLE_FILE 0x0C
70#define VIRTIO_HIST_FILE_SEL 0x0E
71#define VIRTIO_HIST_FILE_NOTIF 0x10
72#define VIRTIO_HIST_ETAT 0x12
73#define VIRTIO_HIST_ISR 0x13
78#define VRING_DESC_F_NEXT 1
79#define VRING_DESC_F_WRITE 2
86typedef struct __attribute__((__packed__)) _VirtioDescripteurBuffer {
96typedef struct __attribute__((__packed__)) _VirtioBufferDisponible {
106typedef struct __attribute__((__packed__)) _VirtioElementUtilise {
114typedef struct __attribute__((__packed__)) _VirtioBufferUtilise {
126typedef struct __attribute__((__packed__)) _VirtioFileVirtuelle {
141typedef struct __attribute__((__packed__)) _VirtioPeripherique {
196 void * bu[],
int lg[],
int nb,
205#ifdef MANUX_VIRTIO_AUDIT
unsigned long long uint64_t
struct _PCIEquipement PCIEquipement
: structure permettant d'identifier un équipement PCI
int virtioFournirBuffer(VirtioPeripherique *vp, uint16_t id, void *bu, int lg, uint16_t fl)
: Fournir un buffer au périphérique.
void virtioFileAutoriserInterruption(VirtioFileVirtuelle *fv)
int virtioInitPeripheriquePCI(VirtioPeripherique *vp, int PCINum, uint32_t masque)
void virtioFileInterdireInterruption(VirtioFileVirtuelle *fv)
#define MANUX_VIRTIO_NB_MAX_FILES
int virtioFournirBuffers(VirtioPeripherique *vp, uint16_t id, void *bu[], int lg[], int nb, uint16_t fl)
: Fournir un(e chaine de) buffer(s) au périphérique.
int virtioFileRecupererBuffers(VirtioFileVirtuelle *fv, void *bu[], int lg[], int nb)
on va récupérer des buffers
struct __attribute__((__packed__))