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

Go to the source code of this file.

Data Structures

struct  ioforge_device
 

Macros

#define IOFORGE_SERVICE_NAME_MAX_LEN   64
 
#define IOFORGE_F_ENABLE   1
 
#define IOFORGE_F_VIRTIO   (1 << 31)
 

Enumerations

enum  IoForgeType : uint8_t {
  IOFORGE_ROOT = 0xFF , IOFORGE_PCI = 0xF1 , IOFORGE_PCI_BUS = 0xF2 , IOFORGE_ACPI = 0xAC ,
  IOFORGE_USB_DEVICE = 0xA2 , IOFORGE_NIC = 0xC3 , IOFORGE_USB_CONTROLLER = 0xE3 , IOFORGE_VIRTIO = 0xD3 ,
  IOFORGE_BLOCK = 0xEE
}
 

Functions

void serial2_printf (const char *fmt,...)
 
void * ioforge_dma_alloc (size_t size, uintptr_t *paddr)
 
void ioforge_memset (void *ptr, uint8_t value, size_t num)
 
void ioforge_memcpy (void *dst, void *src, size_t num)
 
void ioforge_sleep (uint32_t time)
 
uint16_t ioforge_irq_alloc_entry ()
 
uint32_t ioforge_isr_get_vector (uint8_t irq)
 
uint32_t isr_irq_register (uint8_t irq, void *handler)
 
void ioforge_irq_register (uint8_t n, void *handler)
 
void ioforge_map_isr (uint8_t irq, uint8_t vector)
 
void serial_printf (const char *fmt,...)
 
void * ioforge_alloc (size_t size)
 
void ioforge_dma_free (void *paddr, void *vaddr, size_t size)
 
void IOforgeStrCopy (char *dst, char *src)
 
void IOforgeStrnCopy (char *dst, char *src, size_t len)
 
uintptr_t IOforgeMMapPhys (uintptr_t paddr, size_t size)
 
void ioforge_free (void *ptr, size_t size)
 
void ioforge_attach (struct ioforge_device *parent, struct ioforge_device *child)
 
struct ioforge_deviceioforge_get_root ()
 
struct ioforge_deviceioforge_find_by_name (struct ioforge_device *root, const char *name)
 
bool ioforge_can_contain_pci (IoForgeType type)
 
struct ioforge_deviceioforge_get_pci_root ()
 
struct ioforge_deviceioforge_get_block_devices_root ()
 
struct ioforge_pci_deviceioforge_find_pci_device (struct ioforge_device *node, uint16_t vendor_id, uint16_t device_id)
 
void print_device_tree (struct ioforge_device *node, int indent)
 
uint8_t ioforge_get_current_core_id ()
 

Macro Definition Documentation

◆ IOFORGE_F_ENABLE

#define IOFORGE_F_ENABLE   1

Definition at line 22 of file ioforge.h.

◆ IOFORGE_F_VIRTIO

#define IOFORGE_F_VIRTIO   (1 << 31)

Definition at line 23 of file ioforge.h.

Referenced by for_each_virtio_device(), and vxPCIGatheringBusInfo().

◆ IOFORGE_SERVICE_NAME_MAX_LEN

#define IOFORGE_SERVICE_NAME_MAX_LEN   64

Definition at line 6 of file ioforge.h.

Enumeration Type Documentation

◆ IoForgeType

Enumerator
IOFORGE_ROOT 
IOFORGE_PCI 
IOFORGE_PCI_BUS 
IOFORGE_ACPI 
IOFORGE_USB_DEVICE 
IOFORGE_NIC 
IOFORGE_USB_CONTROLLER 
IOFORGE_VIRTIO 
IOFORGE_BLOCK 

Definition at line 10 of file ioforge.h.

Function Documentation

◆ ioforge_alloc()

void * ioforge_alloc ( size_t size)

References size.

Referenced by IOForge::IOUtils::alloc().

◆ ioforge_attach()

◆ ioforge_can_contain_pci()

bool ioforge_can_contain_pci ( IoForgeType type)

Definition at line 149 of file ioforge.c.

References IOFORGE_ACPI, IOFORGE_PCI, IOFORGE_PCI_BUS, IOFORGE_ROOT, and type.

◆ ioforge_dma_alloc()

void * ioforge_dma_alloc ( size_t size,
uintptr_t * paddr )

References size.

Referenced by create_netbuff(), and IOForge::IOUtils::DMAAlloc().

◆ ioforge_dma_free()

void ioforge_dma_free ( void * paddr,
void * vaddr,
size_t size )

References size.

Referenced by IOForge::IOUtils::DMAFree(), and free_netbuff().

◆ ioforge_find_by_name()

struct ioforge_device * ioforge_find_by_name ( struct ioforge_device * root,
const char * name )

References name, root, and type.

◆ ioforge_find_pci_device()

struct ioforge_pci_device * ioforge_find_pci_device ( struct ioforge_device * node,
uint16_t vendor_id,
uint16_t device_id )

Referenced by IOforgePCI::findDevice().

◆ ioforge_free()

void ioforge_free ( void * ptr,
size_t size )

References ptr, and size.

Referenced by IOForge::IOUtils::free().

◆ ioforge_get_block_devices_root()

struct ioforge_device * ioforge_get_block_devices_root ( )

◆ ioforge_get_current_core_id()

uint8_t ioforge_get_current_core_id ( )

Referenced by E1000Module::load().

◆ ioforge_get_pci_root()

struct ioforge_device * ioforge_get_pci_root ( )

◆ ioforge_get_root()

struct ioforge_device * ioforge_get_root ( )

Referenced by __attribute__(), INIT(), and UsbHid::load().

◆ ioforge_irq_alloc_entry()

uint16_t ioforge_irq_alloc_entry ( )

◆ ioforge_irq_register()

void ioforge_irq_register ( uint8_t n,
void * handler )

◆ ioforge_isr_get_vector()

uint32_t ioforge_isr_get_vector ( uint8_t irq)

◆ ioforge_map_isr()

void ioforge_map_isr ( uint8_t irq,
uint8_t vector )

References vector.

Referenced by __attribute__(), and IOForge::IOUtils::isr_map().

◆ ioforge_memcpy()

void ioforge_memcpy ( void * dst,
void * src,
size_t num )

References dst.

Referenced by IOForge::IOUtils::memcpy().

◆ ioforge_memset()

void ioforge_memset ( void * ptr,
uint8_t value,
size_t num )

◆ ioforge_sleep()

void ioforge_sleep ( uint32_t time)

◆ IOforgeMMapPhys()

uintptr_t IOforgeMMapPhys ( uintptr_t paddr,
size_t size )

References size.

◆ IOforgeStrCopy()

void IOforgeStrCopy ( char * dst,
char * src )

References dst.

Referenced by IOForge::IOUtils::strcopy().

◆ IOforgeStrnCopy()

void IOforgeStrnCopy ( char * dst,
char * src,
size_t len )

References dst, and len.

Referenced by IOForge::IOUtils::strncopy().

◆ isr_irq_register()

uint32_t isr_irq_register ( uint8_t irq,
void * handler )

◆ print_device_tree()

void print_device_tree ( struct ioforge_device * node,
int indent )

Referenced by __attribute__(), and UsbHid::load().

◆ serial2_printf()

◆ serial_printf()

void serial_printf ( const char * fmt,
... )