Added lance entry to drivers.conf.
[minix3-old.git] / kernel / system / do_profbuf.c
blob7638e046d0937baa088446c470af020a0c545f82
1 /* The kernel call that is implemented in this file:
2 * m_type: SYS_PROFBUF
4 * The parameters for this kernel call are:
5 * m7_p1: PROF_CTL_PTR (location of control struct)
6 * m7_p2: PROF_MEM_PTR (location of profiling table)
8 * Changes:
9 * 14 Aug, 2006 Created (Rogier Meurs)
12 #include "../system.h"
14 #if CPROFILE
16 /*===========================================================================*
17 * do_profbuf *
18 *===========================================================================*/
19 PUBLIC int do_profbuf(m_ptr)
20 register message *m_ptr; /* pointer to request message */
22 /* This kernel call is used by profiled system processes when Call
23 * Profiling is enabled. It is called on the first execution of procentry.
24 * By means of this kernel call, the profiled processes inform the kernel
25 * about the location of their profiling table and the control structure
26 * which is used to enable the kernel to have the tables cleared.
27 */
28 int proc_nr, len;
29 vir_bytes vir_dst;
30 struct proc *rp;
32 /* Store process name, control struct, table locations. */
33 isokendpt(m_ptr->m_source, &proc_nr);
34 rp = proc_addr(proc_nr);
36 cprof_proc_info[cprof_procs_no].endpt = who_e;
37 cprof_proc_info[cprof_procs_no].name = rp->p_name;
39 len = (phys_bytes) sizeof (void *);
41 vir_dst = (vir_bytes) m_ptr->PROF_CTL_PTR;
42 cprof_proc_info[cprof_procs_no].ctl =
43 numap_local(proc_nr, vir_dst, len);
45 vir_dst = (vir_bytes) m_ptr->PROF_MEM_PTR;
46 cprof_proc_info[cprof_procs_no].buf =
47 numap_local(proc_nr, vir_dst, len);
49 cprof_procs_no++;
51 return OK;
54 #endif /* CPROFILE */