PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
config.c File Reference
Include dependency graph for config.c:

Go to the source code of this file.

Functions

static uint64_t pci_config_init (void)
 
static pci_config_bar_tpci_config_bar_get (pci_segment_group_t segmentGroup, pci_bus_t bus)
 
static volatile void * pci_config_get_address (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, uint8_t function, uint16_t offset)
 
uint8_t pci_config_read8 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset)
 Read a byte from PCI configuration space.
 
uint16_t pci_config_read16 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset)
 Read a word from PCI configuration space.
 
uint32_t pci_config_read32 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset)
 Read a dword from PCI configuration space.
 
void pci_config_write8 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset, uint8_t value)
 Write a byte to PCI configuration space.
 
void pci_config_write16 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset, uint16_t value)
 Write a word to PCI configuration space.
 
void pci_config_write32 (pci_segment_group_t segmentGroup, pci_bus_t bus, pci_slot_t slot, pci_function_t function, uint16_t offset, uint32_t value)
 Write a dword to PCI configuration space.
 

Variables

static uint64_t entryCount
 
static mcfg_tmcfg
 
static bool initialized = false
 
static lock_t initLock = LOCK_CREATE()
 

Function Documentation

◆ pci_config_init()

static uint64_t pci_config_init ( void  )
static

Definition at line 13 of file config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_config_bar_get()

static pci_config_bar_t * pci_config_bar_get ( pci_segment_group_t  segmentGroup,
pci_bus_t  bus 
)
static

Definition at line 62 of file config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pci_config_get_address()

static volatile void * pci_config_get_address ( pci_segment_group_t  segmentGroup,
pci_bus_t  bus,
pci_slot_t  slot,
uint8_t  function,
uint16_t  offset 
)
static

Definition at line 80 of file config.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ entryCount

uint64_t entryCount
static

Definition at line 7 of file config.c.

◆ mcfg

mcfg_t* mcfg
static

Definition at line 8 of file config.c.

◆ initialized

bool initialized = false
static

Definition at line 10 of file config.c.

◆ initLock

lock_t initLock = LOCK_CREATE()
static

Definition at line 11 of file config.c.