Fix a 64-bit bogon. The hardware command structure only has one 32 bit

field for holding driver-dependant data.  Instead of putting the pointer
to the driver command struct in there, take advantage of these structs
being a (virtually) contiguous array and just put the array index in the
field.
This commit is contained in:
Scott Long 2003-02-19 23:33:56 +00:00
parent b7d18f9a8a
commit cb0d64b9b9
2 changed files with 4 additions and 3 deletions

View File

@ -753,8 +753,7 @@ aac_start(struct aac_command *cm)
cm->cm_fib->Header.ReceiverFibAddress = cm->cm_fibphys; cm->cm_fib->Header.ReceiverFibAddress = cm->cm_fibphys;
/* save a pointer to the command for speedy reverse-lookup */ /* save a pointer to the command for speedy reverse-lookup */
cm->cm_fib->Header.SenderData = (u_int32_t)cm; /* XXX 64-bit physical cm->cm_fib->Header.SenderData = cm->cm_index;
* address issue */
/* put the FIB on the outbound queue */ /* put the FIB on the outbound queue */
error = aac_enqueue_fib(sc, cm->cm_queue, cm); error = aac_enqueue_fib(sc, cm->cm_queue, cm);
return(error); return(error);
@ -867,7 +866,7 @@ aac_complete(void *context, int pending)
break; /* nothing to do */ break; /* nothing to do */
/* get the command, unmap and queue for later processing */ /* get the command, unmap and queue for later processing */
cm = (struct aac_command *)fib->Header.SenderData; cm = sc->aac_commands + fib->Header.SenderData;
if (cm == NULL) { if (cm == NULL) {
AAC_PRINT_FIB(sc, fib); AAC_PRINT_FIB(sc, fib);
break; break;
@ -1161,6 +1160,7 @@ aac_alloc_commands(struct aac_softc *sc)
cm->cm_sc = sc; cm->cm_sc = sc;
cm->cm_fib = fm->aac_fibs + i; cm->cm_fib = fm->aac_fibs + i;
cm->cm_fibphys = fibphys + (i * sizeof(struct aac_fib)); cm->cm_fibphys = fibphys + (i * sizeof(struct aac_fib));
cm->cm_index = sc->total_fibs;
if ((error = bus_dmamap_create(sc->aac_buffer_dmat, 0, if ((error = bus_dmamap_create(sc->aac_buffer_dmat, 0,
&cm->cm_datamap)) == 0) &cm->cm_datamap)) == 0)

View File

@ -179,6 +179,7 @@ struct aac_command
void *cm_private; void *cm_private;
time_t cm_timestamp; /* command creation time */ time_t cm_timestamp; /* command creation time */
int cm_queue; int cm_queue;
int cm_index;
}; };
struct aac_fibmap { struct aac_fibmap {