From 948a5389f9c4cfeef8796f7fce03180f346094c2 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 19 May 2014 11:25:52 +0200 Subject: [PATCH] Message type for SVRCTL Change-Id: Ibdb9edb9878e06cf2a641ffc3975f878a6e41dfb --- include/minix/com.h | 4 ---- include/minix/ipc.h | 10 ++++++++++ lib/libc/sys-minix/svrctl.c | 4 ++-- servers/pm/misc.c | 4 ++-- servers/vfs/misc.c | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index 444db2677..9e8b37b25 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1235,10 +1235,6 @@ #define SI_WHERE m1_p1 /* void */ #define SI_SIZE m1_i2 /* size_t */ -/* Field names for the svrctl(2) call. */ -#define SVRCTL_REQ m2_i1 /* int */ -#define SVRCTL_ARG m2_p1 /* void * */ - /*===========================================================================* * Internal codes used by several services * *===========================================================================*/ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 21cea5168..2e8311be4 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -769,6 +769,14 @@ typedef struct { } mess_lsys_sched_scheduling_stop; _ASSERT_MSG_SIZE(mess_lsys_sched_scheduling_stop); +typedef struct { + int request; + vir_bytes arg; + + uint8_t padding[48]; +} mess_lsys_svrctl; +_ASSERT_MSG_SIZE(mess_lsys_svrctl); + typedef struct { endpoint_t endpt; cp_grant_id_t grant; @@ -1368,6 +1376,8 @@ typedef struct { mess_lsys_sched_scheduling_start m_lsys_sched_scheduling_start; mess_lsys_sched_scheduling_stop m_lsys_sched_scheduling_stop; + mess_lsys_svrctl m_lsys_svrctl; + mess_lsys_vfs_checkperms m_lsys_vfs_checkperms; mess_lsys_vfs_copyfd m_lsys_vfs_copyfd; mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver; diff --git a/lib/libc/sys-minix/svrctl.c b/lib/libc/sys-minix/svrctl.c index c691ce2dd..b93af6cea 100644 --- a/lib/libc/sys-minix/svrctl.c +++ b/lib/libc/sys-minix/svrctl.c @@ -11,8 +11,8 @@ int svrctl(int request, void *argp) message m; memset(&m, 0, sizeof(m)); - m.SVRCTL_REQ = request; - m.SVRCTL_ARG = argp; + m.m_lsys_svrctl.request = request; + m.m_lsys_svrctl.arg = argp; switch ((request >> 8) & 0xFF) { case 'M': diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 63de747fb..f7781d791 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -305,8 +305,8 @@ int do_svrctl() } local_param_overrides[MAX_LOCAL_PARAMS]; static int local_params = 0; - req = m_in.SVRCTL_REQ; - ptr = (vir_bytes) m_in.SVRCTL_ARG; + req = m_in.m_lsys_svrctl.request; + ptr = m_in.m_lsys_svrctl.arg; /* Is the request indeed for the PM? */ if (((req >> 8) & 0xFF) != 'M') return(EINVAL); diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index 69dae6507..e35dc323c 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -779,8 +779,8 @@ int do_svrctl(void) unsigned int svrctl; vir_bytes ptr; - svrctl = job_m_in.SVRCTL_REQ; - ptr = (vir_bytes) job_m_in.SVRCTL_ARG; + svrctl = job_m_in.m_lsys_svrctl.request; + ptr = job_m_in.m_lsys_svrctl.arg; if (((svrctl >> 8) & 0xFF) != 'M') return(EINVAL); switch (svrctl) {