From 8644f25feb60605bf4469e138f47c03dcf4ced39 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Fri, 25 Jul 2014 19:53:10 +0200 Subject: [PATCH] Message type for SYS_PROFBUF. Change-Id: I10c1e878b0e3ff9bfc52709cc87dace632fa3e4f --- include/minix/com.h | 4 ---- include/minix/ipc.h | 9 +++++++++ kernel/system/do_profbuf.c | 9 ++++----- lib/libsys/sys_profbuf.c | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index 513880e9e..e4d9da24f 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -362,10 +362,6 @@ #define SMS_BYTES m2_l2 /* bytes from offset */ #define SMS_PATTERN m2_i2 /* memset() pattern */ -/* Field names for SYS_SPROF, _CPROF, _PROFBUF. */ -#define PROF_CTL_PTR m7_p1 /* location of info struct */ -#define PROF_MEM_PTR m7_p2 /* location of profiling data */ - /* Field names for SYS_VMCTL. */ #define SVMCTL_WHO m1_i1 #define SVMCTL_PARAM m1_i2 /* All SYS_VMCTL requests. */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 6a8240588..4de52c274 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -146,6 +146,14 @@ typedef struct { } mess_lc_pm_cprof; _ASSERT_MSG_SIZE(mess_lc_pm_cprof); +typedef struct { + vir_bytes ctl_ptr; + vir_bytes mem_ptr; + + uint8_t padding[48]; +} mess_lsys_krn_sys_profbuf; +_ASSERT_MSG_SIZE(mess_lsys_krn_sys_profbuf); + typedef struct { endpoint_t endpt; int action; @@ -2028,6 +2036,7 @@ typedef struct { 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_profbuf m_lsys_krn_sys_profbuf; 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; diff --git a/kernel/system/do_profbuf.c b/kernel/system/do_profbuf.c index e82f500f6..13fa798b7 100644 --- a/kernel/system/do_profbuf.c +++ b/kernel/system/do_profbuf.c @@ -2,8 +2,8 @@ * m_type: SYS_PROFBUF * * The parameters for this kernel call are: - * m7_p1: PROF_CTL_PTR (location of control struct) - * m7_p2: PROF_MEM_PTR (location of profiling table) + * m_lsys_krn_sys_profbuf.ctl_ptr (location of control struct) + * m_lsys_krn_sys_profbuf.mem_ptr (location of profiling table) * * Changes: * 14 Aug, 2006 Created (Rogier Meurs) @@ -39,8 +39,8 @@ int do_profbuf(struct proc * caller, message * m_ptr) cprof_proc_info[cprof_procs_no].endpt = caller->p_endpoint; cprof_proc_info[cprof_procs_no].name = rp->p_name; - cprof_proc_info[cprof_procs_no].ctl_v = (vir_bytes) m_ptr->PROF_CTL_PTR; - cprof_proc_info[cprof_procs_no].buf_v = (vir_bytes) m_ptr->PROF_MEM_PTR; + cprof_proc_info[cprof_procs_no].ctl_v = m_ptr->m_lsys_krn_sys_profbuf.ctl_ptr; + cprof_proc_info[cprof_procs_no].buf_v = m_ptr->m_lsys_krn_sys_profbuf.mem_ptr; cprof_procs_no++; @@ -48,4 +48,3 @@ int do_profbuf(struct proc * caller, message * m_ptr) } #endif /* CPROFILE */ - diff --git a/lib/libsys/sys_profbuf.c b/lib/libsys/sys_profbuf.c index 834226722..a331684b7 100644 --- a/lib/libsys/sys_profbuf.c +++ b/lib/libsys/sys_profbuf.c @@ -9,8 +9,8 @@ void *mem_ptr; /* pointer to profiling table */ { message m; - m.PROF_CTL_PTR = ctl_ptr; - m.PROF_MEM_PTR = mem_ptr; + m.m_lsys_krn_sys_profbuf.ctl_ptr = (vir_bytes)ctl_ptr; + m.m_lsys_krn_sys_profbuf.mem_ptr = (vir_bytes)mem_ptr; return(_kernel_call(SYS_PROFBUF, &m)); } -- 2.44.0