Skip to content

Commit f9eba5f

Browse files
committed
Fix mpii(4) on 32bit.
The expression results in a signed extension from 32bit to 64bit, resulting in the higher word being 0xffffffff on 32bit systems: The expression is bus_addr_t + caddr_t - caddr_t, which is: (bus_addr_t + caddr_t) - caddr_t, which is (u_long + (char *)) - (char *), u_long + char * == signed 32bit pointer, which then gets subtracted, which then gets signed extended to 64bit. ok pedro@
1 parent 65dbcf2 commit f9eba5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sys/dev/pci/mpii.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ mpii_load_xs(struct mpii_ccb *ccb)
773773
MPII_SGE_FL_SIZE_64 | len);
774774
/* address of the next sge */
775775
mpii_dvatosge(csge, ccb->ccb_cmd_dva +
776-
(caddr_t)nsge - (caddr_t)io);
776+
((bus_addr_t)nsge - (bus_addr_t)io));
777777
}
778778

779779
sge = nsge;

0 commit comments

Comments
 (0)