From 6082b2b4de353c35c8a3245768f766738bfd195a Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 28 Jul 2014 10:44:15 +0200 Subject: [PATCH] Message type for COMMON_REQ_GCOV_DATA. Change-Id: I97d31059990e33411a685d5d8191c728a02e7d0f --- include/minix/com.h | 4 ---- include/minix/ipc.h | 11 +++++++++++ lib/libc/sys-minix/gcov_flush.c | 6 +++--- lib/libsys/gcov.c | 3 ++- servers/vfs/gcov.c | 10 +++++----- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index 7736a62b2..9b5d22b24 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -577,10 +577,6 @@ /* Common request to all processes: gcov data. */ #define COMMON_REQ_GCOV_DATA (COMMON_RQ_BASE+1) -# define GCOV_GRANT m1_i2 -# define GCOV_PID m1_i3 -# define GCOV_BUFF_P m1_p1 -# define GCOV_BUFF_SZ m1_i1 /* Common fault injection ctl request to all processes. */ #define COMMON_REQ_FI_CTL (COMMON_RQ_BASE+2) diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 62780da73..c6460911d 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -101,6 +101,16 @@ typedef struct { } mess_lsys_krn_readbios; _ASSERT_MSG_SIZE(mess_lsys_krn_readbios); +typedef struct { + cp_grant_id_t grant; + int pid; + vir_bytes buff_p; + size_t buff_sz; + + uint8_t padding[40]; +} mess_lc_vfs_gcov; +_ASSERT_MSG_SIZE(mess_lc_vfs_gcov); + typedef struct { off_t pos; @@ -2036,6 +2046,7 @@ typedef struct { mess_lblockdriver_lbdev_reply m_lblockdriver_lbdev_reply; mess_lc_pm_cprof m_lc_pm_cprof; mess_lc_pm_sprof m_lc_pm_sprof; + mess_lc_vfs_gcov m_lc_vfs_gcov; 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; diff --git a/lib/libc/sys-minix/gcov_flush.c b/lib/libc/sys-minix/gcov_flush.c index 2f9058a9b..2382d6b0a 100644 --- a/lib/libc/sys-minix/gcov_flush.c +++ b/lib/libc/sys-minix/gcov_flush.c @@ -7,9 +7,9 @@ int gcov_flush_svr(char *buff, int buff_sz, int server_nr) message m; memset(&m, 0, sizeof(m)); - m.GCOV_BUFF_P = buff; - m.GCOV_BUFF_SZ = buff_sz; - m.GCOV_PID = server_nr; + m.m_lc_vfs_gcov.buff_p = buff; + m.m_lc_vfs_gcov.buff_sz = buff_sz; + m.m_lc_vfs_gcov.pid = server_nr; /* Make the call to server. It will call the gcov library, * buffer the stdio requests, and copy the buffer to this user diff --git a/lib/libsys/gcov.c b/lib/libsys/gcov.c index 1e2d71b6d..8f1706828 100644 --- a/lib/libsys/gcov.c +++ b/lib/libsys/gcov.c @@ -154,7 +154,8 @@ int do_gcov_flush_impl(message *msg) assert(msg->m_type == COMMON_REQ_GCOV_DATA); assert(msg->m_source == VFS_PROC_NR); - replymsg.m_type = gcov_flush(msg->GCOV_GRANT, msg->GCOV_BUFF_SZ); + replymsg.m_type = gcov_flush(msg->m_lc_vfs_gcov.grant, + msg->m_lc_vfs_gcov.buff_sz); return ipc_send(msg->m_source, &replymsg); } diff --git a/servers/vfs/gcov.c b/servers/vfs/gcov.c index 642fe558a..7d1c1e7ab 100644 --- a/servers/vfs/gcov.c +++ b/servers/vfs/gcov.c @@ -23,9 +23,9 @@ int do_gcov_flush() message m; vir_bytes buf; - size = job_m_in.GCOV_BUFF_SZ; - target = job_m_in.GCOV_PID; - buf = (vir_bytes) job_m_in.GCOV_BUFF_P; + size = job_m_in.m_lc_vfs_gcov.buff_sz; + target = job_m_in.m_lc_vfs_gcov.pid; + buf = job_m_in.m_lc_vfs_gcov.buff_p; /* If the wrong process is sent to, the system hangs; so make this root-only. */ @@ -55,8 +55,8 @@ int do_gcov_flush() r = gcov_flush(grantid, size); } else { /* Perform generic GCOV request. */ - m.GCOV_GRANT = grantid; - m.GCOV_BUFF_SZ = size; + m.m_lc_vfs_gcov.grant = grantid; + m.m_lc_vfs_gcov.buff_sz = size; r = _taskcall(rfp->fp_endpoint, COMMON_REQ_GCOV_DATA, &m); } -- 2.44.0