Message type for CDEV_REPLY

Change-Id: I555bf35a43c59e7d7b6180b625021b3c13bbeaa3
This commit is contained in:
Lionel Sambuc 2014-05-19 13:14:24 +02:00
parent 4091fdf5c4
commit 79b594a2e9
4 changed files with 21 additions and 11 deletions

View file

@ -1574,6 +1574,14 @@ typedef struct {
} mess_vfs_fs_utime;
_ASSERT_MSG_SIZE(mess_vfs_fs_utime);
typedef struct {
int status;
uint32_t id; /* should be cdev_id_t */
uint8_t padding[48];
} mess_lchardriver_vfs_reply;
_ASSERT_MSG_SIZE(mess_lchardriver_vfs_reply);
typedef struct {
time_t atime;
time_t mtime;
@ -1719,6 +1727,8 @@ typedef struct {
mess_lc_vm_rusage m_lc_vm_rusage;
mess_lchardriver_vfs_reply m_lchardriver_vfs_reply;
mess_lexec_pm_exec_new m_lexec_pm_exec_new;
mess_li2cdriver_i2c_busc_i2c_exec m_li2cdriver_i2c_busc_i2c_exec;

View file

@ -369,8 +369,8 @@ static void do_char_open(message *m_ptr, int ipc_status)
memset(&m_reply, 0, sizeof(m_reply));
m_reply.m_type = CDEV_REPLY;
m_reply.CDEV_STATUS = ENXIO;
m_reply.CDEV_ID = m_ptr->CDEV_ID;
m_reply.m_lchardriver_vfs_reply.status = ENXIO;
m_reply.m_lchardriver_vfs_reply.id = m_ptr->CDEV_ID;
send_reply(m_ptr->m_source, &m_reply, ipc_status);
}

View file

@ -138,8 +138,8 @@ void chardriver_reply_task(endpoint_t endpt, cdev_id_t id, int r)
memset(&m_reply, 0, sizeof(m_reply));
m_reply.m_type = CDEV_REPLY;
m_reply.CDEV_STATUS = r;
m_reply.CDEV_ID = id;
m_reply.m_lchardriver_vfs_reply.status = r;
m_reply.m_lchardriver_vfs_reply.id = id;
if ((r = asynsend3(endpt, &m_reply, AMF_NOREPLY)) != OK)
printf("chardriver_reply_task: send to %d failed: %d\n", endpt, r);
@ -240,8 +240,8 @@ static void chardriver_reply(message *mess, int ipc_status, int r)
case CDEV_IOCTL:
case CDEV_CANCEL: /* For cancel, this is a reply to the original request! */
reply_mess.m_type = CDEV_REPLY;
reply_mess.CDEV_STATUS = r;
reply_mess.CDEV_ID = mess->CDEV_ID;
reply_mess.m_lchardriver_vfs_reply.status = r;
reply_mess.m_lchardriver_vfs_reply.id = mess->CDEV_ID;
break;
case CDEV_SELECT:

View file

@ -428,7 +428,7 @@ static int cdev_opcl(
self->w_drv_sendrec = NULL;
/* Process the reply. */
r = dev_mess.CDEV_STATUS;
r = dev_mess.m_lchardriver_vfs_reply.status;
if (op == CDEV_OPEN && r >= 0) {
/* Some devices need special processing upon open. Such a device is
@ -595,7 +595,7 @@ int cdev_cancel(dev_t dev)
fp->fp_grant = GRANT_INVALID;
}
r = dev_mess.CDEV_STATUS;
r = dev_mess.m_lchardriver_vfs_reply.status;
return (r == EAGAIN) ? EINTR : r;
}
@ -726,9 +726,9 @@ static void cdev_generic_reply(message *m_ptr)
endpoint_t proc_e;
int slot;
proc_e = m_ptr->CDEV_ID;
proc_e = m_ptr->m_lchardriver_vfs_reply.id;
if (m_ptr->CDEV_STATUS == SUSPEND) {
if (m_ptr->m_lchardriver_vfs_reply.status == SUSPEND) {
printf("VFS: got SUSPEND from %d, not reviving\n", m_ptr->m_source);
return;
}
@ -750,7 +750,7 @@ static void cdev_generic_reply(message *m_ptr)
*/
printf("VFS: proc %d not blocked on %d\n", proc_e, m_ptr->m_source);
} else {
revive(proc_e, m_ptr->CDEV_STATUS);
revive(proc_e, m_ptr->m_lchardriver_vfs_reply.status);
}
}