The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/linuxkpi/common/include/asm/cpufeature.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* Public domain. */
    2 
    3 #ifndef _LINUXKPI_ASM_CPUFEATURE_H
    4 #define _LINUXKPI_ASM_CPUFEATURE_H
    5 
    6 #if defined(__amd64__) || defined(__i386__)
    7 
    8 #include <sys/types.h>
    9 #include <machine/md_var.h>
   10 
   11 #define X86_FEATURE_CLFLUSH     1
   12 #define X86_FEATURE_XMM4_1      2
   13 #define X86_FEATURE_PAT         3
   14 #define X86_FEATURE_HYPERVISOR  4
   15 
   16 static inline bool
   17 static_cpu_has(uint16_t f)
   18 {
   19         switch (f) {
   20         case X86_FEATURE_CLFLUSH:
   21                 return ((cpu_feature & CPUID_CLFSH) != 0);
   22         case X86_FEATURE_XMM4_1:
   23                 return ((cpu_feature2 & CPUID2_SSE41) != 0);
   24         case X86_FEATURE_PAT:
   25                 return ((cpu_feature & CPUID_PAT) != 0);
   26         case X86_FEATURE_HYPERVISOR:
   27                 return ((cpu_feature2 & CPUID2_HV) != 0);
   28         default:
   29                 return (false);
   30         }
   31 }
   32 
   33 #define boot_cpu_has(x) static_cpu_has(x)
   34 
   35 #endif
   36 
   37 #endif

Cache object: e154e67fdc28a65262e78418686fe77d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.