From owner-p4-projects@FreeBSD.ORG Fri May 25 22:15:03 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 168481065675; Fri, 25 May 2012 22:15:03 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4D361065670 for ; Fri, 25 May 2012 22:15:02 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDE68FC14 for ; Fri, 25 May 2012 22:15:02 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q4PMF2p2027031 for ; Fri, 25 May 2012 22:15:02 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q4PMF2fL027028 for perforce@freebsd.org; Fri, 25 May 2012 22:15:02 GMT (envelope-from brooks@freebsd.org) Date: Fri, 25 May 2012 22:15:02 GMT Message-Id: <201205252215.q4PMF2fL027028@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 211755 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 May 2012 22:15:03 -0000 http://p4web.freebsd.org/@@211755?ac=10 Change 211755 by brooks@brooks_ecr_current on 2012/05/25 22:14:11 Massage isf(4) so that it compiles. Not hooked up as I've not verified that it doesn't panic much less that it works. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.c#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.h#2 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_nexus.c#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.c#2 (text+ko) ==== @@ -81,32 +81,35 @@ } #endif -isf_read(struct isf_softc *sc, uint64_t off, void *data, size_t len) +static void +isf_read(struct isf_softc *sc, off_t off, void *data, size_t len) { KASSERT((uintptr_t)data % 2 == 0, ("%s: unaligned data %p", __func__, data)); KASSERT((len <= ISF_SECTORSIZE) && (len % 2 == 0), ("%s: invalid length %ju", __func__, len)); - KASSERT(off % ISF_SECTORLEN == 0, + KASSERT(off % ISF_SECTORSIZE == 0, ("%s: invalid offset %ju\n", __func__, off)); bus_read_region_2(sc->isf_res, off, (uint16_t *)data, len / 2); } +#ifdef NOTYET static void -isf_write(struct isf_softc *sc, uint64_t off, void *data, size_t len) +isf_write(struct isf_softc *sc, off_t off, void *data, size_t len) { KASSERT((uintptr_t)data % 2 == 0, ("%s: unaligned data %p", __func__, data)); KASSERT((len <= ISF_SECTORSIZE) && (len % 2 == 0), ("%s: invalid length %ju", __func__, len)); - KASSERT(off % ISF_SECTORLEN == 0, + KASSERT(off % ISF_SECTORSIZE == 0, ("%s: invalid offset %ju\n", __func__, off)); bus_write_region_2(sc->isf_res, off, (uint16_t *)data, len / 2); } +#endif /* * disk(9) methods. @@ -156,7 +159,7 @@ case BIO_WRITE: error = ENXIO; -#if 0 +#ifdef NOTYET /* * XXXRW: copied and pasted from altera_sdcard -- obviously * won't work. @@ -174,14 +177,12 @@ bp->bio_resid = 0; biofinish(bp, NULL, error); ISF_UNLOCK(sc); - return (error); } -void +static void isf_disk_insert(struct isf_softc *sc) { struct disk *disk; - uint64_t size; disk = disk_alloc(); disk->d_drv1 = sc; @@ -225,18 +226,21 @@ start = rman_get_start(sc->isf_res); if (start % 2 != 0) { - device_printf(sc, "Unsupported flash start alignment %llu\n", + device_printf(sc->isf_dev, + "Unsupported flash start alignment %lu\n", start); return (ENXIO); } size = rman_get_size(sc->isf_res); if (size != ISF_MEDIASIZE) { - device_printf(sc, "Unsupported flash size %llu\n", size); + device_printf(sc->isf_dev, + "Unsupported flash size %lu\n", size); return (ENXIO); } ISF_LOCK_INIT(sc); sc->isf_disk = NULL; isf_disk_insert(sc); + return(0); } void ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.h#2 (text+ko) ==== @@ -63,7 +63,7 @@ MTX_DEF) #define ISF_UNLOCK(sc) mtx_unlock(&(sc)->isf_lock) -void isf_attach(struct isf_softc *sc); +int isf_attach(struct isf_softc *sc); void isf_detach(struct isf_softc *sc); #endif /* _DEV_ISF_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_nexus.c#2 (text+ko) ==== @@ -68,7 +68,8 @@ static int isf_nexus_attach(device_t dev) { - struct isf_softc *sc; + int error; + struct isf_softc *sc; sc = device_get_softc(dev); sc->isf_dev = dev;