cpu.h 761 B

1234567891011121314151617181920
  1. /* CPU feature detection for the optional fast paths.
  2. *
  3. * The kernel targets i586, so SSE/SSE2 must never be assumed: CPUID itself
  4. * may not exist (early Pentium and below), which is why the ID bit in EFLAGS
  5. * is toggled first. Detected features are cached after the first call. */
  6. #ifndef CPU_H
  7. #define CPU_H
  8. /* 1 when CPUID is available (has the ID bit in EFLAGS). */
  9. int cpu_has_cpuid(void);
  10. /* 1 when the CPU supports SSE2 (the ION does, the Pentium targets do not). */
  11. int cpu_has_sse2(void);
  12. /* Enable CR4.OSFXSR/OSXMMEXCPT on the calling CPU when it has FXSR. The BSP
  13. * does this lazily in cpu_has_sse2(); an AP starts with firmware CR4 and must
  14. * call this before it can run the SSE2 drawing fast paths. */
  15. void cpu_enable_sse(void);
  16. #endif