Date: Wed, 12 Jul 2006 04:39:01 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 101327 for review Message-ID: <200607120439.k6C4d111054769@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=101327 Change 101327 by kmacy@kmacy_storage:sun4v_work_stable on 2006/07/12 04:38:58 oops - explicit cast doesn't work - needs to be separate call to bus_space_read_2 still confused Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.c#5 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.h#5 edit Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.c#5 (text+ko) ==== @@ -1373,7 +1373,7 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout1\n"); return ETIMEDOUT; } - *data16++ = (u_int16_t)mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; + *data16++ = mpt_read_16(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); /* Get Second Word */ @@ -1381,7 +1381,7 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout2\n"); return ETIMEDOUT; } - *data16++ = (u_int16_t)mpt_read(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; + *data16++ = mpt_read_16(mpt, MPT_OFFSET_DOORBELL) & MPT_DB_DATA_MASK; mpt_write(mpt, MPT_OFFSET_INTR_STATUS, 0); /* @@ -1411,7 +1411,7 @@ mpt_prt(mpt, "mpt_recv_handshake_cmd timeout3\n"); return ETIMEDOUT; } - datum = (u_int16_t)mpt_read(mpt, MPT_OFFSET_DOORBELL); + datum = mpt_read_16(mpt, MPT_OFFSET_DOORBELL); if (reply_left-- > 0) *data16++ = datum & MPT_DB_DATA_MASK; ==== //depot/projects/kmacy_sun4v_stable/src/sys/dev/mpt/mpt.h#5 (text+ko) ==== @@ -819,6 +819,7 @@ /******************************* Register Access ******************************/ static __inline void mpt_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_read(struct mpt_softc *, int); +static __inline uint16_t mpt_read_16(struct mpt_softc *, int); static __inline void mpt_pio_write(struct mpt_softc *, size_t, uint32_t); static __inline uint32_t mpt_pio_read(struct mpt_softc *, int); @@ -834,6 +835,12 @@ return (bus_space_read_4(mpt->pci_st, mpt->pci_sh, offset)); } +static __inline uint16_t +mpt_read_16(struct mpt_softc *mpt, int offset) +{ + return (bus_space_read_2(mpt->pci_st, mpt->pci_sh, offset)); +} + /* * Some operations (e.g. diagnostic register writes while the ARM proccessor * is disabled), must be performed using "PCI pio" operations. On non-PCI
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607120439.k6C4d111054769>