src/cpuinfo/SDL_cpuinfo.c
changeset 13945 465afae5eb7e
parent 13922 23d4515c00b4
child 14014 1b8e12692202
equal deleted inserted replaced
13944:b8c8ce11efc7 13945:465afae5eb7e
    47 #include <sys/types.h>
    47 #include <sys/types.h>
    48 #include <sys/sysctl.h>
    48 #include <sys/sysctl.h>
    49 #endif
    49 #endif
    50 #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
    50 #if defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))
    51 #include <sys/sysctl.h>         /* For AltiVec check */
    51 #include <sys/sysctl.h>         /* For AltiVec check */
    52 #elif defined(__OpenBSD__) && defined(__powerpc__)
    52 #elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__powerpc__)
    53 #include <sys/param.h>
    53 #include <sys/param.h>
    54 #include <sys/sysctl.h> /* For AltiVec check */
    54 #include <sys/sysctl.h> /* For AltiVec check */
    55 #include <machine/cpu.h>
    55 #include <machine/cpu.h>
    56 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
    56 #elif SDL_ALTIVEC_BLITTERS && HAVE_SETJMP
    57 #include <signal.h>
    57 #include <signal.h>
   312 static int
   312 static int
   313 CPU_haveAltiVec(void)
   313 CPU_haveAltiVec(void)
   314 {
   314 {
   315     volatile int altivec = 0;
   315     volatile int altivec = 0;
   316 #ifndef SDL_CPUINFO_DISABLED
   316 #ifndef SDL_CPUINFO_DISABLED
   317 #if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__))
   317 #if (defined(__MACOSX__) && (defined(__ppc__) || defined(__ppc64__))) || (defined(__OpenBSD__) && defined(__powerpc__)) || (defined(__FreeBSD__) && defined(__powerpc__))
   318 #ifdef __OpenBSD__
   318 #ifdef __OpenBSD__
   319     int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
   319     int selectors[2] = { CTL_MACHDEP, CPU_ALTIVEC };
       
   320 #elif defined(__FreeBSD__)
       
   321     int selectors[2] = { CTL_HW, PPC_FEATURE_HAS_ALTIVEC };
   320 #else
   322 #else
   321     int selectors[2] = { CTL_HW, HW_VECTORUNIT };
   323     int selectors[2] = { CTL_HW, HW_VECTORUNIT };
   322 #endif
   324 #endif
   323     int hasVectorUnit = 0;
   325     int hasVectorUnit = 0;
   324     size_t length = sizeof(hasVectorUnit);
   326     size_t length = sizeof(hasVectorUnit);