From a1c31f335ceab33258e51380d36af07353b97602 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 12 May 2014 18:54:52 +0200 Subject: [PATCH] Message type for PM_GETPROCNR Change-Id: I4fcd682f78255afc1fdc0160fb6f1a3d2fe05d2e --- include/minix/callnr.h | 4 ---- include/minix/ipc.h | 18 ++++++++++++++++++ lib/libsys/getprocnr.c | 4 ++-- servers/pm/misc.c | 4 ++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 2356075f7..997b36816 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -61,10 +61,6 @@ #define NR_PM_CALLS 48 /* highest number from base plus one */ -/* Field names for the getprocnr(2) call. */ -#define PM_GETPROCNR_PID m1_i1 /* pid_t */ -#define PM_GETPROCNR_ENDPT m1_i1 /* endpoint_t */ - /* Field names for the getepinfo(2) call. */ #define PM_GETEPINFO_ENDPT m1_i1 /* endpoint_t */ #define PM_GETEPINFO_UID m1_i1 /* uid_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 927091b27..c9dc5f464 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -380,6 +380,20 @@ typedef struct { } mess_lc_vfs_umount; _ASSERT_MSG_SIZE(mess_lc_vfs_umount); +typedef struct { + pid_t pid; + + uint8_t padding[52]; +} mess_lsys_pm_getprocnr; +_ASSERT_MSG_SIZE(mess_lsys_pm_getprocnr); + +typedef struct { + endpoint_t endpt; + + uint8_t padding[52]; +} mess_pm_lsys_getprocnr; +_ASSERT_MSG_SIZE(mess_pm_lsys_getprocnr); + typedef struct { endpoint_t endpt; cp_grant_id_t grant; @@ -883,10 +897,14 @@ typedef struct { mess_lc_vfs_umask m_lc_vfs_umask; mess_lc_vfs_umount m_lc_vfs_umount; + mess_lsys_pm_getprocnr m_lsys_pm_getprocnr; + mess_lsys_vfs_checkperms m_lsys_vfs_checkperms; mess_lsys_vfs_copyfd m_lsys_vfs_copyfd; mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver; + mess_pm_lsys_getprocnr m_pm_lsys_getprocnr; + mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; mess_vfs_fs_chmod m_vfs_fs_chmod; mess_vfs_fs_chown m_vfs_fs_chown; diff --git a/lib/libsys/getprocnr.c b/lib/libsys/getprocnr.c index 2750aed30..ddaa52f37 100644 --- a/lib/libsys/getprocnr.c +++ b/lib/libsys/getprocnr.c @@ -9,11 +9,11 @@ getprocnr(pid_t pid, endpoint_t *proc_e) int r; memset(&m, 0, sizeof(m)); - m.PM_GETPROCNR_PID = pid; + m.m_lsys_pm_getprocnr.pid = pid; if ((r = _taskcall(PM_PROC_NR, PM_GETPROCNR, &m)) < 0) return r; - *proc_e = m.PM_GETPROCNR_ENDPT; + *proc_e = m.m_pm_lsys_getprocnr.endpt; return r; } diff --git a/servers/pm/misc.c b/servers/pm/misc.c index fcdda46a2..12d80ee0a 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -175,10 +175,10 @@ int do_getprocnr(void) return EPERM; } - if ((rmp = find_proc(m_in.PM_GETPROCNR_PID)) == NULL) + if ((rmp = find_proc(m_in.m_lsys_pm_getprocnr.pid)) == NULL) return(ESRCH); - mp->mp_reply.PM_GETPROCNR_ENDPT = rmp->mp_endpoint; + mp->mp_reply.m_pm_lsys_getprocnr.endpt = rmp->mp_endpoint; return(OK); } -- 2.44.0