The Pedigree Project 0.1
PcSchedulerTimerSelection.h
1/*
2 * Copyright (c) 2026, Pedigree Developers
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted.
6 */
7
8#ifndef KERNEL_MACHINE_X86_COMMON_PCSCHEDULERTIMERSELECTION_H
9#define KERNEL_MACHINE_X86_COMMON_PCSCHEDULERTIMERSELECTION_H
10#include <config.h>
11
19 public:
20 enum class Source {
21 Pit,
22 LocalApic,
23 };
24
25 PcSchedulerTimerSelection() : m_Source(Source::Pit) {}
26
27 void recordLocalApicInitialisation(bool succeeded) {
28 m_Source = succeeded ? Source::LocalApic : Source::Pit;
29 }
30
31 Source source() const {
32 return m_Source;
33 }
34
35 bool usesPit() const {
36 return m_Source == Source::Pit;
37 }
38
39 bool usesLocalApic() const {
40 return m_Source == Source::LocalApic;
41 }
42
43 private:
44 Source m_Source;
45};
46
47#endif
Definition Pit.h:38