MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / ConfigWriteByte

Function ConfigWriteByte

Kernel/src/arch/x86_64/pci.cpp:65–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 void ConfigWriteByte(uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset, uint8_t data){
66 uint32_t address = (uint32_t)((bus << 16) | (slot << 11) | (func << 8) | (offset & 0xfc) | 0x80000000);
67
68 outportl(0xCF8, address);
69 outportb(0xCFC, (inportl(0xCFC) & (~(0xFF << ((offset & 3) * 8)))) | (static_cast<uint32_t>(data) << ((offset & 3) * 8)));
70 }
71
72 uint16_t GetVendor(uint8_t bus, uint8_t slot, uint8_t func){
73 uint16_t vendor;

Callers 1

SetInterruptLineMethod · 0.85

Calls 3

outportlFunction · 0.85
outportbFunction · 0.85
inportlFunction · 0.85

Tested by

no test coverage detected