Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
pci.c File Reference
#include "./pci.h"
#include <ioforge/ioforge.h>
#include <ioforge/ioforge_pci.h>
#include <libk/io.h>
#include <libk/serial.h>

Go to the source code of this file.

Macros

#define PCI_COMMAND   0XCF8
 
#define PCI_DATA   0xCFC
 

Functions

static uint32_t pci_readl (uint8_t bus, uint8_t device, uint8_t func, uint8_t offset)
 
static void pci_writel (uint8_t bus, uint8_t device, uint8_t func, uint8_t offset, uint32_t value)
 
uint32_t legacy_read32 (uintptr_t base, uint8_t bus, uint8_t dev, uint8_t func, uint16_t offset)
 
void legacy_write32 (uintptr_t base, uint8_t bus, uint8_t dev, uint8_t func, uint16_t offset, uint32_t val)
 

Macro Definition Documentation

◆ PCI_COMMAND

#define PCI_COMMAND   0XCF8

Definition at line 7 of file pci.c.

Referenced by pci_readl(), and pci_writel().

◆ PCI_DATA

#define PCI_DATA   0xCFC

Definition at line 8 of file pci.c.

Referenced by pci_readl(), and pci_writel().

Function Documentation

◆ legacy_read32()

uint32_t legacy_read32 ( uintptr_t base,
uint8_t bus,
uint8_t dev,
uint8_t func,
uint16_t offset )

Definition at line 32 of file pci.c.

References base, offset, and pci_readl().

◆ legacy_write32()

void legacy_write32 ( uintptr_t base,
uint8_t bus,
uint8_t dev,
uint8_t func,
uint16_t offset,
uint32_t val )

Definition at line 38 of file pci.c.

References base, offset, and pci_writel().

◆ pci_readl()

static uint32_t pci_readl ( uint8_t bus,
uint8_t device,
uint8_t func,
uint8_t offset )
static

Definition at line 11 of file pci.c.

References address, device, inl(), offset, outl(), PCI_COMMAND, and PCI_DATA.

Referenced by legacy_read32().

◆ pci_writel()

static void pci_writel ( uint8_t bus,
uint8_t device,
uint8_t func,
uint8_t offset,
uint32_t value )
static

Definition at line 22 of file pci.c.

References address, device, offset, outl(), PCI_COMMAND, PCI_DATA, and value.

Referenced by legacy_write32().