From: Lionel Sambuc Date: Fri, 23 May 2014 10:53:48 +0000 (+0200) Subject: Message type for SYS_SETGRANT X-Git-Tag: v3.3.0~214 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.host.html?a=commitdiff_plain;h=f06c676a479c64f14843c0d0eccbbe3e5aa538ef;p=minix.git Message type for SYS_SETGRANT Change-Id: I542f839d7992d3348fef19c51bfcb58bb408d9f4 --- diff --git a/include/minix/com.h b/include/minix/com.h index b3d127e56..d11fbd135 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -351,10 +351,6 @@ #define SYS_PRIV_UPDATE_SYS 9 /* Update a sys privilege structure. */ #define SYS_PRIV_YIELD 10 /* Allow process to run and suspend */ -/* Field names for SYS_SETGRANT */ -#define SG_ADDR m2_p1 /* address */ -#define SG_SIZE m2_i2 /* no. of entries */ - /* Field names for SYS_FORK, _EXEC, _EXIT, GETMCONTEXT, SETMCONTEXT.*/ #define PR_ENDPT m1_i1 /* indicates a process */ #define PR_PRIORITY m1_i2 /* process priority */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 7c5cc8d41..e056658ec 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -795,6 +795,14 @@ typedef struct { } mess_lsys_krn_sys_setalarm; _ASSERT_MSG_SIZE(mess_lsys_krn_sys_setalarm); +typedef struct { + vir_bytes addr; /* cp_grant_t * */ + int size; + + uint8_t padding[48]; +} mess_lsys_krn_sys_setgrant; +_ASSERT_MSG_SIZE(mess_lsys_krn_sys_setgrant); + typedef struct { int request; @@ -1649,6 +1657,7 @@ typedef struct { mess_lsys_krn_sys_privctl m_lsys_krn_sys_privctl; mess_lsys_krn_sys_sdevio m_lsys_krn_sys_sdevio; mess_lsys_krn_sys_setalarm m_lsys_krn_sys_setalarm; + mess_lsys_krn_sys_setgrant m_lsys_krn_sys_setgrant; mess_lsys_krn_sys_statectl m_lsys_krn_sys_statectl; mess_lsys_krn_sys_stime m_lsys_krn_sys_stime; mess_lsys_krn_sys_settime m_lsys_krn_sys_settime; diff --git a/kernel/system/do_setgrant.c b/kernel/system/do_setgrant.c index 11992fa9e..c93247548 100644 --- a/kernel/system/do_setgrant.c +++ b/kernel/system/do_setgrant.c @@ -2,8 +2,8 @@ * m_type: SYS_SETGRANT * * The parameters for this kernel call are: - * SG_ADDR address of grant table in own address space - * SG_SIZE number of entries + * m_lsys_krn_sys_setgrant.addr address of grant table in own address space + * m_lsys_krn_sys_setgrant.size number of entries */ #include "kernel/system.h" @@ -21,8 +21,8 @@ int do_setgrant(struct proc * caller, message * m_ptr) r = EPERM; } else { _K_SET_GRANT_TABLE(caller, - (vir_bytes) m_ptr->SG_ADDR, - m_ptr->SG_SIZE); + m_ptr->m_lsys_krn_sys_setgrant.addr, + m_ptr->m_lsys_krn_sys_setgrant.size); r = OK; } diff --git a/lib/libsys/sys_setgrant.c b/lib/libsys/sys_setgrant.c index 39d719690..f09df89bd 100644 --- a/lib/libsys/sys_setgrant.c +++ b/lib/libsys/sys_setgrant.c @@ -7,8 +7,8 @@ int sys_setgrant(cp_grant_t *grants, int ngrants) { message m; - m.SG_ADDR = (char *) grants; - m.SG_SIZE = ngrants; + m.m_lsys_krn_sys_setgrant.addr = (vir_bytes)grants; + m.m_lsys_krn_sys_setgrant.size = ngrants; return _kernel_call(SYS_SETGRANT, &m); }