diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 08:46:09 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-01-30 08:46:09 +0100 |
| commit | d7112cd6909640afd7609b3a142bc6ecf921ee25 (patch) | |
| tree | 55033ad28d58d536c4b3bad715d8635f00773bfd /Private/HALKit/AMD64/PCI/Device.cpp | |
| parent | f22e69b8837b84548f79e0b8ca7bef24605c6611 (diff) | |
Kernel: Breaking changes, see source code.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/HALKit/AMD64/PCI/Device.cpp')
| -rw-r--r-- | Private/HALKit/AMD64/PCI/Device.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Private/HALKit/AMD64/PCI/Device.cpp b/Private/HALKit/AMD64/PCI/Device.cpp index 597e936b..f3da65f7 100644 --- a/Private/HALKit/AMD64/PCI/Device.cpp +++ b/Private/HALKit/AMD64/PCI/Device.cpp @@ -1,7 +1,7 @@ /* * ======================================================== * - * hCore + * HCore * Copyright 2024 Mahrouss Logic, all rights reserved. * * ======================================================== @@ -10,29 +10,29 @@ #include <ArchKit/Arch.hpp> #include <KernelKit/PCI/Device.hpp> -hCore::UInt LumiaPCIReadRaw(hCore::UInt bar, hCore::UShort bus, - hCore::UShort dev, hCore::UShort fun) { - hCore::UInt target = 0x80000000 | ((hCore::UInt)bus << 16) | - ((hCore::UInt)dev << 11) | ((hCore::UInt)fun << 8) | +HCore::UInt LumiaPCIReadRaw(HCore::UInt bar, HCore::UShort bus, + HCore::UShort dev, HCore::UShort fun) { + HCore::UInt target = 0x80000000 | ((HCore::UInt)bus << 16) | + ((HCore::UInt)dev << 11) | ((HCore::UInt)fun << 8) | (bar & 0xFC); - hCore::HAL::out32((hCore::UShort)hCore::PCI::PciConfigKind::ConfigAddress, + HCore::HAL::out32((HCore::UShort)HCore::PCI::PciConfigKind::ConfigAddress, target); - return hCore::HAL::in32((hCore::UShort)hCore::PCI::PciConfigKind::ConfigData); + return HCore::HAL::in32((HCore::UShort)HCore::PCI::PciConfigKind::ConfigData); } -void LumiaPCISetCfgTarget(hCore::UInt bar, hCore::UShort bus, hCore::UShort dev, - hCore::UShort fun) { - hCore::UInt target = 0x80000000 | ((hCore::UInt)bus << 16) | - ((hCore::UInt)dev << 11) | ((hCore::UInt)fun << 8) | +void LumiaPCISetCfgTarget(HCore::UInt bar, HCore::UShort bus, HCore::UShort dev, + HCore::UShort fun) { + HCore::UInt target = 0x80000000 | ((HCore::UInt)bus << 16) | + ((HCore::UInt)dev << 11) | ((HCore::UInt)fun << 8) | (bar & ~3); - hCore::HAL::out32((hCore::UShort)hCore::PCI::PciConfigKind::ConfigAddress, + HCore::HAL::out32((HCore::UShort)HCore::PCI::PciConfigKind::ConfigAddress, target); } -namespace hCore::PCI { +namespace HCore::PCI { Device::Device(UShort bus, UShort device, UShort func, UShort bar) : m_Bus(bus), m_Device(device), m_Function(func), m_Bar(bar) {} @@ -109,4 +109,4 @@ UShort Device::Vendor() { } Device::operator bool() { return VendorId() != (UShort)PciConfigKind::Invalid; } -} // namespace hCore::PCI +} // namespace HCore::PCI |
