Message type for SYS_SETGRANT

Change-Id: I542f839d7992d3348fef19c51bfcb58bb408d9f4
This commit is contained in:
Lionel Sambuc 2014-05-23 12:53:48 +02:00
parent dd2552d6d4
commit f06c676a47
4 changed files with 15 additions and 10 deletions

View file

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

View file

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

View file

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

View file

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