The Pedigree Project 0.1
modules/drivers/x86/chipset/main.cc
1/* Copyright (c) 2026, Pedigree Developers. SPDX-License-Identifier: ISC */
2#include "pedigree/kernel/machine/Device.h"
3
4#include "Qm67.h"
5#include "modules/Module.h"
6
7namespace {
8bool entry() {
9 Vector<Device*> devices;
10 auto collect = [](Device* device, Vector<Device*>* candidates) {
11 if (device->getParent() && device->getParent()->getSpecificType() == String("pci"))
12 candidates->pushBack(device);
13 return device;
14 };
15 auto collector = pedigree_std::make_callable(collect);
16 Device::foreach (collector, nullptr, &devices);
17 Qm67::routeInterrupts(devices);
18 return true;
19}
20
21void exit() {}
22} // namespace
23
24// PIRQ configuration and PIC reservations remain owned for the kernel lifetime.
25MODULE_INFO_NON_UNLOADABLE("chipset", &entry, &exit, "pci-enumeration");
static void foreach(Callback callback, Device *root=0)
Definition Device.cc:107
A vector / dynamic array.
Definition Vector.h:33