From 2e01f1f9b9283bf4196a804030e6a536da2a184d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 3 Sep 2020 20:59:58 +0200 Subject: [PATCH] Kernel: Add PCI::get_programming_interface(PCI::Address) This returns the programming interface at a given PCI address. This is sometimes referred to as "prog-if" on other systems. --- Kernel/PCI/Access.cpp | 5 +++++ Kernel/PCI/Definitions.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Kernel/PCI/Access.cpp b/Kernel/PCI/Access.cpp index 999f6b6002d..a480cb8f2e0 100644 --- a/Kernel/PCI/Access.cpp +++ b/Kernel/PCI/Access.cpp @@ -193,6 +193,11 @@ u8 get_class(Address address) return read8(address, PCI_CLASS); } +u8 get_programming_interface(Address address) +{ + return read8(address, PCI_PROG_IF); +} + u16 get_subsystem_id(Address address) { return read16(address, PCI_SUBSYSTEM_ID); diff --git a/Kernel/PCI/Definitions.h b/Kernel/PCI/Definitions.h index 767ff73cc19..5e1741d0db0 100644 --- a/Kernel/PCI/Definitions.h +++ b/Kernel/PCI/Definitions.h @@ -208,6 +208,7 @@ u32 get_BAR3(Address); u32 get_BAR4(Address); u32 get_BAR5(Address); u8 get_revision_id(Address); +u8 get_programming_interface(Address); u8 get_subclass(Address); u8 get_class(Address); u16 get_subsystem_id(Address);