FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
pci.h File Reference

The Header files for actual PCI source. More...

#include <basics.h>
#include <hal.h>
#include <graphics.h>
#include <drivers/rtl8139.h>
#include <debugger.h>
#include <ahci.h>
#include <nvme.h>
#include <isr.h>
#include <pci_id.h>
Include dependency graph for pci.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pci_location_t

Macros

#define PCI_CONFIG_ADDRESS   0xCF8
#define PCI_CONFIG_DATA   0xCFC

Typedefs

typedef void(* pci_probe_fn) (uint8_t bus, uint8_t slot, uint8_t function)

Functions

int16 pci_read_word (int16 bus, int16 slot, int16 func, int16 offset)
 Read a 16-bit value from a PCI configuration register.
int16 getVendorID (int16 bus, int16 device, int16 function)
 Gets the Vendor ID from PCI.
int16 getDeviceID (int16 bus, int16 device, int16 function)
 Gets the Device ID from PCI.
int16 getClassId (int16 bus, int16 device, int16 function)
 Gets the Class ID from PCI.
int16 getSubClassId (int16 bus, int16 device, int16 function)
 Gets the Sub-class ID from PCI.
int8 getProgIF (int16 bus, int16 device, int16 function)
void probe_pci ()
 Scans (Probes) PCI Devices.
int32 pci_config_read_dword (int8 bus, int8 slot, int8 func, int8 offset)
 Function to read a 32-bit value from the PCI configuration space.
void pci_config_write_dword (int8 bus, int8 slot, int8 func, int8 offset, uint32_t value)
int32 get_ahci_bar_address (int8 bus, int slot, int func, int bar_num)
 Gets the AHCI bar address.

Variables

cstring display_adapter_name
cstring GPUName [1]
string using_graphics_card
int64 * graphics_base_Address
int total_devices

Detailed Description

The Header files for actual PCI source.

Author
Pradosh (prado.nosp@m.shga.nosp@m.me@gm.nosp@m.ail..nosp@m.com)
Version
0.1
Date
2023-10-29

Definition in file pci.h.

Macro Definition Documentation

◆ PCI_CONFIG_ADDRESS

#define PCI_CONFIG_ADDRESS   0xCF8

Definition at line 33 of file pci.h.

◆ PCI_CONFIG_DATA

#define PCI_CONFIG_DATA   0xCFC

Definition at line 34 of file pci.h.

Typedef Documentation

◆ pci_probe_fn

typedef void(* pci_probe_fn) (uint8_t bus, uint8_t slot, uint8_t function)

Definition at line 36 of file pci.h.

Function Documentation

◆ get_ahci_bar_address()

int32 get_ahci_bar_address ( int8 bus,
int slot,
int func,
int bar_num )

Gets the AHCI bar address.

Parameters
busThe PCI bus number.
slotThe PCI slot number.
funcThe PCI function number.
bar_numThe Base Address Register Number.
Returns
int32

◆ getClassId()

int16 getClassId ( int16 bus,
int16 device,
int16 function )

Gets the Class ID from PCI.

Parameters
bus
device
function
Returns
int16 Class ID

◆ getDeviceID()

int16 getDeviceID ( int16 bus,
int16 device,
int16 function )

Gets the Device ID from PCI.

Parameters
bus
device
function
Returns
int16 Device ID

◆ getSubClassId()

int16 getSubClassId ( int16 bus,
int16 device,
int16 function )

Gets the Sub-class ID from PCI.

Parameters
bus
device
function
Returns
int16 Sub-class ID

◆ getVendorID()

int16 getVendorID ( int16 bus,
int16 device,
int16 function )

Gets the Vendor ID from PCI.

Parameters
bus
device
function
Returns
int16 Vendor ID

◆ pci_config_read_dword()

int32 pci_config_read_dword ( int8 bus,
int8 slot,
int8 func,
int8 offset )

Function to read a 32-bit value from the PCI configuration space.

Parameters
bus
slot
func
offset
Returns
int32

◆ pci_read_word()

int16 pci_read_word ( int16 bus,
int16 slot,
int16 func,
int16 offset )

Read a 16-bit value from a PCI configuration register.

This function reads a 16-bit value from a specified PCI configuration register using the provided bus, slot, function, and offset parameters.

Parameters
busThe PCI bus number.
slotThe PCI slot number.
funcThe PCI function number.
offsetThe offset within the PCI configuration register to read.
Returns
The 16-bit value read from the specified PCI configuration register.