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

Function ConfigReadByte

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

Source from the content-addressed store, hash-verified

38 }
39
40 uint8_t ConfigReadByte(uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset){
41 uint32_t address = (uint32_t)((bus << 16) | (slot << 11) | (func << 8) | (offset & 0xfc) | 0x80000000);
42
43 outportl(0xCF8, address);
44
45 uint8_t data;
46 data = (uint8_t)((inportl(0xCFC) >> ((offset & 3) * 8)) & 0xff);
47
48 return data;
49 }
50
51 void ConfigWriteDword(uint8_t bus, uint8_t slot, uint8_t func, uint8_t offset, uint16_t data){
52 uint32_t address = (uint32_t)((bus << 16) | (slot << 11) | (func << 8) | (offset & 0xfc) | 0x80000000);

Callers 4

GetInterruptLineMethod · 0.85
UpdateClassMethod · 0.85
HeaderTypeMethod · 0.85
GetProgIFMethod · 0.85

Calls 2

outportlFunction · 0.85
inportlFunction · 0.85

Tested by

no test coverage detected