xref: /minix3/minix/lib/libc/sys/sprofile.c (revision 5dd8da10c5368f1f7c641252b24203c14ed8d051)
1433d6423SLionel Sambuc #include <sys/cdefs.h>
2433d6423SLionel Sambuc #include "namespace.h"
3433d6423SLionel Sambuc 
4433d6423SLionel Sambuc #ifdef __weak_alias
__weak_alias(sprofile,_sprofile)5433d6423SLionel Sambuc __weak_alias(sprofile, _sprofile)
6433d6423SLionel Sambuc #endif
7433d6423SLionel Sambuc 
8433d6423SLionel Sambuc #include <lib.h>
9433d6423SLionel Sambuc #include <string.h>
10433d6423SLionel Sambuc #include <minix/profile.h>
11433d6423SLionel Sambuc 
12433d6423SLionel Sambuc int sprofile(int action,
13433d6423SLionel Sambuc 		int size,
14433d6423SLionel Sambuc 		int freq,
15433d6423SLionel Sambuc 		int type,
16433d6423SLionel Sambuc 		void *ctl_ptr,
17433d6423SLionel Sambuc 		void *mem_ptr)
18433d6423SLionel Sambuc {
19433d6423SLionel Sambuc   message m;
20433d6423SLionel Sambuc 
21433d6423SLionel Sambuc   memset(&m, 0, sizeof(m));
22433d6423SLionel Sambuc   m.m_lc_pm_sprof.action	= action;
23433d6423SLionel Sambuc   m.m_lc_pm_sprof.mem_size	= size;
24433d6423SLionel Sambuc   m.m_lc_pm_sprof.freq		= freq;
25433d6423SLionel Sambuc   m.m_lc_pm_sprof.intr_type	= type;
26*5dd8da10SDavid van Moolenbroek   m.m_lc_pm_sprof.ctl_ptr	= (vir_bytes)ctl_ptr;
27*5dd8da10SDavid van Moolenbroek   m.m_lc_pm_sprof.mem_ptr	= (vir_bytes)mem_ptr;
28433d6423SLionel Sambuc 
29433d6423SLionel Sambuc   return _syscall(PM_PROC_NR, PM_SPROF, &m);
30433d6423SLionel Sambuc }
31433d6423SLionel Sambuc 
32