From: Lionel Sambuc Date: Mon, 19 May 2014 11:14:24 +0000 (+0200) Subject: Message type for CDEV_REPLY X-Git-Tag: v3.3.0~196 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=79b594a2e97c61fa66b2d01eb544da9539cbcc9d;p=minix.git Message type for CDEV_REPLY Change-Id: I555bf35a43c59e7d7b6180b625021b3c13bbeaa3 --- diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 99c988a35..ffe1d7fa7 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -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; diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index 1c3d5fade..42bca46aa 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -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); } diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index a8de1ad40..e07d07a8f 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -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: diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 7e6095a4d..d7008c4a3 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -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); } }