ofw_disk.c (139749) | ofw_disk.c (151894) |
---|---|
1/*- 2 * Copyright (C) 2002 Benno Rice <benno@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 25 * 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (C) 2002 Benno Rice <benno@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 25 * 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_disk.c 139749 2005-01-06 01:43:34Z imp $"); | 29__FBSDID("$FreeBSD: head/sys/dev/ofw/ofw_disk.c 151894 2005-10-31 03:09:38Z grehan $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bio.h> 34#include <sys/kernel.h> 35#include <sys/kthread.h> 36#include <sys/linker.h> 37#include <sys/lock.h> --- 39 unchanged lines hidden (view full) --- 77TUNABLE_INT("kern.ofw.disk", &ofwd_enable); 78 79static int 80ofwd_startio(struct ofwd_softc *sc, struct bio *bp) 81{ 82 u_int r; 83 84 r = OF_seek(sc->ofwd_instance, bp->bio_offset); | 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bio.h> 34#include <sys/kernel.h> 35#include <sys/kthread.h> 36#include <sys/linker.h> 37#include <sys/lock.h> --- 39 unchanged lines hidden (view full) --- 77TUNABLE_INT("kern.ofw.disk", &ofwd_enable); 78 79static int 80ofwd_startio(struct ofwd_softc *sc, struct bio *bp) 81{ 82 u_int r; 83 84 r = OF_seek(sc->ofwd_instance, bp->bio_offset); |
85 |
|
85 switch (bp->bio_cmd) { 86 case BIO_READ: 87 r = OF_read(sc->ofwd_instance, (void *)bp->bio_data, 88 bp->bio_length); 89 break; 90 case BIO_WRITE: 91 r = OF_write(sc->ofwd_instance, (void *)bp->bio_data, 92 bp->bio_length); --- 66 unchanged lines hidden (view full) --- 159 return; 160 } 161 162 sc = (struct ofwd_softc *)malloc(sizeof *sc, M_DEVBUF, 163 M_WAITOK|M_ZERO); 164 bioq_init(&sc->ofwd_bio_queue); 165 mtx_init(&sc->ofwd_queue_mtx, "ofwd bio queue", NULL, MTX_DEF); 166 sc->ofwd_instance = ifd; | 86 switch (bp->bio_cmd) { 87 case BIO_READ: 88 r = OF_read(sc->ofwd_instance, (void *)bp->bio_data, 89 bp->bio_length); 90 break; 91 case BIO_WRITE: 92 r = OF_write(sc->ofwd_instance, (void *)bp->bio_data, 93 bp->bio_length); --- 66 unchanged lines hidden (view full) --- 160 return; 161 } 162 163 sc = (struct ofwd_softc *)malloc(sizeof *sc, M_DEVBUF, 164 M_WAITOK|M_ZERO); 165 bioq_init(&sc->ofwd_bio_queue); 166 mtx_init(&sc->ofwd_queue_mtx, "ofwd bio queue", NULL, MTX_DEF); 167 sc->ofwd_instance = ifd; |
167 sc->ofwd_mediasize = (off_t)2*33554432 * OFWD_BLOCKSIZE; | 168 sc->ofwd_mediasize = (off_t)2*33554432; |
168 sc->ofwd_sectorsize = OFWD_BLOCKSIZE; 169 sc->ofwd_fwsectors = 0; 170 sc->ofwd_fwheads = 0; 171 error = kthread_create(ofwd_kthread, sc, &sc->ofwd_procp, 0, 0, 172 "ofwd0"); 173 if (error != 0) { 174 free(sc, M_DEVBUF); 175 return; --- 32 unchanged lines hidden --- | 169 sc->ofwd_sectorsize = OFWD_BLOCKSIZE; 170 sc->ofwd_fwsectors = 0; 171 sc->ofwd_fwheads = 0; 172 error = kthread_create(ofwd_kthread, sc, &sc->ofwd_procp, 0, 0, 173 "ofwd0"); 174 if (error != 0) { 175 free(sc, M_DEVBUF); 176 return; --- 32 unchanged lines hidden --- |