/* Open Device - required for drivers using libblockdriver */
memset(&m, '\0', sizeof(message));
m.m_type = BDEV_OPEN;
- m.BDEV_ACCESS = BDEV_R_BIT;
- m.BDEV_ID = 0;
- m.BDEV_MINOR = 0;
+ m.m_lbdev_lblockdriver_msg.access = BDEV_R_BIT;
+ m.m_lbdev_lblockdriver_msg.id = 0;
+ m.m_lbdev_lblockdriver_msg.minor = 0;
r = ipc_sendrec(driver_endpt, &m);
if (r != OK) {
/* Perform the read */
memset(&m, '\0', sizeof(message));
m.m_type = BDEV_READ;
- m.BDEV_MINOR = 0;
- m.BDEV_COUNT = bufsize;
- m.BDEV_GRANT = grant_nr;
- m.BDEV_FLAGS = BDEV_NOPAGE; /* the EEPROMs used for EDID are pageless */
- m.BDEV_ID = 0;
- m.BDEV_POS = 0;
+ m.m_lbdev_lblockdriver_msg.minor = 0;
+ m.m_lbdev_lblockdriver_msg.count = bufsize;
+ m.m_lbdev_lblockdriver_msg.grant = grant_nr;
+ m.m_lbdev_lblockdriver_msg.flags = BDEV_NOPAGE; /* the EEPROMs used for EDID are pageless */
+ m.m_lbdev_lblockdriver_msg.id = 0;
+ m.m_lbdev_lblockdriver_msg.pos = 0;
r = ipc_sendrec(driver_endpt, &m);
cpf_revoke(grant_nr);
/* Clean-up: try to close the device */
memset(&m, '\0', sizeof(message));
m.m_type = BDEV_CLOSE;
- m.BDEV_MINOR = 0;
- m.BDEV_ID = 0;
+ m.m_lbdev_lblockdriver_msg.minor = 0;
+ m.m_lbdev_lblockdriver_msg.id = 0;
ipc_sendrec(driver_endpt, &m);
return r;
}
/* Close the device */
memset(&m, '\0', sizeof(message));
m.m_type = BDEV_CLOSE;
- m.BDEV_MINOR = 0;
- m.BDEV_ID = 0;
+ m.m_lbdev_lblockdriver_msg.minor = 0;
+ m.m_lbdev_lblockdriver_msg.id = 0;
r = ipc_sendrec(driver_endpt, &m);
if (r != OK) {
log_debug(&log, "ipc_sendrec(BDEV_CLOSE) failed (r=%d)\n", r);
/* We simply forward this request to the real driver. */
memset(&m, 0, sizeof(m));
m.m_type = BDEV_OPEN;
- m.BDEV_MINOR = driver_minor;
- m.BDEV_ACCESS = access;
- m.BDEV_ID = 0;
+ m.m_lbdev_lblockdriver_msg.minor = driver_minor;
+ m.m_lbdev_lblockdriver_msg.access = access;
+ m.m_lbdev_lblockdriver_msg.id = 0;
if ((r = ipc_sendrec(driver_endpt, &m)) != OK)
panic("ipc_sendrec to driver failed (%d)\n", r);
/* We simply forward this request to the real driver. */
memset(&m, 0, sizeof(m));
m.m_type = BDEV_CLOSE;
- m.BDEV_MINOR = driver_minor;
- m.BDEV_ID = 0;
+ m.m_lbdev_lblockdriver_msg.minor = driver_minor;
+ m.m_lbdev_lblockdriver_msg.id = 0;
if ((r = ipc_sendrec(driver_endpt, &m)) != OK)
panic("ipc_sendrec to driver failed (%d)\n", r);
memset(&m, 0, sizeof(m));
m.m_type = BDEV_IOCTL;
- m.BDEV_MINOR = driver_minor;
- m.BDEV_REQUEST = request;
- m.BDEV_GRANT = gid;
- m.BDEV_USER = NONE;
- m.BDEV_ID = 0;
+ m.m_lbdev_lblockdriver_msg.minor = driver_minor;
+ m.m_lbdev_lblockdriver_msg.request = request;
+ m.m_lbdev_lblockdriver_msg.grant = gid;
+ m.m_lbdev_lblockdriver_msg.user = NONE;
+ m.m_lbdev_lblockdriver_msg.id = 0;
if ((r = ipc_sendrec(driver_endpt, &m)) != OK)
panic("ipc_sendrec to driver failed (%d)\n", r);
assert(grant != GRANT_INVALID);
m.m_type = do_write ? BDEV_SCATTER : BDEV_GATHER;
- m.BDEV_MINOR = driver_minor;
- m.BDEV_COUNT = count;
- m.BDEV_GRANT = grant;
- m.BDEV_FLAGS = flags;
- m.BDEV_ID = 0;
- m.BDEV_POS = position;
+ m.m_lbdev_lblockdriver_msg.minor = driver_minor;
+ m.m_lbdev_lblockdriver_msg.count = count;
+ m.m_lbdev_lblockdriver_msg.grant = grant;
+ m.m_lbdev_lblockdriver_msg.flags = flags;
+ m.m_lbdev_lblockdriver_msg.id = 0;
+ m.m_lbdev_lblockdriver_msg.pos = position;
if ((r = ipc_sendrec(driver_endpt, &m)) != OK)
panic("ipc_sendrec to driver failed (%d)\n", r);
assert(grant != GRANT_INVALID);
m.m_type = do_write ? BDEV_SCATTER : BDEV_GATHER;
- m.BDEV_MINOR = driver_minor;
- m.BDEV_COUNT = count;
- m.BDEV_GRANT = grant;
- m.BDEV_FLAGS = flags;
- m.BDEV_ID = 0;
- m.BDEV_POS = position;
+ m.m_lbdev_lblockdriver_msg.minor = driver_minor;
+ m.m_lbdev_lblockdriver_msg.count = count;
+ m.m_lbdev_lblockdriver_msg.grant = grant;
+ m.m_lbdev_lblockdriver_msg.flags = flags;
+ m.m_lbdev_lblockdriver_msg.id = 0;
+ m.m_lbdev_lblockdriver_msg.pos = position;
if ((r = ipc_sendrec(driver_endpt, &m)) != OK)
panic("ipc_sendrec to driver failed (%d)\n", r);
memset(&msg, 0, sizeof(msg));
msg.m_type = BDEV_OPEN;
- msg.BDEV_MINOR = driver[which].minor;
- msg.BDEV_ACCESS = BDEV_R_BIT | BDEV_W_BIT;
- msg.BDEV_ID = 0;
+ msg.m_lbdev_lblockdriver_msg.minor = driver[which].minor;
+ msg.m_lbdev_lblockdriver_msg.access = BDEV_R_BIT | BDEV_W_BIT;
+ msg.m_lbdev_lblockdriver_msg.id = 0;
r = ipc_sendrec(driver[which].endpt, &msg);
if (r != OK) {
memset(&msg, 0, sizeof(msg));
msg.m_type = BDEV_IOCTL;
- msg.BDEV_MINOR = driver[which].minor;
- msg.BDEV_REQUEST = DIOCGETP;
- msg.BDEV_GRANT = gid;
- msg.BDEV_USER = NONE;
- msg.BDEV_ID = 0;
+ msg.m_lbdev_lblockdriver_msg.minor = driver[which].minor;
+ msg.m_lbdev_lblockdriver_msg.request = DIOCGETP;
+ msg.m_lbdev_lblockdriver_msg.grant = gid;
+ msg.m_lbdev_lblockdriver_msg.user = NONE;
+ msg.m_lbdev_lblockdriver_msg.id = 0;
r = ipc_sendrec(driver[which].endpt, &msg);
memset(&msg, 0, sizeof(msg));
msg.m_type = BDEV_CLOSE;
- msg.BDEV_MINOR = driver[which].minor;
- msg.BDEV_ID = 0;
+ msg.m_lbdev_lblockdriver_msg.minor = driver[which].minor;
+ msg.m_lbdev_lblockdriver_msg.id = 0;
r = ipc_sendrec(driver[which].endpt, &msg);
if (r != OK) {
asynmsg_t *amp;
/* Fill in the last bits of the message. */
- mess->BDEV_MINOR = driver[which].minor;
- mess->BDEV_ID = 0;
+ mess->m_lbdev_lblockdriver_msg.minor = driver[which].minor;
+ mess->m_lbdev_lblockdriver_msg.id = 0;
/* Send the message asynchronously. */
amp = &amsgtable[which];
#if DEBUG2
printf("paired_sendrec(%d) - <%d,%llx,%d> - %x,%x\n",
- both, m1->m_type, m1->BDEV_POS,
- m1->BDEV_COUNT, m1->BDEV_GRANT, m2->BDEV_GRANT);
+ both, m1->m_type, m1->m_lbdev_lblockdriver_msg.pos,
+ m1->m_lbdev_lblockdriver_msg.count, m1->m_lbdev_lblockdriver_msg.grant, m2->m_lbdev_lblockdriver_msg.grant);
#endif
if (both)
memset(&m1, 0, sizeof(m1));
m1.m_type = (request == FLT_WRITE) ? BDEV_SCATTER : BDEV_GATHER;
- m1.BDEV_COUNT = count;
- m1.BDEV_POS = pos;
+ m1.m_lbdev_lblockdriver_msg.count = count;
+ m1.m_lbdev_lblockdriver_msg.pos = pos;
m2 = m1;
- m1.BDEV_GRANT = gids[0];
- m2.BDEV_GRANT = gids[1];
+ m1.m_lbdev_lblockdriver_msg.grant = gids[0];
+ m2.m_lbdev_lblockdriver_msg.grant = gids[1];
r = paired_sendrec(&m1, &m2, both);
/* Message types for block device responses. */
#define BDEV_REPLY (BDEV_RS_BASE + 0) /* general reply code */
-/* Field names for block device messages. */
-#define BDEV_MINOR m10_i1 /* minor device number */
-#define BDEV_ACCESS m10_i2 /* access bits for open requests */
-#define BDEV_COUNT m10_i2 /* number of bytes or elements in transfer */
-#define BDEV_GRANT m10_i3 /* grant ID of buffer or vector */
-#define BDEV_FLAGS m10_i4 /* transfer flags */
-#define BDEV_USER m10_i4 /* user endpoint requesting I/O control */
-#define BDEV_ID m10_l1 /* opaque request ID */
-#define BDEV_REQUEST m10_l2 /* I/O control request */
-#define BDEV_POS m10_ull1 /* transfer position */
-
/* Bits in 'BDEV_ACCESS' field of block device open requests. */
# define BDEV_R_BIT 0x01 /* open with read access */
# define BDEV_W_BIT 0x02 /* open with write access */
} mess_lsys_krn_readbios;
_ASSERT_MSG_SIZE(mess_lsys_krn_readbios);
+typedef struct {
+ off_t pos;
+
+ int minor;
+ int id;
+ int access;
+
+ int count;
+ cp_grant_id_t grant;
+ int flags;
+
+ endpoint_t user;
+ int request;
+
+ uint8_t padding[16];
+} mess_lbdev_lblockdriver_msg;
+_ASSERT_MSG_SIZE(mess_lbdev_lblockdriver_msg);
+
typedef struct {
int status;
int id;
mess_notify m_notify;
mess_sigcalls m_sigcalls;
+ mess_lbdev_lblockdriver_msg m_lbdev_lblockdriver_msg;
mess_lblockdriver_lbdev_reply m_lblockdriver_lbdev_reply;
mess_lc_pm_cprof m_lc_pm_cprof;
mess_lc_pm_sprof m_lc_pm_sprof;
do {
memset(&m, 0, sizeof(m));
m.m_type = req;
- m.BDEV_MINOR = minor(dev);
- m.BDEV_ACCESS = access;
+ m.m_lbdev_lblockdriver_msg.minor = minor(dev);
+ m.m_lbdev_lblockdriver_msg.access = access;
r = bdev_sendrec(dev, &m);
} while (bdev_retry(&driver_tries, NULL, &r));
memset(m, 0, sizeof(*m));
m->m_type = req;
- m->BDEV_MINOR = minor(dev);
- m->BDEV_POS = pos;
- m->BDEV_COUNT = count;
- m->BDEV_GRANT = grant;
- m->BDEV_FLAGS = flags;
+ m->m_lbdev_lblockdriver_msg.minor = minor(dev);
+ m->m_lbdev_lblockdriver_msg.pos = pos;
+ m->m_lbdev_lblockdriver_msg.count = count;
+ m->m_lbdev_lblockdriver_msg.grant = grant;
+ m->m_lbdev_lblockdriver_msg.flags = flags;
return OK;
}
/* Clean up a single-buffer read/write request.
*/
- cpf_revoke(m->BDEV_GRANT);
+ cpf_revoke(m->m_lbdev_lblockdriver_msg.grant);
}
static ssize_t bdev_rdwt(int req, dev_t dev, u64_t pos, char *buf,
memset(m, 0, sizeof(*m));
m->m_type = req;
- m->BDEV_MINOR = minor(dev);
- m->BDEV_POS = pos;
- m->BDEV_COUNT = count;
- m->BDEV_GRANT = grant;
- m->BDEV_FLAGS = flags;
+ m->m_lbdev_lblockdriver_msg.minor = minor(dev);
+ m->m_lbdev_lblockdriver_msg.pos = pos;
+ m->m_lbdev_lblockdriver_msg.count = count;
+ m->m_lbdev_lblockdriver_msg.grant = grant;
+ m->m_lbdev_lblockdriver_msg.flags = flags;
return OK;
}
cp_grant_id_t grant;
int i;
- grant = m->BDEV_GRANT;
+ grant = m->m_lbdev_lblockdriver_msg.grant;
cpf_revoke(grant);
- for (i = m->BDEV_COUNT - 1; i >= 0; i--)
+ for (i = m->m_lbdev_lblockdriver_msg.count - 1; i >= 0; i--)
cpf_revoke(gvec[i].iov_grant);
}
memset(m, 0, sizeof(*m));
m->m_type = BDEV_IOCTL;
- m->BDEV_MINOR = minor(dev);
- m->BDEV_REQUEST = request;
- m->BDEV_GRANT = grant;
- m->BDEV_USER = user_endpt;
+ m->m_lbdev_lblockdriver_msg.minor = minor(dev);
+ m->m_lbdev_lblockdriver_msg.request = request;
+ m->m_lbdev_lblockdriver_msg.grant = grant;
+ m->m_lbdev_lblockdriver_msg.user = user_endpt;
return OK;
}
/* Clean up an I/O control request.
*/
- cpf_revoke(m->BDEV_GRANT);
+ cpf_revoke(m->m_lbdev_lblockdriver_msg.grant);
}
int bdev_ioctl(dev_t dev, int request, void *buf, endpoint_t user_endpt)
bdev_rdwt_cleanup(&call->msg);
r = bdev_rdwt_setup(type, call->dev,
- call->msg.BDEV_POS,
- (char *) call->vec[0].iov_addr, call->msg.BDEV_COUNT,
- call->msg.BDEV_FLAGS, &call->msg);
+ call->msg.m_lbdev_lblockdriver_msg.pos,
+ (char *) call->vec[0].iov_addr, call->msg.m_lbdev_lblockdriver_msg.count,
+ call->msg.m_lbdev_lblockdriver_msg.flags, &call->msg);
break;
bdev_vrdwt_cleanup(&call->msg, call->gvec);
r = bdev_vrdwt_setup(type, call->dev,
- call->msg.BDEV_POS,
- call->vec, call->msg.BDEV_COUNT, call->msg.BDEV_FLAGS,
+ call->msg.m_lbdev_lblockdriver_msg.pos,
+ call->vec, call->msg.m_lbdev_lblockdriver_msg.count, call->msg.m_lbdev_lblockdriver_msg.flags,
&call->msg, call->gvec);
break;
case BDEV_IOCTL:
bdev_ioctl_cleanup(&call->msg);
- r = bdev_ioctl_setup(call->dev, call->msg.BDEV_REQUEST,
- (char *) call->vec[0].iov_addr, call->msg.BDEV_USER,
+ r = bdev_ioctl_setup(call->dev, call->msg.m_lbdev_lblockdriver_msg.request,
+ (char *) call->vec[0].iov_addr, call->msg.m_lbdev_lblockdriver_msg.user,
&call->msg);
break;
return EDEADSRCDST;
m = *m_orig;
- m.BDEV_ID = id;
+ m.m_lbdev_lblockdriver_msg.id = id;
r = asynsend(endpt, &m);
/* Send the request and block until we receive a reply. */
m = *m_orig;
- m.BDEV_ID = NO_ID;
+ m.m_lbdev_lblockdriver_msg.id = NO_ID;
r = ipc_sendrec(endpt, &m);
for (j = 0; j < open_dev[i].count; j++) {
memset(&m, 0, sizeof(m));
m.m_type = BDEV_OPEN;
- m.BDEV_MINOR = minor(open_dev[i].dev);
- m.BDEV_ACCESS = open_dev[i].access;
- m.BDEV_ID = NO_ID;
+ m.m_lbdev_lblockdriver_msg.minor = minor(open_dev[i].dev);
+ m.m_lbdev_lblockdriver_msg.access = open_dev[i].access;
+ m.m_lbdev_lblockdriver_msg.id = NO_ID;
if ((r = ipc_sendrec(endpt, &m)) != OK) {
printf("bdev: IPC to driver (%d) failed (%d)\n",
m_reply.m_type = BDEV_REPLY;
m_reply.m_lblockdriver_lbdev_reply.status = reply;
- m_reply.m_lblockdriver_lbdev_reply.id = m_ptr->BDEV_ID;
+ m_reply.m_lblockdriver_lbdev_reply.id = m_ptr->m_lbdev_lblockdriver_msg.id;
send_reply(m_ptr->m_source, &m_reply, ipc_status);
}
{
/* Open a minor device. */
- return (*bdp->bdr_open)(mp->BDEV_MINOR, mp->BDEV_ACCESS);
+ return (*bdp->bdr_open)(mp->m_lbdev_lblockdriver_msg.minor, mp->m_lbdev_lblockdriver_msg.access);
}
/*===========================================================================*
{
/* Close a minor device. */
- return (*bdp->bdr_close)(mp->BDEV_MINOR);
+ return (*bdp->bdr_close)(mp->m_lbdev_lblockdriver_msg.minor);
}
/*===========================================================================*
ssize_t r;
/* Disk address? Address and length of the user buffer? */
- if (mp->BDEV_COUNT < 0) return EINVAL;
+ if (mp->m_lbdev_lblockdriver_msg.count < 0) return EINVAL;
/* Create a one element scatter/gather vector for the buffer. */
- iovec1.iov_addr = mp->BDEV_GRANT;
- iovec1.iov_size = mp->BDEV_COUNT;
+ iovec1.iov_addr = mp->m_lbdev_lblockdriver_msg.grant;
+ iovec1.iov_size = mp->m_lbdev_lblockdriver_msg.count;
/* Transfer bytes from/to the device. */
do_write = (mp->m_type == BDEV_WRITE);
- position = mp->BDEV_POS;
+ position = mp->m_lbdev_lblockdriver_msg.pos;
- r = (*bdp->bdr_transfer)(mp->BDEV_MINOR, do_write, position, mp->m_source,
- &iovec1, 1, mp->BDEV_FLAGS);
+ r = (*bdp->bdr_transfer)(mp->m_lbdev_lblockdriver_msg.minor, do_write, position, mp->m_source,
+ &iovec1, 1, mp->m_lbdev_lblockdriver_msg.flags);
/* Return the number of bytes transferred or an error code. */
return r;
ssize_t r, size;
/* Copy the vector from the caller to kernel space. */
- nr_req = mp->BDEV_COUNT; /* Length of I/O vector */
+ nr_req = mp->m_lbdev_lblockdriver_msg.count; /* Length of I/O vector */
if (nr_req > NR_IOREQS) nr_req = NR_IOREQS;
- if (OK != sys_safecopyfrom(mp->m_source, (vir_bytes) mp->BDEV_GRANT,
+ if (OK != sys_safecopyfrom(mp->m_source, (vir_bytes) mp->m_lbdev_lblockdriver_msg.grant,
0, (vir_bytes) iovec, nr_req * sizeof(iovec[0]))) {
printf("blockdriver: bad I/O vector by: %d\n", mp->m_source);
return EINVAL;
/* Transfer bytes from/to the device. */
do_write = (mp->m_type == BDEV_SCATTER);
- position = mp->BDEV_POS;
+ position = mp->m_lbdev_lblockdriver_msg.pos;
- r = (*bdp->bdr_transfer)(mp->BDEV_MINOR, do_write, position, mp->m_source,
- iovec, nr_req, mp->BDEV_FLAGS);
+ r = (*bdp->bdr_transfer)(mp->m_lbdev_lblockdriver_msg.minor, do_write, position, mp->m_source,
+ iovec, nr_req, mp->m_lbdev_lblockdriver_msg.flags);
/* Return the number of bytes transferred or an error code. */
return r;
endpoint_t user_endpt;
int r;
- minor = mp->BDEV_MINOR;
- request = mp->BDEV_REQUEST;
- grant = mp->BDEV_GRANT;
- user_endpt = mp->BDEV_USER;
+ minor = mp->m_lbdev_lblockdriver_msg.minor;
+ request = mp->m_lbdev_lblockdriver_msg.request;
+ grant = mp->m_lbdev_lblockdriver_msg.grant;
+ user_endpt = mp->m_lbdev_lblockdriver_msg.user;
switch (request) {
case BIOCTRACEBUF:
* requests on devices that have not previously been opened, signaling the
* caller that something went wrong.
*/
- if (IS_BDEV_RQ(m_ptr->m_type) && !is_open_dev(m_ptr->BDEV_MINOR)) {
+ if (IS_BDEV_RQ(m_ptr->m_type) && !is_open_dev(m_ptr->m_lbdev_lblockdriver_msg.minor)) {
/* Reply ERESTART to spurious requests for unopened devices. */
if (m_ptr->m_type != BDEV_OPEN) {
blockdriver_reply(m_ptr, ipc_status, ERESTART);
}
/* Mark the device as opened otherwise. */
- set_open_dev(m_ptr->BDEV_MINOR);
+ set_open_dev(m_ptr->m_lbdev_lblockdriver_msg.minor);
}
trace_start(id, m_ptr);
}
/* Query the device ID. Upon failure, send the error code to the caller. */
- r = (*bdtab->bdr_device)(m_ptr->BDEV_MINOR, &id);
+ r = (*bdtab->bdr_device)(m_ptr->m_lbdev_lblockdriver_msg.minor, &id);
if (r != OK) {
blockdriver_reply(m_ptr, ipc_status, r);
size_t size;
int flags;
- if (!trace_enabled || trace_dev != m_ptr->BDEV_MINOR) return;
+ if (!trace_enabled || trace_dev != m_ptr->m_lbdev_lblockdriver_msg.minor) return;
assert(id >= 0 && id < MAX_THREADS + 1);
case BDEV_OPEN:
case BDEV_CLOSE:
pos = 0;
- size = m_ptr->BDEV_ACCESS;
+ size = m_ptr->m_lbdev_lblockdriver_msg.access;
flags = 0;
break;
case BDEV_WRITE:
case BDEV_GATHER:
case BDEV_SCATTER:
- pos = m_ptr->BDEV_POS;
- size = m_ptr->BDEV_COUNT;
- flags = m_ptr->BDEV_FLAGS;
+ pos = m_ptr->m_lbdev_lblockdriver_msg.pos;
+ size = m_ptr->m_lbdev_lblockdriver_msg.count;
+ flags = m_ptr->m_lbdev_lblockdriver_msg.flags;
break;
case BDEV_IOCTL:
pos = 0;
- size = m_ptr->BDEV_REQUEST;
+ size = m_ptr->m_lbdev_lblockdriver_msg.request;
flags = 0;
/* Do not log trace control requests. */
m_reply.m_type = BDEV_REPLY;
m_reply.m_lblockdriver_lbdev_reply.status = ENXIO;
- m_reply.m_lblockdriver_lbdev_reply.id = m_ptr->BDEV_ID;
+ m_reply.m_lblockdriver_lbdev_reply.id = m_ptr->m_lbdev_lblockdriver_msg.id;
send_reply(m_ptr->m_source, &m_reply, ipc_status);
}
memset(&dev_mess, 0, sizeof(dev_mess));
dev_mess.m_type = BDEV_OPEN;
- dev_mess.BDEV_MINOR = minor_dev;
- dev_mess.BDEV_ACCESS = 0;
- if (access & R_BIT) dev_mess.BDEV_ACCESS |= BDEV_R_BIT;
- if (access & W_BIT) dev_mess.BDEV_ACCESS |= BDEV_W_BIT;
- dev_mess.BDEV_ID = 0;
+ dev_mess.m_lbdev_lblockdriver_msg.minor = minor_dev;
+ dev_mess.m_lbdev_lblockdriver_msg.access = 0;
+ if (access & R_BIT) dev_mess.m_lbdev_lblockdriver_msg.access |= BDEV_R_BIT;
+ if (access & W_BIT) dev_mess.m_lbdev_lblockdriver_msg.access |= BDEV_W_BIT;
+ dev_mess.m_lbdev_lblockdriver_msg.id = 0;
/* Call the task. */
r = block_io(dmap[major_dev].dmap_driver, &dev_mess);
memset(&dev_mess, 0, sizeof(dev_mess));
dev_mess.m_type = BDEV_CLOSE;
- dev_mess.BDEV_MINOR = minor_dev;
- dev_mess.BDEV_ID = 0;
+ dev_mess.m_lbdev_lblockdriver_msg.minor = minor_dev;
+ dev_mess.m_lbdev_lblockdriver_msg.id = 0;
r = block_io(dmap[major_dev].dmap_driver, &dev_mess);
if (r != OK)
memset(&dev_mess, 0, sizeof(dev_mess));
dev_mess.m_type = BDEV_IOCTL;
- dev_mess.BDEV_MINOR = minor_dev;
- dev_mess.BDEV_REQUEST = req;
- dev_mess.BDEV_GRANT = gid;
- dev_mess.BDEV_USER = proc_e;
- dev_mess.BDEV_ID = 0;
+ dev_mess.m_lbdev_lblockdriver_msg.minor = minor_dev;
+ dev_mess.m_lbdev_lblockdriver_msg.request = req;
+ dev_mess.m_lbdev_lblockdriver_msg.grant = gid;
+ dev_mess.m_lbdev_lblockdriver_msg.user = proc_e;
+ dev_mess.m_lbdev_lblockdriver_msg.id = 0;
/* Call the task. */
r = block_io(dp->dmap_driver, &dev_mess);
memset(&m, 0, sizeof(m));
m.m_type = BDEV_OPEN;
- m.BDEV_MINOR = minor;
- m.BDEV_ACCESS = (may_write) ? (BDEV_R_BIT | BDEV_W_BIT) : BDEV_R_BIT;
- m.BDEV_ID = 0;
+ m.m_lbdev_lblockdriver_msg.minor = minor;
+ m.m_lbdev_lblockdriver_msg.access = (may_write) ? (BDEV_R_BIT | BDEV_W_BIT) : BDEV_R_BIT;
+ m.m_lbdev_lblockdriver_msg.id = 0;
(void) ipc_sendrec(driver_endpt, &m);
}
if (m_ptr->m_type != BDEV_REPLY)
return set_result(res, RESULT_BADTYPE, m_ptr->m_type);
- if (m_ptr->m_lblockdriver_lbdev_reply.id != m_orig.BDEV_ID)
+ if (m_ptr->m_lblockdriver_lbdev_reply.id != m_orig.m_lbdev_lblockdriver_msg.id)
return set_result(res, RESULT_BADID,
m_ptr->m_lblockdriver_lbdev_reply.id);
memset(&m, 0, sizeof(m));
m.m_type = write ? BDEV_SCATTER : BDEV_GATHER;
- m.BDEV_MINOR = minor;
- m.BDEV_POS = pos;
- m.BDEV_COUNT = nr_req;
- m.BDEV_GRANT = grant;
- m.BDEV_ID = lrand48();
+ m.m_lbdev_lblockdriver_msg.minor = minor;
+ m.m_lbdev_lblockdriver_msg.pos = pos;
+ m.m_lbdev_lblockdriver_msg.count = nr_req;
+ m.m_lbdev_lblockdriver_msg.grant = grant;
+ m.m_lbdev_lblockdriver_msg.id = lrand48();
r = sendrec_driver(&m, exp, res);
*/
memset(&mt, 0, sizeof(mt));
mt.m_type = BDEV_GATHER;
- mt.BDEV_MINOR = driver_minor;
- mt.BDEV_POS = 0LL;
- mt.BDEV_COUNT = 1;
- mt.BDEV_GRANT = grant;
- mt.BDEV_ID = lrand48();
+ mt.m_lbdev_lblockdriver_msg.minor = driver_minor;
+ mt.m_lbdev_lblockdriver_msg.pos = 0LL;
+ mt.m_lbdev_lblockdriver_msg.count = 1;
+ mt.m_lbdev_lblockdriver_msg.grant = grant;
+ mt.m_lbdev_lblockdriver_msg.id = lrand48();
memset(&iovt, 0, sizeof(iovt));
iovt.iov_grant = grant2;
m = mt;
iov = iovt;
- m.BDEV_COUNT = 0;
+ m.m_lbdev_lblockdriver_msg.count = 0;
sendrec_driver(&m, EINVAL, &res);
/* Test bad iovec grant. */
m = mt;
- m.BDEV_GRANT = GRANT_INVALID;
+ m.m_lbdev_lblockdriver_msg.grant = GRANT_INVALID;
sendrec_driver(&m, EINVAL, &res);
cpf_revoke(grant3);
- m.BDEV_GRANT = grant3;
+ m.m_lbdev_lblockdriver_msg.grant = grant3;
sendrec_driver(&m, EINVAL, &res);
memset(&m, 0, sizeof(m));
m.m_type = BDEV_OPEN;
- m.BDEV_MINOR = minor;
- m.BDEV_ACCESS = may_write ? (BDEV_R_BIT | BDEV_W_BIT) : BDEV_R_BIT;
- m.BDEV_ID = lrand48();
+ m.m_lbdev_lblockdriver_msg.minor = minor;
+ m.m_lbdev_lblockdriver_msg.access = may_write ? (BDEV_R_BIT | BDEV_W_BIT) : BDEV_R_BIT;
+ m.m_lbdev_lblockdriver_msg.id = lrand48();
sendrec_driver(&m, OK, &res);
memset(&m, 0, sizeof(m));
m.m_type = BDEV_CLOSE;
- m.BDEV_MINOR = minor;
- m.BDEV_ID = lrand48();
+ m.m_lbdev_lblockdriver_msg.minor = minor;
+ m.m_lbdev_lblockdriver_msg.id = lrand48();
sendrec_driver(&m, OK, &res);
memset(&m, 0, sizeof(m));
m.m_type = BDEV_IOCTL;
- m.BDEV_MINOR = minor;
- m.BDEV_REQUEST = req;
- m.BDEV_GRANT = grant;
- m.BDEV_USER = NONE;
- m.BDEV_ID = lrand48();
+ m.m_lbdev_lblockdriver_msg.minor = minor;
+ m.m_lbdev_lblockdriver_msg.request = req;
+ m.m_lbdev_lblockdriver_msg.grant = grant;
+ m.m_lbdev_lblockdriver_msg.user = NONE;
+ m.m_lbdev_lblockdriver_msg.id = lrand48();
r = sendrec_driver(&m, exp, res);