]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/arm/ipi-arm.cpp
update
[l4.git] / kernel / fiasco / src / kern / arm / ipi-arm.cpp
1 IMPLEMENTATION [mp]:
2
3 #include "cpu.h"
4 #include "pic.h"
5 #include "gic.h"
6 #include "processor.h"
7
8 EXTENSION class Ipi
9 {
10 private:
11   Unsigned32 _phys_id;
12
13 public:
14   enum Message
15   {
16     Ipi_start = 1,
17     Global_request = Ipi_start, Request, Debug,
18     Ipi_end
19   };
20 };
21
22
23 PUBLIC inline
24 Ipi::Ipi() : _phys_id(~0)
25 {}
26
27 IMPLEMENT inline NEEDS["processor.h"]
28 void
29 Ipi::init(unsigned cpu)
30 {
31   _ipi.cpu(cpu)._phys_id = Proc::cpu_id();
32 }
33
34 PUBLIC static
35 void Ipi::ipi_call_debug_arch()
36 {
37 }
38
39 PUBLIC static inline
40 void Ipi::eoi(Message, unsigned on_cpu)
41 {
42   // with the ARM-GIC we have to do the EOI right after the ACK
43   stat_received(on_cpu);
44 }
45
46 // ---------------------------------------------------------------------------
47 IMPLEMENTATION [mp && !irregular_gic]:
48
49 PUBLIC static inline NEEDS["pic.h"]
50 void Ipi::send(Message m, unsigned from_cpu, unsigned to_cpu)
51 {
52   Pic::gic->softint_cpu(1 << _ipi.cpu(to_cpu)._phys_id, m);
53   stat_sent(from_cpu);
54 }
55
56 PUBLIC static inline
57 void
58 Ipi::bcast(Message m, unsigned from_cpu)
59 {
60   (void)from_cpu;
61   Pic::gic->softint_bcast(m);
62 }
63