ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

Detect CPU features and install optimized transform and lighting routines. Currently, CPU features are only detected. The optimized routines have yet to be written.

Bug:
This routine is highly specific to Linux kernel 2.6. I'm still waiting to hear back from the glibc folk on how to do this "right".

Definition at line 56 of file common_ppc.c.

Referenced by _math_init_transformation().

{
#ifdef USE_PPC_ASM
   const pid_t  my_pid = getpid();
   char file_name[32];
   FILE * f;
#ifdef __powerpc64__
   Elf64_auxv_t  v;
#else
   Elf32_auxv_t  v;
#endif

   sprintf( file_name, "/proc/%u/auxv", (unsigned) my_pid );
   f = fopen( file_name, "rb" );
   if ( f != NULL ) {
      while( 1 ) {
     ssize_t elem = fread( & v, sizeof( v ), 1, f );

     if ( elem < 1 ) {
        break;
     }

     if ( v.a_type == AT_HWCAP ) {
        _mesa_ppc_cpu_features = v.a_un.a_val;
        break;
     }
      }

      fclose( f );
   }
   
# ifndef USE_VMX_ASM
   _mesa_ppc_cpu_features &= ~PPC_FEATURES_HAS_ALTIVEC;
# endif
#endif
}

Generated on Sat May 26 2012 04:57:41 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.