Message type for CDEV_SEL{1,2}

Change-Id: I4857363a62eeede2e137f3354566699b08cb235d
This commit is contained in:
Lionel Sambuc 2014-05-19 13:57:19 +02:00
parent 79b594a2e9
commit 0edd2b252a
4 changed files with 26 additions and 7 deletions

View file

@ -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 */

View 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;

View 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:

View 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);