-
Notifications
You must be signed in to change notification settings - Fork 0
/
freebsd-memory.c
60 lines (47 loc) · 1.06 KB
/
freebsd-memory.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/****************************/
/* THIS IS OPEN SOURCE CODE */
/****************************/
/*
* File: freebsd-memory.c
* Author: Harald Servat
* Mod: James Ralph
*/
#include "papi.h"
#include "papi_internal.h"
#include "x86_cpuid_info.h"
#define UNREFERENCED(x) (void)x
#if defined(__i386__)||defined(__x86_64__)
static int
x86_get_memory_info( PAPI_hw_info_t *hw_info )
{
int retval = PAPI_OK;
switch ( hw_info->vendor ) {
case PAPI_VENDOR_AMD:
case PAPI_VENDOR_INTEL:
retval = _x86_cache_info( &hw_info->mem_hierarchy );
break;
default:
PAPIERROR( "Unknown vendor in memory information call for x86." );
return PAPI_ENOIMPL;
}
return retval;
}
#endif
int
_freebsd_get_memory_info( PAPI_hw_info_t *hw_info, int id)
{
UNREFERENCED(id);
UNREFERENCED(hw_info);
#if defined(__i386__)||defined(__x86_64__)
x86_get_memory_info( hw_info );
#endif
return PAPI_ENOIMPL;
}
int _papi_freebsd_get_dmem_info(PAPI_dmem_info_t *d)
{
/* TODO */
d->pagesize = getpagesize();
return PAPI_OK;
}