From owner-p4-projects@FreeBSD.ORG Thu Jan 11 04:52:08 2007 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 5575216A415; Thu, 11 Jan 2007 04:52:08 +0000 (UTC) X-Original-To: perforce@freebsd.org 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 DE16416A407; Thu, 11 Jan 2007 04:52:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 99DC613C45A; Thu, 11 Jan 2007 04:52:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.13.4/8.13.4) with ESMTP id l0B4p670061821; Wed, 10 Jan 2007 21:51:06 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 10 Jan 2007 21:51:19 -0700 (MST) Message-Id: <20070110.215119.1021576971.imp@bsdimp.com> To: peter@freebsd.org From: "M. Warner Losh" In-Reply-To: <200701110211.l0B2B1sl023597@repoman.freebsd.org> References: <200701110211.l0B2B1sl023597@repoman.freebsd.org> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 10 Jan 2007 21:51:06 -0700 (MST) Cc: perforce@freebsd.org Subject: Re: PERFORCE change 112755 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: Thu, 11 Jan 2007 04:52:08 -0000 In message: <200701110211.l0B2B1sl023597@repoman.freebsd.org> Peter Wemm writes: : http://perforce.freebsd.org/chv.cgi?CH=112755 : : Change 112755 by peter@peter_overcee on 2007/01/11 02:10:31 : : Ignore the warnings and copy this bit of necessary code to avoid : sio unit numbers from sio_pci to sio_puc. Marcel left this out in : the great puc rewrite. I have some changes that I'm working on in my tree that should obviate the need for this entirely... But until they are in, you are going to need to do this... Warner : Affected files ... : : .. //depot/projects/hammer/sys/dev/sio/sio_puc.c#8 edit : : Differences ... : : ==== //depot/projects/hammer/sys/dev/sio/sio_puc.c#8 (text+ko) ==== : : @@ -62,6 +62,34 @@ : 0, : }; : : +/* : + * Don't cut and paste this to other drivers. It is a horrible kludge : + * which will fail to work and also be unnecessary in future versions. : + */ : +static void : +sio_puc_kludge_unit(device_t dev) : +{ : + devclass_t dc; : + int err; : + int start; : + int unit; : + : + unit = 0; : + start = 0; : + while (resource_int_value("sio", unit, "port", &start) == 0 && : + start > 0) : + unit++; : + if (device_get_unit(dev) < unit) { : + dc = device_get_devclass(dev); : + while (devclass_get_device(dc, unit)) : + unit++; : + device_printf(dev, "moving to sio%d\n", unit); : + err = device_set_unit(dev, unit); /* EVIL DO NOT COPY */ : + if (err) : + device_printf(dev, "error moving device %d\n", err); : + } : +} : + : static int : sio_puc_attach(device_t dev) : { : @@ -70,6 +98,7 @@ : if (BUS_READ_IVAR(device_get_parent(dev), dev, PUC_IVAR_CLOCK, : &rclk) != 0) : rclk = DEFAULT_RCLK; : + sio_puc_kludge_unit(dev); : return (sioattach(dev, 0, rclk)); : } : :