4 * A special CPU lock, that disables IRQ's via the PIC.
6 EXTENSION class Cpu_lock
9 Unsigned32 pic_status; ///< The save PIC mask.
10 Status _is_set; ///< The current state of the lock.
14 IMPLEMENTATION[ia32,amd64]:
18 #include "processor.h"
30 IMPLEMENT inline NEEDS ["config.h","processor.h","pic.h"]
33 // When profiling, we use a sligtly different strategy: Instead of
34 // disabling interrupts in the CPU, we disable all interrupts but the
35 // profiling timer interrupt in the PIC.
39 // mask out all irqs except the profiling timer interrupt
40 pic_status = Pic::disable_all_save();
42 Pic::enable_locked(Config::profile_irq);
46 Proc::irq_chance(); // last chance for an irq to be delivered
51 * (IA32 only) Clear the kernel lock, but disable interrupts.
52 * There is a difference betweeen ``kernel lock'' and ``disabled interrupts''
53 * if the kernel lock is not implemented using CPU-interrupt disabling
54 * (but, for example, IRQ disabling in the PIC).
56 PUBLIC inline NEEDS ["processor.h", "pic.h"]
57 void Cpu_lock::clear_irqdisable()
62 Pic::restore_all(pic_status);
67 IMPLEMENT inline NEEDS ["processor.h",Cpu_lock::clear_irqdisable]
68 void Cpu_lock::clear()
75 Cpu_lock::Status Cpu_lock::test() const