btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / arch / arm / soc.h
blob4b1f4e8addedd048aac5ca9f9094bfdf96673060
1 #ifndef ARCH_ARM_SOC_H
2 #define ARCH_ARM_SOC_H
4 class InterruptController;
6 #include <drivers/bus/FDT.h>
7 #include <private/kernel/int.h>
8 #include <private/kernel/timer.h>
10 // ------------------------------------------------------ InterruptController
12 class InterruptController {
13 public:
14 virtual void EnableInterrupt(int irq) = 0;
15 virtual void DisableInterrupt(int irq) = 0;
17 virtual void HandleInterrupt() = 0;
19 static InterruptController* Get() {
20 return sInstance;
23 protected:
24 InterruptController(fdt_module_info *fdtModule, fdt_device_node node)
25 : fFDT(fdtModule), fNode(node) {
26 if (sInstance) {
27 panic("Multiple InterruptController objects created; that is currently unsupported!");
29 sInstance = this;
32 // Keep our node around as we might want to grab attributes from it
33 fdt_module_info *fFDT;
34 fdt_device_node fNode;
36 static InterruptController *sInstance;
40 // ------------------------------------------------------ HardwareTimer
42 class HardwareTimer {
43 public:
44 virtual void SetTimeout(bigtime_t timeout) = 0;
45 virtual bigtime_t Time() = 0;
46 virtual void Clear() = 0;
48 static HardwareTimer* Get() {
49 return sInstance;
52 protected:
53 HardwareTimer(fdt_module_info *fdtModule, fdt_device_node node)
54 : fFDT(fdtModule), fNode(node) {
55 if (sInstance) {
56 panic("Multiple HardwareTimer objects created; that is currently unsupported!");
58 sInstance = this;
61 // Keep our node around as we might want to grab attributes from it
62 fdt_module_info *fFDT;
63 fdt_device_node fNode;
65 static HardwareTimer *sInstance;
68 #endif // ARCH_ARM_SOC_H