]> Zhao Yanbai Git Server - minix.git/commitdiff
Message type for CDEV_SEL{1,2}
authorLionel Sambuc <lionel@minix3.org>
Mon, 19 May 2014 11:57:19 +0000 (13:57 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:52 +0000 (17:05 +0200)
Change-Id: I4857363a62eeede2e137f3354566699b08cb235d

include/minix/com.h
include/minix/ipc.h
lib/libchardriver/chardriver.c
servers/vfs/device.c

index 948dca05e361f40d32150f305a00d3cfbe224bd7..24e5c9d1b9ce14fa4cdd294c52c4d437beb839ba 100644 (file)
 
 /* 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 */
index ffe1d7fa7df899b906e88f712000cad2fb70f60f..029194ecb332703af7dc738ca556370db4bd9ed1 100644 (file)
@@ -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;
 
index e07d07a8f84135f60386bcfe768fd49a434aa452..6b9361c3d5a8c896a398133a2ed9744656779a7d 100644 (file)
@@ -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:
index d7008c4a395c849bf1e5b4e2956c109178e52ff0..99118d48e5046139554bab5c221cd059d2ba9e96 100644 (file)
@@ -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);