12static inline bool interrupts_enabled(
void) {
14 __asm__ __volatile__(
"pushfq; popq %0" :
"=r"(
flags));
15 return (
flags & (1UL << 9)) != 0;
18static void update_apic_irqs(
IRQL newLevel) {
52static inline void toggle_scheduler(
void) {
83 bool prev_if = interrupts_enabled();
97 update_apic_irqs(NewIrql);
126 bool prev_if = interrupts_enabled();
130 if (NewIrql > curr) {
137 update_apic_irqs(NewIrql);
153 if (prev_if)
__sti();
181 bool prev_if = interrupts_enabled();
186 update_apic_irqs(NewIrql);
199 if (prev_if)
__sti();
210 bool prev_if = interrupts_enabled();
217 IN bool EnabledBefore
223 if (EnabledBefore)
__sti();
234 return interrupts_enabled();
void MhRequestSoftwareInterrupt(IN IRQL RequestIrql)
FORCEINLINE uint32_t InterlockedFetchU32(volatile uint32_t *target)
NORETURN void MeBugCheck(IN enum _BUGCHECK_CODES BugCheckCode)
FORCEINLINE void __sti(void)
FORCEINLINE void __write_cr8(unsigned long val)
FORCEINLINE void __cli(void)
bool MeDisableInterrupts(void)
void MeRaiseIrql(IN IRQL NewIrql, OUT PIRQL OldIrql)
bool MeAreInterruptsEnabled(void)
void MeEnableInterrupts(IN bool EnabledBefore)
void _MeSetIrql(IN IRQL NewIrql)
void MeLowerIrql(IN IRQL NewIrql)
@ IRQL_NOT_GREATER_OR_EQUAL
FORCEINLINE IRQL MeGetCurrentIrql(void)
FORCEINLINE PPROCESSOR MeGetCurrentProcessor(void)
volatile bool schedulerEnabled
volatile bool DpcRoutineActive
volatile bool DpcInterruptRequested
volatile bool ApcRoutineActive
volatile bool ApcInterruptRequested