Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
virtio.h File Reference
#include <type.h>

Go to the source code of this file.

Data Structures

struct  __attribute__
 
struct  virtio_queue_t
 
struct  virtio_device_t
 
struct  virtio_pci_cap
 

Macros

#define VIRTIO_PCI_CAP   0x09
 
#define VIRTIO_PCI_CAP_COMMON_CFG   1
 
#define VIRTIO_PCI_CAP_NOTIFY_CFG   2
 
#define VIRTIO_PCI_CAP_ISR_CFG   3
 
#define VIRTIO_PCI_CAP_DEVICE_CFG   4
 
#define VIRTIO_PCI_CAP_PCI_CFG   5
 
#define VIRTIO_STATUS_ACKNOWLEDGE   (1 << 0)
 
#define VIRTIO_STATUS_DRIVER   (1 << 1)
 
#define VIRTIO_STATUS_DRIVER_OK   (1 << 2)
 
#define VIRTIO_STATUS_FEATURES_OK   (1 << 3)
 
#define VIRTIO_STATUS_DEVICE_NEEDS_RESET   (1 << 6)
 
#define VIRTIO_STATUS_FAILED   (1 << 7)
 

Functions

struct virtio_pci_cap __attribute__ ((packed))
 
struct ioforge_virtio_devicefind_virtio_device_by_id (uint16_t vendor_id, uint16_t device_id)
 

Variables

uint8_t cap_vndr
 
uint8_t cap_next
 
uint8_t cap_len
 
uint8_t cfg_type
 
uint8_t bar
 
uint8_t padding [3]
 
uint32_t offset
 
uint32_t length
 

Macro Definition Documentation

◆ VIRTIO_PCI_CAP

#define VIRTIO_PCI_CAP   0x09

Definition at line 6 of file virtio.h.

Referenced by for_each_virtio_device().

◆ VIRTIO_PCI_CAP_COMMON_CFG

#define VIRTIO_PCI_CAP_COMMON_CFG   1

Definition at line 8 of file virtio.h.

Referenced by virtio_scan_capabilities().

◆ VIRTIO_PCI_CAP_DEVICE_CFG

#define VIRTIO_PCI_CAP_DEVICE_CFG   4

Definition at line 11 of file virtio.h.

◆ VIRTIO_PCI_CAP_ISR_CFG

#define VIRTIO_PCI_CAP_ISR_CFG   3

Definition at line 10 of file virtio.h.

Referenced by virtio_scan_capabilities().

◆ VIRTIO_PCI_CAP_NOTIFY_CFG

#define VIRTIO_PCI_CAP_NOTIFY_CFG   2

Definition at line 9 of file virtio.h.

Referenced by virtio_scan_capabilities().

◆ VIRTIO_PCI_CAP_PCI_CFG

#define VIRTIO_PCI_CAP_PCI_CFG   5

Definition at line 12 of file virtio.h.

◆ VIRTIO_STATUS_ACKNOWLEDGE

#define VIRTIO_STATUS_ACKNOWLEDGE   (1 << 0)

Definition at line 15 of file virtio.h.

◆ VIRTIO_STATUS_DEVICE_NEEDS_RESET

#define VIRTIO_STATUS_DEVICE_NEEDS_RESET   (1 << 6)

Definition at line 19 of file virtio.h.

◆ VIRTIO_STATUS_DRIVER

#define VIRTIO_STATUS_DRIVER   (1 << 1)

Definition at line 16 of file virtio.h.

◆ VIRTIO_STATUS_DRIVER_OK

#define VIRTIO_STATUS_DRIVER_OK   (1 << 2)

Definition at line 17 of file virtio.h.

◆ VIRTIO_STATUS_FAILED

#define VIRTIO_STATUS_FAILED   (1 << 7)

Definition at line 20 of file virtio.h.

◆ VIRTIO_STATUS_FEATURES_OK

#define VIRTIO_STATUS_FEATURES_OK   (1 << 3)

Definition at line 18 of file virtio.h.

Function Documentation

◆ __attribute__()

struct virtio_pci_cap __attribute__ ( (packed) )

Definition at line 1 of file tcp.h.

◆ find_virtio_device_by_id()

struct ioforge_virtio_device * find_virtio_device_by_id ( uint16_t vendor_id,
uint16_t device_id )

Referenced by VirtioGpu::load().

Variable Documentation

◆ bar

◆ cap_len

uint8_t cap_len

Definition at line 2 of file virtio.h.

Referenced by virtio_scan_capabilities().

◆ cap_next

uint8_t cap_next

Definition at line 1 of file virtio.h.

◆ cap_vndr

uint8_t cap_vndr

Definition at line 0 of file virtio.h.

◆ cfg_type

uint8_t cfg_type

Definition at line 3 of file virtio.h.

◆ length

volatile uint16_t length

Definition at line 7 of file virtio.h.

Referenced by checksum16_adc(), checksum16_raw(), and phys_base_alloc_aligned().

◆ offset

◆ padding

uint32_t padding

Definition at line 5 of file virtio.h.