|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "./pci.h"#include "hal/cpu/paging.h"#include <type.h>#include "memory/kalloc.h"#include "memory/vm_manager.h"#include <ioforge/ioforge.h>#include <ioforge/ioforge_pci.h>#include <libk/io.h>#include <libk/serial.h>#include <str.h>#include <memory/memory_utils.h>Go to the source code of this file.
Functions | |
| static pci_segment_t * | find_segment (uint8_t bus) |
| void | register_segment (uint16_t seg_id, uint8_t start, uint8_t end, uintptr_t vbase, pci_access_ops_t *ops, PCI_SEGMENT_TYPE type) |
| uint32_t | pci_read32 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off) |
| uint64_t | pci_read64 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off) |
| uint16_t | pci_read16 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off) |
| uint8_t | pci_read8 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off) |
| void | pci_write32 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off, uint32_t val) |
| void | pci_write64 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off, uint64_t val) |
| void | pci_write16 (uint8_t bus, uint8_t dev, uint8_t func, uint16_t off, uint16_t val) |
| static void | vxPCIGatheringBusInfo (uint8_t bus, uint8_t device, uint8_t func) |
| static void | pci_check_bus (uint8_t bus) |
| static void | pci_check_func (uint8_t bus, uint8_t dev, uint8_t func) |
| static void | pci_scan_bus (pci_segment_t *s) |
| void | pci_scan () |
Variables | |
| static pci_segment_t | segments [16] |
| static size_t | segment_count = 0 |
| static boolean_t | has_ecam = 0 |
| static pci_access_ops_t | legacy_ops |
|
static |
Definition at line 17 of file scan.c.
References pci_segment::bus_start, NULL, segment_count, segments, and pci_segment::valid.
Referenced by pci_read32(), and pci_write32().
|
static |
Definition at line 384 of file scan.c.
References header, LOG_INFO, pci_check_func(), and pci_read32().
Referenced by pci_check_func(), and pci_scan_bus().
Definition at line 371 of file scan.c.
References pci_check_bus(), pci_read8(), serial_trace, and vxPCIGatheringBusInfo().
Referenced by pci_check_bus().
Definition at line 62 of file scan.c.
References pci_read32().
Referenced by __attribute__(), pci_scan_bus(), and vxPCIGatheringBusInfo().
Definition at line 49 of file scan.c.
References find_segment(), pci_segment::ops, pci_access_ops::read32, segments, and pci_segment::vbase.
Referenced by pci_check_bus(), pci_read16(), pci_read64(), pci_read8(), pci_write16(), virtio_scan_capabilities(), and vxPCIGatheringBusInfo().
Definition at line 56 of file scan.c.
References pci_read32().
Definition at line 67 of file scan.c.
References pci_read32().
Referenced by for_each_virtio_device(), pci_check_func(), pci_scan_bus(), virtio_scan_capabilities(), and vxPCIGatheringBusInfo().
| void pci_scan | ( | ) |
Definition at line 425 of file scan.c.
References pci_segment::bus_end, pci_segment::bus_start, has_ecam, legacy_ops, LOG_INFO, pci_scan_bus(), PCI_SEGMENT_LEGACY, register_segment(), segment_count, pci_segment::segment_id, segments, and pci_segment::valid.
Referenced by INIT().
|
static |
Definition at line 410 of file scan.c.
References pci_segment::bus_start, pci_check_bus(), pci_read16(), and pci_read8().
Referenced by pci_scan().
Definition at line 88 of file scan.c.
References pci_read32(), and pci_write32().
Referenced by __attribute__(), and vxPCIGatheringBusInfo().
Definition at line 72 of file scan.c.
References find_segment(), pci_segment::ops, segments, pci_segment::vbase, and pci_access_ops::write32.
Referenced by __attribute__(), pci_write16(), pci_write64(), and vxPCIGatheringBusInfo().
Definition at line 80 of file scan.c.
References pci_write32().
| void register_segment | ( | uint16_t | seg_id, |
| uint8_t | start, | ||
| uint8_t | end, | ||
| uintptr_t | vbase, | ||
| pci_access_ops_t * | ops, | ||
| PCI_SEGMENT_TYPE | type ) |
Definition at line 26 of file scan.c.
References pci_segment::bus_end, pci_segment::bus_start, ops, pci_segment::ops, PCI_MAX_SEGMENTS, segment_count, pci_segment::segment_id, segments, pci_segment::type, type, pci_segment::valid, and pci_segment::vbase.
Referenced by mcfg_parse(), and pci_scan().
Definition at line 101 of file scan.c.
References addr, ALIGN_DOWN, bar, ioforge_pci_device::bus, cmd, device, get_kernel_vmm_page(), ioforge_pci_device::interrupt_line, ioforge_pci_device::interrupt_pin, ioforge_attach(), IOFORGE_F_VIRTIO, ioforge_get_pci_root(), IOFORGE_PCI, kalloc(), LOG_INFO, memset(), offset, PAGE_SIZE, paging_get_highest_page_map(), paging_reload(), pci, pci_read16(), pci_read32(), pci_read8(), pci_write16(), pci_write32(), serial_printf(), size, value, vma_lookup_free_vaddr(), VMA_REGION_C, vma_register(), and vxMultipleMmap().
Referenced by pci_check_func().
|
static |
Definition at line 42 of file scan.c.
Referenced by pci_scan().
|
static |
Definition at line 14 of file scan.c.
Referenced by find_segment(), pci_scan(), and register_segment().
|
static |
Definition at line 13 of file scan.c.
Referenced by find_segment(), pci_read32(), pci_scan(), pci_write32(), and register_segment().