#define SMS_PATTERN m2_i2 /* memset() pattern */
/* Field names for SYS_SPROF, _CPROF, _PROFBUF. */
-#define PROF_ACTION m7_i1 /* start/stop/reset/get */
-#define PROF_MEM_SIZE m7_i2 /* available memory for data */
-#define PROF_ENDPT m7_i4 /* endpoint of caller */
#define PROF_CTL_PTR m7_p1 /* location of info struct */
#define PROF_MEM_PTR m7_p2 /* location of profiling data */
} mess_lc_pm_sprof;
_ASSERT_MSG_SIZE(mess_lc_pm_sprof);
+typedef struct {
+ int action;
+ vir_bytes ctl_ptr;
+ vir_bytes mem_ptr;
+ size_t mem_size;
+
+ uint8_t padding[40];
+} mess_lc_pm_cprof;
+_ASSERT_MSG_SIZE(mess_lc_pm_cprof);
+
+typedef struct {
+ endpoint_t endpt;
+ int action;
+ vir_bytes ctl_ptr;
+ vir_bytes mem_ptr;
+ size_t mem_size;
+
+ uint8_t padding[36];
+} mess_lsys_krn_sys_cprof;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_cprof);
+
typedef struct {
int num;
mess_notify m_notify;
mess_sigcalls m_sigcalls;
+ mess_lc_pm_cprof m_lc_pm_cprof;
mess_lc_pm_sprof m_lc_pm_sprof;
mess_lsys_krn_sys_diagctl m_lsys_krn_sys_diagctl;
+ mess_lsys_krn_sys_cprof m_lsys_krn_sys_cprof;
mess_lsys_krn_sys_sprof m_lsys_krn_sys_sprof;
mess_lsys_krn_readbios m_lsys_krn_readbios;
mess_pm_lsys_sigs_signal m_pm_lsys_sigs_signal;
/* The kernel call that is implemented in this file:
- * m_type: SYS_CPROFILE
+ * m_type: SYS_CPROF
*
* The parameters for this kernel call are:
- * m7_i1: PROF_ACTION (get/reset profiling data)
- * m7_i2: PROF_MEM_SIZE (available memory for data)
- * m7_i4: PROF_ENDPT (endpoint of caller)
- * m7_p1: PROF_CTL_PTR (location of info struct)
- * m7_p2: PROF_MEM_PTR (location of memory for data)
+ * m_lsys_krn_cprof.action (get/reset profiling data)
+ * m_lsys_krn_cprof.mem_size (available memory for data)
+ * m_lsys_krn_cprof.endpt (endpoint of caller)
+ * m_lsys_krn_cprof.ctl_ptr (location of info struct)
+ * m_lsys_krn_cprof.mem_ptr (location of memory for data)
*
* Changes:
* 14 Aug, 2006 Created (Rogier Meurs)
phys_bytes len;
vir_bytes vir_dst;
- switch (m_ptr->PROF_ACTION) {
+ switch (m_ptr->m_lsys_krn_cprof.action) {
case PROF_RESET:
* tables of the profiled processes.
*/
- if(!isokendpt(m_ptr->PROF_ENDPT, &proc_nr))
+ if(!isokendpt(m_ptr->m_lsys_krn_cprof.endpt, &proc_nr))
return EINVAL;
- cprof_mem_size = m_ptr->PROF_MEM_SIZE;
+ cprof_mem_size = m_ptr->m_lsys_krn_cprof.mem_size;
printf("CPROFILE notice: getting tables:");
/* Copy the info struct to the user process. */
data_copy(KERNEL, (vir_bytes) &cprof_info,
- m_ptr->PROF_ENDPT, (vir_bytes) m_ptr->PROF_CTL_PTR,
+ m_ptr->m_lsys_krn_cprof.endpt, m_ptr->m_lsys_krn_cprof.ctl_ptr,
sizeof(cprof_info));
/* If there is no space or errors occurred, don't bother copying. */
/* For each profiled process, copy its name, slots_used and profiling
* table to the user process. */
- vir_dst = (vir_bytes) m_ptr->PROF_MEM_PTR;
+ vir_dst = m_ptr->m_lsys_krn_cprof.mem_ptr;
for (i=0; i<cprof_procs_no; i++) {
len = (phys_bytes) strlen(cprof_proc_info[i].name);
data_copy(KERNEL, (vir_bytes) cprof_proc_info[i].name,
- m_ptr->PROF_ENDPT, vir_dst, len);
+ m_ptr->m_lsys_krn_cprof.endpt, vir_dst, len);
vir_dst += CPROF_PROCNAME_LEN;
len = (phys_bytes) sizeof(cprof_ctl_inst.slots_used);
data_copy(cprof_proc_info[i].endpt,
cprof_proc_info[i].ctl_v + sizeof(cprof_ctl_inst.reset),
- m_ptr->PROF_ENDPT, vir_dst, len);
+ m_ptr->m_lsys_krn_cprof.endpt, vir_dst, len);
vir_dst += len;
len = (phys_bytes)
(sizeof(cprof_tbl_inst) * cprof_proc_info[i].slots_used);
data_copy(cprof_proc_info[i].endpt, cprof_proc_info[i].buf_v,
- m_ptr->PROF_ENDPT, vir_dst, len);
+ m_ptr->m_lsys_krn_cprof.endpt, vir_dst, len);
vir_dst += len;
}
message m;
memset(&m, 0, sizeof(m));
- m.PROF_ACTION = action;
- m.PROF_MEM_SIZE = size;
- m.PROF_CTL_PTR = (void *) ctl_ptr;
- m.PROF_MEM_PTR = (void *) mem_ptr;
+ m.m_lc_pm_cprof.action = action;
+ m.m_lc_pm_cprof.mem_size = size;
+ m.m_lc_pm_cprof.ctl_ptr = ctl_ptr;
+ m.m_lc_pm_cprof.mem_ptr = mem_ptr;
return _syscall(PM_PROC_NR, PM_CPROF, &m);
}
int sys_cprof(action, size, endpt, ctl_ptr, mem_ptr)
int action; /* get/reset profiling tables */
int size; /* size of allocated memory */
-endpoint_t endpt; /* caller endpoint */
+endpoint_t endpt; /* caller endpoint */
void *ctl_ptr; /* location of info struct */
void *mem_ptr; /* location of allocated memory */
{
message m;
- m.PROF_ACTION = action;
- m.PROF_MEM_SIZE = size;
- m.PROF_ENDPT = endpt;
- m.PROF_CTL_PTR = ctl_ptr;
- m.PROF_MEM_PTR = mem_ptr;
+ m.m_lsys_krn_sys_cprof.action = action;
+ m.m_lsys_krn_sys_cprof.mem_size = size;
+ m.m_lsys_krn_sys_cprof.endpt = endpt;
+ m.m_lsys_krn_sys_cprof.ctl_ptr = (vir_bytes)ctl_ptr;
+ m.m_lsys_krn_sys_cprof.mem_ptr = (vir_bytes)mem_ptr;
return(_kernel_call(SYS_CPROF, &m));
}
int r;
- switch(m_in.PROF_ACTION) {
+ switch(m_in.m_lc_pm_cprof.action) {
case PROF_GET:
- return sys_cprof(PROF_GET, m_in.PROF_MEM_SIZE, who_e,
- m_in.PROF_CTL_PTR, m_in.PROF_MEM_PTR);
+ return sys_cprof(PROF_GET, m_in.m_lc_pm_cprof.mem_size, who_e,
+ m_in.m_lc_pm_cprof.ctl_ptr, m_in.m_lc_pm_cprof.mem_ptr);
case PROF_RESET:
return sys_cprof(PROF_RESET,0,0,0,0);