From: Lionel Sambuc Date: Mon, 19 May 2014 11:57:19 +0000 (+0200) Subject: Message type for CDEV_SEL{1,2} X-Git-Tag: v3.3.0~195 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/dnssec-signzone.html?a=commitdiff_plain;h=0edd2b252af4fe2cc3fb940e75bbda067d5fd50a;p=minix.git Message type for CDEV_SEL{1,2} Change-Id: I4857363a62eeede2e137f3354566699b08cb235d --- diff --git a/include/minix/com.h b/include/minix/com.h index 948dca05e..24e5c9d1b 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1011,7 +1011,6 @@ /* Field names for block device messages. */ #define CDEV_MINOR m10_i1 /* minor device number */ -#define CDEV_STATUS m10_i2 /* OK, error code, minor device, operations */ #define CDEV_ACCESS m10_i2 /* access bits for open requests */ #define CDEV_GRANT m10_i2 /* grant ID of buffer */ #define CDEV_OPS m10_i2 /* requested select operations */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index ffe1d7fa7..029194ecb 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -1582,6 +1582,22 @@ typedef struct { } mess_lchardriver_vfs_reply; _ASSERT_MSG_SIZE(mess_lchardriver_vfs_reply); +typedef struct { + int status; + int32_t minor; + + uint8_t padding[48]; +} mess_lchardriver_vfs_sel1; +_ASSERT_MSG_SIZE(mess_lchardriver_vfs_sel1); + +typedef struct { + int status; + int32_t minor; + + uint8_t padding[48]; +} mess_lchardriver_vfs_sel2; +_ASSERT_MSG_SIZE(mess_lchardriver_vfs_sel2); + typedef struct { time_t atime; time_t mtime; @@ -1728,6 +1744,8 @@ typedef struct { mess_lc_vm_rusage m_lc_vm_rusage; mess_lchardriver_vfs_reply m_lchardriver_vfs_reply; + mess_lchardriver_vfs_sel1 m_lchardriver_vfs_sel1; + mess_lchardriver_vfs_sel2 m_lchardriver_vfs_sel2; mess_lexec_pm_exec_new m_lexec_pm_exec_new; diff --git a/lib/libchardriver/chardriver.c b/lib/libchardriver/chardriver.c index e07d07a8f..6b9361c3d 100644 --- a/lib/libchardriver/chardriver.c +++ b/lib/libchardriver/chardriver.c @@ -162,8 +162,8 @@ void chardriver_reply_select(endpoint_t endpt, devminor_t minor, int r) memset(&m_reply, 0, sizeof(m_reply)); m_reply.m_type = CDEV_SEL2_REPLY; - m_reply.CDEV_MINOR = minor; - m_reply.CDEV_STATUS = r; + m_reply.m_lchardriver_vfs_sel2.minor = minor; + m_reply.m_lchardriver_vfs_sel2.status = r; if ((r = asynsend3(endpt, &m_reply, AMF_NOREPLY)) != OK) printf("chardriver_reply_select: send to %d failed: %d\n", endpt, r); @@ -246,8 +246,8 @@ static void chardriver_reply(message *mess, int ipc_status, int r) case CDEV_SELECT: reply_mess.m_type = CDEV_SEL1_REPLY; - reply_mess.CDEV_MINOR = mess->CDEV_MINOR; - reply_mess.CDEV_STATUS = r; + reply_mess.m_lchardriver_vfs_sel1.minor = mess->CDEV_MINOR; + reply_mess.m_lchardriver_vfs_sel1.status = r; break; default: diff --git a/servers/vfs/device.c b/servers/vfs/device.c index d7008c4a3..99118d48e 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -772,10 +772,12 @@ void cdev_reply(void) cdev_generic_reply(&m_in); break; case CDEV_SEL1_REPLY: - select_reply1(m_in.m_source, m_in.CDEV_MINOR, m_in.CDEV_STATUS); + select_reply1(m_in.m_source, m_in.m_lchardriver_vfs_sel1.minor, + m_in.m_lchardriver_vfs_sel1.status); break; case CDEV_SEL2_REPLY: - select_reply2(m_in.m_source, m_in.CDEV_MINOR, m_in.CDEV_STATUS); + select_reply2(m_in.m_source, m_in.m_lchardriver_vfs_sel2.minor, + m_in.m_lchardriver_vfs_sel2.status); break; default: printf("VFS: char driver %u sent unknown reply %x\n", who_e, call_nr);