mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:08:13 +00:00
Kernel/PCI: Add helpers to enable IO and memory accesses
This commit is contained in:
parent
a2a7986527
commit
ecf897f7c4
2 changed files with 22 additions and 0 deletions
|
@ -187,6 +187,24 @@ ID get_id(Address address)
|
|||
return { read16(address, PCI_VENDOR_ID), read16(address, PCI_DEVICE_ID) };
|
||||
}
|
||||
|
||||
void enable_io_space(Address address)
|
||||
{
|
||||
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) | (1 << 0));
|
||||
}
|
||||
void disable_io_space(Address address)
|
||||
{
|
||||
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) & ~(1 << 0));
|
||||
}
|
||||
|
||||
void enable_memory_space(Address address)
|
||||
{
|
||||
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) | (1 << 1));
|
||||
}
|
||||
void disable_memory_space(Address address)
|
||||
{
|
||||
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) & ~(1 << 1));
|
||||
}
|
||||
|
||||
void enable_interrupt_line(Address address)
|
||||
{
|
||||
write16(address, PCI_COMMAND, read16(address, PCI_COMMAND) & ~(1 << 10));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue