From owner-p4-projects@FreeBSD.ORG Fri Mar 24 18:13:54 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 E5E2116A423; Fri, 24 Mar 2006 18:13:53 +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 AD6C216A401 for ; Fri, 24 Mar 2006 18:13:53 +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 7254043D46 for ; Fri, 24 Mar 2006 18:13:53 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2OIDrFi006523 for ; Fri, 24 Mar 2006 18:13:53 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2OIDri0006520 for perforce@freebsd.org; Fri, 24 Mar 2006 18:13:53 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 24 Mar 2006 18:13:53 GMT Message-Id: <200603241813.k2OIDri0006520@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 93938 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: Fri, 24 Mar 2006 18:13:54 -0000 http://perforce.freebsd.org/chv.cgi?CH=93938 Change 93938 by kmacy@kmacy_storage:sun4vtmp on 2006/03/24 18:13:23 hook simdisk into vnex Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/simdisk.c#4 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/simdisk.c#4 (text+ko) ==== @@ -1,7 +1,7 @@ /*- - * Copyright (C) 2002 Benno Rice - * Copyright (C) 2006 Kip Macy + * Copyright (c) 2006 Kip Macy + * Copyright (c) 2001 Benno Rice * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,28 +13,22 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. * - * - */ - - -/* This is pretty much a rip-off of ofw_disk - it only works on the simulator - * so odds are it will be put out to pasture in a week or two + * $ Exp $ */ - - #include -__FBSDID("$FreeBSD: src/sys/dev/ofw/ofw_disk.c,v 1.18 2005/10/31 03:09:38 grehan Exp $"); +__FBSDID("$$"); #include #include @@ -52,6 +46,11 @@ #include +#include +#include +#include + + #include #define HVD_BLOCKSIZE 512 @@ -139,9 +138,6 @@ curthread->td_base_pri = PRIBIO; for (;;) { -#if 0 - printf("in hvd_kthread\n"); -#endif mtx_lock(&sc->hvd_queue_mtx); bp = bioq_takefirst(&sc->hvd_bio_queue); if (!bp) { @@ -218,3 +214,40 @@ return (ENXIO); return (0); } + +static int +hvd_probe(device_t dev) +{ + + if (strcmp(ofw_bus_get_name(dev), "disk")) + return (ENXIO); + + device_set_desc(dev, "sun4v virtual disk"); + + return (0); +} + + +static int +hvd_attach(device_t dev) +{ + return (0); +} + +static device_method_t hvd_methods[] = { + DEVMETHOD(device_probe, hvd_probe), + DEVMETHOD(device_attach, hvd_attach), + {0, 0} +}; + + +static driver_t hvd_driver = { + "hvd", + hvd_methods, + 0, +}; + + +static devclass_t hvd_devclass; + +DRIVER_MODULE(hvd, vnex, hvd_driver, hvd_devclass, 0, 0);