From owner-p4-projects@FreeBSD.ORG Wed Jul 12 04:39:02 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9CF9916A4E8; Wed, 12 Jul 2006 04:39:02 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BF9D16A4E6 for ; Wed, 12 Jul 2006 04:39:02 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D24543D49 for ; Wed, 12 Jul 2006 04:39:02 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k6C4d2ia054773 for ; Wed, 12 Jul 2006 04:39:02 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k6C4d111054769 for perforce@freebsd.org; Wed, 12 Jul 2006 04:39:01 GMT (envelope-from kmacy@freebsd.org) Date: Wed, 12 Jul 2006 04:39:01 GMT Message-Id: <200607120439.k6C4d111054769@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 101327 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2006 04:39:02 -0000 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