From 09dd11ddf800898c00ecb04a65fb5cd10fb481fa Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Wed, 8 May 2024 12:32:41 +0200 Subject: MHR-23: :boom: changes, reworked project tree. Signed-off-by: Amlal El Mahrouss --- Private/KernelKit/PCI/Device.hpp | 79 ---------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 Private/KernelKit/PCI/Device.hpp (limited to 'Private/KernelKit/PCI/Device.hpp') diff --git a/Private/KernelKit/PCI/Device.hpp b/Private/KernelKit/PCI/Device.hpp deleted file mode 100644 index e34a12b0..00000000 --- a/Private/KernelKit/PCI/Device.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ -#pragma once - -#include - -namespace NewOS::PCI -{ - enum class PciConfigKind : UShort - { - ConfigAddress = 0xCF8, - ConfigData = 0xCFC, - Invalid = 0xFFF - }; - - class Device final - { - public: - Device() = default; - - public: - explicit Device(UShort bus, UShort device, UShort function, UShort bar); - - Device& operator=(const Device&) = default; - - Device(const Device&) = default; - - ~Device(); - - public: - UInt Read(UInt bar, Size szData); - void Write(UInt bar, UIntPtr data, Size szData); - - public: - operator bool(); - - public: - template - UInt Read(UInt bar) - { - static_assert(sizeof(T) <= 4, "64-bit PCI addressing is unsupported"); - return Read(bar, sizeof(T)); - } - - template - void Write(UInt bar, UIntPtr data) - { - static_assert(sizeof(T) <= 4, "64-bit PCI addressing is unsupported"); - Write(bar, data, sizeof(T)); - } - - public: - UShort DeviceId(); - UShort VendorId(); - UShort InterfaceId(); - UChar Class(); - UChar Subclass(); - UChar ProgIf(); - UChar HeaderType(); - - public: - void EnableMmio(); - void BecomeBusMaster(); // for PCI-DMA, PC-DMA does not need that. - - UShort Vendor(); - - private: - UShort fBus; - UShort fDevice; - UShort fFunction; - UShort fBar; - }; -} // namespace NewOS::PCI - -EXTERN_C void NewOSPCISetCfgTarget(NewOS::UInt bar); -EXTERN_C NewOS::UInt NewOSPCIReadRaw(NewOS::UInt bar); -- cgit v1.2.3