summaryrefslogtreecommitdiff
path: root/Kernel/Bus/PCI/Device.h
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-08-21 06:58:43 +0300
committerAndreas Kling <kling@serenityos.org>2021-08-23 01:07:45 +0200
commitaacb1f0bf4c82569c7896930436f3bbd216fed67 (patch)
tree1d87e46b3e7060e4a1d8444fbe26853884f33451 /Kernel/Bus/PCI/Device.h
parent7b9c3439ec1d4d0c2122897fdfeb72fe52814d7a (diff)
downloadserenity-aacb1f0bf4c82569c7896930436f3bbd216fed67.zip
Kernel: Rename PCI::DeviceController => PCI::Device
Now that the old PCI::Device was removed, we can complete the PCI changes by making the PCI::DeviceController to be named PCI::Device. Really the entire purpose and the distinction between the two was about interrupts, but since this is no longer a problem, just rename it to simplify things further.
Diffstat (limited to 'Kernel/Bus/PCI/Device.h')
-rw-r--r--Kernel/Bus/PCI/Device.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Kernel/Bus/PCI/Device.h b/Kernel/Bus/PCI/Device.h
new file mode 100644
index 0000000000..5d827f1f49
--- /dev/null
+++ b/Kernel/Bus/PCI/Device.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <AK/Types.h>
+#include <Kernel/Bus/PCI/Definitions.h>
+
+namespace Kernel {
+class PCI::Device {
+public:
+ Address pci_address() const { return m_pci_address; };
+
+ virtual ~Device() = default;
+ void enable_pin_based_interrupts() const;
+ void disable_pin_based_interrupts() const;
+
+ bool is_msi_capable() const;
+ bool is_msix_capable() const;
+
+ void enable_message_signalled_interrupts();
+ void disable_message_signalled_interrupts();
+
+ void enable_extended_message_signalled_interrupts();
+ void disable_extended_message_signalled_interrupts();
+
+protected:
+ explicit Device(Address pci_address);
+
+private:
+ Address m_pci_address;
+};
+}