mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Make aac(4) compile cleanly on 64-bit machines. The code was already 64-bit
safe, but some (unneeded and/or harmless) downcasts were generating warnings. The driver still is not endian-clean.
This commit is contained in:
parent
9cccabebd7
commit
b88ffdc860
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=119146
sys/dev/aac
@ -1113,7 +1113,6 @@ aac_release_command(struct aac_command *cm)
|
||||
* intermediate stage may have destroyed them. They're left
|
||||
* initialised here for debugging purposes only.
|
||||
*/
|
||||
cm->cm_fib->Header.SenderFibAddress = (u_int32_t)cm->cm_fib;
|
||||
cm->cm_fib->Header.ReceiverFibAddress = (u_int32_t)cm->cm_fibphys;
|
||||
cm->cm_fib->Header.SenderData = 0;
|
||||
|
||||
@ -1408,8 +1407,7 @@ aac_init(struct aac_softc *sc)
|
||||
{
|
||||
struct aac_adapter_init *ip;
|
||||
time_t then;
|
||||
u_int32_t code;
|
||||
u_int8_t *qaddr;
|
||||
u_int32_t code, qoffset;
|
||||
int error;
|
||||
|
||||
debug_called(1);
|
||||
@ -1581,12 +1579,10 @@ aac_init(struct aac_softc *sc)
|
||||
* list manipulation functions which 'know' the size of each list by
|
||||
* virtue of a table.
|
||||
*/
|
||||
qaddr = &sc->aac_common->ac_qbuf[0] + AAC_QUEUE_ALIGN;
|
||||
qaddr -= (u_int32_t)qaddr % AAC_QUEUE_ALIGN;
|
||||
sc->aac_queues = (struct aac_queue_table *)qaddr;
|
||||
ip->CommHeaderAddress = sc->aac_common_busaddr +
|
||||
((u_int32_t)sc->aac_queues -
|
||||
(u_int32_t)sc->aac_common);
|
||||
qoffset = offsetof(struct aac_common, ac_qbuf) + AAC_QUEUE_ALIGN;
|
||||
qoffset &= (AAC_QUEUE_ALIGN - 1);
|
||||
sc->aac_queues = (struct aac_queue_table *)((uintptr_t)sc->aac_common + qoffset);
|
||||
ip->CommHeaderAddress = sc->aac_common_busaddr + qoffset;
|
||||
|
||||
sc->aac_queues->qt_qindex[AAC_HOST_NORM_CMD_QUEUE][AAC_PRODUCER_INDEX] =
|
||||
AAC_HOST_NORM_CMD_ENTRIES;
|
||||
@ -1757,7 +1753,7 @@ aac_sync_fib(struct aac_softc *sc, u_int32_t command, u_int32_t xferstate,
|
||||
fib->Header.StructType = AAC_FIBTYPE_TFIB;
|
||||
fib->Header.Size = sizeof(struct aac_fib) + datasize;
|
||||
fib->Header.SenderSize = sizeof(struct aac_fib);
|
||||
fib->Header.SenderFibAddress = (u_int32_t)fib;
|
||||
fib->Header.SenderFibAddress = 0; /* Not needed */
|
||||
fib->Header.ReceiverFibAddress = sc->aac_common_busaddr +
|
||||
offsetof(struct aac_common,
|
||||
ac_sync_fib);
|
||||
@ -2383,7 +2379,7 @@ aac_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
|
||||
union aac_statrequest *as;
|
||||
struct aac_softc *sc;
|
||||
int error = 0;
|
||||
int i;
|
||||
uint32_t cookie;
|
||||
|
||||
debug_called(2);
|
||||
|
||||
@ -2434,8 +2430,8 @@ aac_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
|
||||
* Here, we give it the proc pointer of the per-adapter aif
|
||||
* thread. It's only used as a sanity check in other calls.
|
||||
*/
|
||||
i = (int)sc->aifthread;
|
||||
error = copyout(&i, arg, sizeof(i));
|
||||
cookie = (uint32_t)(uintptr_t)sc->aifthread;
|
||||
error = copyout(&cookie, arg, sizeof(cookie));
|
||||
break;
|
||||
case FSACTL_GET_NEXT_ADAPTER_FIB:
|
||||
arg = *(caddr_t*)arg;
|
||||
@ -2531,7 +2527,7 @@ aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib)
|
||||
goto out;
|
||||
size = cm->cm_fib->Header.Size + sizeof(struct aac_fib_header);
|
||||
if (size > sizeof(struct aac_fib)) {
|
||||
device_printf(sc->aac_dev, "incoming FIB oversized (%d > %d)\n",
|
||||
device_printf(sc->aac_dev, "incoming FIB oversized (%d > %zd)\n",
|
||||
size, sizeof(struct aac_fib));
|
||||
size = sizeof(struct aac_fib);
|
||||
}
|
||||
@ -2554,7 +2550,7 @@ aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib)
|
||||
*/
|
||||
size = cm->cm_fib->Header.Size;
|
||||
if (size > sizeof(struct aac_fib)) {
|
||||
device_printf(sc->aac_dev, "outbound FIB oversized (%d > %d)\n",
|
||||
device_printf(sc->aac_dev, "outbound FIB oversized (%d > %zd)\n",
|
||||
size, sizeof(struct aac_fib));
|
||||
size = sizeof(struct aac_fib);
|
||||
}
|
||||
@ -2776,7 +2772,7 @@ aac_getnext_aif(struct aac_softc *sc, caddr_t arg)
|
||||
/*
|
||||
* Check the magic number that we gave the caller.
|
||||
*/
|
||||
if (agf.AdapterFibContext != (int)sc->aifthread) {
|
||||
if (agf.AdapterFibContext != (int)(uintptr_t)sc->aifthread) {
|
||||
error = EFAULT;
|
||||
} else {
|
||||
error = aac_return_aif(sc, agf.AifFib);
|
||||
|
@ -339,9 +339,14 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb)
|
||||
if ((ccb->ccb_h.flags & CAM_SCATTER_VALID) == 0) {
|
||||
srb->data_len = csio->dxfer_len;
|
||||
if (ccb->ccb_h.flags & CAM_DATA_PHYS) {
|
||||
/*
|
||||
* XXX This isn't 64-bit clean.
|
||||
* However, this condition is not
|
||||
* normally used in CAM.
|
||||
*/
|
||||
srb->sg_map32.SgCount = 1;
|
||||
srb->sg_map32.SgEntry[0].SgAddress =
|
||||
(u_int32_t)csio->data_ptr;
|
||||
(uint32_t)(uintptr_t)csio->data_ptr;
|
||||
srb->sg_map32.SgEntry[0].SgByteCount =
|
||||
csio->dxfer_len;
|
||||
} else {
|
||||
|
@ -272,7 +272,8 @@ aac_disk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size
|
||||
size = fib->Header.Size + sizeof(struct aac_blockwrite);
|
||||
|
||||
if (aac_sync_fib(sc, ContainerCommand, 0, fib, size)) {
|
||||
printf("Error dumping block 0x%x\n", physical);
|
||||
printf("Error dumping block 0x%jx\n",
|
||||
(uintptr_t)physical);
|
||||
return (EIO);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user