new_qw = zalloc(new_length * sizeof(struct fifo_quadword*));
ASSERT(new_qw != NULL);
- /* copy over old pointers to beginning of new block */
- memcpy(new_qw, fifo->quadwords,
- fifo->length * sizeof(struct fifo_quadword*));
-
- /* free old block */
- zfree(fifo->quadwords);
+ /* copy over old contents, if any */
+ if(fifo->quadwords != NULL)
+ {
+ /* copy over old pointers to beginning of new block */
+ memcpy(new_qw, fifo->quadwords,
+ fifo->length * sizeof(struct fifo_quadword*));
+
+ /* free old block */
+ zfree(fifo->quadwords);
+ }
/* replace pointers & counts */
fifo->quadwords = new_qw;
/* collect word into quadword */
*A4_16(&fifo_data, 3 - (i % 4)) = *operand;
-
+
/* write to GPUIF FIFO only with full quadword */
if(i % 4 == 3)
{
& fifo_data,
16);
} /* write collected quadword */
-
} /* GPUIF xfer loop */
/* done */