summaryrefslogtreecommitdiff
path: root/minix/lib/libc/sys/sprofile.c
blob: 0fe27c43f28fe8a7e6a71f888883e8eca14fb639 (plain)
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
#include <sys/cdefs.h>
#include "namespace.h"

#ifdef __weak_alias
__weak_alias(sprofile, _sprofile)
#endif

#include <lib.h>
#include <string.h>
#include <minix/profile.h>

int sprofile(int action,
		int size,
		int freq,
		int type,
		void *ctl_ptr,
		void *mem_ptr)
{
  message m;

  memset(&m, 0, sizeof(m));
  m.m_lc_pm_sprof.action	= action;
  m.m_lc_pm_sprof.mem_size	= size;
  m.m_lc_pm_sprof.freq		= freq;
  m.m_lc_pm_sprof.intr_type	= type;
  m.m_lc_pm_sprof.ctl_ptr	= (vir_bytes)ctl_ptr;
  m.m_lc_pm_sprof.mem_ptr	= (vir_bytes)mem_ptr;

  return _syscall(PM_PROC_NR, PM_SPROF, &m);
}