xref: /haiku/src/system/kernel/arch/arm/soc_pxa.h (revision 4a55cc230cf7566cadcbb23b1928eefff8aea9a2)
1 #ifndef ARCH_ARM_SOC_PXA_H
2 #define ARCH_ARM_SOC_PXA_H
3 
4 class PXAInterruptController;
5 
6 #include "soc.h"
7 
8 #include <new>
9 
10 
11 class PXAInterruptController : public InterruptController {
12 public:
13 	PXAInterruptController(uint32_t reg_base);
14 	void EnableInterrupt(int irq);
15 	void DisableInterrupt(int irq);
16 	void HandleInterrupt();
17 
18 protected:
19 	area_id fRegArea;
20 	uint32 *fRegBase;
21 };
22 
23 
24 class PXATimer : public HardwareTimer {
25 public:
26 	void SetTimeout(bigtime_t timeout);
27 	void Clear();
28 	bigtime_t Time();
29 
30 	static status_t Init(uint32_t reg_base) {
31 		PXATimer *timer = new(std::nothrow) PXATimer(reg_base);
32 		// XXX implement InitCheck() functionality
33 		return timer != NULL ? B_OK : B_NO_MEMORY;
34 	}
35 
36 protected:
37 	PXATimer(uint32_t reg_base);
38 
39 	area_id fRegArea;
40 	uint32 *fRegBase;
41 	bigtime_t fSystemTime;
42 private:
43 	static int32 _InterruptWrapper(void *data);
44 	int32 HandleInterrupt();
45 };
46 
47 
48 #endif // ARCH_ARM_SOC_PXA_H
49