Message type for PM_GETPROCNR

Change-Id: I4fcd682f78255afc1fdc0160fb6f1a3d2fe05d2e
This commit is contained in:
Lionel Sambuc 2014-05-12 18:54:52 +02:00
parent 7031438f58
commit a1c31f335c
4 changed files with 22 additions and 8 deletions

View file

@ -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 */

View file

@ -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;

View file

@ -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;
}

View file

@ -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);
}