arch/x86/include/asm/mwait.h

Source file repositories/reference/linux-study-clean/arch/x86/include/asm/mwait.h

File Facts

System
Linux kernel
Corpus path
arch/x86/include/asm/mwait.h
Extension
.h
Size
4718 bytes
Lines
151
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ecx & 1) {
			__mwait(eax, ecx);
		} else {
			__sti_mwait(eax, ecx);
			raw_local_irq_disable();
		}
	}

out:
	current_clr_polling();
}

/*
 * Caller can specify whether to enter C0.1 (low latency, less
 * power saving) or C0.2 state (saves more power, but longer wakeup
 * latency). This may be overridden by the IA32_UMWAIT_CONTROL MSR
 * which can force requests for C0.2 to be downgraded to C0.1.
 */
static inline void __tpause(u32 ecx, u32 edx, u32 eax)
{
	/* "tpause %ecx" */
	asm volatile(".byte 0x66, 0x0f, 0xae, 0xf1"
		     :: "c" (ecx), "d" (edx), "a" (eax));
}

#endif /* _ASM_X86_MWAIT_H */

Annotation

Implementation Notes