| 123456789101112131415161718192021222324252627 |
- /* CPU feature detection for the optional fast paths.
- *
- * The kernel targets i586, so SSE/SSE2 must never be assumed: CPUID itself
- * may not exist (early Pentium and below), which is why the ID bit in EFLAGS
- * is toggled first. Detected features are cached after the first call. */
- #ifndef CPU_H
- #define CPU_H
- /* 1 when CPUID is available (has the ID bit in EFLAGS). */
- int cpu_has_cpuid(void);
- /* (display family << 8) | display model from CPUID leaf 1 (extended
- * family/model folded in the Intel way), or 0 without CPUID. Used as a
- * platform allowlist for probes that poke fixed MMIO addresses. */
- unsigned int cpu_family_model(void);
- /* 1 when the CPU supports SSE2 (the ION does, the Pentium targets do not). */
- int cpu_has_sse2(void);
- /* Enable CR4.OSFXSR/OSXMMEXCPT on the calling CPU when it has FXSR. The BSP
- * does this lazily in cpu_has_sse2(); an AP starts with firmware CR4 and must
- * call this before it can run the SSE2 drawing fast paths. */
- void cpu_enable_sse(void);
- /* Native x87 error reporting and a clean FPU on this CPU (BSP and APs). */
- void cpu_init_fpu(void);
- #endif
|