summaryrefslogtreecommitdiffhomepage
path: root/Private/HALKit/AMD64/PCI/Iterator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Private/HALKit/AMD64/PCI/Iterator.cpp')
-rw-r--r--Private/HALKit/AMD64/PCI/Iterator.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/Private/HALKit/AMD64/PCI/Iterator.cpp b/Private/HALKit/AMD64/PCI/Iterator.cpp
index 6f80d496..3d357901 100644
--- a/Private/HALKit/AMD64/PCI/Iterator.cpp
+++ b/Private/HALKit/AMD64/PCI/Iterator.cpp
@@ -9,31 +9,29 @@
#include <KernelKit/PCI/Iterator.hpp>
-#define PCI_ITERATOR_FIND_AND_UNWRAP(DEV, SZ) \
- if (DEV.Leak()) \
- return DEV.Leak();
+#define PCI_ITERATOR_FIND_AND_UNWRAP(DEV, SZ) \
+ if (DEV.Leak()) return DEV.Leak();
namespace hCore::PCI {
- Iterator::Iterator(const Types::PciDeviceKind &type) {
- // probe devices.
- for (int bus = 0; bus < ME_BUS_COUNT; ++bus) {
- for (int device = 0; device < ME_DEVICE_COUNT; ++device) {
- for (int function = 0; function < ME_FUNCTION_COUNT; ++function) {
- Device dev(bus, device, function, 0);
+Iterator::Iterator(const Types::PciDeviceKind &type) {
+ // probe devices.
+ for (int bus = 0; bus < ME_BUS_COUNT; ++bus) {
+ for (int device = 0; device < ME_DEVICE_COUNT; ++device) {
+ for (int function = 0; function < ME_FUNCTION_COUNT; ++function) {
+ Device dev(bus, device, function, 0);
- if (dev.Class() == (UChar) type) {
- m_Devices[bus].Leak().Leak() = dev;
- }
- }
- }
+ if (dev.Class() == (UChar)type) {
+ m_Devices[bus].Leak().Leak() = dev;
}
+ }
}
+ }
+}
- Iterator::~Iterator() {
- }
+Iterator::~Iterator() {}
- Ref<PCI::Device> Iterator::operator[](const Size &sz) {
- PCI_ITERATOR_FIND_AND_UNWRAP(m_Devices[sz], sz);
- return {};
- }
-} // namespace hCore::PCI
+Ref<PCI::Device> Iterator::operator[](const Size &sz) {
+ PCI_ITERATOR_FIND_AND_UNWRAP(m_Devices[sz], sz);
+ return {};
+}
+} // namespace hCore::PCI