]> Zhao Yanbai Git Server - minix.git/commitdiff
Message type for CDEV_SELECT
authorLionel Sambuc <lionel@minix3.org>
Fri, 6 Jun 2014 12:21:20 +0000 (14:21 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:52 +0000 (17:05 +0200)
Change-Id: I74e67ef2206102fe4686efb35d1aaf42db5cd236

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

index 210975317bb69226ad3eff4da555e119e622da14..0ee25611c32bd7b26cee3e8e7511b75d13d11dcf 100644 (file)
 /* Field names for block device messages. */
 #define CDEV_MINOR     m10_i1  /* minor device number */
 #define CDEV_GRANT     m10_i2  /* grant ID of buffer */
-#define CDEV_OPS       m10_i2  /* requested select operations */
 #define CDEV_COUNT     m10_i3  /* number of bytes to transfer */
 #define CDEV_USER      m10_i3  /* endpoint of user process */
 #define CDEV_FLAGS     m10_i4  /* transfer flags */
index 350ce871ba454274519db45ad92f853dd74ddeb0..a668079ab9529b1c04cef9148a47da13355f7c6a 100644 (file)
@@ -1592,6 +1592,14 @@ typedef struct {
 } mess_vfs_lchardriver_openclose;
 _ASSERT_MSG_SIZE(mess_vfs_lchardriver_openclose);
 
+typedef struct {
+       devminor_t minor;
+       int ops;
+
+       uint8_t padding[48];
+} mess_vfs_lchardriver_select;
+_ASSERT_MSG_SIZE(mess_vfs_lchardriver_select);
+
 typedef struct {
        int status;
        uint32_t id;            /* should be cdev_id_t */
@@ -1881,6 +1889,7 @@ typedef struct {
 
                mess_vfs_lchardriver_cancel     m_vfs_lchardriver_cancel;
                mess_vfs_lchardriver_openclose  m_vfs_lchardriver_openclose;
+               mess_vfs_lchardriver_select     m_vfs_lchardriver_select;
 
                mess_vfs_utimens        m_vfs_utimens;
                mess_vm_vfs_mmap        m_vm_vfs_mmap;
index fca505c0fe8ae59d147cf943da9e48d80860372c..586a9c6569115a86e5fb4e81752b59a51badfa84 100644 (file)
@@ -260,8 +260,9 @@ static void chardriver_reply(message *mess, int ipc_status, int r)
 
   case CDEV_SELECT:
        reply_mess.m_type = CDEV_SEL1_REPLY;
-       reply_mess.m_lchardriver_vfs_sel1.minor = mess->CDEV_MINOR;
        reply_mess.m_lchardriver_vfs_sel1.status = r;
+       reply_mess.m_lchardriver_vfs_sel1.minor =
+               mess->m_vfs_lchardriver_select.minor;
        break;
 
   default:
@@ -422,8 +423,8 @@ static int do_select(struct chardriver *cdp, message *m_ptr)
        return EBADF;
 
   /* Call the select hook. */
-  minor = m_ptr->CDEV_MINOR;
-  ops = m_ptr->CDEV_OPS;
+  minor = m_ptr->m_vfs_lchardriver_select.minor;
+  ops = m_ptr->m_vfs_lchardriver_select.ops;
   endpt = m_ptr->m_source;
 
   return cdp->cdr_select(minor, ops, endpt);
@@ -582,10 +583,12 @@ int chardriver_get_minor(message *m, devminor_t *minor)
        case CDEV_CANCEL:
            *minor = m->m_vfs_lchardriver_cancel.minor;
            return OK;
+       case CDEV_SELECT:
+           *minor = m->m_vfs_lchardriver_select.minor;
+           return OK;
        case CDEV_READ:
        case CDEV_WRITE:
        case CDEV_IOCTL:
-       case CDEV_SELECT:
            *minor = m->CDEV_MINOR;
            return OK;
        default:
index 84264f2539b2944b959526c247bca1998f4b0fdf..56478944c218f24c8feab53a18f68f245300dc68 100644 (file)
@@ -545,8 +545,8 @@ int cdev_select(dev_t dev, int ops)
   memset(&dev_mess, 0, sizeof(dev_mess));
 
   dev_mess.m_type = CDEV_SELECT;
-  dev_mess.CDEV_MINOR = minor_dev;
-  dev_mess.CDEV_OPS = ops;
+  dev_mess.m_vfs_lchardriver_select.minor = minor_dev;
+  dev_mess.m_vfs_lchardriver_select.ops = ops;
 
   /* Send the request to the driver. */
   if ((r = asynsend3(dp->dmap_driver, &dev_mess, AMF_NOREPLY)) != OK)