64-bit bdev position
Change-Id: I149693624610e04af0c5e4437b5efa484a33467d
This commit is contained in:
		
							parent
							
								
									d1cfa0acd0
								
							
						
					
					
						commit
						3c7f4e462e
					
				| @ -113,8 +113,7 @@ do_read(endpoint_t driver_endpt, uint8_t *buf, size_t bufsize) | |||||||
| 	m.BDEV_GRANT = grant_nr; | 	m.BDEV_GRANT = grant_nr; | ||||||
| 	m.BDEV_FLAGS = BDEV_NOPAGE; /* the EEPROMs used for EDID are pageless */ | 	m.BDEV_FLAGS = BDEV_NOPAGE; /* the EEPROMs used for EDID are pageless */ | ||||||
| 	m.BDEV_ID = 0; | 	m.BDEV_ID = 0; | ||||||
| 	m.BDEV_POS_LO = 0; | 	m.BDEV_POS = 0; | ||||||
| 	m.BDEV_POS_HI = 0; |  | ||||||
| 
 | 
 | ||||||
| 	r = ipc_sendrec(driver_endpt, &m); | 	r = ipc_sendrec(driver_endpt, &m); | ||||||
| 	cpf_revoke(grant_nr); | 	cpf_revoke(grant_nr); | ||||||
|  | |||||||
| @ -258,8 +258,7 @@ static ssize_t fbd_transfer_direct(int do_write, u64_t position, | |||||||
| 	m.BDEV_GRANT = grant; | 	m.BDEV_GRANT = grant; | ||||||
| 	m.BDEV_FLAGS = flags; | 	m.BDEV_FLAGS = flags; | ||||||
| 	m.BDEV_ID = 0; | 	m.BDEV_ID = 0; | ||||||
| 	m.BDEV_POS_LO = ex64lo(position); | 	m.BDEV_POS = position; | ||||||
| 	m.BDEV_POS_HI = ex64hi(position); |  | ||||||
| 
 | 
 | ||||||
| 	if ((r = ipc_sendrec(driver_endpt, &m)) != OK) | 	if ((r = ipc_sendrec(driver_endpt, &m)) != OK) | ||||||
| 		panic("ipc_sendrec to driver failed (%d)\n", r); | 		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_GRANT = grant; | ||||||
| 	m.BDEV_FLAGS = flags; | 	m.BDEV_FLAGS = flags; | ||||||
| 	m.BDEV_ID = 0; | 	m.BDEV_ID = 0; | ||||||
| 	m.BDEV_POS_LO = ex64lo(position); | 	m.BDEV_POS = position; | ||||||
| 	m.BDEV_POS_HI = ex64hi(position); |  | ||||||
| 
 | 
 | ||||||
| 	if ((r = ipc_sendrec(driver_endpt, &m)) != OK) | 	if ((r = ipc_sendrec(driver_endpt, &m)) != OK) | ||||||
| 		panic("ipc_sendrec to driver failed (%d)\n", r); | 		panic("ipc_sendrec to driver failed (%d)\n", r); | ||||||
|  | |||||||
| @ -770,8 +770,8 @@ static int paired_sendrec(message *m1, message *m2, int both) | |||||||
| 	int r; | 	int r; | ||||||
| 
 | 
 | ||||||
| #if DEBUG2 | #if DEBUG2 | ||||||
| 	printf("paired_sendrec(%d) - <%d,%lx:%lx,%d> - %x,%x\n", | 	printf("paired_sendrec(%d) - <%d,%llx,%d> - %x,%x\n", | ||||||
| 		both, m1->m_type, m1->BDEV_POS_HI, m1->BDEV_POS_LO, | 		both, m1->m_type, m1->BDEV_POS, | ||||||
| 		m1->BDEV_COUNT, m1->BDEV_GRANT, m2->BDEV_GRANT); | 		m1->BDEV_COUNT, m1->BDEV_GRANT, m2->BDEV_GRANT); | ||||||
| #endif | #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)); | 	memset(&m1, 0, sizeof(m1)); | ||||||
| 	m1.m_type = (request == FLT_WRITE) ? BDEV_SCATTER : BDEV_GATHER; | 	m1.m_type = (request == FLT_WRITE) ? BDEV_SCATTER : BDEV_GATHER; | ||||||
| 	m1.BDEV_COUNT = count; | 	m1.BDEV_COUNT = count; | ||||||
| 	m1.BDEV_POS_LO = ex64lo(pos); | 	m1.BDEV_POS = pos; | ||||||
| 	m1.BDEV_POS_HI = ex64hi(pos); |  | ||||||
| 
 | 
 | ||||||
| 	m2 = m1; | 	m2 = m1; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1252,8 +1252,7 @@ | |||||||
| #define BDEV_USER	m10_i4	/* user endpoint requesting I/O control */ | #define BDEV_USER	m10_i4	/* user endpoint requesting I/O control */ | ||||||
| #define BDEV_ID		m10_l1	/* opaque request ID */ | #define BDEV_ID		m10_l1	/* opaque request ID */ | ||||||
| #define BDEV_REQUEST	m10_l2	/* I/O control request */ | #define BDEV_REQUEST	m10_l2	/* I/O control request */ | ||||||
| #define BDEV_POS_LO	m10_l2	/* transfer position (low bits) */ | #define BDEV_POS	m10_ull1 /* transfer position */ | ||||||
| #define BDEV_POS_HI	m10_l3	/* transfer position (high bits) */ |  | ||||||
| 
 | 
 | ||||||
| /* Bits in 'BDEV_ACCESS' field of block device open requests. */ | /* Bits in 'BDEV_ACCESS' field of block device open requests. */ | ||||||
| #  define BDEV_R_BIT		0x01	/* open with read access */ | #  define BDEV_R_BIT		0x01	/* open with read access */ | ||||||
|  | |||||||
| @ -89,9 +89,10 @@ typedef struct { | |||||||
| _ASSERT_MSG_SIZE(mess_9); | _ASSERT_MSG_SIZE(mess_9); | ||||||
| 
 | 
 | ||||||
| typedef struct { | typedef struct { | ||||||
|  | 	u64_t m10ull1; | ||||||
| 	int m10i1, m10i2, m10i3, m10i4; | 	int m10i1, m10i2, m10i3, m10i4; | ||||||
| 	long m10l1, m10l2, m10l3; | 	long m10l1, m10l2, m10l3; | ||||||
| 	uint8_t padding[28]; | 	uint8_t padding[20]; | ||||||
| } mess_10; | } mess_10; | ||||||
| _ASSERT_MSG_SIZE(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_l1 m_m10.m10l1 | ||||||
| #define m10_l2 m_m10.m10l2 | #define m10_l2 m_m10.m10l2 | ||||||
| #define m10_l3 m_m10.m10l3 | #define m10_l3 m_m10.m10l3 | ||||||
|  | #define m10_ull1 m_m10.m10ull1 | ||||||
| 
 | 
 | ||||||
| #define m11_i1 m_m11.m11i1 | #define m11_i1 m_m11.m11i1 | ||||||
| #define m11_s1 m_m11.m11s1 | #define m11_s1 m_m11.m11s1 | ||||||
|  | |||||||
| @ -135,8 +135,7 @@ static int bdev_rdwt_setup(int req, dev_t dev, u64_t pos, char *buf, | |||||||
|   memset(m, 0, sizeof(*m)); |   memset(m, 0, sizeof(*m)); | ||||||
|   m->m_type = req; |   m->m_type = req; | ||||||
|   m->BDEV_MINOR = minor(dev); |   m->BDEV_MINOR = minor(dev); | ||||||
|   m->BDEV_POS_LO = ex64lo(pos); |   m->BDEV_POS = pos; | ||||||
|   m->BDEV_POS_HI = ex64hi(pos); |  | ||||||
|   m->BDEV_COUNT = count; |   m->BDEV_COUNT = count; | ||||||
|   m->BDEV_GRANT = grant; |   m->BDEV_GRANT = grant; | ||||||
|   m->BDEV_FLAGS = flags; |   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)); |   memset(m, 0, sizeof(*m)); | ||||||
|   m->m_type = req; |   m->m_type = req; | ||||||
|   m->BDEV_MINOR = minor(dev); |   m->BDEV_MINOR = minor(dev); | ||||||
|   m->BDEV_POS_LO = ex64lo(pos); |   m->BDEV_POS = pos; | ||||||
|   m->BDEV_POS_HI = ex64hi(pos); |  | ||||||
|   m->BDEV_COUNT = count; |   m->BDEV_COUNT = count; | ||||||
|   m->BDEV_GRANT = grant; |   m->BDEV_GRANT = grant; | ||||||
|   m->BDEV_FLAGS = flags; |   m->BDEV_FLAGS = flags; | ||||||
| @ -605,7 +603,7 @@ int bdev_restart_asyn(bdev_call_t *call) | |||||||
| 	bdev_rdwt_cleanup(&call->msg); | 	bdev_rdwt_cleanup(&call->msg); | ||||||
| 
 | 
 | ||||||
| 	r = bdev_rdwt_setup(type, call->dev, | 	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, | 		(char *) call->vec[0].iov_addr, call->msg.BDEV_COUNT, | ||||||
| 		call->msg.BDEV_FLAGS, &call->msg); | 		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); | 	bdev_vrdwt_cleanup(&call->msg, call->gvec); | ||||||
| 
 | 
 | ||||||
| 	r = bdev_vrdwt_setup(type, call->dev, | 	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->vec, call->msg.BDEV_COUNT, call->msg.BDEV_FLAGS, | ||||||
| 		&call->msg, call->gvec); | 		&call->msg, call->gvec); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -4,19 +4,19 @@ | |||||||
|  * Field names are prefixed with BDEV_. Separate field names are used for the |  * Field names are prefixed with BDEV_. Separate field names are used for the | ||||||
|  * "access", "request", and "user" fields. |  * "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_OPEN    | minor  |  access  |       |       |  id  |         |      | | ||||||
|  * |--------------+--------+----------+-------+-------+------+---------+------| |  * |--------------+--------+----------+-------+-------+------+---------+------| | ||||||
|  * | BDEV_CLOSE   | minor  |          |       |       |  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 |      | |  * | 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. */ |   /* Transfer bytes from/to the device. */ | ||||||
|   do_write = (mp->m_type == BDEV_WRITE); |   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, |   r = (*bdp->bdr_transfer)(mp->BDEV_MINOR, do_write, position, mp->m_source, | ||||||
| 	&iovec1, 1, mp->BDEV_FLAGS); | 	&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. */ |   /* Transfer bytes from/to the device. */ | ||||||
|   do_write = (mp->m_type == BDEV_SCATTER); |   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, |   r = (*bdp->bdr_transfer)(mp->BDEV_MINOR, do_write, position, mp->m_source, | ||||||
| 	iovec, nr_req, mp->BDEV_FLAGS); | 	iovec, nr_req, mp->BDEV_FLAGS); | ||||||
|  | |||||||
| @ -205,7 +205,7 @@ void trace_start(thread_id_t id, message *m_ptr) | |||||||
|   case BDEV_WRITE: |   case BDEV_WRITE: | ||||||
|   case BDEV_GATHER: |   case BDEV_GATHER: | ||||||
|   case BDEV_SCATTER: |   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; | 	size = m_ptr->BDEV_COUNT; | ||||||
| 	flags = m_ptr->BDEV_FLAGS; | 	flags = m_ptr->BDEV_FLAGS; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -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)); | 	memset(&m, 0, sizeof(m)); | ||||||
| 	m.m_type = write ? BDEV_SCATTER : BDEV_GATHER; | 	m.m_type = write ? BDEV_SCATTER : BDEV_GATHER; | ||||||
| 	m.BDEV_MINOR = minor; | 	m.BDEV_MINOR = minor; | ||||||
| 	m.BDEV_POS_LO = ex64lo(pos); | 	m.BDEV_POS = pos; | ||||||
| 	m.BDEV_POS_HI = ex64hi(pos); |  | ||||||
| 	m.BDEV_COUNT = nr_req; | 	m.BDEV_COUNT = nr_req; | ||||||
| 	m.BDEV_GRANT = grant; | 	m.BDEV_GRANT = grant; | ||||||
| 	m.BDEV_ID = lrand48(); | 	m.BDEV_ID = lrand48(); | ||||||
| @ -425,8 +424,7 @@ static void bad_read1(void) | |||||||
| 	memset(&mt, 0, sizeof(mt)); | 	memset(&mt, 0, sizeof(mt)); | ||||||
| 	mt.m_type = BDEV_GATHER; | 	mt.m_type = BDEV_GATHER; | ||||||
| 	mt.BDEV_MINOR = driver_minor; | 	mt.BDEV_MINOR = driver_minor; | ||||||
| 	mt.BDEV_POS_LO = 0L; | 	mt.BDEV_POS = 0LL; | ||||||
| 	mt.BDEV_POS_HI = 0L; |  | ||||||
| 	mt.BDEV_COUNT = 1; | 	mt.BDEV_COUNT = 1; | ||||||
| 	mt.BDEV_GRANT = grant; | 	mt.BDEV_GRANT = grant; | ||||||
| 	mt.BDEV_ID = lrand48(); | 	mt.BDEV_ID = lrand48(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ben Gras
						Ben Gras