The Pedigree Project 0.1
InterruptProbe.h
1/* Copyright (c) 2026, Pedigree Developers. SPDX-License-Identifier: ISC */
2#ifndef DRIVER_INTERRUPT_PROBE_H
3#define DRIVER_INTERRUPT_PROBE_H
4
5namespace InterruptProbe {
6template <typename Command, typename Counter>
7bool run(Command command, Counter interruptCompletions) {
8 const auto before = interruptCompletions();
9 const bool completed = command();
10 // Polling can recover a command while its required interrupt route is dead.
11 return completed && interruptCompletions() != before;
12}
13} // namespace InterruptProbe
14#endif