PAPI  5.0.1.0
freebsd-memory.c
Go to the documentation of this file.
00001 /****************************/
00002 /* THIS IS OPEN SOURCE CODE */
00003 /****************************/
00004 
00005 /*
00006 * File:     freebsd-memory.c
00007 * Author:   Harald Servat
00008 *           redcrash@gmail.com
00009 * Mod:      James Ralph 
00010 *           ralph@cs.utk.edu
00011 */
00012 
00013 #include "papi.h"
00014 #include "papi_internal.h"
00015 
00016 #include "x86_cpuid_info.h"
00017 
00018 #define UNREFERENCED(x) (void)x
00019 
00020 
00021 #if defined(__i386__)||defined(__x86_64__)
00022 static int
00023 x86_get_memory_info( PAPI_hw_info_t *hw_info )
00024 {
00025   int retval = PAPI_OK;
00026 
00027   switch ( hw_info->vendor ) {
00028   case PAPI_VENDOR_AMD:
00029   case PAPI_VENDOR_INTEL:
00030     retval = _x86_cache_info( &hw_info->mem_hierarchy );
00031     break;
00032   default:
00033     PAPIERROR( "Unknown vendor in memory information call for x86." );
00034     return PAPI_ENOIMPL;
00035   }
00036   return retval;
00037 }
00038 #endif
00039 
00040 
00041 int 
00042 _freebsd_get_memory_info( PAPI_hw_info_t *hw_info, int id)
00043 {
00044     UNREFERENCED(id);
00045     UNREFERENCED(hw_info);
00046 
00047 #if defined(__i386__)||defined(__x86_64__)
00048         x86_get_memory_info( hw_info );
00049 #endif
00050 
00051     return PAPI_ENOIMPL;
00052 }
00053 
00054 int _papi_freebsd_get_dmem_info(PAPI_dmem_info_t *d)
00055 {
00056   /* TODO */
00057     d->pagesize = getpagesize();
00058     return PAPI_OK;
00059 }
00060  
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines