]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/cpu_lock-generic.cpp
update
[l4.git] / kernel / fiasco / src / kern / cpu_lock-generic.cpp
1 IMPLEMENTATION:
2 /**
3  * Generic implementation of the CPU lock. 
4  * This implementation uses Proc::cli and
5  * Proc::sti from the processor headers.
6  *
7  */
8
9 #include "processor.h"
10
11 IMPLEMENT inline
12 Cpu_lock::Cpu_lock()
13 {}
14
15 IMPLEMENT inline NEEDS ["processor.h"]
16 void Cpu_lock::lock()
17 {
18   Proc::cli();
19 }
20
21 IMPLEMENT inline NEEDS ["processor.h"]
22 void
23 Cpu_lock::clear()
24 {
25   Proc::sti();
26 }
27
28 IMPLEMENT inline NEEDS ["processor.h"]
29 Cpu_lock::Status Cpu_lock::test() const
30 {
31   return ! Proc::interrupts();
32 }