Add Pci.write_config_register()
This commit is contained in:
parent
7aa28da1ef
commit
9ac69c9003
@ -33,6 +33,13 @@ struct Pci
|
|||||||
return in32(IO_ADDR_CONFIG_DATA);
|
return in32(IO_ADDR_CONFIG_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void write_config_register(uint bus_id, uint device_idx, uint function_idx, uint register_id, uint value)
|
||||||
|
{
|
||||||
|
uint addr = 0x8000_0000u | (bus_id << 16u) | (device_idx << 11u) | (function_idx << 8u) | (register_id << 2u);
|
||||||
|
out32(IO_ADDR_CONFIG_ADDRESS, addr);
|
||||||
|
out32(IO_ADDR_CONFIG_DATA, value);
|
||||||
|
}
|
||||||
|
|
||||||
private static void init_device(ubyte class_id, ubyte subclass_id, ubyte if_id)
|
private static void init_device(ubyte class_id, ubyte subclass_id, ubyte if_id)
|
||||||
{
|
{
|
||||||
switch (class_id)
|
switch (class_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user