diff options
author | Liav A <liavalb@gmail.com> | 2020-02-22 17:15:03 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-02-24 11:27:03 +0100 |
commit | 3539666ac98cad87ea6d0c325363099e40453c4b (patch) | |
tree | 91bcb4b4918ce30fa3643542db968d00519c714d /Kernel/PCI/Access.cpp | |
parent | ca05d54b2be89a739ebd3fcdea208ef35830f602 (diff) | |
download | serenity-3539666ac98cad87ea6d0c325363099e40453c4b.zip |
Kernel: Add PCI helpers to enable and disable the interrupt line
Diffstat (limited to 'Kernel/PCI/Access.cpp')
-rw-r--r-- | Kernel/PCI/Access.cpp | 144 |
1 files changed, 76 insertions, 68 deletions
diff --git a/Kernel/PCI/Access.cpp b/Kernel/PCI/Access.cpp index 87feda710e..cd86f257f5 100644 --- a/Kernel/PCI/Access.cpp +++ b/Kernel/PCI/Access.cpp @@ -107,77 +107,85 @@ void PCI::Access::disable_bus_mastering(Address address) } namespace PCI { -void enumerate_all(Function<void(Address, ID)> callback) -{ - PCI::Access::the().enumerate_all(callback); -} + void enumerate_all(Function<void(Address, ID)> callback) + { + PCI::Access::the().enumerate_all(callback); + } -ID get_id(Address address) -{ - return PCI::Access::the().get_id(address); -} + ID get_id(Address address) + { + return PCI::Access::the().get_id(address); + } -u8 get_interrupt_line(Address address) -{ - return PCI::Access::the().get_interrupt_line(address); -} -u32 get_BAR0(Address address) -{ - return PCI::Access::the().get_BAR0(address); -} -u32 get_BAR1(Address address) -{ - return PCI::Access::the().get_BAR1(address); -} -u32 get_BAR2(Address address) -{ - return PCI::Access::the().get_BAR2(address); -} -u32 get_BAR3(Address address) -{ - return PCI::Access::the().get_BAR3(address); -} -u32 get_BAR4(Address address) -{ - return PCI::Access::the().get_BAR4(address); -} -u32 get_BAR5(Address address) -{ - return PCI::Access::the().get_BAR5(address); -} -u8 get_revision_id(Address address) -{ - return PCI::Access::the().get_revision_id(address); -} -u8 get_subclass(Address address) -{ - return PCI::Access::the().get_subclass(address); -} -u8 get_class(Address address) -{ - return PCI::Access::the().get_class(address); -} -u16 get_subsystem_id(Address address) -{ - return PCI::Access::the().get_subsystem_id(address); -} -u16 get_subsystem_vendor_id(Address address) -{ - return PCI::Access::the().get_subsystem_vendor_id(address); -} -void enable_bus_mastering(Address address) -{ - PCI::Access::the().enable_bus_mastering(address); -} -void disable_bus_mastering(Address address) -{ - PCI::Access::the().disable_bus_mastering(address); -} -size_t get_BAR_Space_Size(Address address, u8 bar_number) -{ - return PCI::Access::the().get_BAR_Space_Size(address, bar_number); -} + void enable_interrupt_line(Address address) + { + PCI::Access::the().enable_interrupt_line(address); + } + void disable_interrupt_line(Address address) + { + PCI::Access::the().disable_interrupt_line(address); + } + u8 get_interrupt_line(Address address) + { + return PCI::Access::the().get_interrupt_line(address); + } + u32 get_BAR0(Address address) + { + return PCI::Access::the().get_BAR0(address); + } + u32 get_BAR1(Address address) + { + return PCI::Access::the().get_BAR1(address); + } + u32 get_BAR2(Address address) + { + return PCI::Access::the().get_BAR2(address); + } + u32 get_BAR3(Address address) + { + return PCI::Access::the().get_BAR3(address); + } + u32 get_BAR4(Address address) + { + return PCI::Access::the().get_BAR4(address); + } + u32 get_BAR5(Address address) + { + return PCI::Access::the().get_BAR5(address); + } + u8 get_revision_id(Address address) + { + return PCI::Access::the().get_revision_id(address); + } + u8 get_subclass(Address address) + { + return PCI::Access::the().get_subclass(address); + } + u8 get_class(Address address) + { + return PCI::Access::the().get_class(address); + } + u16 get_subsystem_id(Address address) + { + return PCI::Access::the().get_subsystem_id(address); + } + u16 get_subsystem_vendor_id(Address address) + { + return PCI::Access::the().get_subsystem_vendor_id(address); + } + void enable_bus_mastering(Address address) + { + PCI::Access::the().enable_bus_mastering(address); + } + void disable_bus_mastering(Address address) + { + PCI::Access::the().disable_bus_mastering(address); + } + size_t get_BAR_Space_Size(Address address, u8 bar_number) + { + return PCI::Access::the().get_BAR_Space_Size(address, bar_number); + } } } |