22#include <manux/types.h>
31#ifndef MANUX_VIRTIO_NB_MAX_FILES
32# define MANUX_VIRTIO_NB_MAX_FILES 3
38#define PCI_VENDEUR_VIRTIO 0x1AF4
39#define PCI_PERIPHERIQUE_VIRTIO_NET 0x1000
40#define PCI_PERIPHERIQUE_VIRTIO_CONSOLE 0x1003
45#define VIRTIO_RESET 0x00
46#define VIRTIO_ACKNOWLEDGE 0x01
47#define VIRTIO_DRIVER 0x02
48#define VIRTIO_DRIVER_OK 0x04
49#define VIRTIO_FEATURES_OK 0x08
54#define VIRTIO_F_RING_INDIRECT_DESC 0x10000000
55#define VIRTIO_F_RING_EVENT_IDX 0x20000000
62#define VIRTIO_HIST_CAPA_EQUIP 0x00
63#define VIRTIO_HIST_CAPA_PILOTE 0x04
64#define VIRTIO_HIST_ADDRESS_FILE 0x08
66#define VIRTIO_HIST_TAILLE_FILE 0x0C
67#define VIRTIO_HIST_FILE_SEL 0x0E
68#define VIRTIO_HIST_FILE_NOTIF 0x10
69#define VIRTIO_HIST_ETAT 0x12
70#define VIRTIO_HIST_ISR 0x13
75#define VRING_DESC_F_NEXT 1
76#define VRING_DESC_F_WRITE 2
83typedef struct __attribute__((__packed__)) _VirtioDescripteurBuffer {
93typedef struct __attribute__((__packed__)) _VirtioBufferDisponible {
103typedef struct __attribute__((__packed__)) _VirtioElementUtilise {
111typedef struct __attribute__((__packed__)) _VirtioBufferUtilise {
123typedef struct __attribute__((__packed__)) _VirtioFileVirtuelle {
138typedef struct __attribute__((__packed__)) _VirtioPeripherique {
193 void * bu[],
int lg[],
int nb,
202#ifdef MANUX_VIRTIO_AUDIT
unsigned long long uint64_t
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__)) _VirtioDescripteurBuffer
: structure permettant d'identifier un équipement PCI