From: Ben Gras Date: Mon, 24 Feb 2014 13:22:04 +0000 (+0100) Subject: 64-bit bdev position X-Git-Tag: v3.3.0~429 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.named-rrchecker.html?a=commitdiff_plain;h=3c7f4e462e4f36370d748c3f7612dc2e4fbcf1f5;p=minix.git 64-bit bdev position Change-Id: I149693624610e04af0c5e4437b5efa484a33467d --- diff --git a/drivers/fb/fb_edid.c b/drivers/fb/fb_edid.c index e0e4ef18b..9c200d8a6 100644 --- a/drivers/fb/fb_edid.c +++ b/drivers/fb/fb_edid.c @@ -113,8 +113,7 @@ do_read(endpoint_t driver_endpt, uint8_t *buf, size_t 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_LO = 0; - m.BDEV_POS_HI = 0; + m.BDEV_POS = 0; r = ipc_sendrec(driver_endpt, &m); cpf_revoke(grant_nr); diff --git a/drivers/fbd/fbd.c b/drivers/fbd/fbd.c index 5ffc93a1d..5ffe9a365 100644 --- a/drivers/fbd/fbd.c +++ b/drivers/fbd/fbd.c @@ -258,8 +258,7 @@ static ssize_t fbd_transfer_direct(int do_write, u64_t position, m.BDEV_GRANT = grant; m.BDEV_FLAGS = flags; m.BDEV_ID = 0; - m.BDEV_POS_LO = ex64lo(position); - m.BDEV_POS_HI = ex64hi(position); + m.BDEV_POS = position; if ((r = ipc_sendrec(driver_endpt, &m)) != OK) panic("ipc_sendrec to driver failed (%d)\n", r); @@ -351,8 +350,7 @@ static ssize_t fbd_transfer_copy(int do_write, u64_t position, m.BDEV_GRANT = grant; m.BDEV_FLAGS = flags; m.BDEV_ID = 0; - m.BDEV_POS_LO = ex64lo(position); - m.BDEV_POS_HI = ex64hi(position); + m.BDEV_POS = position; if ((r = ipc_sendrec(driver_endpt, &m)) != OK) panic("ipc_sendrec to driver failed (%d)\n", r); diff --git a/drivers/filter/driver.c b/drivers/filter/driver.c index 80e97cc7b..2664df76a 100644 --- a/drivers/filter/driver.c +++ b/drivers/filter/driver.c @@ -770,8 +770,8 @@ static int paired_sendrec(message *m1, message *m2, int both) int r; #if DEBUG2 - printf("paired_sendrec(%d) - <%d,%lx:%lx,%d> - %x,%x\n", - both, m1->m_type, m1->BDEV_POS_HI, m1->BDEV_POS_LO, + 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); #endif @@ -919,8 +919,7 @@ int read_write(u64_t pos, char *bufa, char *bufb, size_t *sizep, int request) memset(&m1, 0, sizeof(m1)); m1.m_type = (request == FLT_WRITE) ? BDEV_SCATTER : BDEV_GATHER; m1.BDEV_COUNT = count; - m1.BDEV_POS_LO = ex64lo(pos); - m1.BDEV_POS_HI = ex64hi(pos); + m1.BDEV_POS = pos; m2 = m1; diff --git a/include/minix/com.h b/include/minix/com.h index 0ea6126e9..7a1bbc5b1 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -1252,8 +1252,7 @@ #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_LO m10_l2 /* transfer position (low bits) */ -#define BDEV_POS_HI m10_l3 /* transfer position (high bits) */ +#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 */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 2eaaed8b2..1eee45247 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -89,9 +89,10 @@ typedef struct { _ASSERT_MSG_SIZE(mess_9); typedef struct { + u64_t m10ull1; int m10i1, m10i2, m10i3, m10i4; long m10l1, m10l2, m10l3; - uint8_t padding[28]; + uint8_t padding[20]; } mess_10; _ASSERT_MSG_SIZE(mess_10); @@ -295,6 +296,7 @@ typedef int _ASSERT_message[/* CONSTCOND */sizeof(message) == 64 ? 1 : -1]; #define m10_l1 m_m10.m10l1 #define m10_l2 m_m10.m10l2 #define m10_l3 m_m10.m10l3 +#define m10_ull1 m_m10.m10ull1 #define m11_i1 m_m11.m11i1 #define m11_s1 m_m11.m11s1 diff --git a/lib/libbdev/bdev.c b/lib/libbdev/bdev.c index b4037f963..76737d75f 100644 --- a/lib/libbdev/bdev.c +++ b/lib/libbdev/bdev.c @@ -135,8 +135,7 @@ static int bdev_rdwt_setup(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_LO = ex64lo(pos); - m->BDEV_POS_HI = ex64hi(pos); + m->BDEV_POS = pos; m->BDEV_COUNT = count; m->BDEV_GRANT = grant; m->BDEV_FLAGS = flags; @@ -227,8 +226,7 @@ static int bdev_vrdwt_setup(int req, dev_t dev, u64_t pos, iovec_t *vec, memset(m, 0, sizeof(*m)); m->m_type = req; m->BDEV_MINOR = minor(dev); - m->BDEV_POS_LO = ex64lo(pos); - m->BDEV_POS_HI = ex64hi(pos); + m->BDEV_POS = pos; m->BDEV_COUNT = count; m->BDEV_GRANT = grant; m->BDEV_FLAGS = flags; @@ -605,7 +603,7 @@ int bdev_restart_asyn(bdev_call_t *call) bdev_rdwt_cleanup(&call->msg); r = bdev_rdwt_setup(type, call->dev, - make64(call->msg.BDEV_POS_LO, call->msg.BDEV_POS_HI), + call->msg.BDEV_POS, (char *) call->vec[0].iov_addr, call->msg.BDEV_COUNT, call->msg.BDEV_FLAGS, &call->msg); @@ -616,7 +614,7 @@ int bdev_restart_asyn(bdev_call_t *call) bdev_vrdwt_cleanup(&call->msg, call->gvec); r = bdev_vrdwt_setup(type, call->dev, - make64(call->msg.BDEV_POS_LO, call->msg.BDEV_POS_HI), + call->msg.BDEV_POS, call->vec, call->msg.BDEV_COUNT, call->msg.BDEV_FLAGS, &call->msg, call->gvec); diff --git a/lib/libblockdriver/driver.c b/lib/libblockdriver/driver.c index 96f97c416..1c3d5fade 100644 --- a/lib/libblockdriver/driver.c +++ b/lib/libblockdriver/driver.c @@ -4,19 +4,19 @@ * Field names are prefixed with BDEV_. Separate field names are used for the * "access", "request", and "user" fields. * - * m_type MINOR COUNT GRANT FLAGS ID POS_LO POS_HI + * m_type MINOR COUNT GRANT FLAGS ID REQUEST POS * +--------------+--------+----------+-------+-------+------+---------+------+ * | BDEV_OPEN | minor | access | | | id | | | * |--------------+--------+----------+-------+-------+------+---------+------| * | BDEV_CLOSE | minor | | | | id | | | * |--------------+--------+----------+-------+-------+------+---------+------| - * | BDEV_READ | minor | bytes | grant | flags | id | position | + * | BDEV_READ | minor | bytes | grant | flags | id | | pos. | * |--------------+--------+----------+-------+-------+------+---------+------| - * | BDEV_WRITE | minor | bytes | grant | flags | id | position | + * | BDEV_WRITE | minor | bytes | grant | flags | id | | pos. | * |--------------+--------+----------+-------+-------+------+---------+------| - * | BDEV_GATHER | minor | elements | grant | flags | id | position | + * | BDEV_GATHER | minor | elements | grant | flags | id | | pos. | * |--------------+--------+----------+-------+-------+------+---------+------| - * | BDEV_SCATTER | minor | elements | grant | flags | id | position | + * | BDEV_SCATTER | minor | elements | grant | flags | id | | pos. | * |--------------+--------+----------+-------+-------+------+---------+------| * | BDEV_IOCTL | minor | | grant | user | id | request | | * ---------------------------------------------------------------------------- @@ -207,7 +207,7 @@ static int do_rdwt(struct blockdriver *bdp, message *mp) /* Transfer bytes from/to the device. */ do_write = (mp->m_type == BDEV_WRITE); - position = make64(mp->BDEV_POS_LO, mp->BDEV_POS_HI); + position = mp->BDEV_POS; r = (*bdp->bdr_transfer)(mp->BDEV_MINOR, do_write, position, mp->m_source, &iovec1, 1, mp->BDEV_FLAGS); @@ -248,7 +248,7 @@ static int do_vrdwt(struct blockdriver *bdp, message *mp, thread_id_t id) /* Transfer bytes from/to the device. */ do_write = (mp->m_type == BDEV_SCATTER); - position = make64(mp->BDEV_POS_LO, mp->BDEV_POS_HI); + position = mp->BDEV_POS; r = (*bdp->bdr_transfer)(mp->BDEV_MINOR, do_write, position, mp->m_source, iovec, nr_req, mp->BDEV_FLAGS); diff --git a/lib/libblockdriver/trace.c b/lib/libblockdriver/trace.c index 92f7e6ac9..008f7a114 100644 --- a/lib/libblockdriver/trace.c +++ b/lib/libblockdriver/trace.c @@ -205,7 +205,7 @@ void trace_start(thread_id_t id, message *m_ptr) case BDEV_WRITE: case BDEV_GATHER: case BDEV_SCATTER: - pos = make64(m_ptr->BDEV_POS_LO, m_ptr->BDEV_POS_HI); + pos = m_ptr->BDEV_POS; size = m_ptr->BDEV_COUNT; flags = m_ptr->BDEV_FLAGS; diff --git a/test/blocktest/blocktest.c b/test/blocktest/blocktest.c index fc7574733..14563185d 100644 --- a/test/blocktest/blocktest.c +++ b/test/blocktest/blocktest.c @@ -308,8 +308,7 @@ static void raw_xfer(dev_t minor, u64_t pos, iovec_s_t *iovec, int nr_req, memset(&m, 0, sizeof(m)); m.m_type = write ? BDEV_SCATTER : BDEV_GATHER; m.BDEV_MINOR = minor; - m.BDEV_POS_LO = ex64lo(pos); - m.BDEV_POS_HI = ex64hi(pos); + m.BDEV_POS = pos; m.BDEV_COUNT = nr_req; m.BDEV_GRANT = grant; m.BDEV_ID = lrand48(); @@ -425,8 +424,7 @@ static void bad_read1(void) memset(&mt, 0, sizeof(mt)); mt.m_type = BDEV_GATHER; mt.BDEV_MINOR = driver_minor; - mt.BDEV_POS_LO = 0L; - mt.BDEV_POS_HI = 0L; + mt.BDEV_POS = 0LL; mt.BDEV_COUNT = 1; mt.BDEV_GRANT = grant; mt.BDEV_ID = lrand48();