From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 03:30:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8C43106564A; Sun, 29 Mar 2009 03:30:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C91B8FC1C; Sun, 29 Mar 2009 03:30:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2T3UFlM020794; Sun, 29 Mar 2009 03:30:15 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2T3UFVA020793; Sun, 29 Mar 2009 03:30:15 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <200903290330.n2T3UFVA020793@svn.freebsd.org> From: Robert Watson Date: Sun, 29 Mar 2009 03:30:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190518 - head/sys/tools X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 03:30:16 -0000 Author: rwatson Date: Sun Mar 29 03:30:15 2009 New Revision: 190518 URL: http://svn.freebsd.org/changeset/base/190518 Log: Add SDT DTrace probes for VFS vnode operations in the vfs:vop provider namespace. These are inserted dynamically into the VOP_..._AP() functions created from vnode_if.src. Each VOP has entry and return probes, as arg0 the primary vnode, arg1 the vnode operation argument structure pointer, providing access to IN and OUT arguments, and for return probes, arg2 the return value. MFC after: 1 month Sponsored by: Google, Inc. Modified: head/sys/tools/vnode_if.awk Modified: head/sys/tools/vnode_if.awk ============================================================================== --- head/sys/tools/vnode_if.awk Sun Mar 29 01:04:13 2009 (r190517) +++ head/sys/tools/vnode_if.awk Sun Mar 29 03:30:15 2009 (r190518) @@ -165,12 +165,18 @@ if (hfile) { if (cfile) { printc(common_head \ + "#include \"opt_kdtrace.h\"\n" \ + "\n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ + "SDT_PROVIDER_DECLARE(vfs);\n" \ + "\n" \ "struct vnodeop_desc vop_default_desc = {\n" \ " \"default\",\n" \ " 0,\n" \ @@ -348,6 +354,10 @@ while ((getline < srcfile) > 0) { printc("\tVDESC_NO_OFFSET"); printc("};"); + printc("\n"); + printc("SDT_PROBE_DEFINE2(vfs, vop, " name ", entry, \"struct vnode *\", \"struct " name "_args *\");\n"); + printc("SDT_PROBE_DEFINE3(vfs, vop, " name ", return, \"struct vnode *\", \"struct " name "_args *\", \"int\");\n"); + # Print out function. printc("\nint\n" uname "_AP(struct " name "_args *a)"); printc("{"); @@ -364,6 +374,7 @@ while ((getline < srcfile) > 0) { printc("\t vop->"name" == NULL && vop->vop_bypass == NULL)") printc("\t\tvop = vop->vop_default;") printc("\tVNASSERT(vop != NULL, a->a_" args[0]", (\"No "name"(%p, %p)\", a->a_" args[0]", a));") + printc("\tSDT_PROBE(vfs, vop, " name ", entry, a->a_" args[0] ", a, 0, 0, 0);\n"); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); add_pre(name); @@ -372,6 +383,7 @@ while ((getline < srcfile) > 0) { printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") printc(ctrstr); + printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "OK", "\t\t"); From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 05:13:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC6BC1065673 for ; Sun, 29 Mar 2009 05:13:18 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outD.internet-mail-service.net (outd.internet-mail-service.net [216.240.47.227]) by mx1.freebsd.org (Postfix) with ESMTP id A8F8A8FC1B for ; Sun, 29 Mar 2009 05:13:18 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id B84B83BDFD; Sat, 28 Mar 2009 22:13:18 -0700 (PDT) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 4F8EE2D6053; Sat, 28 Mar 2009 22:13:15 -0700 (PDT) Message-ID: <49CF0382.7090102@elischer.org> Date: Sat, 28 Mar 2009 22:13:38 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: Christoph Mallon References: <49C5737F.1050902@gmx.de> <20090321.175756.-434257642.imp@bsdimp.com> <49C5F88C.3070600@freebsd.org> <20090322.070349.195750067.imp@bsdimp.com> <49C68197.1060204@elischer.org> <49CE77CE.3040801@gmx.de> In-Reply-To: <49CE77CE.3040801@gmx.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org, marius@alchemy.franken.de, svn-src-head@FreeBSD.org, "M. Warner Losh" Subject: Re: svn commit: r190098 - in head/sys/sparc64: fhc sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 05:13:19 -0000 Christoph Mallon wrote: > Julian Elischer schrieb: >> M. Warner Losh wrote: >>> In message: <49C5F88C.3070600@freebsd.org> >>> Andriy Gapon writes: >>> : E.g. you can have a simple 3 line block where you need a local >>> variable >>> : but that block is located 50 lines from start of an enclosing >>> function. >>> : Very convenient when you need to quickly glance the variable's type >>> (not). >>> >>> No you don't. There's absolutely nothing wrong with putting them at >>> the top. In fact, it is simpler, really, than having to go hunting >>> for dozens of different declarations. As someone who has spent a lot >>> of time looking at code, the time wasted looking for these damn-fool >>> things really adds up. >> >> and in a complicated function, if you have them all over the place you >> have no idea as to what the potential stack usage of the function is.. >> This matters in the kernel. > > The declared local variables are neither a lower *nor* an upper bound > for stack usage. no but it can give you an idea as to what is going on.. most modern compilers can reuse space for non overlapping variable scope but it's still useful.. I was not saying it needs to be that way, just that there are often arguments for doing thing sone way or another that can be non-obvious. From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 07:10:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 772D6106566C; Sun, 29 Mar 2009 07:10:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7468FC0C; Sun, 29 Mar 2009 07:10:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2T7AqJQ024726; Sun, 29 Mar 2009 07:10:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2T7AqVQ024725; Sun, 29 Mar 2009 07:10:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903290710.n2T7AqVQ024725@svn.freebsd.org> From: Alexander Motin Date: Sun, 29 Mar 2009 07:10:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190519 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 07:10:52 -0000 Author: mav Date: Sun Mar 29 07:10:52 2009 New Revision: 190519 URL: http://svn.freebsd.org/changeset/base/190519 Log: Fixup relative pointers after channel realloc. It fixes crash on systems with several HDA codecs per controller. While I am there, remove some unneeded dereferences. Submitted by: Tor Egge Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sun Mar 29 03:30:15 2009 (r190518) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Mar 29 07:10:52 2009 (r190519) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090316_0130" +#define HDA_DRV_TEST_REV "20090329_0131" SND_DECLARE_FILE("$FreeBSD$"); @@ -5280,7 +5280,7 @@ hdac_audio_bind_as(struct hdac_devinfo * sizeof(struct hdac_chan) * cnt, M_HDAC, M_ZERO | M_NOWAIT); if (sc->chans == NULL) { - device_printf(devinfo->codec->sc->dev, + device_printf(sc->dev, "Channels memory allocation failed!\n"); return; } @@ -5290,17 +5290,20 @@ hdac_audio_bind_as(struct hdac_devinfo * M_HDAC, M_ZERO | M_NOWAIT); if (sc->chans == NULL) { sc->num_chans = 0; - device_printf(devinfo->codec->sc->dev, + device_printf(sc->dev, "Channels memory allocation failed!\n"); return; } + /* Fixup relative pointers after realloc */ + for (j = 0; j < sc->num_chans; j++) + sc->chans[j].caps.fmtlist = sc->chans[j].fmtlist; } free = sc->num_chans; sc->num_chans += cnt; for (j = free; j < free + cnt; j++) { - devinfo->codec->sc->chans[j].devinfo = devinfo; - devinfo->codec->sc->chans[j].as = -1; + sc->chans[j].devinfo = devinfo; + sc->chans[j].as = -1; } /* Assign associations in order of their numbers, */ @@ -5309,10 +5312,10 @@ hdac_audio_bind_as(struct hdac_devinfo * continue; as[j].chan = free; - devinfo->codec->sc->chans[free].as = j; - devinfo->codec->sc->chans[free].dir = + sc->chans[free].as = j; + sc->chans[free].dir = (as[j].dir == HDA_CTL_IN) ? PCMDIR_REC : PCMDIR_PLAY; - hdac_pcmchannel_setup(&devinfo->codec->sc->chans[free]); + hdac_pcmchannel_setup(&sc->chans[free]); free++; } } From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 13:35:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43E2F1065673; Sun, 29 Mar 2009 13:35:21 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF748FC17; Sun, 29 Mar 2009 13:35:21 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TDZLgc036008; Sun, 29 Mar 2009 13:35:21 GMT (envelope-from mr@svn.freebsd.org) Received: (from mr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TDZLeS036007; Sun, 29 Mar 2009 13:35:21 GMT (envelope-from mr@svn.freebsd.org) Message-Id: <200903291335.n2TDZLeS036007@svn.freebsd.org> From: Michael Reifenberger Date: Sun, 29 Mar 2009 13:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190521 - head/sys/i386/cpufreq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 13:35:22 -0000 Author: mr Date: Sun Mar 29 13:35:20 2009 New Revision: 190521 URL: http://svn.freebsd.org/changeset/base/190521 Log: Extend comment in copyright notice as requested by author. Submitted by: G.Otsuji Modified: head/sys/i386/cpufreq/hwpstate.c Modified: head/sys/i386/cpufreq/hwpstate.c ============================================================================== --- head/sys/i386/cpufreq/hwpstate.c Sun Mar 29 08:07:36 2009 (r190520) +++ head/sys/i386/cpufreq/hwpstate.c Sun Mar 29 13:35:20 2009 (r190521) @@ -8,7 +8,7 @@ * Copyright (c) 2008-2009 Gen Otsuji * * This code is depending on kern_cpu.c, est.c, powernow.c, p4tcc.c, smist.c - * in various parts. The authors of these files are + * in various parts. The authors of these files are Nate Lawson, * Colin Percival, Bruno Durcot, and FUKUDA Nobuhiko. * This code contains patches by Michael Reifenberger and Norikatsu Shigemura. * Thank you. From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 14:09:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0750F106566C for ; Sun, 29 Mar 2009 14:09:59 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-bw0-f164.google.com (mail-bw0-f164.google.com [209.85.218.164]) by mx1.freebsd.org (Postfix) with ESMTP id 84D298FC1A for ; Sun, 29 Mar 2009 14:09:58 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: by bwz8 with SMTP id 8so1511056bwz.43 for ; Sun, 29 Mar 2009 07:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=DGXhc1ypBWIFOF6KU4HTcN9HgOuWem06VgfVumAU6+Q=; b=pfbTRLrhzIs3I7kb/i4vb1Us6H3g/s9uy79FMYJMvYHuDBZwYTMzGv4+/f63x/U7Lv npZwZbNQ6/lp41Xp3AjLXH61QGuY+mpahEZJqNvtTwe85FrM/piiZKgxJg7eXsGTCcgJ 7A42V2NPNLmZ8D/XHc3iGdTUtAzA7X7eLLJJs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=ZNB/LC29+dfowX27c0gbuSnZQ8lOYzeVxMbalYuinfDypRjZTnFJyr0koYfVLllc+V UNC+mnpT26JsYshVUeIBZldooC45UXUL1cGhwv+vlUIky58WTANSVo+KJVQyq3x9Xhqt akLNqr5rjjn/oN2yybxq45erHcUFyNFeMH7j0= MIME-Version: 1.0 Received: by 10.103.243.9 with SMTP id v9mr1229176mur.91.1238334192516; Sun, 29 Mar 2009 06:43:12 -0700 (PDT) In-Reply-To: <200903270317.n2R3HPR6046525@svn.freebsd.org> References: <200903270317.n2R3HPR6046525@svn.freebsd.org> Date: Sun, 29 Mar 2009 10:43:12 -0300 Message-ID: From: "Carlos A. M. dos Santos" To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190458 - head/sys/dev/wpi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 14:09:59 -0000 On Fri, Mar 27, 2009 at 12:17 AM, Juli Mallett wrote: > Author: jmallett > Date: Fri Mar 27 03:17:25 2009 > New Revision: 190458 > URL: http://svn.freebsd.org/changeset/base/190458 > > Log: > o) Check that no overrun or CRC errors were encountered in receiving a > packet. Linux, OpenBSD and our iwn(4) all do this. It also results in > a huge performance improvement (and the rejection of a fair number of > apparently-bad packets on receive) on my hardware. > o) Like the wpi(4) driver in OpenBSD, and like our iwn(4), also drop runt > packets. > o) Don't bother doing IFQ_POLL and then IFQ_DRV_DEQUEUE, just do > IFQ_DRV_DEQUEUE outright. This is more similar to how OpenBSD and our > iwn(4) work. Do you plan to MFC this? -- My preferred quotation of Robert Louis Stevenson is "You cannot make an omelette without breaking eggs". Not because I like the omelettes, but because I like the sound of eggs being broken. From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 15:10:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AAE510656EC; Sun, 29 Mar 2009 15:10:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 166A98FC19; Sun, 29 Mar 2009 15:10:50 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TFAn2O037753; Sun, 29 Mar 2009 15:10:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TFAnwD037751; Sun, 29 Mar 2009 15:10:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200903291510.n2TFAnwD037751@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Mar 2009 15:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190522 - head/sys/dev/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 15:10:53 -0000 Author: marius Date: Sun Mar 29 15:10:49 2009 New Revision: 190522 URL: http://svn.freebsd.org/changeset/base/190522 Log: Unbreak OF_interpret() and its standard implementation after r186347. Modified: head/sys/dev/ofw/ofw_standard.c head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/ofw_standard.c ============================================================================== --- head/sys/dev/ofw/ofw_standard.c Sun Mar 29 13:35:20 2009 (r190521) +++ head/sys/dev/ofw/ofw_standard.c Sun Mar 29 15:10:49 2009 (r190522) @@ -204,7 +204,7 @@ ofw_std_interpret(ofw_t ofw, const char } status = args.slot[i++]; while (i < 1 + nreturns) - returns[j] = args.slot[i++]; + returns[j++] = args.slot[i++]; return (status); } Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Sun Mar 29 13:35:20 2009 (r190521) +++ head/sys/dev/ofw/openfirm.c Sun Mar 29 15:10:49 2009 (r190522) @@ -164,9 +164,11 @@ OF_interpret(const char *cmd, int nretur int status; status = OFW_INTERPRET(ofw_obj, cmd, nreturns, slots); + if (status == -1) + return (status); va_start(ap, nreturns); - while (i < 1 + nreturns) + while (i < nreturns) *va_arg(ap, cell_t *) = slots[i++]; va_end(ap); From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 17:45:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 313BA106564A; Sun, 29 Mar 2009 17:45:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E2668FC0A; Sun, 29 Mar 2009 17:45:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2THjnBa040759; Sun, 29 Mar 2009 17:45:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2THjmbg040755; Sun, 29 Mar 2009 17:45:48 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200903291745.n2THjmbg040755@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 29 Mar 2009 17:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190524 - in head/sys: security/mac_biba security/mac_bsdextended security/mac_mls sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 17:45:49 -0000 Author: trasz Date: Sun Mar 29 17:45:48 2009 New Revision: 190524 URL: http://svn.freebsd.org/changeset/base/190524 Log: Get rid of VSTAT and replace it with VSTAT_PERMS, which is somewhat better defined. Approved by: rwatson (mentor) Modified: head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_bsdextended/mac_bsdextended.c head/sys/security/mac_mls/mac_mls.c head/sys/sys/vnode.h Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Sun Mar 29 17:42:30 2009 (r190523) +++ head/sys/security/mac_biba/mac_biba.c Sun Mar 29 17:45:48 2009 (r190524) @@ -2892,11 +2892,11 @@ biba_vnode_check_open(struct ucred *cred obj = SLOT(vplabel); /* XXX privilege override for admin? */ - if (accmode & (VREAD | VEXEC | VSTAT)) { + if (accmode & (VREAD | VEXEC | VSTAT_PERMS)) { if (!biba_dominate_effective(obj, subj)) return (EACCES); } - if (accmode & (VWRITE | VAPPEND | VADMIN)) { + if (accmode & VMODIFY_PERMS) { if (!biba_dominate_effective(subj, obj)) return (EACCES); } Modified: head/sys/security/mac_bsdextended/mac_bsdextended.c ============================================================================== --- head/sys/security/mac_bsdextended/mac_bsdextended.c Sun Mar 29 17:42:30 2009 (r190523) +++ head/sys/security/mac_bsdextended/mac_bsdextended.c Sun Mar 29 17:45:48 2009 (r190524) @@ -478,9 +478,9 @@ ugidfw_accmode2mbi(accmode_t accmode) mbi |= MBI_WRITE; if (accmode & VREAD) mbi |= MBI_READ; - if (accmode & VADMIN) + if (accmode & VADMIN_PERMS) mbi |= MBI_ADMIN; - if (accmode & VSTAT) + if (accmode & VSTAT_PERMS) mbi |= MBI_STAT; if (accmode & VAPPEND) mbi |= MBI_APPEND; Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Sun Mar 29 17:42:30 2009 (r190523) +++ head/sys/security/mac_mls/mac_mls.c Sun Mar 29 17:45:48 2009 (r190524) @@ -2515,11 +2515,11 @@ mls_vnode_check_open(struct ucred *cred, obj = SLOT(vplabel); /* XXX privilege override for admin? */ - if (accmode & (VREAD | VEXEC | VSTAT)) { + if (accmode & (VREAD | VEXEC | VSTAT_PERMS)) { if (!mls_dominate_effective(subj, obj)) return (EACCES); } - if (accmode & (VWRITE | VAPPEND | VADMIN)) { + if (accmode & VMODIFY_PERMS) { if (!mls_dominate_effective(obj, subj)) return (EACCES); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Mar 29 17:42:30 2009 (r190523) +++ head/sys/sys/vnode.h Sun Mar 29 17:45:48 2009 (r190524) @@ -314,7 +314,6 @@ struct vattr { #define VWRITE 000000000200 /* write permission */ #define VREAD 000000000400 /* read permission */ #define VADMIN 000000010000 /* being the file owner */ -#define VSTAT 000000020000 /* permission to retrieve attrs */ #define VAPPEND 000000040000 /* permission to write/append */ /* * VEXPLICIT_DENY makes VOP_ACCESS(9) return EPERM or EACCES only @@ -344,7 +343,7 @@ struct vattr { /* * Permissions that were traditionally granted to everyone. */ -#define VSTAT_PERMS (VSTAT | VREAD_ATTRIBUTES | VREAD_ACL | VSYNCHRONIZE) +#define VSTAT_PERMS (VREAD_ATTRIBUTES | VREAD_ACL) /* * Permissions that allow to change the state of the file in any way. From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 17:55:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76DB61065695; Sun, 29 Mar 2009 17:55:11 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6425B8FC08; Sun, 29 Mar 2009 17:55:11 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2THtBpQ040965; Sun, 29 Mar 2009 17:55:11 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2THtBwY040964; Sun, 29 Mar 2009 17:55:11 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200903291755.n2THtBwY040964@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 29 Mar 2009 17:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190525 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 17:55:12 -0000 Author: ume Date: Sun Mar 29 17:55:11 2009 New Revision: 190525 URL: http://svn.freebsd.org/changeset/base/190525 Log: Query DNS only once per an address family. Obtained from: KAME MFC after: 2 weeks Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sun Mar 29 17:45:48 2009 (r190524) +++ head/lib/libc/net/getaddrinfo.c Sun Mar 29 17:55:11 2009 (r190525) @@ -102,7 +102,6 @@ __FBSDID("$FreeBSD$"); # define FAITH #endif -#define SUCCESS 0 #define ANY 0 #define YES 1 #define NO 0 @@ -179,11 +178,6 @@ static const struct explore explore[] = { PF_INET, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 }, { PF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, { PF_INET, SOCK_RAW, ANY, NULL, 0x05 }, - { PF_UNSPEC, SOCK_DGRAM, IPPROTO_UDP, "udp", 0x07 }, - { PF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, "tcp", 0x07 }, - { PF_UNSPEC, SOCK_STREAM, IPPROTO_SCTP, "sctp", 0x03 }, - { PF_UNSPEC, SOCK_SEQPACKET, IPPROTO_SCTP, "sctp", 0x07 }, - { PF_UNSPEC, SOCK_RAW, ANY, NULL, 0x05 }, { -1, 0, 0, NULL, 0 }, }; @@ -233,6 +227,8 @@ typedef union { } querybuf; static int str2number(const char *, int *); +static int explore_copy(const struct addrinfo *, const struct addrinfo *, + struct addrinfo **); static int explore_null(const struct addrinfo *, const char *, struct addrinfo **); static int explore_numeric(const struct addrinfo *, const char *, @@ -243,6 +239,7 @@ static int get_canonname(const struct ad struct addrinfo *, const char *); static struct addrinfo *get_ai(const struct addrinfo *, const struct afd *, const char *); +static struct addrinfo *copy_ai(const struct addrinfo *); static int get_portmatch(const struct addrinfo *, const char *); static int get_port(struct addrinfo *, const char *, int); static const struct afd *find_afd(int); @@ -371,12 +368,23 @@ getaddrinfo(const char *hostname, const struct addrinfo sentinel; struct addrinfo *cur; int error = 0; - struct addrinfo ai; - struct addrinfo ai0; + struct addrinfo ai, ai0, *afai; struct addrinfo *pai; + const struct afd *afd; const struct explore *ex; + struct addrinfo *afailist[sizeof(afdl)/sizeof(afdl[0])]; + struct addrinfo *afai_unspec; + int found; int numeric = 0; + /* ensure we return NULL on errors */ + *res = NULL; + + memset(&ai, 0, sizeof(ai)); + + memset(afailist, 0, sizeof(afailist)); + afai_unspec = NULL; + memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; pai = &ai; @@ -416,15 +424,18 @@ getaddrinfo(const char *hostname, const */ if (pai->ai_socktype != ANY && pai->ai_protocol != ANY) { for (ex = explore; ex->e_af >= 0; ex++) { - if (pai->ai_family != ex->e_af) + if (!MATCH_FAMILY(pai->ai_family, ex->e_af, + WILD_AF(ex))) continue; - if (ex->e_socktype == ANY) + if (!MATCH(pai->ai_socktype, ex->e_socktype, + WILD_SOCKTYPE(ex))) continue; - if (ex->e_protocol == ANY) + if (!MATCH(pai->ai_protocol, ex->e_protocol, + WILD_PROTOCOL(ex))) continue; - if (pai->ai_socktype == ex->e_socktype && - pai->ai_protocol == ex->e_protocol) - break; + + /* matched */ + break; } if (ex->e_af < 0) @@ -460,49 +471,48 @@ getaddrinfo(const char *hostname, const ai0 = *pai; - /* NULL hostname, or numeric hostname */ - for (ex = explore; ex->e_af >= 0; ex++) { + /* + * NULL hostname, or numeric hostname. + * If numeric representation of AF1 can be interpreted as FQDN + * representation of AF2, we need to think again about the code below. + */ + found = 0; + for (afd = afdl; afd->a_af; afd++) { *pai = ai0; - /* PF_UNSPEC entries are prepared for DNS queries only */ - if (ex->e_af == PF_UNSPEC) - continue; - - if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) - continue; - if (!MATCH(pai->ai_socktype, ex->e_socktype, WILD_SOCKTYPE(ex))) - continue; - if (!MATCH(pai->ai_protocol, ex->e_protocol, WILD_PROTOCOL(ex))) + if (!MATCH_FAMILY(pai->ai_family, afd->a_af, 1)) continue; if (pai->ai_family == PF_UNSPEC) - pai->ai_family = ex->e_af; - if (pai->ai_socktype == ANY && ex->e_socktype != ANY) - pai->ai_socktype = ex->e_socktype; - if (pai->ai_protocol == ANY && ex->e_protocol != ANY) - pai->ai_protocol = ex->e_protocol; + pai->ai_family = afd->a_af; - if (hostname == NULL) - error = explore_null(pai, servname, &cur->ai_next); - else + if (hostname == NULL) { + error = explore_null(pai, servname, + &afailist[afd - afdl]); + + /* + * Errors from explore_null should be unexpected and + * be caught to avoid returning an incomplete result. + */ + if (error != 0) + goto bad; + } else { error = explore_numeric_scope(pai, hostname, servname, - &cur->ai_next); + &afailist[afd - afdl]); - if (error) - goto free; + /* + * explore_numeric_scope returns an error for address + * families that do not match that of hostname. + * Thus we should not catch the error at this moment. + */ + } - while (cur && cur->ai_next) - cur = cur->ai_next; + if (!error && afailist[afd - afdl]) + found++; } - - /* - * XXX - * If numreic representation of AF1 can be interpreted as FQDN - * representation of AF2, we need to think again about the code below. - */ - if (sentinel.ai_next) { + if (found) { numeric = 1; - goto good; + goto globcopy; } if (hostname == NULL) @@ -515,42 +525,55 @@ getaddrinfo(const char *hostname, const /* * hostname as alphabetical name. - * we would like to prefer AF_INET6 than AF_INET, so we'll make a - * outer loop by AFs. */ + *pai = ai0; + error = explore_fqdn(pai, hostname, servname, &afai_unspec); + +globcopy: for (ex = explore; ex->e_af >= 0; ex++) { *pai = ai0; - /* require exact match for family field */ - if (pai->ai_family != ex->e_af) + if (!MATCH_FAMILY(pai->ai_family, ex->e_af, WILD_AF(ex))) continue; - if (!MATCH(pai->ai_socktype, ex->e_socktype, - WILD_SOCKTYPE(ex))) { + WILD_SOCKTYPE(ex))) continue; - } if (!MATCH(pai->ai_protocol, ex->e_protocol, - WILD_PROTOCOL(ex))) { + WILD_PROTOCOL(ex))) continue; - } + if (pai->ai_family == PF_UNSPEC) + pai->ai_family = ex->e_af; if (pai->ai_socktype == ANY && ex->e_socktype != ANY) pai->ai_socktype = ex->e_socktype; if (pai->ai_protocol == ANY && ex->e_protocol != ANY) pai->ai_protocol = ex->e_protocol; - error = explore_fqdn(pai, hostname, servname, - &cur->ai_next); + /* + * if the servname does not match socktype/protocol, ignore it. + */ + if (get_portmatch(pai, servname) != 0) + continue; + + if (afai_unspec) + afai = afai_unspec; + else { + if ((afd = find_afd(pai->ai_family)) == NULL) + continue; + /* XXX assumes that afd points inside afdl[] */ + afai = afailist[afd - afdl]; + } + if (!afai) + continue; + + error = explore_copy(pai, afai, &cur->ai_next); + if (error != 0) + goto bad; while (cur && cur->ai_next) cur = cur->ai_next; } - /* XXX inhibit errors if we have the result */ - if (sentinel.ai_next) - error = 0; - -good: /* * ensure we return either: * - error == 0, non-NULL *res @@ -586,16 +609,22 @@ good: } } *res = sentinel.ai_next; - return SUCCESS; } else error = EAI_FAIL; } -free: + bad: - if (sentinel.ai_next) - freeaddrinfo(sentinel.ai_next); - *res = NULL; - return error; + if (afai_unspec) + freeaddrinfo(afai_unspec); + for (afd = afdl; afd->a_af; afd++) { + if (afailist[afd - afdl]) + freeaddrinfo(afailist[afd - afdl]); + } + if (!*res) + if (sentinel.ai_next) + freeaddrinfo(sentinel.ai_next); + + return (error); } static int @@ -1047,6 +1076,41 @@ gai_addr2scopetype(struct sockaddr *sa) } } +static int +explore_copy(const struct addrinfo *pai, const struct addrinfo *src0, + struct addrinfo **res) +{ + int error; + struct addrinfo sentinel, *cur; + const struct addrinfo *src; + + error = 0; + sentinel.ai_next = NULL; + cur = &sentinel; + + for (src = src0; src != NULL; src = src->ai_next) { + if (src->ai_family != pai->ai_family) + continue; + + cur->ai_next = copy_ai(src); + if (!cur->ai_next) { + error = EAI_MEMORY; + goto fail; + } + + cur->ai_next->ai_socktype = pai->ai_socktype; + cur->ai_next->ai_protocol = pai->ai_protocol; + cur = cur->ai_next; + } + + *res = sentinel.ai_next; + return 0; + +fail: + freeaddrinfo(sentinel.ai_next); + return error; +} + /* * hostname == NULL. * passive socket -> anyaddr (0.0.0.0 or ::) @@ -1075,12 +1139,6 @@ explore_null(const struct addrinfo *pai, } else _close(s); - /* - * if the servname does not match socktype/protocol, ignore it. - */ - if (get_portmatch(pai, servname) != 0) - return 0; - afd = find_afd(pai->ai_family); if (afd == NULL) return 0; @@ -1117,12 +1175,6 @@ explore_numeric(const struct addrinfo *p *res = NULL; ai = NULL; - /* - * if the servname does not match socktype/protocol, ignore it. - */ - if (get_portmatch(pai, servname) != 0) - return 0; - afd = find_afd(pai->ai_family); if (afd == NULL) return 0; @@ -1189,12 +1241,6 @@ explore_numeric_scope(const struct addri char *cp, *hostname2 = NULL, *scope, *addr; struct sockaddr_in6 *sin6; - /* - * if the servname does not match socktype/protocol, ignore it. - */ - if (get_portmatch(pai, servname) != 0) - return 0; - afd = find_afd(pai->ai_family); if (afd == NULL) return 0; @@ -1227,6 +1273,8 @@ explore_numeric_scope(const struct addri sin6 = (struct sockaddr_in6 *)(void *)cur->ai_addr; if (ip6_str2scopeid(scope, sin6, &scopeid) == -1) { free(hostname2); + freeaddrinfo(*res); + *res = NULL; return(EAI_NONAME); /* XXX: is return OK? */ } sin6->sin6_scope_id = scopeid; @@ -1235,6 +1283,10 @@ explore_numeric_scope(const struct addri free(hostname2); + if (error && *res) { + freeaddrinfo(*res); + *res = NULL; + } return error; #endif } @@ -1318,6 +1370,38 @@ get_ai(const struct addrinfo *pai, const return ai; } +/* XXX need to malloc() the same way we do from other functions! */ +static struct addrinfo * +copy_ai(const struct addrinfo *pai) +{ + struct addrinfo *ai; + size_t l; + + l = sizeof(*ai) + pai->ai_addrlen; + if ((ai = (struct addrinfo *)malloc(l)) == NULL) + return NULL; + memset(ai, 0, l); + memcpy(ai, pai, sizeof(*ai)); + ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); + memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen); + + if (pai->ai_canonname) { + l = strlen(pai->ai_canonname) + 1; + if ((ai->ai_canonname = malloc(l)) == NULL) { + free(ai); + return NULL; + } + strlcpy(ai->ai_canonname, pai->ai_canonname, l); + } else { + /* just to make sure */ + ai->ai_canonname = NULL; + } + + ai->ai_next = NULL; + + return ai; +} + static int get_portmatch(const struct addrinfo *ai, const char *servname) { From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 17:59:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9820106566C; Sun, 29 Mar 2009 17:59:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4CD18FC22; Sun, 29 Mar 2009 17:59:15 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2THxFw6041087; Sun, 29 Mar 2009 17:59:15 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2THxEh4041069; Sun, 29 Mar 2009 17:59:14 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903291759.n2THxEh4041069@svn.freebsd.org> From: Sam Leffler Date: Sun, 29 Mar 2009 17:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190526 - in head/sys: dev/ath dev/if_ndis dev/ipw dev/iwi dev/iwn dev/malo dev/ral dev/usb/wlan dev/wi dev/wpi net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 17:59:16 -0000 Author: sam Date: Sun Mar 29 17:59:14 2009 New Revision: 190526 URL: http://svn.freebsd.org/changeset/base/190526 Log: Eliminate ic_myaddr so changing the mac address of a device works correctly: o remove ic_myaddr from ieee80211com o change ieee80211_ifattach to take the mac address of the physical device and use that to setup the lladdr. o replace all references to ic_myaddr in drivers by IF_LLADDR o related cleanups (e.g. kill dead code) PR: kern/133178 Reviewed by: thompsa, rpaulo Modified: head/sys/dev/ath/if_ath.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwn/if_iwn.c head/sys/dev/malo/if_malo.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/wi/if_wi.c head/sys/dev/wpi/if_wpi.c head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/ath/if_ath.c Sun Mar 29 17:59:14 2009 (r190526) @@ -353,6 +353,7 @@ ath_attach(u_int16_t devid, struct ath_s HAL_STATUS status; int error = 0, i; u_int wmodes; + uint8_t macaddr[IEEE80211_ADDR_LEN]; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); @@ -681,14 +682,14 @@ ath_attach(u_int16_t devid, struct ath_s sc->sc_hasveol = ath_hal_hasveol(ah); /* get mac address from hardware */ - ath_hal_getmac(ah, ic->ic_myaddr); + ath_hal_getmac(ah, macaddr); if (sc->sc_hasbmask) ath_hal_getbssidmask(ah, sc->sc_hwbssidmask); /* NB: used to size node table key mapping array */ ic->ic_max_keyix = sc->sc_keymax; /* call MI attach routine. */ - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_setregdomain = ath_setregdomain; ic->ic_getradiocaps = ath_getradiocaps; sc->sc_opmode = HAL_M_STA; @@ -2755,7 +2756,6 @@ static void ath_mode_init(struct ath_softc *sc) { struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; struct ath_hal *ah = sc->sc_ah; u_int32_t rfilt; @@ -2766,16 +2766,8 @@ ath_mode_init(struct ath_softc *sc) /* configure operational mode */ ath_hal_setopmode(ah); - /* - * Handle any link-level address change. Note that we only - * need to force ic_myaddr; any other addresses are handled - * as a byproduct of the ifnet code marking the interface - * down then up. - * - * XXX should get from lladdr instead of arpcom but that's more work - */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - ath_hal_setmac(ah, ic->ic_myaddr); + /* handle any link-level address change */ + ath_hal_setmac(ah, IF_LLADDR(ifp)); /* calculate and install multicast filter */ ath_update_mcast(ifp); Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/if_ndis/if_ndis.c Sun Mar 29 17:59:14 2009 (r190526) @@ -937,8 +937,7 @@ got_crypto: if (r == 0) ic->ic_caps |= IEEE80211_C_TXPMGT; - bcopy(eaddr, &ic->ic_myaddr, sizeof(eaddr)); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, eaddr); ic->ic_raw_xmit = ndis_raw_xmit; ic->ic_scan_start = ndis_scan_start; ic->ic_scan_end = ndis_scan_end; @@ -2408,7 +2407,7 @@ ndis_setstate_80211(sc) /* Set the BSSID to our value so the driver doesn't associate */ len = IEEE80211_ADDR_LEN; - bcopy(ic->ic_myaddr, bssid, len); + bcopy(IF_LLADDR(ifp), bssid, len); DPRINTF(("Setting BSSID to %6D\n", (uint8_t *)&bssid, ":")); rval = ndis_set_info(sc, OID_802_11_BSSID, &bssid, &len); if (rval) Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/ipw/if_ipw.c Sun Mar 29 17:59:14 2009 (r190526) @@ -231,6 +231,7 @@ ipw_attach(device_t dev) struct ieee80211_channel *c; uint16_t val; int error, i; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -315,14 +316,14 @@ ipw_attach(device_t dev) /* read MAC address from EEPROM */ val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 0); - ic->ic_myaddr[0] = val >> 8; - ic->ic_myaddr[1] = val & 0xff; + macaddr[0] = val >> 8; + macaddr[1] = val & 0xff; val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 1); - ic->ic_myaddr[2] = val >> 8; - ic->ic_myaddr[3] = val & 0xff; + macaddr[2] = val >> 8; + macaddr[3] = val & 0xff; val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 2); - ic->ic_myaddr[4] = val >> 8; - ic->ic_myaddr[5] = val & 0xff; + macaddr[4] = val >> 8; + macaddr[5] = val & 0xff; /* set supported .11b channels (read from EEPROM) */ if ((val = ipw_read_prom_word(sc, IPW_EEPROM_CHANNEL_LIST)) == 0) @@ -341,7 +342,7 @@ ipw_attach(device_t dev) if (!(ipw_read_prom_word(sc, IPW_EEPROM_RADIO) & 8)) sc->flags |= IPW_FLAG_HAS_RADIO_SWITCH; - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_scan_start = ipw_scan_start; ic->ic_scan_end = ipw_scan_end; ic->ic_set_channel = ipw_set_channel; Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/iwi/if_iwi.c Sun Mar 29 17:59:14 2009 (r190526) @@ -280,6 +280,7 @@ iwi_attach(device_t dev) uint16_t val; int i, error; uint8_t bands; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -403,14 +404,14 @@ iwi_attach(device_t dev) /* read MAC address from EEPROM */ val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 0); - ic->ic_myaddr[0] = val & 0xff; - ic->ic_myaddr[1] = val >> 8; + macaddr[0] = val & 0xff; + macaddr[1] = val >> 8; val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 1); - ic->ic_myaddr[2] = val & 0xff; - ic->ic_myaddr[3] = val >> 8; + macaddr[2] = val & 0xff; + macaddr[3] = val >> 8; val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2); - ic->ic_myaddr[4] = val & 0xff; - ic->ic_myaddr[5] = val >> 8; + macaddr[4] = val & 0xff; + macaddr[5] = val >> 8; bands = 0; setbit(&bands, IEEE80211_MODE_11B); @@ -419,7 +420,7 @@ iwi_attach(device_t dev) setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); /* override default methods */ ic->ic_node_alloc = iwi_node_alloc; sc->sc_node_free = ic->ic_node_free; @@ -2568,9 +2569,8 @@ iwi_config(struct iwi_softc *sc) IWI_LOCK_ASSERT(sc); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - DPRINTF(("Setting MAC address to %6D\n", ic->ic_myaddr, ":")); - error = iwi_cmd(sc, IWI_CMD_SET_MAC_ADDRESS, ic->ic_myaddr, + DPRINTF(("Setting MAC address to %6D\n", IF_LLADDR(ifp), ":")); + error = iwi_cmd(sc, IWI_CMD_SET_MAC_ADDRESS, IF_LLADDR(ifp), IEEE80211_ADDR_LEN); if (error != 0) return error; Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 29 17:59:14 2009 (r190526) @@ -132,7 +132,8 @@ void iwn_cmd_intr(struct iwn_softc *, s static void iwn_bmiss(void *, int); void iwn_notif_intr(struct iwn_softc *); void iwn_intr(void *); -void iwn_read_eeprom(struct iwn_softc *); +void iwn_read_eeprom(struct iwn_softc *, + uint8_t macaddr[IEEE80211_ADDR_LEN]); static void iwn_read_eeprom_channels(struct iwn_softc *); void iwn_print_power_group(struct iwn_softc *, int); uint8_t iwn_plcp_signal(int); @@ -254,6 +255,7 @@ iwn_attach(device_t dev) struct ieee80211com *ic; struct ifnet *ifp; int i, error, result; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -410,7 +412,7 @@ iwn_attach(device_t dev) ; #endif /* read supported channels and MAC address from EEPROM */ - iwn_read_eeprom(sc); + iwn_read_eeprom(sc, macaddr); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_softc = sc; @@ -422,7 +424,7 @@ iwn_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_vap_create = iwn_vap_create; ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; @@ -2409,10 +2411,8 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, } void -iwn_read_eeprom(struct iwn_softc *sc) +iwn_read_eeprom(struct iwn_softc *sc, uint8_t macaddr[IEEE80211_ADDR_LEN]) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; char domain[4]; uint16_t val; int i, error; @@ -2427,8 +2427,8 @@ iwn_read_eeprom(struct iwn_softc *sc) device_printf(sc->sc_dev,"Reg Domain: %.4s", domain); /* read and print MAC address */ - iwn_read_prom_data(sc, IWN_EEPROM_MAC, ic->ic_myaddr, 6); - printf(", address %s\n", ether_sprintf(ic->ic_myaddr)); + iwn_read_prom_data(sc, IWN_EEPROM_MAC, macaddr, 6); + printf(", address %6D\n", macaddr, ":"); /* read the list of authorized channels */ iwn_read_eeprom_channels(sc); @@ -3754,7 +3754,7 @@ iwn_scan(struct iwn_softc *sc) IEEE80211_FC0_SUBTYPE_PROBE_REQ; wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); - IEEE80211_ADDR_COPY(wh->i_addr2, ic->ic_myaddr); + IEEE80211_ADDR_COPY(wh->i_addr2, IF_LLADDR(ifp)); IEEE80211_ADDR_COPY(wh->i_addr3, ifp->if_broadcastaddr); *(u_int16_t *)&wh->i_dur[0] = 0; /* filled by h/w */ *(u_int16_t *)&wh->i_seq[0] = 0; /* filled by h/w */ @@ -3892,8 +3892,8 @@ iwn_config(struct iwn_softc *sc) /* configure adapter */ memset(&sc->config, 0, sizeof (struct iwn_config)); - IEEE80211_ADDR_COPY(sc->config.myaddr, ic->ic_myaddr); - IEEE80211_ADDR_COPY(sc->config.wlap, ic->ic_myaddr); + IEEE80211_ADDR_COPY(sc->config.myaddr, IF_LLADDR(ifp)); + IEEE80211_ADDR_COPY(sc->config.wlap, IF_LLADDR(ifp)); /* set default channel */ sc->config.chan = htole16(ieee80211_chan2ieee(ic, ic->ic_curchan)); sc->config.flags = htole32(IWN_CONFIG_TSF); Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/malo/if_malo.c Sun Mar 29 17:59:14 2009 (r190526) @@ -175,16 +175,10 @@ malo_bar0_write4(struct malo_softc *sc, bus_space_write_4(sc->malo_io0t, sc->malo_io0h, off, val); } -static uint8_t -malo_bar1_read1(struct malo_softc *sc, bus_size_t off) -{ - return bus_space_read_1(sc->malo_io1t, sc->malo_io1h, off); -} - int malo_attach(uint16_t devid, struct malo_softc *sc) { - int error, i; + int error; struct ieee80211com *ic; struct ifnet *ifp; struct malo_hal *mh; @@ -203,16 +197,6 @@ malo_attach(uint16_t devid, struct malo_ if_initname(ifp, device_get_name(sc->malo_dev), device_get_unit(sc->malo_dev)); - /* - * NB: get mac address from hardware directly here before we set DMAs - * for HAL because we don't want to disturb operations of HAL at BAR 1. - */ - for (i = 0; i < IEEE80211_ADDR_LEN; i++) { - /* XXX remove a magic number but we don't have documents. */ - ic->ic_myaddr[i] = malo_bar1_read1(sc, 0xa528 + i); - DELAY(1000); - } - mh = malo_hal_attach(sc->malo_dev, devid, sc->malo_io1h, sc->malo_io1t, sc->malo_dmat); if (mh == NULL) { @@ -319,11 +303,8 @@ malo_attach(uint16_t devid, struct malo_ ic->ic_headroom = sizeof(struct malo_txrec) - sizeof(struct ieee80211_frame); - /* get mac address from hardware */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->malo_hwspecs.macaddr); - /* call MI attach routine. */ - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, sc->malo_hwspecs.macaddr); /* override default methods */ ic->ic_vap_create = malo_vap_create; ic->ic_vap_delete = malo_vap_delete; @@ -1636,14 +1617,6 @@ malo_mode_init(struct malo_softc *sc) struct malo_hal *mh = sc->malo_mh; /* - * Handle any link-level address change. Note that we only - * need to force ic_myaddr; any other addresses are handled - * as a byproduct of the ifnet code marking the interface - * down then up. - */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - - /* * NB: Ignore promisc in hostap mode; it's set by the * bridge. This is wrong but we have no way to * identify internal requests (from the bridge) Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/ral/rt2560.c Sun Mar 29 17:59:14 2009 (r190526) @@ -202,6 +202,7 @@ rt2560_attach(device_t dev, int id) struct ifnet *ifp; int error; uint8_t bands; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -260,7 +261,7 @@ rt2560_attach(device_t dev, int id) ic = ifp->if_l2com; /* retrieve MAC address */ - rt2560_get_macaddr(sc, ic->ic_myaddr); + rt2560_get_macaddr(sc, macaddr); ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); @@ -300,7 +301,7 @@ rt2560_attach(device_t dev, int id) setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_newassoc = rt2560_newassoc; ic->ic_raw_xmit = rt2560_raw_xmit; ic->ic_updateslot = rt2560_update_slot; @@ -2683,8 +2684,7 @@ rt2560_init_locked(struct rt2560_softc * for (i = 0; i < N(rt2560_def_mac); i++) RAL_WRITE(sc, rt2560_def_mac[i].reg, rt2560_def_mac[i].val); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - rt2560_set_macaddr(sc, ic->ic_myaddr); + rt2560_set_macaddr(sc, IF_LLADDR(ifp)); /* set basic rate set (will be updated later) */ RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x153); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/ral/rt2661.c Sun Mar 29 17:59:14 2009 (r190526) @@ -155,7 +155,7 @@ static int rt2661_wme_update(struct iee static void rt2661_update_slot(struct ifnet *); static const char *rt2661_get_rf(int); static void rt2661_read_eeprom(struct rt2661_softc *, - struct ieee80211com *); + uint8_t macaddr[IEEE80211_ADDR_LEN]); static int rt2661_bbp_init(struct rt2661_softc *); static void rt2661_init_locked(struct rt2661_softc *); static void rt2661_init(void *); @@ -204,6 +204,7 @@ rt2661_attach(device_t dev, int id) uint32_t val; int error, ac, ntries; uint8_t bands; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_id = id; sc->sc_dev = dev; @@ -234,7 +235,7 @@ rt2661_attach(device_t dev, int id) } /* retrieve RF rev. no and various other things from EEPROM */ - rt2661_read_eeprom(sc, ic); + rt2661_read_eeprom(sc, macaddr); device_printf(dev, "MAC/BBP RT%X, RF %s\n", val, rt2661_get_rf(sc->rf_rev)); @@ -303,7 +304,7 @@ rt2661_attach(device_t dev, int id) setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_newassoc = rt2661_newassoc; ic->ic_node_alloc = rt2661_node_alloc; #if 0 @@ -2219,23 +2220,23 @@ rt2661_get_rf(int rev) } static void -rt2661_read_eeprom(struct rt2661_softc *sc, struct ieee80211com *ic) +rt2661_read_eeprom(struct rt2661_softc *sc, uint8_t macaddr[IEEE80211_ADDR_LEN]) { uint16_t val; int i; /* read MAC address */ val = rt2661_eeprom_read(sc, RT2661_EEPROM_MAC01); - ic->ic_myaddr[0] = val & 0xff; - ic->ic_myaddr[1] = val >> 8; + macaddr[0] = val & 0xff; + macaddr[1] = val >> 8; val = rt2661_eeprom_read(sc, RT2661_EEPROM_MAC23); - ic->ic_myaddr[2] = val & 0xff; - ic->ic_myaddr[3] = val >> 8; + macaddr[2] = val & 0xff; + macaddr[3] = val >> 8; val = rt2661_eeprom_read(sc, RT2661_EEPROM_MAC45); - ic->ic_myaddr[4] = val & 0xff; - ic->ic_myaddr[5] = val >> 8; + macaddr[4] = val & 0xff; + macaddr[5] = val >> 8; val = rt2661_eeprom_read(sc, RT2661_EEPROM_ANTENNA); /* XXX: test if different from 0xffff? */ @@ -2413,8 +2414,7 @@ rt2661_init_locked(struct rt2661_softc * for (i = 0; i < N(rt2661_def_mac); i++) RAL_WRITE(sc, rt2661_def_mac[i].reg, rt2661_def_mac[i].val); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - rt2661_set_macaddr(sc, ic->ic_myaddr); + rt2661_set_macaddr(sc, IF_LLADDR(ifp)); /* set host ready */ RAL_WRITE(sc, RT2661_MAC_CSR1, 3); Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/usb/wlan/if_rum.c Sun Mar 29 17:59:14 2009 (r190526) @@ -494,7 +494,6 @@ rum_attach_post(struct usb2_proc_msg *pm ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -516,7 +515,7 @@ rum_attach_post(struct usb2_proc_msg *pm setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, sc->sc_bssid); ic->ic_update_promisc = rum_update_promisc; ic->ic_newassoc = rum_newassoc; ic->ic_raw_xmit = rum_raw_xmit; @@ -2064,8 +2063,7 @@ rum_init_task(struct usb2_proc_msg *pm) /* clear STA registers */ rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - rum_set_macaddr(sc, ic->ic_myaddr); + rum_set_macaddr(sc, IF_LLADDR(ifp)); /* initialize ASIC */ rum_write(sc, RT2573_MAC_CSR1, 4); Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/usb/wlan/if_ural.c Sun Mar 29 17:59:14 2009 (r190526) @@ -485,7 +485,6 @@ ural_attach_post(struct usb2_proc_msg *p ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -507,7 +506,7 @@ ural_attach_post(struct usb2_proc_msg *p setbit(&bands, IEEE80211_MODE_11A); ieee80211_init_channels(ic, NULL, &bands); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, sc->sc_bssid); ic->ic_update_promisc = ural_update_promisc; ic->ic_newassoc = ural_newassoc; ic->ic_raw_xmit = ural_raw_xmit; @@ -2216,8 +2215,7 @@ ural_init_task(struct usb2_proc_msg *pm) ural_set_txantenna(sc, sc->tx_ant); ural_set_rxantenna(sc, sc->rx_ant); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - ural_set_macaddr(sc, ic->ic_myaddr); + ural_set_macaddr(sc, IF_LLADDR(ifp)); /* * Allocate Tx and Rx xfer queues. Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/usb/wlan/if_zyd.c Sun Mar 29 17:59:14 2009 (r190526) @@ -396,7 +396,6 @@ zyd_attach_post(struct usb2_proc_msg *pm ic->ic_ifp = ifp; ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */ ic->ic_opmode = IEEE80211_M_STA; - IEEE80211_ADDR_COPY(ic->ic_myaddr, sc->sc_bssid); /* set device capabilities */ ic->ic_caps = @@ -413,7 +412,7 @@ zyd_attach_post(struct usb2_proc_msg *pm setbit(&bands, IEEE80211_MODE_11G); ieee80211_init_channels(ic, NULL, &bands); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, sc->sc_bssid); ic->ic_newassoc = zyd_newassoc; ic->ic_raw_xmit = zyd_raw_xmit; ic->ic_node_alloc = zyd_node_alloc; @@ -2859,10 +2858,9 @@ zyd_init_task(struct usb2_proc_msg *pm) if (ifp->if_drv_flags & IFF_DRV_RUNNING) zyd_stop_task(pm); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - DPRINTF(sc, ZYD_DEBUG_INIT, "setting MAC address to %s\n", - ether_sprintf(ic->ic_myaddr)); - error = zyd_set_macaddr(sc, ic->ic_myaddr); + DPRINTF(sc, ZYD_DEBUG_INIT, "setting MAC address to %6D\n", + IF_LLADDR(ifp), ":"); + error = zyd_set_macaddr(sc, IF_LLADDR(ifp)); if (error != 0) return; Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/wi/if_wi.c Sun Mar 29 17:59:14 2009 (r190526) @@ -245,6 +245,7 @@ wi_attach(device_t dev) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; int error; + uint8_t macaddr[IEEE80211_ADDR_LEN]; ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { @@ -312,12 +313,12 @@ wi_attach(device_t dev) * the probe to fail. */ buflen = IEEE80211_ADDR_LEN; - error = wi_read_rid(sc, WI_RID_MAC_NODE, ic->ic_myaddr, &buflen); + error = wi_read_rid(sc, WI_RID_MAC_NODE, macaddr, &buflen); if (error != 0) { buflen = IEEE80211_ADDR_LEN; - error = wi_read_rid(sc, WI_RID_MAC_NODE, ic->ic_myaddr, &buflen); + error = wi_read_rid(sc, WI_RID_MAC_NODE, macaddr, &buflen); } - if (error || IEEE80211_ADDR_EQ(ic->ic_myaddr, empty_macaddr)) { + if (error || IEEE80211_ADDR_EQ(macaddr, empty_macaddr)) { if (error != 0) device_printf(dev, "mac read failed %d\n", error); else { @@ -451,7 +452,7 @@ wi_attach(device_t dev) sc->sc_portnum = WI_DEFAULT_PORT; TASK_INIT(&sc->sc_oor_task, 0, wi_status_oor, ic); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); ic->ic_raw_xmit = wi_raw_xmit; ic->ic_scan_start = wi_scan_start; ic->ic_scan_end = wi_scan_end; @@ -690,7 +691,6 @@ static void wi_init_locked(struct wi_softc *sc) { struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; int wasenabled; WI_LOCK_ASSERT(sc); @@ -699,8 +699,7 @@ wi_init_locked(struct wi_softc *sc) if (wasenabled) wi_stop_locked(sc, 1); - IEEE80211_ADDR_COPY(ic->ic_myaddr, IF_LLADDR(ifp)); - if (wi_setup_locked(sc, sc->sc_porttype, 3, ic->ic_myaddr) != 0) { + if (wi_setup_locked(sc, sc->sc_porttype, 3, IF_LLADDR(ifp)) != 0) { if_printf(ifp, "interface not running\n"); wi_stop_locked(sc, 1); return; Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/dev/wpi/if_wpi.c Sun Mar 29 17:59:14 2009 (r190526) @@ -211,7 +211,8 @@ static void wpi_set_channel(struct ieee8 static void wpi_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void wpi_scan_mindwell(struct ieee80211_scan_state *); static int wpi_ioctl(struct ifnet *, u_long, caddr_t); -static void wpi_read_eeprom(struct wpi_softc *); +static void wpi_read_eeprom(struct wpi_softc *, + uint8_t macaddr[IEEE80211_ADDR_LEN]); static void wpi_read_eeprom_channels(struct wpi_softc *, int); static void wpi_read_eeprom_group(struct wpi_softc *, int); static int wpi_cmd(struct wpi_softc *, int, const void *, int, int); @@ -493,6 +494,7 @@ wpi_attach(device_t dev) int ac, error, supportsa = 1; uint32_t tmp; const struct wpi_ident *ident; + uint8_t macaddr[IEEE80211_ADDR_LEN]; sc->sc_dev = dev; @@ -650,7 +652,7 @@ wpi_attach(device_t dev) * Read in the eeprom and also setup the channels for * net80211. We don't set the rates as net80211 does this for us */ - wpi_read_eeprom(sc); + wpi_read_eeprom(sc, macaddr); if (bootverbose || WPI_DEBUG_SET) { device_printf(sc->sc_dev, "Regulatory Domain: %.4s\n", sc->domain); @@ -675,7 +677,7 @@ wpi_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - ieee80211_ifattach(ic); + ieee80211_ifattach(ic, macaddr); /* override default methods */ ic->ic_node_alloc = wpi_node_alloc; ic->ic_newassoc = wpi_newassoc; @@ -2150,10 +2152,8 @@ wpi_ioctl(struct ifnet *ifp, u_long cmd, * Extract various information from EEPROM. */ static void -wpi_read_eeprom(struct wpi_softc *sc) +wpi_read_eeprom(struct wpi_softc *sc, uint8_t macaddr[IEEE80211_ADDR_LEN]) { - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; int i; /* read the hardware capabilities, revision and SKU type */ @@ -2165,7 +2165,7 @@ wpi_read_eeprom(struct wpi_softc *sc) wpi_read_prom_data(sc, WPI_EEPROM_DOMAIN, sc->domain, 4); /* read in the hw MAC address */ - wpi_read_prom_data(sc, WPI_EEPROM_MAC, ic->ic_myaddr, 6); + wpi_read_prom_data(sc, WPI_EEPROM_MAC, macaddr, 6); /* read the list of authorized channels */ for (i = 0; i < WPI_CHAN_BANDS_COUNT; i++) @@ -2638,7 +2638,7 @@ wpi_scan(struct wpi_softc *sc) IEEE80211_FC0_SUBTYPE_PROBE_REQ; wh->i_fc[1] = IEEE80211_FC1_DIR_NODS; IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr); - IEEE80211_ADDR_COPY(wh->i_addr2, ic->ic_myaddr); + IEEE80211_ADDR_COPY(wh->i_addr2, IF_LLADDR(ifp)); IEEE80211_ADDR_COPY(wh->i_addr3, ifp->if_broadcastaddr); *(u_int16_t *)&wh->i_dur[0] = 0; /* filled by h/w */ *(u_int16_t *)&wh->i_seq[0] = 0; /* filled by h/w */ @@ -2810,7 +2810,7 @@ wpi_config(struct wpi_softc *sc) /* configure adapter */ memset(&sc->config, 0, sizeof (struct wpi_config)); - IEEE80211_ADDR_COPY(sc->config.myaddr, ic->ic_myaddr); + IEEE80211_ADDR_COPY(sc->config.myaddr, IF_LLADDR(ifp)); /*set default channel*/ sc->config.chan = htole16(ieee80211_chan2ieee(ic, ic->ic_curchan)); sc->config.flags = htole32(WPI_CONFIG_TSF); Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/net80211/ieee80211.c Sun Mar 29 17:59:14 2009 (r190526) @@ -239,7 +239,8 @@ null_input(struct ifnet *ifp, struct mbu * the driver on attach to prior to creating any vap's. */ void -ieee80211_ifattach(struct ieee80211com *ic) +ieee80211_ifattach(struct ieee80211com *ic, + const uint8_t macaddr[IEEE80211_ADDR_LEN]) { struct ifnet *ifp = ic->ic_ifp; struct sockaddr_dl *sdl; @@ -290,7 +291,7 @@ ieee80211_ifattach(struct ieee80211com * sdl = (struct sockaddr_dl *)ifa->ifa_addr; sdl->sdl_type = IFT_ETHER; /* XXX IFT_IEEE80211? */ sdl->sdl_alen = IEEE80211_ADDR_LEN; - IEEE80211_ADDR_COPY(LLADDR(sdl), ic->ic_myaddr); + IEEE80211_ADDR_COPY(LLADDR(sdl), macaddr); } /* Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/net80211/ieee80211_ddb.c Sun Mar 29 17:59:14 2009 (r190526) @@ -445,7 +445,6 @@ _db_show_com(const struct ieee80211com * db_printf(" opmode %s", ieee80211_opmode_name[ic->ic_opmode]); db_printf("\n"); db_printf("\tmedia %p", &ic->ic_media); - db_printf(" myaddr %s", ether_sprintf(ic->ic_myaddr)); db_printf(" inact %p", &ic->ic_inact); db_printf("\n"); Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/net80211/ieee80211_freebsd.c Sun Mar 29 17:59:14 2009 (r190526) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -137,7 +138,7 @@ wlan_clone_create(struct if_clone *ifc, vap = ic->ic_vap_create(ic, ifc->ifc_name, unit, cp.icp_opmode, cp.icp_flags, cp.icp_bssid, cp.icp_flags & IEEE80211_CLONE_MACADDR ? - cp.icp_macaddr : ic->ic_myaddr); + cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp)); return (vap == NULL ? EIO : 0); } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Mar 29 17:55:11 2009 (r190525) +++ head/sys/net80211/ieee80211_var.h Sun Mar 29 17:59:14 2009 (r190526) @@ -115,7 +115,6 @@ struct ieee80211com { enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ enum ieee80211_opmode ic_opmode; /* operation mode */ struct ifmedia ic_media; /* interface media config */ - uint8_t ic_myaddr[IEEE80211_ADDR_LEN]; struct callout ic_inact; /* inactivity processing */ struct task ic_parent_task; /* deferred parent processing */ @@ -575,7 +574,8 @@ MALLOC_DECLARE(M_80211_VAP); "\20\1LDPC\2CHWIDTH40\5GREENFIELD\6SHORTGI20\7SHORTGI40\10TXSTBC" \ "\21AMPDU\22AMSDU\23HT\24SMPS\25RIFS" -void ieee80211_ifattach(struct ieee80211com *); +void ieee80211_ifattach(struct ieee80211com *, + const uint8_t macaddr[IEEE80211_ADDR_LEN]); void ieee80211_ifdetach(struct ieee80211com *); int ieee80211_vap_setup(struct ieee80211com *, struct ieee80211vap *, const char name[IFNAMSIZ], int unit, int opmode, int flags, From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 18:05:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02A0C106566B; Sun, 29 Mar 2009 18:05:05 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E55CA8FC08; Sun, 29 Mar 2009 18:05:04 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TI54Dd041256; Sun, 29 Mar 2009 18:05:04 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TI54uK041255; Sun, 29 Mar 2009 18:05:04 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903291805.n2TI54uK041255@svn.freebsd.org> From: Sam Leffler Date: Sun, 29 Mar 2009 18:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190527 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 18:05:05 -0000 Author: sam Date: Sun Mar 29 18:05:04 2009 New Revision: 190527 URL: http://svn.freebsd.org/changeset/base/190527 Log: fix wired-wireless failover example and remove incorrect comment about WPA not working Modified: head/share/man/man4/lagg.4 Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Sun Mar 29 17:59:14 2009 (r190526) +++ head/share/man/man4/lagg.4 Sun Mar 29 18:05:04 2009 (r190527) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2007 +.Dd March 29, 2009 .Dt LAGG 4 .Os .Sh NAME @@ -142,10 +142,14 @@ Whenever the wired master interface is u device will be used: .Bd -literal -offset indent # ifconfig em0 up -# ifconfig ath0 nwid my_net up -# ifconfig lagg0 laggproto failover laggport em0 laggport ath0 \e +# ifconfig ath0 ether 00:11:22:33:44:55 +# ifconfig create wlan0 wlandev ath0 nwid my_net up +# ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e 192.168.1.1 netmask 255.255.255.0 .Ed +.Pp +(Note the mac addresss of the wireless device is forced to match the wired +device as a workaround.) .Sh SEE ALSO .Xr ng_fec 4 , .Xr ng_one2many 4 , @@ -172,6 +176,3 @@ There is no way to configure LACP admini and port priorities. The current implementation always performs active-mode LACP and uses 0x8000 as system and port priorities. -.Pp -WPA security does not currently work correctly with a wireless interface added -to the lagg port. From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 18:14:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD699106566B; Sun, 29 Mar 2009 18:14:45 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC1488FC16; Sun, 29 Mar 2009 18:14:45 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TIEjaA041452; Sun, 29 Mar 2009 18:14:45 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TIEjMg041451; Sun, 29 Mar 2009 18:14:45 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903291814.n2TIEjMg041451@svn.freebsd.org> From: Sam Leffler Date: Sun, 29 Mar 2009 18:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190528 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 18:14:46 -0000 Author: sam Date: Sun Mar 29 18:14:45 2009 New Revision: 190528 URL: http://svn.freebsd.org/changeset/base/190528 Log: remove bogus nwid use; that's a compat shim for netbsd Modified: head/share/man/man4/lagg.4 Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Sun Mar 29 18:05:04 2009 (r190527) +++ head/share/man/man4/lagg.4 Sun Mar 29 18:14:45 2009 (r190528) @@ -143,7 +143,7 @@ device will be used: .Bd -literal -offset indent # ifconfig em0 up # ifconfig ath0 ether 00:11:22:33:44:55 -# ifconfig create wlan0 wlandev ath0 nwid my_net up +# ifconfig create wlan0 wlandev ath0 ssid my_net up # ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e 192.168.1.1 netmask 255.255.255.0 .Ed From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 20:09:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D57A71065670; Sun, 29 Mar 2009 20:09:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C44438FC08; Sun, 29 Mar 2009 20:09:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TK9pe8043629; Sun, 29 Mar 2009 20:09:51 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TK9pLQ043627; Sun, 29 Mar 2009 20:09:51 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200903292009.n2TK9pLQ043627@svn.freebsd.org> From: Ed Schouten Date: Sun, 29 Mar 2009 20:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190529 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 20:09:53 -0000 Author: ed Date: Sun Mar 29 20:09:51 2009 New Revision: 190529 URL: http://svn.freebsd.org/changeset/base/190529 Log: Emulate the FIODGNAME ioctl in our 32-bit emulator. It's quite strange that nobody reported this issue before. It turns out functions like ttyname(), ptsname() and fdevname() don't work in compat32. This means it't not even possible to run applications like script(1) inside a 32-bit FreeBSD jail. Fix this by converting 32-bit fiodgname_arg structures to their 64-bit equivalent. Reported by: kris Tested by: kris Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/freebsd32/freebsd32_ioctl.h Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Sun Mar 29 18:14:45 2009 (r190528) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Sun Mar 29 20:09:51 2009 (r190529) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -178,6 +179,22 @@ freebsd32_ioctl_ioc_read_toc(struct thre return error; } +static int +freebsd32_ioctl_fiodgname(struct thread *td, + struct freebsd32_ioctl_args *uap, struct file *fp) +{ + struct fiodgname_arg fgn; + struct fiodgname_arg32 fgn32; + int error; + + if ((error = copyin(uap->data, &fgn32, sizeof fgn32)) != 0) + return (error); + CP(fgn32, fgn, len); + PTRIN_CP(fgn32, fgn, buf); + error = fo_ioctl(fp, FIODGNAME, (caddr_t)&fgn, td->td_ucred, td); + fdrop(fp, td); + return (error); +} int freebsd32_ioctl(struct thread *td, struct freebsd32_ioctl_args *uap) @@ -210,6 +227,9 @@ freebsd32_ioctl(struct thread *td, struc case CDIOREADTOCHEADER_32: return freebsd32_ioctl_ioc_toc_header(td, uap, fp); + case FIODGNAME_32: + return freebsd32_ioctl_fiodgname(td, uap, fp); + default: fdrop(fp, td); ap.fd = uap->fd; Modified: head/sys/compat/freebsd32/freebsd32_ioctl.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.h Sun Mar 29 18:14:45 2009 (r190528) +++ head/sys/compat/freebsd32/freebsd32_ioctl.h Sun Mar 29 20:09:51 2009 (r190529) @@ -62,11 +62,17 @@ struct md_ioctl32 { int md_pad[MDNPAD32]; /* padding for future ideas */ }; +struct fiodgname_arg32 { + int len; + caddr_t32 buf; +}; + #define CDIOREADTOCENTRYS_32 _IOWR('c', 5, struct ioc_read_toc_entry32) #define CDIOREADTOCHEADER_32 _IOR('c', 4, struct ioc_toc_header32) #define MDIOCATTACH_32 _IOC(IOC_INOUT, 'm', 0, sizeof(struct md_ioctl32) + 4) #define MDIOCDETACH_32 _IOC(IOC_INOUT, 'm', 1, sizeof(struct md_ioctl32) + 4) #define MDIOCQUERY_32 _IOC(IOC_INOUT, 'm', 2, sizeof(struct md_ioctl32) + 4) #define MDIOCLIST_32 _IOC(IOC_INOUT, 'm', 3, sizeof(struct md_ioctl32) + 4) +#define FIODGNAME_32 _IOW('f', 120, struct fiodgname_arg32) #endif /* _COMPAT_FREEBSD32_IOCTL_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 21:00:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A9B106564A; Sun, 29 Mar 2009 21:00:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C0C8FC13; Sun, 29 Mar 2009 21:00:27 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TL0RjJ044653; Sun, 29 Mar 2009 21:00:27 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TL0Rac044652; Sun, 29 Mar 2009 21:00:27 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903292100.n2TL0Rac044652@svn.freebsd.org> From: Sam Leffler Date: Sun, 29 Mar 2009 21:00:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190530 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 21:00:28 -0000 Author: sam Date: Sun Mar 29 21:00:27 2009 New Revision: 190530 URL: http://svn.freebsd.org/changeset/base/190530 Log: toggling fast-frames requires clocking the state machine Modified: head/sys/net80211/ieee80211_superg.c Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Mar 29 20:09:51 2009 (r190529) +++ head/sys/net80211/ieee80211_superg.c Sun Mar 29 21:00:27 2009 (r190530) @@ -537,7 +537,7 @@ superg_ioctl_set80211(struct ieee80211va vap->iv_flags |= IEEE80211_F_FF; } else vap->iv_flags &= ~IEEE80211_F_FF; - return ERESTART; + return ENETRESET; case IEEE80211_IOC_TURBOP: if (ireq->i_val) { if ((vap->iv_caps & IEEE80211_C_TURBOP) == 0) From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 21:08:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B965F106566B; Sun, 29 Mar 2009 21:08:48 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A75958FC13; Sun, 29 Mar 2009 21:08:48 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TL8mDm044856; Sun, 29 Mar 2009 21:08:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TL8mRR044855; Sun, 29 Mar 2009 21:08:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200903292108.n2TL8mRR044855@svn.freebsd.org> From: Christian Brueffer Date: Sun, 29 Mar 2009 21:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190531 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 21:08:49 -0000 Author: brueffer Date: Sun Mar 29 21:08:48 2009 New Revision: 190531 URL: http://svn.freebsd.org/changeset/base/190531 Log: Fix typo. Modified: head/share/man/man4/lagg.4 Modified: head/share/man/man4/lagg.4 ============================================================================== --- head/share/man/man4/lagg.4 Sun Mar 29 21:00:27 2009 (r190530) +++ head/share/man/man4/lagg.4 Sun Mar 29 21:08:48 2009 (r190531) @@ -148,7 +148,7 @@ device will be used: 192.168.1.1 netmask 255.255.255.0 .Ed .Pp -(Note the mac addresss of the wireless device is forced to match the wired +(Note the mac address of the wireless device is forced to match the wired device as a workaround.) .Sh SEE ALSO .Xr ng_fec 4 , From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 21:17:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D195106566B; Sun, 29 Mar 2009 21:17:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 597608FC0C; Sun, 29 Mar 2009 21:17:09 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TLH91b045072; Sun, 29 Mar 2009 21:17:09 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TLH8fm045057; Sun, 29 Mar 2009 21:17:08 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903292117.n2TLH8fm045057@svn.freebsd.org> From: Sam Leffler Date: Sun, 29 Mar 2009 21:17:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190532 - in head/sys: dev/ral dev/usb/wlan net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 21:17:10 -0000 Author: sam Date: Sun Mar 29 21:17:08 2009 New Revision: 190532 URL: http://svn.freebsd.org/changeset/base/190532 Log: o add ic_rt to track the rate table for the current channel; this enables calculation of packet transmit times to do things like check txop limits o remove equivalent driver code and convert to use net80211 state Modified: head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2560var.h head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2661var.h head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_rumvar.h head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_uralvar.h head/sys/dev/usb/wlan/usb_wlan.h head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_ioctl.c head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_scan.c head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/ral/rt2560.c Sun Mar 29 21:17:08 2009 (r190532) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -1477,7 +1476,7 @@ rt2560_setup_tx_desc(struct rt2560_softc desc->plcp_service = 4; len += IEEE80211_CRC_LEN; - if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) { + if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) { desc->flags |= htole32(RT2560_TX_OFDM); plcp_length = len & 0xfff; @@ -1622,7 +1621,7 @@ rt2560_tx_mgt(struct rt2560_softc *sc, s if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= RT2560_TX_ACK; - dur = ieee80211_ack_duration(sc->sc_rates, + dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); @@ -1672,16 +1671,16 @@ rt2560_sendprot(struct rt2560_softc *sc, wh = mtod(m, const struct ieee80211_frame *); pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - protrate = ieee80211_ctl_rate(sc->sc_rates, rate); - ackrate = ieee80211_ack_rate(sc->sc_rates, rate); + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(sc->sc_rates, pktlen, rate, isshort) - + ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) + + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RT2560_TX_MORE_FRAG; if (prot == IEEE80211_PROT_RTSCTS) { /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags |= RT2560_TX_ACK; mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); } else { @@ -1852,7 +1851,7 @@ rt2560_tx_data(struct rt2560_softc *sc, if (m0->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) prot = IEEE80211_PROT_RTSCTS; else if ((ic->ic_flags & IEEE80211_F_USEPROT) && - ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) + ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) prot = ic->ic_protmode; if (prot != IEEE80211_PROT_NONE) { error = rt2560_sendprot(sc, m0, ni, prot, rate); @@ -1922,7 +1921,7 @@ rt2560_tx_data(struct rt2560_softc *sc, if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= RT2560_TX_ACK; - dur = ieee80211_ack_duration(sc->sc_rates, + dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); } @@ -2146,8 +2145,6 @@ rt2560_set_chan(struct rt2560_softc *sc, chan = ieee80211_chan2ieee(ic, c); KASSERT(chan != 0 && chan != IEEE80211_CHAN_ANY, ("chan 0x%x", chan)); - sc->sc_rates = ieee80211_get_ratetable(c); - if (IEEE80211_IS_CHAN_2GHZ(c)) power = min(sc->txpow[chan - 1], 31); else Modified: head/sys/dev/ral/rt2560var.h ============================================================================== --- head/sys/dev/ral/rt2560var.h Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/ral/rt2560var.h Sun Mar 29 21:17:08 2009 (r190532) @@ -122,8 +122,6 @@ struct rt2560_softc { int sc_tx_timer; int sc_invalid; int sc_debug; - - const struct ieee80211_rate_table *sc_rates; /* * The same in both up to here * ------------------------------------------------ Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/ral/rt2661.c Sun Mar 29 21:17:08 2009 (r190532) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -320,8 +319,6 @@ rt2661_attach(device_t dev, int id) ic->ic_vap_create = rt2661_vap_create; ic->ic_vap_delete = rt2661_vap_delete; - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); - bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof (struct ieee80211_frame) + sizeof (sc->sc_txtap)); @@ -1302,7 +1299,7 @@ rt2661_setup_tx_desc(struct rt2661_softc desc->plcp_service = 4; len += IEEE80211_CRC_LEN; - if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) { + if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) { desc->flags |= htole32(RT2661_TX_OFDM); plcp_length = len & 0xfff; @@ -1388,7 +1385,7 @@ rt2661_tx_mgt(struct rt2661_softc *sc, s if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= RT2661_TX_NEED_ACK; - dur = ieee80211_ack_duration(sc->sc_rates, + dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); @@ -1438,16 +1435,16 @@ rt2661_sendprot(struct rt2661_softc *sc, wh = mtod(m, const struct ieee80211_frame *); pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - protrate = ieee80211_ctl_rate(sc->sc_rates, rate); - ackrate = ieee80211_ack_rate(sc->sc_rates, rate); + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(sc->sc_rates, pktlen, rate, isshort) - + ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) + + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RT2661_TX_MORE_FRAG; if (prot == IEEE80211_PROT_RTSCTS) { /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags |= RT2661_TX_NEED_ACK; mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); } else { @@ -1544,7 +1541,7 @@ rt2661_tx_data(struct rt2661_softc *sc, if (m0->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) prot = IEEE80211_PROT_RTSCTS; else if ((ic->ic_flags & IEEE80211_F_USEPROT) && - ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) + ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) prot = ic->ic_protmode; if (prot != IEEE80211_PROT_NONE) { error = rt2661_sendprot(sc, ac, m0, ni, prot, rate); @@ -1615,7 +1612,7 @@ rt2661_tx_data(struct rt2661_softc *sc, if (!noack && !IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= RT2661_TX_NEED_ACK; - dur = ieee80211_ack_duration(sc->sc_rates, + dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); } @@ -2041,8 +2038,6 @@ rt2661_set_chan(struct rt2661_softc *sc, chan = ieee80211_chan2ieee(ic, c); KASSERT(chan != 0 && chan != IEEE80211_CHAN_ANY, ("chan 0x%x", chan)); - sc->sc_rates = ieee80211_get_ratetable(c); - /* select the appropriate RF settings based on what EEPROM says */ rfprog = (sc->rfprog == 0) ? rt2661_rf5225_1 : rt2661_rf5225_2; Modified: head/sys/dev/ral/rt2661var.h ============================================================================== --- head/sys/dev/ral/rt2661var.h Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/ral/rt2661var.h Sun Mar 29 21:17:08 2009 (r190532) @@ -114,8 +114,6 @@ struct rt2661_softc { int sc_tx_timer; int sc_invalid; int sc_debug; - - const struct ieee80211_rate_table *sc_rates; /* * The same in both up to here * ------------------------------------------------ Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/usb/wlan/if_rum.c Sun Mar 29 21:17:08 2009 (r190532) @@ -527,8 +527,6 @@ rum_attach_post(struct usb2_proc_msg *pm ic->ic_vap_create = rum_vap_create; ic->ic_vap_delete = rum_vap_delete; - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); - bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof (struct ieee80211_frame) + sizeof(sc->sc_txtap)); @@ -1067,7 +1065,7 @@ rum_setup_tx_desc(struct rum_softc *sc, desc->plcp_service = 4; len += IEEE80211_CRC_LEN; - if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) { + if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) { desc->flags |= htole32(RT2573_TX_OFDM); plcp_length = len & 0xfff; @@ -1106,16 +1104,16 @@ rum_sendprot(struct rum_softc *sc, wh = mtod(m, const struct ieee80211_frame *); pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - protrate = ieee80211_ctl_rate(sc->sc_rates, rate); - ackrate = ieee80211_ack_rate(sc->sc_rates, rate); + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(sc->sc_rates, pktlen, rate, isshort); - + ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort); + + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RT2573_TX_MORE_FRAG; if (prot == IEEE80211_PROT_RTSCTS) { /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags |= RT2573_TX_NEED_ACK; mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); } else { @@ -1174,7 +1172,7 @@ rum_tx_mgt(struct rum_softc *sc, struct if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= RT2573_TX_NEED_ACK; - dur = ieee80211_ack_duration(sc->sc_rates, tp->mgmtrate, + dur = ieee80211_ack_duration(ic->ic_rt, tp->mgmtrate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); @@ -1294,7 +1292,7 @@ rum_tx_data(struct rum_softc *sc, struct if (m0->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) prot = IEEE80211_PROT_RTSCTS; else if ((ic->ic_flags & IEEE80211_F_USEPROT) && - ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) + ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) prot = ic->ic_protmode; if (prot != IEEE80211_PROT_NONE) { error = rum_sendprot(sc, m0, ni, prot, rate); @@ -1318,7 +1316,7 @@ rum_tx_data(struct rum_softc *sc, struct flags |= RT2573_TX_NEED_ACK; flags |= RT2573_TX_MORE_FRAG; - dur = ieee80211_ack_duration(sc->sc_rates, rate, + dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); } @@ -2367,7 +2365,6 @@ rum_set_channel(struct ieee80211com *ic) RUM_LOCK(sc); /* do it in a process context */ sc->sc_scan_action = RUM_SET_CHANNEL; - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); rum_queue_command(sc, rum_scantask, &sc->sc_scantask[0].hdr, &sc->sc_scantask[1].hdr); RUM_UNLOCK(sc); Modified: head/sys/dev/usb/wlan/if_rumvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_rumvar.h Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/usb/wlan/if_rumvar.h Sun Mar 29 21:17:08 2009 (r190532) @@ -101,7 +101,6 @@ struct rum_softc { struct usb2_device *sc_udev; struct usb2_process sc_tq; - const struct ieee80211_rate_table *sc_rates; struct usb2_xfer *sc_xfer[RUM_N_TRANSFER]; struct rum_task *sc_last_task; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/usb/wlan/if_ural.c Sun Mar 29 21:17:08 2009 (r190532) @@ -518,8 +518,6 @@ ural_attach_post(struct usb2_proc_msg *p ic->ic_vap_create = ural_vap_create; ic->ic_vap_delete = ural_vap_delete; - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); - bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof (struct ieee80211_frame) + sizeof(sc->sc_txtap)); @@ -1108,7 +1106,7 @@ ural_setup_tx_desc(struct ural_softc *sc desc->plcp_service = 4; len += IEEE80211_CRC_LEN; - if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) { + if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) { desc->flags |= htole32(RAL_TX_OFDM); plcp_length = len & 0xfff; @@ -1209,7 +1207,7 @@ ural_tx_mgt(struct ural_softc *sc, struc if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { flags |= RAL_TX_ACK; - dur = ieee80211_ack_duration(sc->sc_rates, tp->mgmtrate, + dur = ieee80211_ack_duration(ic->ic_rt, tp->mgmtrate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); @@ -1249,16 +1247,16 @@ ural_sendprot(struct ural_softc *sc, wh = mtod(m, const struct ieee80211_frame *); pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - protrate = ieee80211_ctl_rate(sc->sc_rates, rate); - ackrate = ieee80211_ack_rate(sc->sc_rates, rate); + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + ackrate = ieee80211_ack_rate(ic->ic_rt, rate); isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(sc->sc_rates, pktlen, rate, isshort); - + ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort); + + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RAL_TX_RETRY(7); if (prot == IEEE80211_PROT_RTSCTS) { /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(sc->sc_rates, rate, isshort); + dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags |= RAL_TX_ACK; mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); } else { @@ -1376,7 +1374,7 @@ ural_tx_data(struct ural_softc *sc, stru if (m0->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) prot = IEEE80211_PROT_RTSCTS; else if ((ic->ic_flags & IEEE80211_F_USEPROT) && - ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) + ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) prot = ic->ic_protmode; if (prot != IEEE80211_PROT_NONE) { error = ural_sendprot(sc, m0, ni, prot, rate); @@ -1400,7 +1398,7 @@ ural_tx_data(struct ural_softc *sc, stru flags |= RAL_TX_ACK; flags |= RAL_TX_RETRY(7); - dur = ieee80211_ack_duration(sc->sc_rates, rate, + dur = ieee80211_ack_duration(ic->ic_rt, rate, ic->ic_flags & IEEE80211_F_SHPREAMBLE); *(uint16_t *)wh->i_dur = htole16(dur); } @@ -1742,8 +1740,6 @@ ural_set_channel(struct ieee80211com *ic sc->sc_scan_action = URAL_SET_CHANNEL; ural_queue_command(sc, ural_scantask, &sc->sc_scantask[0].hdr, &sc->sc_scantask[1].hdr); - - sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan); RAL_UNLOCK(sc); } Modified: head/sys/dev/usb/wlan/if_uralvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_uralvar.h Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/usb/wlan/if_uralvar.h Sun Mar 29 21:17:08 2009 (r190532) @@ -106,8 +106,6 @@ struct ural_softc { struct usb2_device *sc_udev; struct usb2_process sc_tq; - const struct ieee80211_rate_table *sc_rates; - uint32_t asic_rev; uint8_t rf_rev; Modified: head/sys/dev/usb/wlan/usb_wlan.h ============================================================================== --- head/sys/dev/usb/wlan/usb_wlan.h Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/dev/usb/wlan/usb_wlan.h Sun Mar 29 21:17:08 2009 (r190532) @@ -46,7 +46,6 @@ #include #include #include -#include #include #include Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/net80211/ieee80211.c Sun Mar 29 21:17:08 2009 (r190532) @@ -186,6 +186,7 @@ ieee80211_chan_init(struct ieee80211com ic->ic_csa_newchan = NULL; /* arbitrarily pick the first channel */ ic->ic_curchan = &ic->ic_channels[0]; + ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); /* fillin well-known rate sets if driver has not specified */ DEFAULTRATES(IEEE80211_MODE_11B, ieee80211_rateset_11b); Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/net80211/ieee80211_ioctl.c Sun Mar 29 21:17:08 2009 (r190532) @@ -1871,6 +1871,7 @@ setcurchan(struct ieee80211vap *vap, str vap->iv_bss->ni_chan = ic->ic_curchan; } else ic->ic_curchan = vap->iv_des_chan; + ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); } else { /* * Need to go through the state machine in case we @@ -1886,6 +1887,7 @@ setcurchan(struct ieee80211vap *vap, str * there is immediate feedback; e.g. via ifconfig. */ ic->ic_curchan = vap->iv_des_chan; + ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); } } return error; Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/net80211/ieee80211_node.c Sun Mar 29 21:17:08 2009 (r190532) @@ -627,6 +627,7 @@ ieee80211_sync_curchan(struct ieee80211c if (c != ic->ic_curchan) { ic->ic_curchan = c; ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); + ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); ic->ic_set_channel(ic); } } @@ -651,6 +652,7 @@ ieee80211_setcurchan(struct ieee80211com } ic->ic_bsschan = ic->ic_curchan = c; ic->ic_curmode = ieee80211_chan2mode(ic->ic_curchan); + ic->ic_rt = ieee80211_get_ratetable(ic->ic_curchan); ic->ic_set_channel(ic); } Modified: head/sys/net80211/ieee80211_scan.c ============================================================================== --- head/sys/net80211/ieee80211_scan.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/net80211/ieee80211_scan.c Sun Mar 29 21:17:08 2009 (r190532) @@ -298,6 +298,7 @@ change_channel(struct ieee80211com *ic, struct ieee80211_channel *chan) { ic->ic_curchan = chan; + ic->ic_rt = ieee80211_get_ratetable(chan); ic->ic_set_channel(ic); } Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/net80211/ieee80211_superg.c Sun Mar 29 21:17:08 2009 (r190532) @@ -490,6 +490,7 @@ ieee80211_dturbo_switch(struct ieee80211 ic->ic_bsschan = chan; ic->ic_prevchan = ic->ic_curchan; ic->ic_curchan = chan; + ic->ic_rt = ieee80211_get_ratetable(chan); ic->ic_set_channel(ic); /* NB: do not need to reset ERP state 'cuz we're in sta mode */ } Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sun Mar 29 21:08:48 2009 (r190531) +++ head/sys/net80211/ieee80211_var.h Sun Mar 29 21:17:08 2009 (r190532) @@ -47,6 +47,7 @@ #include #include #include /* for ieee80211_stats */ +#include #include #include #include @@ -161,6 +162,7 @@ struct ieee80211com { uint8_t ic_chan_active[IEEE80211_CHAN_BYTES]; uint8_t ic_chan_scan[IEEE80211_CHAN_BYTES]; struct ieee80211_channel *ic_curchan; /* current channel */ + const struct ieee80211_rate_table *ic_rt; /* table for ic_curchan */ struct ieee80211_channel *ic_bsschan; /* bss channel */ struct ieee80211_channel *ic_prevchan; /* previous channel */ struct ieee80211_regdomain ic_regdomain;/* regulatory data */ From owner-svn-src-head@FreeBSD.ORG Sun Mar 29 21:25:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D26AB106566C; Sun, 29 Mar 2009 21:25:40 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C04978FC0C; Sun, 29 Mar 2009 21:25:40 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2TLPePm045283; Sun, 29 Mar 2009 21:25:40 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2TLPeCU045279; Sun, 29 Mar 2009 21:25:40 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200903292125.n2TLPeCU045279@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 29 Mar 2009 21:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190533 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Mar 2009 21:25:41 -0000 Author: kan Date: Sun Mar 29 21:25:40 2009 New Revision: 190533 URL: http://svn.freebsd.org/changeset/base/190533 Log: Replace v_dd vnode pointer with v_cache_dd pointer to struct namecache in directory vnodes. Allow namecache dotdot entry to be created pointing from child vnode to parent vnode if no existing links in opposite direction exist. Use direct link from parent to child for dotdot lookups otherwise. This restores more efficient dotdot caching in NFS filesystems which was lost when vnodes stoppped being type stable. Reviewed by: kib Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Mar 29 21:17:08 2009 (r190532) +++ head/sys/kern/vfs_cache.c Sun Mar 29 21:25:40 2009 (r190533) @@ -187,7 +187,8 @@ static MALLOC_DEFINE(M_VFSCACHE, "vfscac /* * Flags in namecache.nc_flag */ -#define NCF_WHITE 1 +#define NCF_WHITE 0x01 +#define NCF_ISDOTDOT 0x02 #ifdef DIAGNOSTIC /* @@ -292,14 +293,20 @@ cache_zap(ncp) CTR2(KTR_VFS, "cache_zap(%p) vp %p", ncp, ncp->nc_vp); vp = NULL; LIST_REMOVE(ncp, nc_hash); - LIST_REMOVE(ncp, nc_src); - if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { - vp = ncp->nc_dvp; - numcachehv--; + if (ncp->nc_flag & NCF_ISDOTDOT) { + if (ncp == ncp->nc_dvp->v_cache_dd) + ncp->nc_dvp->v_cache_dd = NULL; + } else { + LIST_REMOVE(ncp, nc_src); + if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { + vp = ncp->nc_dvp; + numcachehv--; + } } if (ncp->nc_vp) { TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - ncp->nc_vp->v_dd = NULL; + if (ncp == ncp->nc_vp->v_cache_dd) + ncp->nc_vp->v_cache_dd = NULL; } else { TAILQ_REMOVE(&ncneg, ncp, nc_dst); numneg--; @@ -358,11 +365,18 @@ retry_wlocked: } if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { dotdothits++; - if (dvp->v_dd == NULL || - (cnp->cn_flags & MAKEENTRY) == 0) { + if (dvp->v_cache_dd == NULL) + goto unlock; + if ((cnp->cn_flags & MAKEENTRY) == 0) { + if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) + cache_zap(dvp->v_cache_dd); + dvp->v_cache_dd = NULL; goto unlock; } - *vpp = dvp->v_dd; + if (dvp->v_cache_dd->nc_flag & NCF_ISDOTDOT) + *vpp = dvp->v_cache_dd->nc_vp; + else + *vpp = dvp->v_cache_dd->nc_dvp; CTR3(KTR_VFS, "cache_lookup(%p, %s) found %p via ..", dvp, cnp->cn_nameptr, *vpp); goto success; @@ -522,6 +536,7 @@ cache_enter(dvp, vp, cnp) struct namecache *ncp, *n2; struct nchashhead *ncpp; u_int32_t hash; + int flag; int hold; int zap; int len; @@ -539,23 +554,33 @@ cache_enter(dvp, vp, cnp) if (numcache >= desiredvnodes * 2) return; + flag = 0; if (cnp->cn_nameptr[0] == '.') { - if (cnp->cn_namelen == 1) { + if (cnp->cn_namelen == 1) return; - } - /* - * For dotdot lookups only cache the v_dd pointer if the - * directory has a link back to its parent via v_cache_dst. - * Without this an unlinked directory would keep a soft - * reference to its parent which could not be NULLd at - * cache_purge() time. - */ if (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.') { CACHE_WLOCK(); - if (!TAILQ_EMPTY(&dvp->v_cache_dst)) - dvp->v_dd = vp; + /* + * If dotdot entry already exists, just retarget it + * to new parent vnode, otherwise continue with new + * namecache entry allocation. + */ + if ((ncp = dvp->v_cache_dd) != NULL) { + if (ncp->nc_flag & NCF_ISDOTDOT) { + KASSERT(ncp->nc_dvp == dvp, + ("wrong isdotdot parent")); + TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, + ncp, nc_dst); + TAILQ_INSERT_HEAD(&vp->v_cache_dst, + ncp, nc_dst); + ncp->nc_vp = vp; + CACHE_WUNLOCK(); + return; + } + } + dvp->v_cache_dd = NULL; CACHE_WUNLOCK(); - return; + flag = NCF_ISDOTDOT; } } @@ -569,6 +594,7 @@ cache_enter(dvp, vp, cnp) ncp = cache_alloc(cnp->cn_namelen); ncp->nc_vp = vp; ncp->nc_dvp = dvp; + ncp->nc_flag = flag; len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); bcopy(cnp->cn_nameptr, ncp->nc_name, len); @@ -591,14 +617,34 @@ cache_enter(dvp, vp, cnp) } } + /* + * See if we are trying to add .. entry, but some other lookup + * has populated v_cache_dd pointer already. + */ + if (flag == NCF_ISDOTDOT && dvp->v_cache_dd != NULL) { + CACHE_WUNLOCK(); + cache_free(ncp); + return; + } + numcache++; if (!vp) { numneg++; - ncp->nc_flag = cnp->cn_flags & ISWHITEOUT ? NCF_WHITE : 0; + if (cnp->cn_flags & ISWHITEOUT) + ncp->nc_flag |= NCF_WHITE; } else if (vp->v_type == VDIR) { - vp->v_dd = dvp; + if (flag == NCF_ISDOTDOT) { + KASSERT(dvp->v_cache_dd == NULL, + ("dangling v_cache_dd")); + dvp->v_cache_dd = ncp; + } else { + if ((n2 = vp->v_cache_dd) != NULL && + (n2->nc_flag & NCF_ISDOTDOT) != 0) + cache_zap(n2); + vp->v_cache_dd = ncp; + } } else { - vp->v_dd = NULL; + vp->v_cache_dd = NULL; } /* @@ -606,11 +652,14 @@ cache_enter(dvp, vp, cnp) * within the cache entries table. */ LIST_INSERT_HEAD(ncpp, ncp, nc_hash); - if (LIST_EMPTY(&dvp->v_cache_src)) { - hold = 1; - numcachehv++; + if (flag != NCF_ISDOTDOT) { + if (LIST_EMPTY(&dvp->v_cache_src)) { + hold = 1; + numcachehv++; + } + LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); } - LIST_INSERT_HEAD(&dvp->v_cache_src, ncp, nc_src); + /* * If the entry is "negative", we place it into the * "negative" cache queue, otherwise, we place it into the @@ -665,7 +714,12 @@ cache_purge(vp) cache_zap(LIST_FIRST(&vp->v_cache_src)); while (!TAILQ_EMPTY(&vp->v_cache_dst)) cache_zap(TAILQ_FIRST(&vp->v_cache_dst)); - vp->v_dd = NULL; + if (vp->v_cache_dd != NULL) { + KASSERT(vp->v_cache_dd->nc_flag & NCF_ISDOTDOT, + ("lost dotdot link")); + cache_zap(vp->v_cache_dd); + } + KASSERT(vp->v_cache_dd == NULL, ("incomplete purge")); CACHE_WUNLOCK(); } @@ -995,9 +1049,10 @@ vn_fullpath1(struct thread *td, struct v error = ENOTDIR; break; } - ncp = TAILQ_FIRST(&vp->v_cache_dst); + TAILQ_FOREACH(ncp, &vp->v_cache_dst, nc_dst) + if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + break; if (ncp != NULL) { - MPASS(vp->v_dd == NULL || ncp->nc_dvp == vp->v_dd); buflen -= ncp->nc_nlen; for (i = ncp->nc_nlen - 1; i >= 0 && bp != buf; i--) *--bp = ncp->nc_name[i]; @@ -1047,8 +1102,10 @@ vn_commname(struct vnode *vp, char *buf, int l; CACHE_RLOCK(); - ncp = TAILQ_FIRST(&vp->v_cache_dst); - if (!ncp) { + TAILQ_FOREACH(ncp, &vp->v_cache_dst, nc_dst) + if ((ncp->nc_flag & NCF_ISDOTDOT) == 0) + break; + if (ncp == NULL) { CACHE_RUNLOCK(); return (ENOENT); } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Mar 29 21:17:08 2009 (r190532) +++ head/sys/kern/vfs_subr.c Sun Mar 29 21:25:40 2009 (r190533) @@ -860,6 +860,7 @@ vdestroy(struct vnode *vp) VNASSERT(bo->bo_dirty.bv_root == NULL, vp, ("dirtyblkroot not NULL")); VNASSERT(TAILQ_EMPTY(&vp->v_cache_dst), vp, ("vp has namecache dst")); VNASSERT(LIST_EMPTY(&vp->v_cache_src), vp, ("vp has namecache src")); + VNASSERT(vp->v_cache_dd == NULL, vp, ("vp has namecache for ..")); VI_UNLOCK(vp); #ifdef MAC mac_vnode_destroy(vp); Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Mar 29 21:17:08 2009 (r190532) +++ head/sys/sys/vnode.h Sun Mar 29 21:25:40 2009 (r190533) @@ -135,7 +135,7 @@ struct vnode { */ LIST_HEAD(, namecache) v_cache_src; /* c Cache entries from us */ TAILQ_HEAD(, namecache) v_cache_dst; /* c Cache entries to us */ - struct vnode *v_dd; /* c .. vnode */ + struct namecache *v_cache_dd; /* c Cache entry for .. vnode */ /* * clustering stuff From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 00:33:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6566106566B; Mon, 30 Mar 2009 00:33:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4C498FC17; Mon, 30 Mar 2009 00:33:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U0XhLK048825; Mon, 30 Mar 2009 00:33:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U0Xh2I048824; Mon, 30 Mar 2009 00:33:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903300033.n2U0Xh2I048824@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 30 Mar 2009 00:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190534 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 00:33:44 -0000 Author: marcel Date: Mon Mar 30 00:33:43 2009 New Revision: 190534 URL: http://svn.freebsd.org/changeset/base/190534 Log: Sharpen the saw: o Don't create a GPT scheme underneath another scheme when the probe doesn't allow it. Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Sun Mar 29 21:25:40 2009 (r190533) +++ head/sys/geom/part/g_part_gpt.c Mon Mar 30 00:33:43 2009 (r190534) @@ -393,6 +393,10 @@ g_part_gpt_create(struct g_part_table *b quad_t last; size_t tblsz; + /* We don't nest, which means that our depth should be 0. */ + if (basetable->gpt_depth != 0) + return (ENXIO); + table = (struct g_part_gpt_table *)basetable; pp = gpp->gpp_provider; tblsz = (basetable->gpt_entries * sizeof(struct gpt_ent) + From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 00:48:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4555B1065672; Mon, 30 Mar 2009 00:48:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33A988FC0A; Mon, 30 Mar 2009 00:48:43 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U0mgdh049118; Mon, 30 Mar 2009 00:48:42 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U0mgDl049117; Mon, 30 Mar 2009 00:48:42 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903300048.n2U0mgDl049117@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 30 Mar 2009 00:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190535 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 00:48:43 -0000 Author: marcel Date: Mon Mar 30 00:48:42 2009 New Revision: 190535 URL: http://svn.freebsd.org/changeset/base/190535 Log: Sharpen the saw: o EBR uses 32-bit block numbers. Limit the scheme to 2^32-1 blocks when the media is larger. o Calculate the number of entries based on the rounded media size, rather than the raw media size. Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Mon Mar 30 00:33:43 2009 (r190534) +++ head/sys/geom/part/g_part_ebr.c Mon Mar 30 00:48:42 2009 (r190535) @@ -237,7 +237,7 @@ g_part_ebr_create(struct g_part_table *b char psn[8]; struct g_consumer *cp; struct g_provider *pp; - uint64_t msize; + uint32_t msize; int error; pp = gpp->gpp_provider; @@ -257,10 +257,11 @@ g_part_ebr_create(struct g_part_table *b if (strcmp(psn, "MBR")) return (ENXIO); - msize = pp->mediasize / pp->sectorsize; - basetable->gpt_entries = msize / basetable->gpt_sectors; + msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize -= msize % basetable->gpt_sectors; basetable->gpt_first = 0; - basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + basetable->gpt_last = msize - 1; + basetable->gpt_entries = msize / basetable->gpt_sectors; return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 00:53:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 978C91065672; Mon, 30 Mar 2009 00:53:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 861EE8FC16; Mon, 30 Mar 2009 00:53:46 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U0rk1W049236; Mon, 30 Mar 2009 00:53:46 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U0rkgP049235; Mon, 30 Mar 2009 00:53:46 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903300053.n2U0rkgP049235@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 30 Mar 2009 00:53:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190536 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 00:53:47 -0000 Author: marcel Date: Mon Mar 30 00:53:46 2009 New Revision: 190536 URL: http://svn.freebsd.org/changeset/base/190536 Log: Sharpen the saw: o MBR uses 32-bit block numbers. Limit the scheme to 2^32-1 blocks when the media is larger. Modified: head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Mon Mar 30 00:48:42 2009 (r190535) +++ head/sys/geom/part/g_part_mbr.c Mon Mar 30 00:53:46 2009 (r190536) @@ -230,7 +230,7 @@ g_part_mbr_create(struct g_part_table *b struct g_consumer *cp; struct g_provider *pp; struct g_part_mbr_table *table; - uint64_t msize; + uint32_t msize; pp = gpp->gpp_provider; cp = LIST_FIRST(&pp->consumers); @@ -238,7 +238,7 @@ g_part_mbr_create(struct g_part_table *b if (pp->sectorsize < MBRSIZE) return (ENOSPC); - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 01:03:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35B97106566B; Mon, 30 Mar 2009 01:03:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242E38FC0A; Mon, 30 Mar 2009 01:03:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U13wWq049478; Mon, 30 Mar 2009 01:03:58 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U13wFN049477; Mon, 30 Mar 2009 01:03:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200903300103.n2U13wFN049477@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 30 Mar 2009 01:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190537 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 01:03:59 -0000 Author: marcel Date: Mon Mar 30 01:03:58 2009 New Revision: 190537 URL: http://svn.freebsd.org/changeset/base/190537 Log: Sharpen the saw: o PC98 uses 32-bit block numbers. Limit the scheme to 2^32-1 blocks when the media is larger. The 32-bit block numbers are implicit (16-bit cylinder * 8-bit head * 8-bit sector). Modified: head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Mon Mar 30 00:53:46 2009 (r190536) +++ head/sys/geom/part/g_part_pc98.c Mon Mar 30 01:03:58 2009 (r190537) @@ -218,8 +218,7 @@ g_part_pc98_create(struct g_part_table * struct g_consumer *cp; struct g_provider *pp; struct g_part_pc98_table *table; - uint64_t msize; - uint32_t cyl; + uint32_t cyl, msize; pp = gpp->gpp_provider; cp = LIST_FIRST(&pp->consumers); @@ -231,7 +230,7 @@ g_part_pc98_create(struct g_part_table * cyl = basetable->gpt_heads * basetable->gpt_sectors; - msize = pp->mediasize / SECSIZE; + msize = MIN(pp->mediasize / SECSIZE, 0xffffffff); basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 01:47:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1966106566C; Mon, 30 Mar 2009 01:47:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D07778FC18; Mon, 30 Mar 2009 01:47:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U1lW6e050370; Mon, 30 Mar 2009 01:47:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U1lWco050369; Mon, 30 Mar 2009 01:47:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903300147.n2U1lWco050369@svn.freebsd.org> From: Warner Losh Date: Mon, 30 Mar 2009 01:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190538 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 01:47:33 -0000 Author: imp Date: Mon Mar 30 01:47:32 2009 New Revision: 190538 URL: http://svn.freebsd.org/changeset/base/190538 Log: Add PHY entry for the ASIX 88x90 internal PHYs. Modified: head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Mon Mar 30 01:03:58 2009 (r190537) +++ head/sys/dev/mii/miidevs Mon Mar 30 01:47:32 2009 (r190538) @@ -52,6 +52,7 @@ $FreeBSD$ oui AGERE 0x00a0bc Agere Systems oui ALTIMA 0x0010a9 Altima Communications oui AMD 0x00001a Advanced Micro Devices +oui ASIX 0x00602e Asix Semiconductor oui ATHEROS 0x001374 Atheros Communications oui BROADCOM 0x001018 Broadcom Corporation oui BROADCOM2 0x000af7 Broadcom Corporation @@ -120,6 +121,9 @@ model AMD 79c973phy 0x0036 Am79c973 int model AMD 79c978 0x0039 Am79c978 HomePNA PHY model xxAMD 79C873 0x0000 Am79C873/DM9101 10/100 media interface +/* Asix semiconductor PHYs. */ +model ASIX AX88X9X 0x0031 Ax88x9x internal PHY + /* Atheros Communications/Attansic PHYs. */ model ATHEROS F1 0x0001 Atheros F1 10/100/1000 PHY model ATHEROS F2 0x0002 Atheros F2 10/100 PHY From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 05:57:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 861691065670; Mon, 30 Mar 2009 05:57:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 744D68FC16; Mon, 30 Mar 2009 05:57:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U5vtLZ055300; Mon, 30 Mar 2009 05:57:55 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U5vtri055299; Mon, 30 Mar 2009 05:57:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200903300557.n2U5vtri055299@svn.freebsd.org> From: Andrew Thompson Date: Mon, 30 Mar 2009 05:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190540 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 05:57:56 -0000 Author: thompsa Date: Mon Mar 30 05:57:55 2009 New Revision: 190540 URL: http://svn.freebsd.org/changeset/base/190540 Log: Further rate limit the root wait status, it will be printed once per root_mount_rel() wakeup. Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Mar 30 04:42:08 2009 (r190539) +++ head/sys/kern/vfs_mount.c Mon Mar 30 05:57:55 2009 (r190540) @@ -1391,6 +1391,8 @@ static void root_mount_prepare(void) { struct root_hold_token *h; + struct timeval lastfail; + int curfail = 0; for (;;) { DROP_GIANT(); @@ -1401,10 +1403,12 @@ root_mount_prepare(void) mtx_unlock(&mountlist_mtx); break; } - printf("Root mount waiting for:"); - LIST_FOREACH(h, &root_holds, list) - printf(" %s", h->who); - printf("\n"); + if (ppsratecheck(&lastfail, &curfail, 1)) { + printf("Root mount waiting for:"); + LIST_FOREACH(h, &root_holds, list) + printf(" %s", h->who); + printf("\n"); + } msleep(&root_holds, &mountlist_mtx, PZERO | PDROP, "roothold", hz); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 08:39:43 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39C4A106566C; Mon, 30 Mar 2009 08:39:43 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27DC98FC0C; Mon, 30 Mar 2009 08:39:43 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U8dhP5058272; Mon, 30 Mar 2009 08:39:43 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U8dhnW058271; Mon, 30 Mar 2009 08:39:43 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903300839.n2U8dhnW058271@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 30 Mar 2009 08:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190541 - head/sys/dev/malo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 08:39:43 -0000 Author: weongyo Date: Mon Mar 30 08:39:42 2009 New Revision: 190541 URL: http://svn.freebsd.org/changeset/base/190541 Log: fix a bug of uses after free. Pointed by: dchagin MFC after: 3 days Modified: head/sys/dev/malo/if_malohal.c Modified: head/sys/dev/malo/if_malohal.c ============================================================================== --- head/sys/dev/malo/if_malohal.c Mon Mar 30 05:57:55 2009 (r190540) +++ head/sys/dev/malo/if_malohal.c Mon Mar 30 08:39:42 2009 (r190541) @@ -163,8 +163,6 @@ malo_hal_attach(device_t dev, uint16_t d return (mh); fail: - free(mh, M_DEVBUF); - if (mh->mh_dmamap != NULL) { bus_dmamap_unload(mh->mh_dmat, mh->mh_dmamap); if (mh->mh_cmdbuf != NULL) @@ -174,6 +172,7 @@ fail: } if (mh->mh_dmat) bus_dma_tag_destroy(mh->mh_dmat); + free(mh, M_DEVBUF); return (NULL); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 08:47:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D59B106566C; Mon, 30 Mar 2009 08:47:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E06E8FC0C; Mon, 30 Mar 2009 08:47:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U8lTUR058516; Mon, 30 Mar 2009 08:47:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U8lSGo058512; Mon, 30 Mar 2009 08:47:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200903300847.n2U8lSGo058512@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 30 Mar 2009 08:47:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190543 - in head: include libexec/rtld-elf sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 08:47:31 -0000 Author: kib Date: Mon Mar 30 08:47:28 2009 New Revision: 190543 URL: http://svn.freebsd.org/changeset/base/190543 Log: Implement support for RTLD_NODELETE flag for dlopen() and -z nodelete static linker option. Do it by incrementing reference count on the loaded object and its dependencies. Reviewed by: davidxu, kan Modified: head/include/dlfcn.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h head/sys/sys/elf_common.h Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Mon Mar 30 08:44:29 2009 (r190542) +++ head/include/dlfcn.h Mon Mar 30 08:47:28 2009 (r190543) @@ -47,6 +47,7 @@ #define RTLD_GLOBAL 0x100 /* Make symbols globally available. */ #define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default. */ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ +#define RTLD_NODELETE 0x01000 /* Do not remove members. */ /* * Request arguments for dlinfo(). Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Mar 30 08:44:29 2009 (r190542) +++ head/libexec/rtld-elf/rtld.c Mon Mar 30 08:47:28 2009 (r190543) @@ -937,6 +937,8 @@ digest_dynamic(Obj_Entry *obj, int early /* XXX */; if (dynp->d_un.d_val & DF_1_BIND_NOW) obj->bind_now = true; + if (dynp->d_un.d_val & DF_1_NODELETE) + obj->z_nodelete = true; break; default: @@ -1422,15 +1424,21 @@ is_exported(const Elf_Sym *def) static int load_needed_objects(Obj_Entry *first) { - Obj_Entry *obj; + Obj_Entry *obj, *obj1; for (obj = first; obj != NULL; obj = obj->next) { Needed_Entry *needed; for (needed = obj->needed; needed != NULL; needed = needed->next) { - needed->obj = load_object(obj->strtab + needed->name, obj); - if (needed->obj == NULL && !ld_tracing) + obj1 = needed->obj = load_object(obj->strtab + needed->name, obj); + if (obj1 == NULL && !ld_tracing) return -1; + if (obj1 != NULL && obj1->z_nodelete && !obj1->ref_nodel) { + dbg("obj %s nodelete", obj1->path); + init_dag(obj1); + ref_dag(obj1); + obj1->ref_nodel = true; + } } } @@ -1976,12 +1984,13 @@ dlopen(const char *name, int mode) Obj_Entry **old_obj_tail; Obj_Entry *obj; Objlist initlist; - int result, lockstate; + int result, lockstate, nodelete; LD_UTRACE(UTRACE_DLOPEN_START, NULL, NULL, 0, mode, name); ld_tracing = (mode & RTLD_TRACE) == 0 ? NULL : "1"; if (ld_tracing != NULL) environ = (char **)*get_program_var_addr("environ"); + nodelete = mode & RTLD_NODELETE; objlist_init(&initlist); @@ -2029,6 +2038,11 @@ dlopen(const char *name, int mode) if (ld_tracing) goto trace; } + if (obj != NULL && (nodelete || obj->z_nodelete) && !obj->ref_nodel) { + dbg("obj %s nodelete", obj->path); + ref_dag(obj); + obj->z_nodelete = obj->ref_nodel = true; + } } LD_UTRACE(UTRACE_DLOPEN_STOP, obj, NULL, 0, obj ? obj->dl_refcount : 0, Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Mon Mar 30 08:44:29 2009 (r190542) +++ head/libexec/rtld-elf/rtld.h Mon Mar 30 08:47:28 2009 (r190543) @@ -217,6 +217,8 @@ typedef struct Struct_Obj_Entry { bool tls_done : 1; /* Already allocated offset for static TLS */ bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ + bool z_nodelete : 1; /* Do not unload the object and dependencies */ + bool ref_nodel : 1; /* refcount increased to prevent dlclose */ struct link_map linkmap; /* for GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Mon Mar 30 08:44:29 2009 (r190542) +++ head/sys/sys/elf_common.h Mon Mar 30 08:47:28 2009 (r190543) @@ -469,6 +469,7 @@ typedef struct { /* Values for DT_FLAGS_1 */ #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ +#define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ /* Values for n_type. Used in core files. */ From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 08:48:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C66E7106564A; Mon, 30 Mar 2009 08:48:33 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B50758FC18; Mon, 30 Mar 2009 08:48:33 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2U8mXUs058573; Mon, 30 Mar 2009 08:48:33 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2U8mXFc058572; Mon, 30 Mar 2009 08:48:33 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903300848.n2U8mXFc058572@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 30 Mar 2009 08:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190544 - head/sys/dev/malo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 08:48:34 -0000 Author: weongyo Date: Mon Mar 30 08:48:33 2009 New Revision: 190544 URL: http://svn.freebsd.org/changeset/base/190544 Log: handles more exceptional cases when the driver failed to attach. MFC after: 3 days Modified: head/sys/dev/malo/if_malo_pci.c Modified: head/sys/dev/malo/if_malo_pci.c ============================================================================== --- head/sys/dev/malo/if_malo_pci.c Mon Mar 30 08:47:28 2009 (r190543) +++ head/sys/dev/malo/if_malo_pci.c Mon Mar 30 08:48:33 2009 (r190544) @@ -260,12 +260,13 @@ malo_pci_attach(device_t dev) error = malo_attach(pci_get_device(dev), sc); - if (error != 0) { - malo_pci_detach(dev); - return (error); - } + if (error != 0) + goto bad2; return (error); + +bad2: + bus_dma_tag_destroy(sc->malo_dmat); bad1: if (psc->malo_msi == 0) bus_teardown_intr(dev, psc->malo_res_irq[0], @@ -275,10 +276,11 @@ bad1: bus_teardown_intr(dev, psc->malo_res_irq[i], psc->malo_intrhand[i]); } - + bus_release_resources(dev, psc->malo_irq_spec, psc->malo_res_irq); bad: if (psc->malo_msi != 0) pci_release_msi(dev); + bus_release_resources(dev, psc->malo_mem_spec, psc->malo_res_mem); return (error); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 10:18:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A4D510656C8; Mon, 30 Mar 2009 10:18:57 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail16.syd.optusnet.com.au (mail16.syd.optusnet.com.au [211.29.132.197]) by mx1.freebsd.org (Postfix) with ESMTP id 73BF68FC17; Mon, 30 Mar 2009 10:18:54 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c122-106-216-167.belrs3.nsw.optusnet.com.au [122.106.216.167]) by mail16.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n2UAIpPr014572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Mar 2009 21:18:51 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.3/8.14.3) with ESMTP id n2UAIoAR031844; Mon, 30 Mar 2009 21:18:50 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.3/8.14.3/Submit) id n2UAIoGB031843; Mon, 30 Mar 2009 21:18:50 +1100 (EST) (envelope-from peter) Date: Mon, 30 Mar 2009 21:18:50 +1100 From: user@vk2pj.dyndns.org To: Xin LI Message-ID: <20090330101850.GB31695@server.vk2pj.dyndns.org> References: <200903280400.n2S40kW1083700@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aT9PWwzfKXlsBJM1" Content-Disposition: inline In-Reply-To: <200903280400.n2S40kW1083700@svn.freebsd.org> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190482 - in head/lib/libc/db: . btree hash mpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 10:18:58 -0000 --aT9PWwzfKXlsBJM1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Xin, On 2009-Mar-28 04:00:46 +0000, Xin LI wrote: >Log: > When allocating memory, zero out them if we don't intend to overwrite th= em > all; before freeing memory, zero out them before we release it as free > heap. This will eliminate some potential information leak issue. Given that db runs with the same privileges as the process using it, I don't see how zeroing memory eliminates any information leak - the process can directly open and read the underlying db file itself. Zeroing on allocation may fix any potential issue with uninitialised structures and prevent the return of garbage in "holes" but that's not an information leak. --=20 Peter Jeremy --aT9PWwzfKXlsBJM1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAknQnIoACgkQ/opHv/APuIdbAwCfe30BopQQQEEDgQpuI9LrlXrD g5IAoJcvWJMubXmy0QGhVeeTSLDoKhXt =/Veu -----END PGP SIGNATURE----- --aT9PWwzfKXlsBJM1-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 11:23:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47575106570E; Mon, 30 Mar 2009 11:23:15 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 264A18FC15; Mon, 30 Mar 2009 11:23:15 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UBNExK065055; Mon, 30 Mar 2009 11:23:14 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UBNExd065054; Mon, 30 Mar 2009 11:23:14 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903301123.n2UBNExd065054@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 30 Mar 2009 11:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190550 - head/sys/dev/malo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 11:23:26 -0000 Author: weongyo Date: Mon Mar 30 11:23:14 2009 New Revision: 190550 URL: http://svn.freebsd.org/changeset/base/190550 Log: corrects a error message. Modified: head/sys/dev/malo/if_malohal.c Modified: head/sys/dev/malo/if_malohal.c ============================================================================== --- head/sys/dev/malo/if_malohal.c Mon Mar 30 10:54:07 2009 (r190549) +++ head/sys/dev/malo/if_malohal.c Mon Mar 30 11:23:14 2009 (r190550) @@ -128,7 +128,7 @@ malo_hal_attach(device_t dev, uint16_t d NULL, /* lockarg */ &mh->mh_dmat); if (error != 0) { - device_printf(dev, "unable to allocate memory for cmd buffer, " + device_printf(dev, "unable to allocate memory for cmd tag, " "error %u\n", error); goto fail; } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 11:25:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B467E10658E2; Mon, 30 Mar 2009 11:25:47 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by mx1.freebsd.org (Postfix) with ESMTP id 69C218FC1B; Mon, 30 Mar 2009 11:25:47 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: by wa-out-1112.google.com with SMTP id m38so1419676waf.27 for ; Mon, 30 Mar 2009 04:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:subject :message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:organization :x-operation-sytem; bh=BiN46izAdKKeSr9eCwX4u2X7G8inlCO4Ryqwjuns068=; b=oEZXv2pZdI5pFWY+dRhuGWsUm3vQT+NIIDje67t+++ujk7If1MDwExNLN7Lgg+isXb EXhO3EKmb75nMYKcIm734VUFIDASE0qe1ad4hrqULUkNYT2rSXiv0gOngiJMgmhbTzsT wyfxwjkI1u2EEZiqs1BLZe+Z026gYDqbp6vFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent :organization:x-operation-sytem; b=kBtKfu1mzZGaNM0x9SaEFu5bMgtUn07eDq1Ij34NtNXgre6rTzGKe3f4Aj5NmCbbCe M9ZQBQLrC5p2bjZk0vE1r1g5CyCnnEIwxmTW45R2B/BjjtiQG7oJ2iDFvj6BEDcJltTC s/Ns6zESP/YI2pUd89PCmY2418NGoh7TOsNEY= Received: by 10.114.127.1 with SMTP id z1mr3541983wac.3.1238412346919; Mon, 30 Mar 2009 04:25:46 -0700 (PDT) Received: from weongyo ([114.111.62.249]) by mx.google.com with ESMTPS id b39sm12669502rvf.2.2009.03.30.04.25.45 (version=SSLv3 cipher=RC4-MD5); Mon, 30 Mar 2009 04:25:46 -0700 (PDT) Received: by weongyo (sSMTP sendmail emulation); Mon, 30 Mar 2009 20:25:43 +0900 From: Weongyo Jeong Date: Mon, 30 Mar 2009 20:25:43 +0900 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20090330112543.GG26132@weongyo.cdnetworks.kr> References: <200903301123.n2UBNExd065054@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903301123.n2UBNExd065054@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: Subject: Re: svn commit: r190550 - head/sys/dev/malo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 11:25:52 -0000 On Mon, Mar 30, 2009 at 11:23:14AM +0000, Weongyo Jeong wrote: > Author: weongyo > Date: Mon Mar 30 11:23:14 2009 > New Revision: 190550 > URL: http://svn.freebsd.org/changeset/base/190550 > > Log: > corrects a error message. > > Modified: > head/sys/dev/malo/if_malohal.c > > Modified: head/sys/dev/malo/if_malohal.c > ============================================================================== > --- head/sys/dev/malo/if_malohal.c Mon Mar 30 10:54:07 2009 (r190549) > +++ head/sys/dev/malo/if_malohal.c Mon Mar 30 11:23:14 2009 (r190550) > @@ -128,7 +128,7 @@ malo_hal_attach(device_t dev, uint16_t d > NULL, /* lockarg */ > &mh->mh_dmat); > if (error != 0) { > - device_printf(dev, "unable to allocate memory for cmd buffer, " > + device_printf(dev, "unable to allocate memory for cmd tag, " > "error %u\n", error); > goto fail; > } MFC after: 3 days regards, Weongyo Jeong From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 11:51:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1792A106564A; Mon, 30 Mar 2009 11:51:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 060288FC29; Mon, 30 Mar 2009 11:51:06 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UBp5UR065723; Mon, 30 Mar 2009 11:51:05 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UBp5xf065722; Mon, 30 Mar 2009 11:51:05 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903301151.n2UBp5xf065722@svn.freebsd.org> From: Weongyo Jeong Date: Mon, 30 Mar 2009 11:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190552 - head/sys/dev/malo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 11:51:06 -0000 Author: weongyo Date: Mon Mar 30 11:51:05 2009 New Revision: 190552 URL: http://svn.freebsd.org/changeset/base/190552 Log: when it failed to inform rx/tx dma setup it should clean up allocated dma-related buffers and tags. MFC after: 3 days Modified: head/sys/dev/malo/if_malo.c Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Mon Mar 30 11:46:34 2009 (r190551) +++ head/sys/dev/malo/if_malo.c Mon Mar 30 11:51:05 2009 (r190552) @@ -260,7 +260,7 @@ malo_attach(uint16_t devid, struct malo_ } error = malo_setup_hwdma(sc); /* push to firmware */ if (error != 0) /* NB: malo_setupdma prints msg */ - goto bad1; + goto bad2; sc->malo_tq = taskqueue_create_fast("malo_taskq", M_NOWAIT, taskqueue_thread_enqueue, &sc->malo_tq); @@ -329,6 +329,8 @@ malo_attach(uint16_t devid, struct malo_ malo_announce(sc); return 0; +bad2: + malo_dma_cleanup(sc); bad1: malo_hal_detach(mh); bad: From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 14:46:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79CBF1065673; Mon, 30 Mar 2009 14:46:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from gizmo.2hip.net (gizmo.2hip.net [64.74.207.195]) by mx1.freebsd.org (Postfix) with ESMTP id 434668FC13; Mon, 30 Mar 2009 14:46:03 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from [192.168.1.156] (adsl-157-58-177.bna.bellsouth.net [70.157.58.177]) (authenticated bits=0) by gizmo.2hip.net (8.14.3/8.14.3) with ESMTP id n2UEigef066455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Mar 2009 10:44:42 -0400 (EDT) (envelope-from rnoland@FreeBSD.org) From: Robert Noland To: Konstantin Belousov In-Reply-To: <200903300847.n2U8lSGo058512@svn.freebsd.org> References: <200903300847.n2U8lSGo058512@svn.freebsd.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-QdYJipDL6I4iFH2LLB3j" Organization: FreeBSD Date: Mon, 30 Mar 2009 09:45:29 -0500 Message-Id: <1238424329.8491.328.camel@balrog.2hip.net> Mime-Version: 1.0 X-Mailer: Evolution 2.24.5 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_PBL, RDNS_DYNAMIC autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on gizmo.2hip.net Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190543 - in head: include libexec/rtld-elf sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 14:46:04 -0000 --=-QdYJipDL6I4iFH2LLB3j Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2009-03-30 at 08:47 +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Mar 30 08:47:28 2009 > New Revision: 190543 > URL: http://svn.freebsd.org/changeset/base/190543 >=20 > Log: > Implement support for RTLD_NODELETE flag for dlopen() and -z nodelete > static linker option. Do it by incrementing reference count on the load= ed > object and its dependencies. Cool, I can drop my patches to compiz now. robert. > Reviewed by: davidxu, kan >=20 > Modified: > head/include/dlfcn.h > head/libexec/rtld-elf/rtld.c > head/libexec/rtld-elf/rtld.h > head/sys/sys/elf_common.h >=20 > Modified: head/include/dlfcn.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/include/dlfcn.h Mon Mar 30 08:44:29 2009 (r190542) > +++ head/include/dlfcn.h Mon Mar 30 08:47:28 2009 (r190543) > @@ -47,6 +47,7 @@ > #define RTLD_GLOBAL 0x100 /* Make symbols globally available. */ > #define RTLD_LOCAL 0 /* Opposite of RTLD_GLOBAL, and the default. */ > #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ > +#define RTLD_NODELETE 0x01000 /* Do not remove members. */ > =20 > /* > * Request arguments for dlinfo(). >=20 > Modified: head/libexec/rtld-elf/rtld.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/libexec/rtld-elf/rtld.c Mon Mar 30 08:44:29 2009 (r190542) > +++ head/libexec/rtld-elf/rtld.c Mon Mar 30 08:47:28 2009 (r190543) > @@ -937,6 +937,8 @@ digest_dynamic(Obj_Entry *obj, int early > /* XXX */; > if (dynp->d_un.d_val & DF_1_BIND_NOW) > obj->bind_now =3D true; > + if (dynp->d_un.d_val & DF_1_NODELETE) > + obj->z_nodelete =3D true; > break; > =20 > default: > @@ -1422,15 +1424,21 @@ is_exported(const Elf_Sym *def) > static int > load_needed_objects(Obj_Entry *first) > { > - Obj_Entry *obj; > + Obj_Entry *obj, *obj1; > =20 > for (obj =3D first; obj !=3D NULL; obj =3D obj->next) { > Needed_Entry *needed; > =20 > for (needed =3D obj->needed; needed !=3D NULL; needed =3D needed->nex= t) { > - needed->obj =3D load_object(obj->strtab + needed->name, obj); > - if (needed->obj =3D=3D NULL && !ld_tracing) > + obj1 =3D needed->obj =3D load_object(obj->strtab + needed->name, ob= j); > + if (obj1 =3D=3D NULL && !ld_tracing) > return -1; > + if (obj1 !=3D NULL && obj1->z_nodelete && !obj1->ref_nodel) { > + dbg("obj %s nodelete", obj1->path); > + init_dag(obj1); > + ref_dag(obj1); > + obj1->ref_nodel =3D true; > + } > } > } > =20 > @@ -1976,12 +1984,13 @@ dlopen(const char *name, int mode) > Obj_Entry **old_obj_tail; > Obj_Entry *obj; > Objlist initlist; > - int result, lockstate; > + int result, lockstate, nodelete; > =20 > LD_UTRACE(UTRACE_DLOPEN_START, NULL, NULL, 0, mode, name); > ld_tracing =3D (mode & RTLD_TRACE) =3D=3D 0 ? NULL : "1"; > if (ld_tracing !=3D NULL) > environ =3D (char **)*get_program_var_addr("environ"); > + nodelete =3D mode & RTLD_NODELETE; > =20 > objlist_init(&initlist); > =20 > @@ -2029,6 +2038,11 @@ dlopen(const char *name, int mode) > if (ld_tracing) > goto trace; > } > + if (obj !=3D NULL && (nodelete || obj->z_nodelete) && !obj->ref_nodel) = { > + dbg("obj %s nodelete", obj->path); > + ref_dag(obj); > + obj->z_nodelete =3D obj->ref_nodel =3D true; > + } > } > =20 > LD_UTRACE(UTRACE_DLOPEN_STOP, obj, NULL, 0, obj ? obj->dl_refcount := 0, >=20 > Modified: head/libexec/rtld-elf/rtld.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/libexec/rtld-elf/rtld.h Mon Mar 30 08:44:29 2009 (r190542) > +++ head/libexec/rtld-elf/rtld.h Mon Mar 30 08:47:28 2009 (r190543) > @@ -217,6 +217,8 @@ typedef struct Struct_Obj_Entry { > bool tls_done : 1; /* Already allocated offset for static TLS */ > bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ > bool z_origin : 1; /* Process rpath and soname tokens */ > + bool z_nodelete : 1; /* Do not unload the object and dependencies */ > + bool ref_nodel : 1; /* refcount increased to prevent dlclose */ > =20 > struct link_map linkmap; /* for GDB and dlinfo() */ > Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ >=20 > Modified: head/sys/sys/elf_common.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/sys/elf_common.h Mon Mar 30 08:44:29 2009 (r190542) > +++ head/sys/sys/elf_common.h Mon Mar 30 08:47:28 2009 (r190543) > @@ -469,6 +469,7 @@ typedef struct { > /* Values for DT_FLAGS_1 */ > #define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ > #define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ > +#define DF_1_NODELETE 0x00000008 /* Set the RTLD_NODELETE for object */ > #define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ > =20 > /* Values for n_type. Used in core files. */ --=20 Robert Noland FreeBSD --=-QdYJipDL6I4iFH2LLB3j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEABECAAYFAknQ2wkACgkQM4TrQ4qfROOifACcDILXoAZ7HZmAMz5kDq9bHQ2A 8g8AoIYUAH03OSV7FHReZk2kApgeCKLd =JYrV -----END PGP SIGNATURE----- --=-QdYJipDL6I4iFH2LLB3j-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 15:01:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 125DC1065672; Mon, 30 Mar 2009 15:01:30 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F36578FC19; Mon, 30 Mar 2009 15:01:29 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UF1TaP070037; Mon, 30 Mar 2009 15:01:29 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UF1Ta4070036; Mon, 30 Mar 2009 15:01:29 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <200903301501.n2UF1Ta4070036@svn.freebsd.org> From: Christian Brueffer Date: Mon, 30 Mar 2009 15:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190557 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 15:01:30 -0000 Author: brueffer Date: Mon Mar 30 15:01:29 2009 New Revision: 190557 URL: http://svn.freebsd.org/changeset/base/190557 Log: Fix memory leak in semunload(). PR: 133064 Submitted by: Mateusz Guzik MFC after: 1 week Modified: head/sys/kern/sysv_sem.c Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Mon Mar 30 14:11:37 2009 (r190556) +++ head/sys/kern/sysv_sem.c Mon Mar 30 15:01:29 2009 (r190557) @@ -285,6 +285,7 @@ semunload(void) free(semu, M_SEM); for (i = 0; i < seminfo.semmni; i++) mtx_destroy(&sema_mtx[i]); + free(sema_mtx, M_SEM); mtx_destroy(&sem_mtx); mtx_destroy(&sem_undo_mtx); return (0); From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 16:01:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C964C1065673; Mon, 30 Mar 2009 16:01:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5AF88FC16; Mon, 30 Mar 2009 16:01:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UG1919071358; Mon, 30 Mar 2009 16:01:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UG191M071354; Mon, 30 Mar 2009 16:01:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903301601.n2UG191M071354@svn.freebsd.org> From: Warner Losh Date: Mon, 30 Mar 2009 16:01:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190558 - in head/sys: conf dev/mii modules/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 16:01:10 -0000 Author: imp Date: Mon Mar 30 16:01:09 2009 New Revision: 190558 URL: http://svn.freebsd.org/changeset/base/190558 Log: New PHY driver for the internal PHY found in the AX88790. There's a number of quirks for this device, and this implements just the basics. The 2.5s powerdown recommended in the datasheet will be next... Added: head/sys/dev/mii/axphy.c (contents, props changed) head/sys/dev/mii/axphyreg.h (contents, props changed) Modified: head/sys/conf/files head/sys/modules/mii/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Mar 30 15:01:29 2009 (r190557) +++ head/sys/conf/files Mon Mar 30 16:01:09 2009 (r190558) @@ -1103,6 +1103,7 @@ dev/mfi/mfi_cam.c optional mfip scbus dev/mii/acphy.c optional miibus | acphy dev/mii/amphy.c optional miibus | amphy dev/mii/atphy.c optional miibus | atphy +dev/mii/axphy.c optional miibus | axphy dev/mii/bmtphy.c optional miibus | bmtphy dev/mii/brgphy.c optional miibus | brgphy dev/mii/ciphy.c optional miibus | ciphy Added: head/sys/dev/mii/axphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/axphy.c Mon Mar 30 16:01:09 2009 (r190558) @@ -0,0 +1,207 @@ +/*- + * Copyright (c) 2009, M. Warner Losh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * 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 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. + */ +#include +__FBSDID("$FreeBSD$"); + +/* + * driver for internal phy in the AX88x9x chips. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include "miidevs.h" + +#include + +#include "miibus_if.h" + +static int axphy_probe(device_t dev); +static int axphy_attach(device_t dev); + +static device_method_t axphy_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, axphy_probe), + DEVMETHOD(device_attach, axphy_attach), + DEVMETHOD(device_detach, mii_phy_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + { 0, 0 } +}; + +static devclass_t axphy_devclass; + +static driver_t axphy_driver = { + "axphy", + axphy_methods, + sizeof(struct mii_softc) +}; + +DRIVER_MODULE(axphy, miibus, axphy_driver, axphy_devclass, 0, 0); + +static int axphy_service(struct mii_softc *, struct mii_data *, int); +static void axphy_status(struct mii_softc *); + +static const struct mii_phydesc axphys[] = { + MII_PHY_DESC(ASIX, AX88X9X), + MII_PHY_END +}; + +static int +axphy_probe(device_t dev) +{ + + return (mii_phy_dev_probe(dev, axphys, BUS_PROBE_DEFAULT)); +} + +static int +axphy_attach(device_t dev) +{ + struct mii_softc *sc; + struct mii_attach_args *ma; + struct mii_data *mii; + + sc = device_get_softc(dev); + ma = device_get_ivars(dev); + sc->mii_dev = device_get_parent(dev); + mii = device_get_softc(sc->mii_dev); + LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + + sc->mii_inst = mii->mii_instance; + sc->mii_phy = ma->mii_phyno; + sc->mii_service = axphy_service; + sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOISOLATE; + mii->mii_instance++; + + mii_phy_reset(sc); + + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + device_printf(dev, " "); + mii_phy_add_media(sc); + printf("\n"); + + MIIBUS_MEDIAINIT(sc->mii_dev); + mii_phy_setmedia(sc); + + return (0); +} + +static int +axphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) +{ + struct ifmedia_entry *ife = mii->mii_media.ifm_cur; + int reg; + + switch (cmd) { + case MII_POLLSTAT: + if (IFM_INST(ife->ifm_media) != sc->mii_inst) + return (0); + break; + + case MII_MEDIACHG: + if (IFM_INST(ife->ifm_media) != sc->mii_inst) { + reg = PHY_READ(sc, MII_BMCR); + PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); + return (0); + } + + /* + * If the interface is not up, don't do anything. + */ + if ((mii->mii_ifp->if_flags & IFF_UP) == 0) + break; + + mii_phy_setmedia(sc); + break; + + case MII_TICK: + if (IFM_INST(ife->ifm_media) != sc->mii_inst) + return (0); + if (mii_phy_tick(sc) == EJUSTRETURN) + return (0); + break; + } + + /* Update the media status. */ + axphy_status(sc); + + /* Callback if something changed. */ + mii_phy_update(sc, cmd); + return (0); +} + +static void +axphy_status(struct mii_softc *sc) +{ + struct mii_data *mii = sc->mii_pdata; + struct ifmedia_entry *ife = mii->mii_media.ifm_cur; + int bmsr, bmcr; + + mii->mii_media_status = IFM_AVALID; + mii->mii_media_active = IFM_ETHER; + + bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); + if (bmsr & BMSR_LINK) + mii->mii_media_status |= IFM_ACTIVE; + + bmcr = PHY_READ(sc, MII_BMCR); + if (bmcr & BMCR_ISO) { + mii->mii_media_active |= IFM_NONE; + mii->mii_media_status = 0; + return; + } + + if (bmcr & BMCR_LOOP) + mii->mii_media_active |= IFM_LOOP; + + if (bmcr & BMCR_AUTOEN) { + if ((bmsr & BMSR_ACOMP) == 0) { + mii->mii_media_active |= IFM_NONE; + return; + } + +#if 0 + scr = PHY_READ(sc, MII_AXPHY_SCR); + if (scr & SCR_S100) + mii->mii_media_active |= IFM_100_TX; + else + mii->mii_media_active |= IFM_10_T; + if (scr & SCR_FDX) + mii->mii_media_active |= IFM_FDX; +#endif + } else + mii->mii_media_active = ife->ifm_media; +} Added: head/sys/dev/mii/axphyreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mii/axphyreg.h Mon Mar 30 16:01:09 2009 (r190558) @@ -0,0 +1,28 @@ +/*- + * Copyright (c) 2009, M. Warner Losh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * 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 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. + * + * $FreeBSD$ + */ Modified: head/sys/modules/mii/Makefile ============================================================================== --- head/sys/modules/mii/Makefile Mon Mar 30 15:01:29 2009 (r190557) +++ head/sys/modules/mii/Makefile Mon Mar 30 16:01:09 2009 (r190558) @@ -3,7 +3,8 @@ .PATH: ${.CURDIR}/../../dev/mii KMOD= miibus -SRCS= acphy.c amphy.c atphy.c bmtphy.c brgphy.c bus_if.h ciphy.c device_if.h +SRCS= acphy.c amphy.c atphy.c axphy.c bmtphy.c brgphy.c bus_if.h +SRCS+= ciphy.c device_if.h SRCS+= e1000phy.c exphy.c gentbi.c icsphy.c inphy.c ip1000phy.c jmphy.c SRCS+= lxtphy.c miibus_if.c miibus_if.h mii.c miidevs.h mii_physubr.c SRCS+= mlphy.c nsgphy.c nsphy.c nsphyter.c pci_if.h pnaphy.c qsphy.c From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 16:03:24 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D623C10656F3; Mon, 30 Mar 2009 16:03:24 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 756E68FC08; Mon, 30 Mar 2009 16:03:24 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id n2UFi2Fs095159; Mon, 30 Mar 2009 10:44:02 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id n2UFi2M5095158; Mon, 30 Mar 2009 10:44:02 -0500 (CDT) (envelope-from brooks) Date: Mon, 30 Mar 2009 10:44:02 -0500 From: Brooks Davis To: user@vk2pj.dyndns.org Message-ID: <20090330154402.GB94338@lor.one-eyed-alien.net> References: <200903280400.n2S40kW1083700@svn.freebsd.org> <20090330101850.GB31695@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="p4qYPpj5QlsIQJ0K" Content-Disposition: inline In-Reply-To: <20090330101850.GB31695@server.vk2pj.dyndns.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 30 Mar 2009 10:44:02 -0500 (CDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r190482 - in head/lib/libc/db: . btree hash mpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 16:03:28 -0000 --p4qYPpj5QlsIQJ0K Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 30, 2009 at 09:18:50PM +1100, user@vk2pj.dyndns.org wrote: > Hi Xin, >=20 > On 2009-Mar-28 04:00:46 +0000, Xin LI wrote: > >Log: > > When allocating memory, zero out them if we don't intend to overwrite = them > > all; before freeing memory, zero out them before we release it as free > > heap. This will eliminate some potential information leak issue. >=20 > Given that db runs with the same privileges as the process using it, I > don't see how zeroing memory eliminates any information leak - the > process can directly open and read the underlying db file itself. > Zeroing on allocation may fix any potential issue with uninitialised > structures and prevent the return of garbage in "holes" but that's not > an information leak. Consider /etc/pwd.db. It's world readable, but written by a program that also wrote /etc/spwd.db which definitely is not. -- Brooks --p4qYPpj5QlsIQJ0K Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFJ0OjBXY6L6fI4GtQRAvESAJ99iSa/Int9pUI2qDadRu07tXSsQQCgwR7p ODjNiyr9ZQ1twawRPNNyC+k= =RDbA -----END PGP SIGNATURE----- --p4qYPpj5QlsIQJ0K-- From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 16:14:19 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E14106566B; Mon, 30 Mar 2009 16:14:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 689228FC0C; Mon, 30 Mar 2009 16:14:19 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id 8379128448; Tue, 31 Mar 2009 00:14:17 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 133D7EC434F; Tue, 31 Mar 2009 00:14:16 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id 6t0WZTTL3dM5; Tue, 31 Mar 2009 00:14:03 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 01DB8EB54D4; Tue, 31 Mar 2009 00:13:58 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=VGB84my2E5sTlUUN3JVLwbI8y5U+p+5/ms6Ta1GsKMbm3WN2yR6FLgc/nO/FogkG+ FKZo+lr3qMbYQQF68iQzg== Message-ID: <49D0EFC1.7030706@delphij.net> Date: Mon, 30 Mar 2009 09:13:53 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.21 (X11/20090324) MIME-Version: 1.0 To: user@vk2pj.dyndns.org References: <200903280400.n2S40kW1083700@svn.freebsd.org> <20090330101850.GB31695@server.vk2pj.dyndns.org> In-Reply-To: <20090330101850.GB31695@server.vk2pj.dyndns.org> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Xin LI Subject: Re: svn commit: r190482 - in head/lib/libc/db: . btree hash mpool X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 16:14:20 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 user@vk2pj.dyndns.org wrote: [...] > Given that db runs with the same privileges as the process using it, I > don't see how zeroing memory eliminates any information leak - the > process can directly open and read the underlying db file itself. > Zeroing on allocation may fix any potential issue with uninitialised > structures and prevent the return of garbage in "holes" but that's not > an information leak. The process that can read sensitive information _could_ sometimes write something that can be read by non privileged process. It's known in kern/123529 where spwd.db contents could be leaked into aliases.db, for instance. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAknQ78EACgkQi+vbBBjt66AJaQCgg5TONSuHZaGKkPB9W2tOLyhc 1qkAn3wLsADUT+6tRerLYbOP2QIeKW1j =WYob -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 16:15:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A9D21065705; Mon, 30 Mar 2009 16:15:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8697B8FC1A; Mon, 30 Mar 2009 16:15:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UGF6ei071677; Mon, 30 Mar 2009 16:15:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UGF6Bn071672; Mon, 30 Mar 2009 16:15:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903301615.n2UGF6Bn071672@svn.freebsd.org> From: Warner Losh Date: Mon, 30 Mar 2009 16:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190559 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 16:15:08 -0000 Author: imp Date: Mon Mar 30 16:15:06 2009 New Revision: 190559 URL: http://svn.freebsd.org/changeset/base/190559 Log: This is a major reworking of the AX88x90 support. o Introduce new chip_type AX88790. There's a few places we need to know the exact chip for workaronds. o Explain the AX88190 workaround for the ISR bits being stuck, and don't apply them to the AX88790. The datasheet says the bits are fixed, and experience confirms. o Fix mii bit-bang read code to read and discard the 'floating' bit. o Remove empty ed_pccard_ax88x90_mii_reset routine o Report error from mii_phy_probe o Don't use ed_probe_Novel_generic for ax88x90 chips. It puts them into an odd state sometimes. Instead, use a more stream-lined version that avoids the trouble spots. This was copied and tweaked from the original. o Move chip reset into its own routine. o Minor code optimiation on getting MAC address o Add code for coping with AX88790 cards that are in power down state and need to be kicked before the PHY registers for the internal phy read right. o Remove ugly cap of PHYs at 17. o For AX88790, we need to set a special bit for accessig phy 16 (the internal phy) and clear it for all others according to a chip erratum. o streamline the bit-bang code for AX88x90: the delays aren't needed according to the datasheet timing diagrams and also the Linux driver o Fix minor bit definition for direction bit. o Generally: Some comments reformatted o Only try the toshiba probe on cards labelled as toshiba # From another Akihabara card (this one from a few years ago from a # friend in Japan). Fix the Corega FEther II PCC-TXD. This one is # still on sale new, as of a few weeks ago. should fix all other AX88x90 # based cards, but I have some testing left to finish on my collection... Modified: head/sys/dev/ed/ax88x90reg.h head/sys/dev/ed/if_ed.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/ed/if_edreg.h Modified: head/sys/dev/ed/ax88x90reg.h ============================================================================== --- head/sys/dev/ed/ax88x90reg.h Mon Mar 30 16:01:09 2009 (r190558) +++ head/sys/dev/ed/ax88x90reg.h Mon Mar 30 16:15:06 2009 (r190559) @@ -30,7 +30,7 @@ /* AX88x90 based miibus defines */ #define ED_AX88X90_MIIBUS 0x04 /* MII bus register on ASIC */ #define ED_AX88X90_MII_CLK 0x01 -#define ED_AX88X90_MII_DIROUT 0x02 +#define ED_AX88X90_MII_DIRIN 0x02 #define ED_AX88X90_MII_DATAIN 0x04 #define ED_AX88X90_MII_DATAOUT 0x08 #define ED_AX88X90_TEST 0x05 /* "test" register on asic */ Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Mon Mar 30 16:01:09 2009 (r190558) +++ head/sys/dev/ed/if_ed.c Mon Mar 30 16:15:06 2009 (r190559) @@ -427,10 +427,17 @@ ed_stop_hw(struct ed_softc *sc) * Wait for interface to enter stopped state, but limit # of checks to * 'n' (about 5ms). It shouldn't even take 5us on modern DS8390's, but * just in case it's an old one. + * + * The AX88190 and AX88190A chips have a problem with this, it seems, + * but there's no evidence that I've found for excluding the check. + * This may be due to the cryptic references to the ISR register being + * fixed in the AX88790. */ if (sc->chip_type != ED_CHIP_TYPE_AX88190) while (((ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) == 0) && --n) continue; + if (n <= 0) + device_printf(sc->dev, "ed_stop_hw RST never set\n"); } /* @@ -916,10 +923,10 @@ edintr(void *arg) ed_nic_outb(sc, ED_P0_CR, sc->cr_proto | ED_CR_STA); /* - * loop until there are no more new interrupts. When the card - * goes away, the hardware will read back 0xff. Looking at - * the interrupts, it would appear that 0xff is impossible, - * or at least extremely unlikely. + * loop until there are no more new interrupts. When the card goes + * away, the hardware will read back 0xff. Looking at the interrupts, + * it would appear that 0xff is impossible, or at least extremely + * unlikely. */ while ((isr = ed_nic_inb(sc, ED_P0_ISR)) != 0 && isr != 0xff) { @@ -930,12 +937,14 @@ edintr(void *arg) */ ed_nic_outb(sc, ED_P0_ISR, isr); - /* - * XXX workaround for AX88190 + /* + * The AX88190 and AX88190A has problems acking an interrupt + * and having them clear. This interferes with top-level loop + * here. Wait for all the bits to clear. + * * We limit this to 5000 iterations. At 1us per inb/outb, - * this translates to about 15ms, which should be plenty - * of time, and also gives protection in the card eject - * case. + * this translates to about 15ms, which should be plenty of + * time, and also gives protection in the card eject case. */ if (sc->chip_type == ED_CHIP_TYPE_AX88190) { count = 5000; /* 15ms */ @@ -1530,7 +1539,8 @@ ed_setrcr(struct ed_softc *sc) ED_ASSERT_LOCKED(sc); /* Bit 6 in AX88190 RCR register must be set. */ - if (sc->chip_type == ED_CHIP_TYPE_AX88190) + if (sc->chip_type == ED_CHIP_TYPE_AX88190 || + sc->chip_type == ED_CHIP_TYPE_AX88790) reg1 = ED_RCR_INTT; else reg1 = 0x00; Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Mon Mar 30 16:01:09 2009 (r190558) +++ head/sys/dev/ed/if_ed_pccard.c Mon Mar 30 16:15:06 2009 (r190559) @@ -245,7 +245,6 @@ static void ed_pccard_dl100xx_mii_writeb int nbits); static int ed_pccard_ax88x90(device_t dev, const struct ed_product *); -static void ed_pccard_ax88x90_mii_reset(struct ed_softc *sc); static u_int ed_pccard_ax88x90_mii_readbits(struct ed_softc *sc, int nbits); static void ed_pccard_ax88x90_mii_writebits(struct ed_softc *sc, u_int val, int nbits); @@ -364,7 +363,7 @@ ed_pccard_rom_mac(device_t dev, uint8_t */ ed_pio_readmem(sc, 0, romdata, 32); if (bootverbose) - printf("ROM DATA: %32D\n", romdata, " "); + device_printf(dev, "ROM DATA: %32D\n", romdata, " "); if (romdata[28] != 0x57 || romdata[30] != 0x57) return (0); for (i = 0; i < ETHER_ADDR_LEN; i++) @@ -440,6 +439,7 @@ ed_pccard_attach(device_t dev) u_long size; static uint16_t *intr_vals[] = {NULL, NULL}; + sc->dev = dev; if ((pp = (const struct ed_product *) pccard_product_lookup(dev, (const struct pccard_product *) ed_pccard_products, sizeof(ed_pccard_products[0]), NULL)) == NULL) @@ -485,9 +485,8 @@ ed_pccard_attach(device_t dev) error = ed_pccard_tc5299j(dev, pp); if (error != 0) error = ed_probe_Novell_generic(dev, flags); - if (error != 0) { - if (pp->flags & NE2000DVF_TOSHIBA) - flags |= ED_FLAGS_TOSH_ETHER; + if (error != 0 && (pp->flags & NE2000DVF_TOSHIBA)) { + flags |= ED_FLAGS_TOSH_ETHER; flags |= ED_FLAGS_PCCARD; sc->asic_offset = ED_WD_ASIC_OFFSET; sc->nic_offset = ED_WD_NIC_OFFSET; @@ -564,11 +563,11 @@ ed_pccard_attach(device_t dev) ed_pccard_dl100xx_mii_reset(sc); (void)mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, ed_ifmedia_sts); - } else if (sc->chip_type == ED_CHIP_TYPE_AX88190) { - ed_pccard_ax88x90_mii_reset(sc); + } else if (sc->chip_type == ED_CHIP_TYPE_AX88190 || + sc->chip_type == ED_CHIP_TYPE_AX88790) { if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii!\n"); + device_printf(dev, "Missing mii %d!\n", error); goto bad; } @@ -722,11 +721,100 @@ ed_pccard_dl100xx_mii_readbits(struct ed return val; } +static void +ed_pccard_ax88x90_reset(struct ed_softc *sc) +{ + int i; + + /* Reset Card */ + ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0); + ed_asic_outb(sc, ED_NOVELL_RESET, ed_asic_inb(sc, ED_NOVELL_RESET)); + + /* Wait for the interrupt to fire */ + for (i = 10000; i > 0; i--) + if (ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) + break; + ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RST); /* ACK INTR */ + if (i == 0) + device_printf(sc->dev, "Reset didn't finish\n"); +} + +/* + * Probe and vendor-specific initialization routine for ax88x90 boards + */ +static int +ed_probe_ax88x90_generic(device_t dev, int flags) +{ + struct ed_softc *sc = device_get_softc(dev); + u_int memsize; + static char test_pattern[32] = "THIS is A memory TEST pattern"; + char test_buffer[32]; + + ed_pccard_ax88x90_reset(sc); + DELAY(10 * 1000); + + /* Make sure that we really have an 8390 based board */ + if (!ed_probe_generic8390(sc)) + return (ENXIO); + + sc->vendor = ED_VENDOR_NOVELL; + sc->mem_shared = 0; + sc->cr_proto = ED_CR_RD2; + + /* + * Test the ability to read and write to the NIC memory. + */ + + /* + * This prevents packets from being stored in the NIC memory when the + * readmem routine turns on the start bit in the CR. + */ + ed_nic_outb(sc, ED_P0_RCR, ED_RCR_MON); + + /* Temporarily initialize DCR for byte operations */ + ed_nic_outb(sc, ED_P0_DCR, ED_DCR_FT1 | ED_DCR_LS); + sc->isa16bit = 1; + ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); + ed_nic_outb(sc, ED_P0_PSTART, 16384 / ED_PAGE_SIZE); + ed_nic_outb(sc, ED_P0_PSTOP, 32768 / ED_PAGE_SIZE); + /* + * Write a test pattern in word mode. If this also fails, then + * we don't know what this board is. + */ + ed_pio_writemem(sc, test_pattern, 16384, sizeof(test_pattern)); + ed_pio_readmem(sc, 16384, test_buffer, sizeof(test_pattern)); + if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) != 0) + return (ENXIO); + sc->type = ED_TYPE_NE2000; + if (ed_asic_inb(sc, ED_AX88X90_TEST) != 0) + sc->chip_type = ED_CHIP_TYPE_AX88790; + else + sc->chip_type = ED_CHIP_TYPE_AX88190; + + /* 8k of memory plus an additional 8k if 16bit */ + memsize = 8192 + sc->isa16bit * 8192; + sc->mem_size = memsize; + + /* NIC memory doesn't start at zero on an NE board */ + /* The start address is tied to the bus width */ + sc->mem_start = 8192 + sc->isa16bit * 8192; + sc->mem_end = sc->mem_start + memsize; + sc->tx_page_start = memsize / ED_PAGE_SIZE; + sc->txb_cnt = 2; + sc->rec_page_start = sc->tx_page_start + sc->txb_cnt * ED_TXBUF_SIZE; + sc->rec_page_stop = sc->tx_page_start + memsize / ED_PAGE_SIZE; + + sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE; + /* clear any pending interrupts that might have occurred above */ + ed_nic_outb(sc, ED_P0_ISR, 0xff); + sc->sc_write_mbufs = ed_pio_write_mbufs; + return (0); +} + static int -ed_pccard_ax88x90_geteprom(struct ed_softc *sc) +ed_pccard_ax88x90_enaddr(struct ed_softc *sc) { - int prom[16],i; - u_char tmp; + int i, j; struct { unsigned char offset, value; } pg_seq[] = { @@ -739,42 +827,75 @@ ed_pccard_ax88x90_geteprom(struct ed_sof {ED_P0_ISR, 0xff}, {ED_P0_RCR, ED_RCR_MON | ED_RCR_INTT}, /* Set To Monitor */ {ED_P0_TCR, ED_TCR_LB0}, /* loopback mode. */ - {ED_P0_RBCR0, 32}, + {ED_P0_RBCR0, 0x20}, {ED_P0_RBCR1, 0x00}, {ED_P0_RSAR0, 0x00}, {ED_P0_RSAR1, 0x04}, {ED_P0_CR, ED_CR_RD0 | ED_CR_STA | ED_CR_PAGE_0}, }; - /* Reset Card */ - tmp = ed_asic_inb(sc, ED_NOVELL_RESET); - ed_asic_outb(sc, ED_NOVELL_RESET, tmp); - DELAY(5000); - ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0); - DELAY(5000); - /* Card Settings */ for (i = 0; i < sizeof(pg_seq) / sizeof(pg_seq[0]); i++) ed_nic_outb(sc, pg_seq[i].offset, pg_seq[i].value); /* Get Data */ - for (i = 0; i < ETHER_ADDR_LEN / 2; i++) - prom[i] = ed_asic_inw(sc, 0); for (i = 0; i < ETHER_ADDR_LEN; i += 2) { - sc->enaddr[i] = prom[i / 2] & 0xff; - sc->enaddr[i + 1] = (prom[i / 2] >> 8) & 0xff; + j = ed_asic_inw(sc, 0); + sc->enaddr[i] = j & 0xff; + sc->enaddr[i + 1] = (j >> 8) & 0xff; } return (0); } +static int +ed_pccard_ax88x90_check_mii(device_t dev, struct ed_softc *sc) +{ + int i, id; + + /* + * All AX88x90 devices have MII and a PHY, so we use this to weed out + * chips that would otherwise make it through the tests we have after + * this point. + */ + for (i = 0; i < 32; i++) { + id = ed_miibus_readreg(dev, i, MII_BMSR); + if (id != 0 && id != 0xffff) + break; + } + /* + * Found one, we're good. + */ + if (i != 32) + return (0); + /* + * Didn't find anything, so try to power up and try again. The PHY + * may be not responding because we're in power down mode. + */ + if (sc->chip_type == ED_CHIP_TYPE_AX88190) + return (ENXIO); + pccard_ccr_write_1(dev, PCCARD_CCR_STATUS, PCCARD_CCR_STATUS_PWRDWN); + for (i = 0; i < 32; i++) { + id = ed_miibus_readreg(dev, i, MII_BMSR); + if (id != 0 && id != 0xffff) + break; + } + /* + * Still no joy? We're AFU, punt. + */ + if (i == 32) + return (ENXIO); + return (0); + +} + /* * Special setup for AX88[17]90 */ static int ed_pccard_ax88x90(device_t dev, const struct ed_product *pp) { - int error, iobase, i, id; - char *ts; + int error; + int iobase; struct ed_softc *sc = device_get_softc(dev); if (!(pp->flags & NE2000DVF_AX88X90)) @@ -786,93 +907,51 @@ ed_pccard_ax88x90(device_t dev, const st /* * Set the IOBASE Register. The AX88x90 cards are potentially * multifunction cards, and thus requires a slight workaround. - * We write the address the card is at. + * We write the address the card is at, on the off chance that this + * card is not MFC. + * XXX I'm not sure that this is still needed... */ iobase = rman_get_start(sc->port_res); pccard_ccr_write_1(dev, PCCARD_CCR_IOBASE0, iobase & 0xff); pccard_ccr_write_1(dev, PCCARD_CCR_IOBASE1, (iobase >> 8) & 0xff); - ts = "AX88190"; - if (ed_asic_inb(sc, ED_AX88X90_TEST) != 0) { - /* - * AX88790 (and I think AX88190A) chips need to be - * powered down. There's an erratum that says we should - * power down the PHY for 2.5s, but this seems to power - * down the whole card. I'm unsure why this was done, but - * appears to be required for proper operation. - */ - pccard_ccr_write_1(dev, PCCARD_CCR_STATUS, - PCCARD_CCR_STATUS_PWRDWN); - /* - * Linux axnet driver selects the internal phy for the ax88790 - */ - ed_asic_outb(sc, ED_AX88X90_GPIO, ED_AX88X90_GPIO_INT_PHY); - ts = "AX88790"; - } - - /* - * Check to see if we have a MII PHY ID at any of the first 17 - * locations. All AX88x90 devices have MII and a PHY, so we use - * this to weed out chips that would otherwise make it through - * the tests we have after this point. - */ sc->mii_readbits = ed_pccard_ax88x90_mii_readbits; sc->mii_writebits = ed_pccard_ax88x90_mii_writebits; - for (i = 0; i < 17; i++) { - id = ed_miibus_readreg(dev, i, MII_PHYIDR1); - if (id != 0 && id != 0xffff) - break; - } - if (i == 17) { - sc->mii_readbits = 0; - sc->mii_writebits = 0; - return (ENXIO); + error = ed_probe_ax88x90_generic(dev, device_get_flags(dev)); + if (error) { + if (bootverbose) + device_printf(dev, "probe ax88x90 failed %d\n", + error); + goto fail; } - - sc->chip_type = ED_CHIP_TYPE_AX88190; - error = ed_pccard_ax88x90_geteprom(sc); + error = ed_pccard_ax88x90_enaddr(sc); if (error) - return (error); - error = ed_probe_Novell_generic(dev, device_get_flags(dev)); - if (bootverbose) - device_printf(dev, "probe novel returns %d\n", error); - if (error == 0) { - sc->vendor = ED_VENDOR_NOVELL; - sc->type = ED_TYPE_NE2000; - sc->chip_type = ED_CHIP_TYPE_AX88190; - sc->type_str = ts; - } + goto fail; + error = ed_pccard_ax88x90_check_mii(dev, sc); + if (error) + goto fail; + sc->vendor = ED_VENDOR_NOVELL; + sc->type = ED_TYPE_NE2000; + if (sc->chip_type == ED_CHIP_TYPE_AX88190) + sc->type_str = "AX88190"; + else + sc->type_str = "AX88790"; + return (0); +fail:; + sc->mii_readbits = 0; + sc->mii_writebits = 0; return (error); } -/* MII bit-twiddling routines for cards using AX88x90 chipset */ -#define AX88X90_MIISET(sc, x) ed_asic_outb(sc, ED_AX88X90_MIIBUS, \ - ed_asic_inb(sc, ED_AX88X90_MIIBUS) | (x)) -#define AX88X90_MIICLR(sc, x) ed_asic_outb(sc, ED_AX88X90_MIIBUS, \ - ed_asic_inb(sc, ED_AX88X90_MIIBUS) & ~(x)) - -static void -ed_pccard_ax88x90_mii_reset(struct ed_softc *sc) -{ - /* Do nothing! */ -} - static void ed_pccard_ax88x90_mii_writebits(struct ed_softc *sc, u_int val, int nbits) { - int i; + int i, data; - AX88X90_MIICLR(sc, ED_AX88X90_MII_DIROUT); for (i = nbits - 1; i >= 0; i--) { - if ((val >> i) & 1) - AX88X90_MIISET(sc, ED_AX88X90_MII_DATAOUT); - else - AX88X90_MIICLR(sc, ED_AX88X90_MII_DATAOUT); - DELAY(10); - AX88X90_MIISET(sc, ED_AX88X90_MII_CLK); - DELAY(10); - AX88X90_MIICLR(sc, ED_AX88X90_MII_CLK); - DELAY(10); + data = (val >> i) & 1 ? ED_AX88X90_MII_DATAOUT : 0; + ed_asic_outb(sc, ED_AX88X90_MIIBUS, data); + ed_asic_outb(sc, ED_AX88X90_MIIBUS, data | ED_AX88X90_MII_CLK); } } @@ -881,16 +960,15 @@ ed_pccard_ax88x90_mii_readbits(struct ed { int i; u_int val = 0; + uint8_t mdio; - AX88X90_MIISET(sc, ED_AX88X90_MII_DIROUT); + mdio = ED_AX88X90_MII_DIRIN; for (i = nbits - 1; i >= 0; i--) { - AX88X90_MIISET(sc, ED_AX88X90_MII_CLK); - DELAY(10); + ed_asic_outb(sc, ED_AX88X90_MIIBUS, mdio); val <<= 1; if (ed_asic_inb(sc, ED_AX88X90_MIIBUS) & ED_AX88X90_MII_DATAIN) val++; - AX88X90_MIICLR(sc, ED_AX88X90_MII_CLK); - DELAY(10); + ed_asic_outb(sc, ED_AX88X90_MIIBUS, mdio | ED_AX88X90_MII_CLK); } return val; } @@ -1015,20 +1093,29 @@ ed_miibus_readreg(device_t dev, int phy, struct ed_softc *sc; int failed, val; + sc = device_get_softc(dev); /* - * The AX88790 seem to have phy 0..f external, and 0x10 internal. - * but they also seem to have a bogus one that shows up at phy - * 0x11 through 0x1f. + * The AX88790 has an interesting quirk. It has an internal phy that + * needs a special bit set to access, but can also have additional + * external PHYs set for things like HomeNET media. When accessing + * the internal PHY, a bit has to be set, when accessing the external + * PHYs, it must be clear. See Errata 1, page 51, in the AX88790 + * datasheet for more details. */ - if (phy >= 0x11) - return (0); + if (sc->chip_type == ED_CHIP_TYPE_AX88790) { + if (phy == 0x10) + ed_asic_outb(sc, ED_AX88X90_GPIO, + ED_AX88X90_GPIO_INT_PHY); + else + ed_asic_outb(sc, ED_AX88X90_GPIO, 0); + } - sc = device_get_softc(dev); (*sc->mii_writebits)(sc, 0xffffffff, 32); (*sc->mii_writebits)(sc, ED_MII_STARTDELIM, ED_MII_STARTDELIM_BITS); (*sc->mii_writebits)(sc, ED_MII_READOP, ED_MII_OP_BITS); (*sc->mii_writebits)(sc, phy, ED_MII_PHY_BITS); (*sc->mii_writebits)(sc, reg, ED_MII_REG_BITS); + (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); failed = (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); val = (*sc->mii_readbits)(sc, ED_MII_DATA_BITS); (*sc->mii_writebits)(sc, ED_MII_IDLE, ED_MII_IDLE_BITS); @@ -1040,15 +1127,22 @@ ed_miibus_writereg(device_t dev, int phy { struct ed_softc *sc; + sc = device_get_softc(dev); /* - * The AX88790 seem to have phy 0..f external, and 0x10 internal. - * but they also seem to have a bogus one that shows up at phy - * 0x11 through 0x1f. + * The AX88790 has an interesting quirk. It has an internal phy that + * needs a special bit set to access, but can also have additional + * external PHYs set for things like HomeNET media. When accessing + * the internal PHY, a bit has to be set, when accessing the external + * PHYs, it must be clear. See Errata 1, page 51, in the AX88790 + * datasheet for more details. */ - if (phy >= 0x11) - return (0); - - sc = device_get_softc(dev); + if (sc->chip_type == ED_CHIP_TYPE_AX88790) { + if (phy == 0x10) + ed_asic_outb(sc, ED_AX88X90_GPIO, + ED_AX88X90_GPIO_INT_PHY); + else + ed_asic_outb(sc, ED_AX88X90_GPIO, 0); + } (*sc->mii_writebits)(sc, 0xffffffff, 32); (*sc->mii_writebits)(sc, ED_MII_STARTDELIM, ED_MII_STARTDELIM_BITS); (*sc->mii_writebits)(sc, ED_MII_WRITEOP, ED_MII_OP_BITS); Modified: head/sys/dev/ed/if_edreg.h ============================================================================== --- head/sys/dev/ed/if_edreg.h Mon Mar 30 16:01:09 2009 (r190558) +++ head/sys/dev/ed/if_edreg.h Mon Mar 30 16:15:06 2009 (r190559) @@ -1075,6 +1075,7 @@ struct ed_ring { #define ED_CHIP_TYPE_TC5299J 5 #define ED_CHIP_TYPE_RTL8019 6 #define ED_CHIP_TYPE_RTL8029 7 +#define ED_CHIP_TYPE_AX88790 8 /* * MII bus definitions. These are common to both DL100xx and AX88x90 @@ -1091,6 +1092,6 @@ struct ed_ring { #define ED_MII_PHY_BITS 5 #define ED_MII_REG_BITS 5 #define ED_MII_TURNAROUND_BITS 2 -#define ED_MII_DATA_BITS 16 #define ED_MII_ACK_BITS 1 +#define ED_MII_DATA_BITS 16 #define ED_MII_IDLE_BITS 1 From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 17:25:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2EF110656D6; Mon, 30 Mar 2009 17:25:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0E1E8FC0C; Mon, 30 Mar 2009 17:25:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UHPulu073191; Mon, 30 Mar 2009 17:25:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UHPuDY073190; Mon, 30 Mar 2009 17:25:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903301725.n2UHPuDY073190@svn.freebsd.org> From: Warner Losh Date: Mon, 30 Mar 2009 17:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190562 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 17:25:57 -0000 Author: imp Date: Mon Mar 30 17:25:56 2009 New Revision: 190562 URL: http://svn.freebsd.org/changeset/base/190562 Log: Two fixes: (1) Delete all children when detaching to keep from adding a phy each driver reload. (2) All AX88x90 chips have the RST issue. Modified: head/sys/dev/ed/if_ed.c Modified: head/sys/dev/ed/if_ed.c ============================================================================== --- head/sys/dev/ed/if_ed.c Mon Mar 30 16:44:44 2009 (r190561) +++ head/sys/dev/ed/if_ed.c Mon Mar 30 17:25:56 2009 (r190562) @@ -392,6 +392,8 @@ ed_detach(device_t dev) if (sc->irq_res != NULL && sc->irq_handle) bus_teardown_intr(dev, sc->irq_res, sc->irq_handle); ed_release_resources(dev); + if (sc->miibus) + device_delete_child(dev, sc->miibus); ED_LOCK_DESTROY(sc); bus_generic_detach(dev); return (0); @@ -428,14 +430,16 @@ ed_stop_hw(struct ed_softc *sc) * 'n' (about 5ms). It shouldn't even take 5us on modern DS8390's, but * just in case it's an old one. * - * The AX88190 and AX88190A chips have a problem with this, it seems, - * but there's no evidence that I've found for excluding the check. - * This may be due to the cryptic references to the ISR register being - * fixed in the AX88790. + * The AX88x90 chips don't seem to implement this behavor. The + * datasheets say it is only turned on when the chip enters a RESET + * state and is silent about behavior for the stopped state we just + * entered. */ - if (sc->chip_type != ED_CHIP_TYPE_AX88190) - while (((ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) == 0) && --n) - continue; + if (sc->chip_type == ED_CHIP_TYPE_AX88190 || + sc->chip_type == ED_CHIP_TYPE_AX88790) + return; + while (((ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) == 0) && --n) + continue; if (n <= 0) device_printf(sc->dev, "ed_stop_hw RST never set\n"); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 17:49:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33386106567E; Mon, 30 Mar 2009 17:49:22 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 218E88FC12; Mon, 30 Mar 2009 17:49:22 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UHnL3b073677; Mon, 30 Mar 2009 17:49:21 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UHnLpd073676; Mon, 30 Mar 2009 17:49:21 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903301749.n2UHnLpd073676@svn.freebsd.org> From: Robert Noland Date: Mon, 30 Mar 2009 17:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190563 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 17:49:22 -0000 Author: rnoland Date: Mon Mar 30 17:49:21 2009 New Revision: 190563 URL: http://svn.freebsd.org/changeset/base/190563 Log: Load the right microcode for RS780. MFC after: 3 days Modified: head/sys/dev/drm/r600_cp.c Modified: head/sys/dev/drm/r600_cp.c ============================================================================== --- head/sys/dev/drm/r600_cp.c Mon Mar 30 17:25:56 2009 (r190562) +++ head/sys/dev/drm/r600_cp.c Mon Mar 30 17:49:21 2009 (r190563) @@ -392,17 +392,17 @@ static void r600_cp_load_microcode(drm_r DRM_INFO("Loading RS780 CP Microcode\n"); for (i = 0; i < PM4_UCODE_SIZE; i++) { RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][0]); + RS780_cp_microcode[i][0]); RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][1]); + RS780_cp_microcode[i][1]); RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][2]); + RS780_cp_microcode[i][2]); } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); DRM_INFO("Loading RS780 PFP Microcode\n"); for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]); + RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]); } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 18:01:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7965A106564A; Mon, 30 Mar 2009 18:01:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C3678FC0A; Mon, 30 Mar 2009 18:01:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UI1CSU073992; Mon, 30 Mar 2009 18:01:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UI1CSd073990; Mon, 30 Mar 2009 18:01:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903301801.n2UI1CSd073990@svn.freebsd.org> From: John Baldwin Date: Mon, 30 Mar 2009 18:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190564 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 18:01:12 -0000 Author: jhb Date: Mon Mar 30 18:01:12 2009 New Revision: 190564 URL: http://svn.freebsd.org/changeset/base/190564 Log: Add a simple manage for the refcount(9) API. Requested by: rwatson Added: head/share/man/man9/refcount.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Mar 30 17:49:21 2009 (r190563) +++ head/share/man/man9/Makefile Mon Mar 30 18:01:12 2009 (r190564) @@ -201,6 +201,7 @@ MAN= accept_filter.9 \ random.9 \ random_harvest.9 \ redzone.9 \ + refcount.9 \ resettodr.9 \ resource_int_value.9 \ rijndael.9 \ @@ -920,6 +921,9 @@ MLINKS+=random.9 arc4rand.9 \ random.9 arc4random.9 \ random.9 read_random.9 \ random.9 srandom.9 +MLINKS+=refcount.9 refcount_acquire.9 \ + refcount.9 refcount_init.9 \ + refcount.9 refcount_release.9 MLINKS+=resource_int_value.9 resource_long_value.9 \ resource_int_value.9 resource_string_value.9 MLINKS+=rman.9 rman_activate_resource.9 \ Added: head/share/man/man9/refcount.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/refcount.9 Mon Mar 30 18:01:12 2009 (r190564) @@ -0,0 +1,96 @@ +.\" +.\" Copyright (c) 2009 Advanced Computing Technologies LLC +.\" Written by: John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" 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 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. +.\" +.\" $FreeBSD$ +.\" +.Dd January 20, 2009 +.Dt REFCOUNT 9 +.Os +.Sh NAME +.Nm refcount , +.Nm refcount_init , +.Nm refcount_acquire , +.Nm refcount_release +.Nd manage a simple reference counter +.Sh SYNOPSIS +.In sys/param.h +.In sys/refcount.h +.Ft void +.Fn refcount_init "volatile u_int *count, u_int value" +.Ft void +.Fn refcount_acquire "volatile u_int *count" +.Ft int +.Fn refcount_release "volatile u_int *count" +.Sh DESCRIPTION +The +.Nm +functions provide an API to manage a simple reference counter. +The caller provides the storage for the counter in an unsigned integer. +A pointer to this integer is passed via +.Fa count . +Usually the counter is used to manage the lifetime of an object and is +stored as a member of the object. +.Pp +The +.Fn refcount_init +function is used to set the initial value of the counter to +.Fa value . +It is normally used when creating a reference-counted object. +.Pp +The +.Fn refcount_acquire +function is used to acquire a new reference. +The caller is responsible for ensuring that it holds a valid reference +while obtaining a new reference. +For example, +if an object is stored on a list and the list holds a reference on the +object, then holding a lock that protects the list provides sufficient +protection for acquiring a new reference. +.Pp +The +.Fn refcount_release +function is used to release an existing reference. +The function returns a non-zero value if the reference being released was +the last reference; +otherwise, it returns zero. +.Pp +Note that these routines do not provide any inter-CPU synchronization, +data protection, +or memory ordering guarantees except for managing the counter. +The caller is responsible for any additional synchronization needed by +consumers of any containing objects. +In addition, +the caller is also responsible for managing the life cycle of any containing +objects including explicitly releasing any resources when the last reference +is released. +.Sh RETURN VALUES +The +.Nm refcount_release +function returns non-zero when releasing the last reference and zero when +releasing any other reference. +.Sh HISTORY +These functions were introduced in +.Fx 6.0 . From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 18:01:42 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C0DF106568A; Mon, 30 Mar 2009 18:01:42 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FAE8FC13; Mon, 30 Mar 2009 18:01:42 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UI1gKm074035; Mon, 30 Mar 2009 18:01:42 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UI1gTJ074034; Mon, 30 Mar 2009 18:01:42 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903301801.n2UI1gTJ074034@svn.freebsd.org> From: Robert Noland Date: Mon, 30 Mar 2009 18:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190565 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 18:01:44 -0000 Author: rnoland Date: Mon Mar 30 18:01:42 2009 New Revision: 190565 URL: http://svn.freebsd.org/changeset/base/190565 Log: We don't know what these pages are going to be used for, they should be un-cached. This got lost somewhere with all the bus_dma fixups. MFC after: 3 days Modified: head/sys/dev/drm/drm_pci.c Modified: head/sys/dev/drm/drm_pci.c ============================================================================== --- head/sys/dev/drm/drm_pci.c Mon Mar 30 18:01:12 2009 (r190564) +++ head/sys/dev/drm/drm_pci.c Mon Mar 30 18:01:42 2009 (r190565) @@ -91,7 +91,7 @@ drm_pci_alloc(struct drm_device *dev, si } ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, - BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map); + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map); if (ret != 0) { bus_dma_tag_destroy(dmah->tag); free(dmah, DRM_MEM_DMA); From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 19:23:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F9121065673; Mon, 30 Mar 2009 19:23:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0E38FC15; Mon, 30 Mar 2009 19:23:50 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UJNoXi076071; Mon, 30 Mar 2009 19:23:50 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UJNoWk076065; Mon, 30 Mar 2009 19:23:50 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903301923.n2UJNoWk076065@svn.freebsd.org> From: Sam Leffler Date: Mon, 30 Mar 2009 19:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190571 - in head/sys: arm/conf conf dev/ath modules/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 19:23:51 -0000 Author: sam Date: Mon Mar 30 19:23:49 2009 New Revision: 190571 URL: http://svn.freebsd.org/changeset/base/190571 Log: Remove ATH_SUPPORT_TDMA and use IEEE80211_SUPPORT_TDMA instead. It doesn't make much sense to configure driver support w/o net80211. Note this means ath now depends on opt_wlan.h. Modified: head/sys/arm/conf/AVILA head/sys/arm/conf/CAMBRIA head/sys/conf/options head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h head/sys/modules/ath/Makefile Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Mon Mar 30 19:20:56 2009 (r190570) +++ head/sys/arm/conf/AVILA Mon Mar 30 19:23:49 2009 (r190571) @@ -111,7 +111,6 @@ device wlan_tkip # 802.11 TKIP support device wlan_xauth device ath # Atheros pci/cardbus NIC's -options ATH_SUPPORT_TDMA options ATH_DEBUG options ATH_DIAGAPI #options ATH_TX99_DIAG Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Mon Mar 30 19:20:56 2009 (r190570) +++ head/sys/arm/conf/CAMBRIA Mon Mar 30 19:23:49 2009 (r190571) @@ -114,7 +114,6 @@ device wlan_tkip # 802.11 TKIP support device wlan_xauth device ath # Atheros pci/cardbus NIC's -options ATH_SUPPORT_TDMA options ATH_DEBUG options ATH_DIAGAPI #options ATH_TX99_DIAG Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Mar 30 19:20:56 2009 (r190570) +++ head/sys/conf/options Mon Mar 30 19:23:49 2009 (r190571) @@ -745,7 +745,6 @@ ATH_TXBUF opt_ath.h ATH_RXBUF opt_ath.h ATH_DIAGAPI opt_ath.h ATH_TX99_DIAG opt_ath.h -ATH_SUPPORT_TDMA opt_ath.h # options for the Atheros hal AH_SUPPORT_AR5416 opt_ah.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Mar 30 19:20:56 2009 (r190570) +++ head/sys/dev/ath/if_ath.c Mon Mar 30 19:23:49 2009 (r190571) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_ath.h" +#include "opt_wlan.h" #include #include @@ -70,7 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA #include #endif @@ -213,7 +214,7 @@ static int ath_raw_xmit(struct ieee80211 static void ath_bpfattach(struct ath_softc *); static void ath_announce(struct ath_softc *); -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA static void ath_tdma_settimers(struct ath_softc *sc, u_int32_t nexttbtt, u_int32_t bintval); static void ath_tdma_bintvalsetup(struct ath_softc *sc, @@ -255,7 +256,7 @@ ath_hal_getcca(struct ath_hal *ah) #define TDMA_EP_RND(x,mul) \ ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul)) #define TDMA_AVG(x) TDMA_EP_RND(x, TDMA_EP_MULTIPLIER) -#endif /* ATH_SUPPORT_TDMA */ +#endif /* IEEE80211_SUPPORT_TDMA */ SYSCTL_DECL(_hw_ath); @@ -658,7 +659,7 @@ ath_attach(u_int16_t devid, struct ath_s wmodes = ath_hal_getwirelessmodes(ah); if (wmodes & (HAL_MODE_108G|HAL_MODE_TURBO)) ic->ic_caps |= IEEE80211_C_TURBOP; -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (ath_hal_macversion(ah) > 0x78) { ic->ic_caps |= IEEE80211_C_TDMA; /* capable of TDMA */ ic->ic_tdma_update = ath_tdma_update; @@ -887,7 +888,7 @@ ath_vap_create(struct ieee80211com *ic, needbeacon = 1; break; case IEEE80211_M_AHDEMO: -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (flags & IEEE80211_CLONE_TDMA) { needbeacon = 1; flags |= IEEE80211_CLONE_NOBEACONS; @@ -1012,7 +1013,7 @@ ath_vap_create(struct ieee80211com *ic, sc->sc_opmode = HAL_M_STA; break; case IEEE80211_M_AHDEMO: -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (vap->iv_caps & IEEE80211_C_TDMA) { sc->sc_tdma = 1; /* NB: disable tsf adjust */ @@ -1118,7 +1119,7 @@ ath_vap_delete(struct ieee80211vap *vap) } if (vap->iv_opmode != IEEE80211_M_WDS) sc->sc_nvaps--; -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA /* TDMA operation ceases when the last vap is destroyed */ if (sc->sc_tdma && sc->sc_nvaps == 0) { sc->sc_tdma = 0; @@ -1279,7 +1280,7 @@ ath_intr(void *arg) * this is too slow to meet timing constraints * under load. */ -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma) { if (sc->sc_tdmaswba == 0) { struct ieee80211com *ic = ifp->if_l2com; @@ -1626,7 +1627,7 @@ ath_reset(struct ifnet *ifp) */ ath_chan_change(sc, ic->ic_curchan); if (sc->sc_beacons) { -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma) ath_tdma_config(sc, NULL); else @@ -4276,7 +4277,7 @@ rx_accept: /* * Sending station is known, dispatch directly. */ -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA sc->sc_tdmars = rs; #endif type = ieee80211_input(ni, m, @@ -4451,7 +4452,7 @@ ath_txq_update(struct ath_softc *sc, int HAL_TXQ_INFO qi; ath_hal_gettxqueueprops(ah, txq->axq_qnum, &qi); -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma) { /* * AIFS is zero so there's no pre-transmit wait. The @@ -4485,7 +4486,7 @@ ath_txq_update(struct ath_softc *sc, int qi.tqi_cwmax = ATH_EXPONENT_TO_VALUE(wmep->wmep_logcwmax); qi.tqi_readyTime = 0; qi.tqi_burstTime = ATH_TXOP_TO_US(wmep->wmep_txopLimit); -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA } #endif @@ -4675,7 +4676,7 @@ ath_tx_handoff(struct ath_softc *sc, str KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, ("busy status 0x%x", bf->bf_flags)); if (txq->axq_qnum != ATH_TXQ_SWQ) { -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA int qbusy; ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); @@ -4745,7 +4746,7 @@ ath_tx_handoff(struct ath_softc *sc, str txq->axq_qnum, txq->axq_link, (caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth); } -#endif /* ATH_SUPPORT_TDMA */ +#endif /* IEEE80211_SUPPORT_TDMA */ txq->axq_link = &bf->bf_desc[bf->bf_nseg - 1].ds_link; ath_hal_txstart(ah, txq->axq_qnum); } else { @@ -4980,7 +4981,7 @@ ath_tx_start(struct ath_softc *sc, struc } if (flags & HAL_TXDESC_NOACK) /* NB: avoid double counting */ sc->sc_stats.ast_tx_noack++; -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (sc->sc_tdma && (flags & HAL_TXDESC_NOACK) == 0) { DPRINTF(sc, ATH_DEBUG_TDMA, "%s: discard frame, ACK required w/ TDMA\n", __func__); @@ -5222,7 +5223,7 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE_HEAD(txq, bf_list); -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (txq->axq_depth > 0) { /* * More frames follow. Mark the buffer busy @@ -5933,7 +5934,7 @@ ath_newstate(struct ieee80211vap *vap, e ni->ni_capinfo, ieee80211_chan2ieee(ic, ic->ic_curchan)); switch (vap->iv_opmode) { -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA case IEEE80211_M_AHDEMO: if ((vap->iv_caps & IEEE80211_C_TDMA) == 0) break; @@ -5967,7 +5968,7 @@ ath_newstate(struct ieee80211vap *vap, e ni->ni_tstamp.tsf != 0) { sc->sc_syncbeacon = 1; } else if (!sc->sc_beacons) { -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (vap->iv_caps & IEEE80211_C_TDMA) ath_tdma_config(sc, vap); else @@ -6035,7 +6036,7 @@ ath_newstate(struct ieee80211vap *vap, e taskqueue_block(sc->sc_tq); sc->sc_beacons = 0; } -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA ath_hal_setcca(ah, AH_TRUE); #endif } @@ -6543,7 +6544,7 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, sc->sc_stats.ast_rx_packets = ifp->if_ipackets; sc->sc_stats.ast_tx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgtxrssi); sc->sc_stats.ast_rx_rssi = ATH_RSSI(sc->sc_halstats.ns_avgrssi); -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA sc->sc_stats.ast_tdma_tsfadjp = TDMA_AVG(sc->sc_avgtsfdeltap); sc->sc_stats.ast_tdma_tsfadjm = TDMA_AVG(sc->sc_avgtsfdeltam); #endif @@ -6833,7 +6834,7 @@ ath_sysctl_intmit(SYSCTL_HANDLER_ARGS) return !ath_hal_setintmit(sc->sc_ah, intmit) ? EINVAL : 0; } -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA static int ath_sysctl_setcca(SYSCTL_HANDLER_ARGS) { @@ -6847,7 +6848,7 @@ ath_sysctl_setcca(SYSCTL_HANDLER_ARGS) sc->sc_setcca = (setcca != 0); return 0; } -#endif /* ATH_SUPPORT_TDMA */ +#endif /* IEEE80211_SUPPORT_TDMA */ static void ath_sysctlattach(struct ath_softc *sc) @@ -6946,7 +6947,7 @@ ath_sysctlattach(struct ath_softc *sc) SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "monpass", CTLFLAG_RW, &sc->sc_monpass, 0, "mask of error frames to pass when monitoring"); -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA if (ath_hal_macversion(ah) > 0x78) { sc->sc_tdmadbaprep = 2; SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, @@ -7285,7 +7286,7 @@ ath_announce(struct ath_softc *sc) if_printf(ifp, "using %u tx buffers\n", ath_txbuf); } -#ifdef ATH_SUPPORT_TDMA +#ifdef IEEE80211_SUPPORT_TDMA static __inline uint32_t ath_hal_getnexttbtt(struct ath_hal *ah) { @@ -7645,4 +7646,4 @@ ath_tdma_beacon_send(struct ath_softc *s vap->iv_bss->ni_tstamp.tsf = ath_hal_gettsf64(ah); } } -#endif /* ATH_SUPPORT_TDMA */ +#endif /* IEEE80211_SUPPORT_TDMA */ Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Mar 30 19:20:56 2009 (r190570) +++ head/sys/dev/ath/if_athvar.h Mon Mar 30 19:23:49 2009 (r190571) @@ -345,7 +345,6 @@ struct ath_softc { int sc_lastlongcal; /* last long cal completed */ int sc_lastcalreset;/* last cal reset done */ HAL_NODE_STATS sc_halstats; /* station-mode rssi stats */ -#ifdef ATH_SUPPORT_TDMA u_int sc_tdmadbaprep; /* TDMA DBA prep time */ u_int sc_tdmaswbaprep;/* TDMA SWBA prep time */ u_int sc_tdmaswba; /* TDMA SWBA counter */ @@ -356,7 +355,6 @@ struct ath_softc { struct ath_rx_status *sc_tdmars; /* TDMA status of last rx */ u_int32_t sc_avgtsfdeltap;/* TDMA slot adjust (+) */ u_int32_t sc_avgtsfdeltam;/* TDMA slot adjust (-) */ -#endif }; #define ATH_LOCK_INIT(_sc) \ Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Mon Mar 30 19:20:56 2009 (r190570) +++ head/sys/modules/ath/Makefile Mon Mar 30 19:23:49 2009 (r190571) @@ -38,7 +38,7 @@ KMOD= if_ath SRCS= if_ath.c if_ath_pci.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c -SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h +SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h # # AR5210 support; these are first generation 11a-only devices. @@ -95,7 +95,7 @@ SRCS+= ar2133.c # NB: rate control is bound to the driver by symbol names so only pick one .if ${ATH_RATE} == "sample" .PATH: ${.CURDIR}/../../dev/ath/ath_rate/sample -SRCS+= sample.c opt_wlan.h +SRCS+= sample.c .elif ${ATH_RATE} == "onoe" .PATH: ${.CURDIR}/../../dev/ath/ath_rate/onoe SRCS+= onoe.c From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 20:56:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 528981065680; Mon, 30 Mar 2009 20:56:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA828FC16; Mon, 30 Mar 2009 20:56:38 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UKuceP078010; Mon, 30 Mar 2009 20:56:38 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UKubaa077994; Mon, 30 Mar 2009 20:56:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200903302056.n2UKubaa077994@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 30 Mar 2009 20:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190573 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 20:56:39 -0000 Author: trasz Date: Mon Mar 30 20:56:37 2009 New Revision: 190573 URL: http://svn.freebsd.org/changeset/base/190573 Log: Remove pseudocode from VOP_* manual pages. It was out of date anyway. Reviewed by: scottl Approved by: rwatson (mentor) Modified: head/share/man/man9/VOP_ACCESS.9 head/share/man/man9/VOP_ATTRIB.9 head/share/man/man9/VOP_CREATE.9 head/share/man/man9/VOP_FSYNC.9 head/share/man/man9/VOP_INACTIVE.9 head/share/man/man9/VOP_IOCTL.9 head/share/man/man9/VOP_LINK.9 head/share/man/man9/VOP_LOCK.9 head/share/man/man9/VOP_LOOKUP.9 head/share/man/man9/VOP_OPENCLOSE.9 head/share/man/man9/VOP_RDWR.9 head/share/man/man9/VOP_READDIR.9 head/share/man/man9/VOP_READLINK.9 head/share/man/man9/VOP_REMOVE.9 head/share/man/man9/VOP_RENAME.9 head/share/man/man9/VOP_VPTOCNP.9 Modified: head/share/man/man9/VOP_ACCESS.9 ============================================================================== --- head/share/man/man9/VOP_ACCESS.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_ACCESS.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -68,40 +68,6 @@ The vnode will be locked on entry and sh .Sh RETURN VALUES If the file is accessible in the specified way, then zero is returned, otherwise an appropriate error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_access(struct vnode *vp, accmode_t accmode, struct ucred *cred, struct thread *td) -{ - int error; - - /* - * Disallow write attempts on read-only file systems; - * unless the file is a socket, fifo, or a block or - * character device resident on the filesystem. - */ - if (accmode & VWRITE) { - switch (vp->v_type) { - case VDIR: - case VLNK: - case VREG: - if (vp->v_mount->mnt_flag & MNT_RDONLY) - return EROFS; - - break; - } - } - - /* If immutable bit set, nobody gets to write it. */ - if ((accmode & VWRITE) && vp has immutable bit set) - return (EPERM); - - error = vaccess(vp->v_type, mode of vp, owner of vp, - group of vp, ap->a_accmode, ap->a_cred, NULL); - - return (error); -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EPERM Modified: head/share/man/man9/VOP_ATTRIB.9 ============================================================================== --- head/share/man/man9/VOP_ATTRIB.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_ATTRIB.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -84,68 +84,6 @@ otherwise an appropriate error is return .Fn VOP_SETATTR returns zero if the attributes were changed successfully, otherwise an appropriate error is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_getattr(struct vnode *vp, struct vattr *vap, struct ucred *cred) -{ - - /* - * Fill in the contents of *vap with information from - * the file system. - */ - ...; - - return 0; -} - -int -vop_setattr(struct vnode *vp, struct vattr *vap, struct ucred *cred) -{ - - /* - * Check for unsettable attributes. - */ - if ((vap->va_type != VNON) || (vap->va_nlink != VNOVAL) || - (vap->va_fsid != VNOVAL) || (vap->va_fileid != VNOVAL) || - (vap->va_blocksize != VNOVAL) || (vap->va_rdev != VNOVAL) || - ((int)vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL)) { - return (EINVAL); - } - - if (vap->va_flags != VNOVAL) { - /* - * Set the immutable and append flags of the file. - */ - } - - if (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL) { - /* - * Change owner and/or group of the file. - */ - } - - if (vap->va_size != VNOVAL) { - /* - * Truncate the file to the specified size. - */ - } - - if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { - /* - * Change access and/or modification time of file. - */ - } - - if (vap->va_mode != (mode_t)VNOVAL) { - /* - * Change permissions of file. - */ - } - - return 0; -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EPERM Modified: head/share/man/man9/VOP_CREATE.9 ============================================================================== --- head/share/man/man9/VOP_CREATE.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_CREATE.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -80,67 +80,6 @@ If successful, the vnode for the new obj .Fa *vpp and zero is returned. Otherwise, an appropriate error is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_create(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp - struct vattr *vap) -{ - int mode = MAKEIMODE(vap->va_type, vap->va_mode); - struct vnode *vp; - int error; - - *vpp = NULL; - if ((mode & IFMT) == 0) - mode |= IFREG; - - error = SOMEFS_VALLOC(dvp, mode, cnp->cn_cred, &vp); - if (error) - return error; - - /* - * Update the permissions for the new vnode, including - * copying the group from the directory. - */ - ...; - -#ifdef QUOTA - /* - * Possibly check quota information. - */ - ...; -#endif - - /* - * Enter new vnode in directory, taking care that the vnode - * hits the disk before the directory contents are changed. - */ - error = ...; - - if (error) - goto bad; - - *vpp = vp; - - return 0; - -bad: - /* - * Write error occurred trying to update the inode - * or the directory so must deallocate the inode. - */ - vput(vp); - - /* - * Deallocate file system resources for vp. - */ - ...; - - return error; -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er ENOSPC Modified: head/share/man/man9/VOP_FSYNC.9 ============================================================================== --- head/share/man/man9/VOP_FSYNC.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_FSYNC.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -79,61 +79,6 @@ The file should be locked on entry. .Sh RETURN VALUES Zero is returned if the call is successful, otherwise an appropriate error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_fsync(struct vnode *vp, int waitfor, struct thread *td) -{ - struct buf *bp; - struct buf *nbp; - struct timeval tv; - int s; - -loop: - s = splbio(); - for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { - nbp = bp->b_vnbufs.le_next; - - /* - * Ignore buffers which are already being written. - */ - if (bp->b_flags & B_BUSY) - continue; - - /* - * Make sure the buffer is dirty. - */ - if ((bp->b_flags & B_DELWRI) == 0) - panic("vop_fsync: not dirty"); - - vfs_bio_awrite(bp); - splx(s); - goto loop; - } - splx(s); - - if (waitfor == MNT_WAIT) { - s = splbio(); - while (vp->v_numoutput) { - vp->v_flag |= VBWAIT; - tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "vopfsn"); - } - splx(s); -#ifdef DIAGNOSTIC - if (vp->v_dirtyblkhd.lh_first) { - vprint("vop_fsync: dirty", vp); - goto loop; - } -#endif - } - - /* - * Write out the on-disc version of the vnode. - */ - tv = time; - return VOP_UPDATE(vp, &tv, &tv, waitfor == MNT_WAIT); -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er ENOSPC Modified: head/share/man/man9/VOP_INACTIVE.9 ============================================================================== --- head/share/man/man9/VOP_INACTIVE.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_INACTIVE.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -74,38 +74,6 @@ prior to returning. For VOP_RECLAIM, the .Fa vp will not be locked on entry and should be left unlocked on return. -.Sh PSEUDOCODE -.Bd -literal -int -vop_inactive(struct vnode *vp, struct thread *td) -{ - if (link count of vp == 0) { - /* - * Reclaim space in file system for vp. - */ - ...; - } - VOP_UNLOCK(vp, 0, td); - - return 0; -} - -int -vop_reclaim(struct vnode *vp, struct thread *td) -{ - /* - * Clean out the name cache. - */ - cache_purge(vp); - - /* - * Free file system related data. - */ - ...; - - return 0; -} -.Ed .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS Modified: head/share/man/man9/VOP_IOCTL.9 ============================================================================== --- head/share/man/man9/VOP_IOCTL.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_IOCTL.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -67,16 +67,6 @@ If successful, zero is returned, otherwi If the ioctl is not recognized or not handled, .Er ENOTTY should be returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_ioctl(struct vnode *vp, int command, caddr_t data, int fflag, - struct ucred *cred, struct thread *td) -{ - - return ENOTTY; -} -.Ed .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS Modified: head/share/man/man9/VOP_LINK.9 ============================================================================== --- head/share/man/man9/VOP_LINK.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_LINK.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -66,37 +66,6 @@ the vnodes locked on return. .Sh RETURN VALUES Zero is returned if the file was linked successfully, otherwise an error is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_link(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) -{ - int error = 0; - - if (vp->v_mount != dvp->v_mount) - return (EXDEV); - - if (vp would have too many links) - return (EMLINK); - - if (vp is immutable) - return (EPERM); - - /* - * Increment link count of vp and write back the on-disc version of it. - */ - ...; - - if (!error) { - /* - * Add the new name to the directory. - */ - ...; - } - - return error; -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EMLINK Modified: head/share/man/man9/VOP_LOCK.9 ============================================================================== --- head/share/man/man9/VOP_LOCK.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_LOCK.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -116,72 +116,6 @@ also does not want a thread specified as assumes curthread to be used. .Sh RETURN VALUES Zero is returned on success, otherwise an error is returned. -.Sh PSEUDOCODE -.Bd -literal -struct vopnode { - int von_flag; - /* - * Other file system specific data. - */ - ...; -}; -#define VON_LOCKED 1 -#define VON_WANTED 2 -#define VTOVON(vp) ((struct vopnode *) (vp)->v_data) - -int -vop_lock(struct vnode *vp) -{ - struct vopnode* vop; - -start: - while (vp->v_flag & VXLOCK) { - vp->v_flag |= VXWANT; - tsleep((caddr_t)vp, PINOD, "voplk1", 0); - } - if (vp->v_tag == VT_NON) - return ENOENT; - - vop = VTOVON(vp); - if (vop->von_flag & VON_LOCKED) { - vop->von_flag |= VON_WANTED; - tsleep((caddr_t) vop, PINOD, "voplk2", 0); - goto start; - } - - vop->von_flag |= VON_LOCKED; - - return 0; -} - -int -vop_unlock(struct vnode *vp) -{ - struct vopnode *vop = VTOVON(vp); - - if ((vop->von_flag & VON_LOCKED) == 0) { - panic("vop_unlock not locked"); - } - vop->von_flag &= ~VON_LOCKED; - if (vop->von_flag & VON_WANTED) { - vop->von_flag &= ~VON_WANTED; - wakeup((caddr_t) vop); - } - - return 0; -} - -int -vop_islocked(struct vnode *vp) -{ - struct vopnode *vop = VTOVON(vp); - - if (vop->von_flag & VON_LOCKED) - return 1; - else - return 0; -} -.Ed .Sh SEE ALSO .Xr vnode 9 .Sh AUTHORS Modified: head/share/man/man9/VOP_LOOKUP.9 ============================================================================== --- head/share/man/man9/VOP_LOOKUP.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_LOOKUP.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -156,260 +156,6 @@ is specified and the operation would suc .Er EJUSTRETURN is returned. Otherwise, an appropriate error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_lookup(struct vnode *dvp, - struct vnode **vpp, - struct componentname *cnp) -{ - int error; - int nameiop = cnp->cn_nameiop; - int flags = cnp->cn_flags; - int lockparent = flags & LOCKPARENT; - int islastcn = flags & ISLASTCN; - struct vnode *vp = NULL; - - /* - * Check accessibility of directory. - */ - if (dvp->v_type != VDIR) - return ENOTDIR; - - error = VOP_ACCESS(dvp, VEXEC, cred, cnp->cn_thread); - if (error) - return (error); - - if (islastcn && (dvp->v_mount->mnt_flag & MNT_RDONLY) && - (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)) - return (EROFS); - - /* - * Check name cache for directory/name pair. This returns ENOENT - * if the name is known not to exist, -1 if the name was found, or - * zero if not. - */ - error = cache_lookup(dvp, vpp, cnp); - if (error) { - int vpid; - - if (error = ENOENT) - return error; - - vp = *vpp; - if (dvp == vp) { /* lookup on "." */ - VREF(vp); - error = 0; - } else if (flags & ISDOTDOT) { - /* - * We need to unlock the directory before getting - * the locked vnode for ".." to avoid deadlocks. - */ - VOP_UNLOCK(dvp); - error = vget(vp, 1); - if (!error) { - if (lockparent && islastcn) - error = VOP_LOCK(dvp); - } - } else { - error = vget(vp, 1); - if (error || !(lockparent && islastcn)) { - VOP_UNLOCK(dvp); - } - } - - /* - * Check that the capability number did not change - * while we were waiting for the lock. - */ - if (!error) { - if (vpid == vp->v_id) { - /* - * dvp is locked if lockparent && islastcn. - * vp is locked. - */ - return (0); - } - vput(vp); - - if (dvp != vp && lockparent && islastcn) - VOP_UNLOCK(pdp); - } - - /* - * Re-lock dvp for the directory search below. - */ - error = VOP_LOCK(dvp); - if (error) { - return (error); - } - - *vpp = NULL; - } - - /* - * Search dvp for the component cnp->cn_nameptr. - */ - ...; - - if (!found) { - if ((nameiop == CREATE || nameiop == RENAME) - && islastcn - && directory dvp has not been removed) { - /* - * Check for write access on directory. - */ - - /* - * Possibly record the position of a slot in the directory - * large enough for the new component name. This can be - * recorded in the vnode private data for dvp. - * Set the SAVENAME flag to hold onto the pathname for use - * later in VOP_CREATE or VOP_RENAME. - */ - cnp->cn_flags |= SAVENAME; - if (!lockparent) - /* - * Note that the extra data recorded above is only - * useful if lockparent is specified. - */ - VOP_UNLOCK(dvp); - - return EJUSTRETURN; - } - - /* - * Consider inserting name into cache. - */ - if ((cnp->cn_flags & MAKEENTRY) && nameiop != CREATE) - cache_enter(dvp, NULL, cnp); - - return ENOENT; - } else { - /* - * If deleting, and at end of pathname, return parameters - * which can be used to remove file. If the wantparent flag - * isn't set, we return only the directory, otherwise we go on - * and lock the inode, being careful with ".". - */ - if (nameiop == DELETE && islastcn) { - /* - * Check for write access on directory. - */ - error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_thread); - if (error) - return (error); - - if (found entry is same as dvp) { - VREF(dvp); - *vpp = dvp; - return 0; - } - - error = VFS_VGET(dvp->v_mount, ..., &vp); - if (error) - return error; - - if (directory is sticky - && cred->cr_uid != 0 - && cred->cr_uid != owner of dvp - && owner of vp != cred->cr_uid) { - vput(vp); - return EPERM; - } - *vpp = vp; - if (!lockparent) - VOP_UNLOCK(dvp); - - return 0; - } - - /* - * If rewriting (RENAME), return the inode and the - * information required to rewrite the present directory - * Must get inode of directory entry to verify it's a - * regular file, or empty directory. - */ - if (nameiop == RENAME && wantparent && islastcn) { - error = VOP_ACCESS(dvp, VWRITE, cred, cnp->cn_thread); - if (error) - return (error); - - /* - * Check for "." - */ - if (found entry is same as dvp) - return EISDIR; - - error = VFS_VGET(dvp->v_mount, ..., &vp); - if (error) - return error; - *vpp = vp; - /* - * Save the name for use in VOP_RENAME later. - */ - cnp->cn_flags |= SAVENAME; - if (!lockparent) - VOP_UNLOCK(dvp); - - return 0; - } - - /* - * Step through the translation in the name. We do not `vput' the - * directory because we may need it again if a symbolic link - * is relative to the current directory. Instead we save it - * unlocked as "pdp". We must get the target inode before unlocking - * the directory to insure that the inode will not be removed - * before we get it. We prevent deadlock by always fetching - * inodes from the root, moving down the directory tree. Thus - * when following backward pointers ".." we must unlock the - * parent directory before getting the requested directory. - * There is a potential race condition here if both the current - * and parent directories are removed before the VFS_VGET for the - * inode associated with ".." returns. We hope that this occurs - * infrequently since we cannot avoid this race condition without - * implementing a sophisticated deadlock detection algorithm. - * Note also that this simple deadlock detection scheme will not - * work if the file system has any hard links other than ".." - * that point backwards in the directory structure. - */ - if (flags & ISDOTDOT) { - VOP_UNLOCK(dvp); /* race to get the inode */ - error = VFS_VGET(dvp->v_mount, ..., &vp); - if (error) { - VOP_LOCK(dvp); - return (error); - } - if (lockparent && islastcn) { - error = VOP_LOCK(dvp); - if (error) { - vput(vp); - return error; - } - } - *vpp = vp; - } else if (found entry is same as dvp) { - VREF(dvp); /* we want ourself, ie "." */ - *vpp = dvp; - } else { - error = VFS_VGET(dvp->v_mount, ..., &vp); - if (error) - return (error); - if (!lockparent || !islastcn) - VOP_UNLOCK(dvp); - *vpp = vp; - } - - /* - * Insert name into cache if appropriate. - */ - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, *vpp, cnp); - return (0); - } -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er ENOTDIR Modified: head/share/man/man9/VOP_OPENCLOSE.9 ============================================================================== --- head/share/man/man9/VOP_OPENCLOSE.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_OPENCLOSE.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -94,18 +94,6 @@ expects an unlocked, referenced vnode an to returning. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_open(struct vnode *vp, int mode, struct ucred *cred, struct thread *td, - struct file *fp) -{ - /* - * Most file systems don't do much here. - */ - return 0; -} -.Ed .Sh SEE ALSO .Xr vnode 9 , .Xr VOP_LOOKUP 9 Modified: head/share/man/man9/VOP_RDWR.9 ============================================================================== --- head/share/man/man9/VOP_RDWR.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_RDWR.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -85,141 +85,6 @@ Data already in VMIO space. The file should be locked on entry and will still be locked on exit. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_read(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) -{ - struct buf *bp; - off_t bytesinfile; - daddr_t lbn, nextlbn; - long size, xfersize, blkoffset; - int error; - - size = block size of file system; - - for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) { - bytesinfile = size of file - uio->uio_offset; - if (bytesinfile <= 0) - break; - - lbn = uio->uio_offset / size; - blkoffset = uio->uio_offset - lbn * size; - - xfersize = size - blkoffset; - if (uio->uio_resid < xfersize) - xfersize = uio->uio_resid; - if (bytesinfile < xfersize) - xfersize = bytesinfile; - - error = bread(vp, lbn, size, NOCRED, &bp); - if (error) { - brelse(bp); - bp = NULL; - break; - } - - /* - * We should only get non-zero b_resid when an I/O error - * has occurred, which should cause us to break above. - * However, if the short read did not cause an error, - * then we want to ensure that we do not uiomove bad - * or uninitialized data. - */ - size -= bp->b_resid; - if (size < xfersize) { - if (size == 0) - break; - xfersize = size; - } - - error = uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); - if (error) - break; - - bqrelse(bp); - } - if (bp != NULL) - bqrelse(bp); - - return (error); -} - -int -vop_write(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred) -{ - struct buf *bp; - off_t bytesinfile; - daddr_t lbn, nextlbn; - off_t osize; - long size, resid, xfersize, blkoffset; - int flags; - int error; - - osize = size of file; - size = block size of file system; - resid = uio->uio_resid; - if (ioflag & IO_SYNC) - flags = B_SYNC; - else - flags = 0; - - for (error = 0; uio->uio_resid > 0;) { - lbn = uio->uio_offset / size; - blkoffset = uio->uio_offset - lbn * size; - - xfersize = size - blkoffset; - if (uio->uio_resid < xfersize) - xfersize = uio->uio_resid; - - if (uio->uio_offset + xfersize > size of file) - vnode_pager_setsize(vp, uio->uio_offset + xfersize); - - if (size > xfersize) - flags |= B_CLRBUF; - else - flags &= ~B_CLRBUF; - - error = find_block_in_file(vp, lbn, blkoffset + xfersize, - cred, &bp, flags); - if (error) - break; - - if (uio->uio_offset + xfersize > size of file) - set size of file to uio->uio_offset + xfersize; - - error = uiomove((char *)bp->b_data + blkoffset, (int) xfersize, uio); - /* XXX ufs does not check the error here. Why? */ - - if (ioflag & IO_VMIO) - bp->b_flags |= B_RELBUF; /* ??? */ - - if (ioflag & IO_SYNC) - bwrite(bp); - else if (xfersize + blkoffset == size) - bawrite(bp); - else - bdwrite(bp); - - if (error || xfersize == 0) - break; - } - - if (error) { - if (ioflag & IO_UNIT) { - /* call private routine to truncate file. */ - your_truncate(vp, osize, ioflag & IO_SYNC, cred, uio->uio_td); - uio->uio_offset -= resid - uio->uio_resid; - uio->uio_resid = resid; - } - } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) { - struct timeval tv; - error = VOP_UPDATE(vp, &tv, &tv, 1); /* XXX what does this do? */ - } - - return (error); -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EFBIG Modified: head/share/man/man9/VOP_READDIR.9 ============================================================================== --- head/share/man/man9/VOP_READDIR.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_READDIR.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -96,70 +96,6 @@ Memory for the cookies should be allocat *cookies = (u_int*)# malloc(*ncookies * sizeof(u_int), M_TEMP, M_WAITOK); .Ed -.Sh PSEUDOCODE -.Bd -literal -int -vop_readdir(struct vnode *vp, struct uio *uio, struct ucred *cred, - int *eofflag, int *ncookies, u_int **cookies) -{ - off_t off; - int error = 0; - - /* - * Remember the original offset to use later in generating cookies. - */ - off = uio->uio_offset; - - /* - * Read directory contents starting at uio->uio_offset into buffer - * pointed to by uio. - */ - ...; - - if (!error && ncookies != NULL) { - struct dirent *dpStart; - struct dirent *dpEnd; - struct dirent *dp; - int count; - u_int *cookiebuf; - u_int *cookiep; - - if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1) - panic("vop_readdir: unexpected uio from NFS server"); - - /* - * Parse the stuff just read into the uio. - */ - dpStart = (struct dirent *) - ((char *)uio->uio_iov->iov_base - (uio->uio_offset - off)); - dpEnd = (struct dirent *) uio->uio_iov->iov_base; - - /* - * Count number of entries. - */ - for (dp = dpStart, count = 0; - dp < dpEnd; - dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) - count++; - - cookiebuf = (u_int *) malloc(count * sizeof(u_int), M_TEMP, M_WAITOK); - for (dp = dpStart; cookiep = cookiebuf; - dp < dpEnd; - dp = (struct dirent *)((caddr_t) dp + dp->d_reclen)) { - off += dp->d_reclen; - *cookiep++ = (u_int) off; - } - *ncookies = count; - *cookies = cookiebuf; - } - - if (eofflag && uio->uio_offset is past the end of the directory) { - *eofflag = TRUE; - } - - return error; -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EINVAL Modified: head/share/man/man9/VOP_READLINK.9 ============================================================================== --- head/share/man/man9/VOP_READLINK.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_READLINK.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -54,21 +54,6 @@ The credentials of the caller. The vnode should be locked on entry and will still be locked on exit. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_readlink(struct vnode *vp, struct uio *uio, struct ucred *cred) -{ - int error = 0; - - /* - * Read the target of the symlink. - */ - ...; - - return error; -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EIO Modified: head/share/man/man9/VOP_REMOVE.9 ============================================================================== --- head/share/man/man9/VOP_REMOVE.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_REMOVE.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -62,27 +62,6 @@ and should be locked on entry and remain locked on return. .Sh RETURN VALUES Zero is returned on success, otherwise an error code is returned. -.Sh PSEUDOCODE -.Bd -literal -int -vop_remove(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) -{ - int error = 0; - - if (vp is immutable) { - error = EPERM; - goto out; - } - - /* - * Remove name cnp->cn_nameptr from directory and update link count - * of vp. - */ - ...; - - return error; -} -.Ed .Sh ERRORS .Bl -tag -width Er .It Bq Er EPERM Modified: head/share/man/man9/VOP_RENAME.9 ============================================================================== --- head/share/man/man9/VOP_RENAME.9 Mon Mar 30 20:25:04 2009 (r190572) +++ head/share/man/man9/VOP_RENAME.9 Mon Mar 30 20:56:37 2009 (r190573) @@ -72,205 +72,6 @@ The VOP routine is expected to .Xr vput 9 both prior to returning. -.Sh PSEUDOCODE -.Bd -literal -int -vop_rename(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, - struct vnode *tdvp, struct vnode *tvp, struct componentname *tcnp) -{ - int doingdirectory = 0; - int error = 0; - - /* - * Check for cross-device rename. - */ - if (fvp->v_mount != tdvp->v_mount) { - error = EXDEV; - abortit: - if (tdvp == tvp) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 21:29:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E588D106567D; Mon, 30 Mar 2009 21:29:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D06478FC1B; Mon, 30 Mar 2009 21:29:25 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ULTPoU078761; Mon, 30 Mar 2009 21:29:25 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ULTPpF078760; Mon, 30 Mar 2009 21:29:25 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903302129.n2ULTPpF078760@svn.freebsd.org> From: Sam Leffler Date: Mon, 30 Mar 2009 21:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190574 - head/sys/dev/wi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 21:29:29 -0000 Author: sam Date: Mon Mar 30 21:29:25 2009 New Revision: 190574 URL: http://svn.freebsd.org/changeset/base/190574 Log: fake the association id so packets are not rejected in the tx path Modified: head/sys/dev/wi/if_wi.c Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Mon Mar 30 20:56:37 2009 (r190573) +++ head/sys/dev/wi/if_wi.c Mon Mar 30 21:29:25 2009 (r190574) @@ -1503,6 +1503,7 @@ wi_status_connected(void *arg, int pendi struct ieee80211com *ic = vap->iv_ic; IEEE80211_LOCK(ic); + vap->iv_bss->ni_associd = 1 | 0xc000; /* NB: anything will do */ WI_VAP(vap)->wv_newstate(vap, IEEE80211_S_RUN, 0); if (vap->iv_newstate_cb != NULL) vap->iv_newstate_cb(vap, IEEE80211_S_RUN, 0); @@ -1515,6 +1516,7 @@ wi_status_disconnected(void *arg, int pe struct ieee80211vap *vap = arg; if (vap->iv_state == IEEE80211_S_RUN) { + vap->iv_bss->ni_associd = 0; vap->iv_stats.is_rx_deauth++; ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 21:31:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA8A81065723; Mon, 30 Mar 2009 21:31:52 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7CC48FC0C; Mon, 30 Mar 2009 21:31:52 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ULVqVL078859; Mon, 30 Mar 2009 21:31:52 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ULVqtl078858; Mon, 30 Mar 2009 21:31:52 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <200903302131.n2ULVqtl078858@svn.freebsd.org> From: Maksim Yevmenkin Date: Mon, 30 Mar 2009 21:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190575 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 21:31:54 -0000 Author: emax Date: Mon Mar 30 21:31:52 2009 New Revision: 190575 URL: http://svn.freebsd.org/changeset/base/190575 Log: - Add ipfw_nat to the list of required modules if "firewall_nat_enable" is set and "natd_enable" is NOT set; - Accept and pass firewall type to the external firewall script. Submitted by: Yuri Kurenkov < y -dot- kurenkov -at- init -dot- ru > MFC after: 3 days No response from: freebsd-rc Modified: head/etc/rc.d/ipfw Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Mon Mar 30 21:29:25 2009 (r190574) +++ head/etc/rc.d/ipfw Mon Mar 30 21:31:52 2009 (r190575) @@ -23,10 +23,20 @@ ipfw_prestart() if checkyesno dummynet_enable; then required_modules="$required_modules dummynet" fi + + if checkyesno firewall_nat_enable; then + if ! checkyesno natd_enable; then + required_modules="$required_modules ipfw_nat" + fi + fi } ipfw_start() { + local _firewall_type + + _firewall_type=$1 + # set the firewall rules script if none was specified [ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall @@ -34,7 +44,7 @@ ipfw_start() if [ -f /etc/rc.d/natd ] ; then /etc/rc.d/natd quietstart fi - /bin/sh "${firewall_script}" + /bin/sh "${firewall_script}" "${_firewall_type}" echo 'Firewall rules loaded.' elif [ "`ipfw list 65535`" = "65535 deny ip from any to any" ]; then echo 'Warning: kernel has firewall functionality, but' \ @@ -67,4 +77,4 @@ ipfw_stop() } load_rc_config $name -run_rc_command "$1" +run_rc_command $* From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 21:41:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 402551065676; Mon, 30 Mar 2009 21:41:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB4D8FC21; Mon, 30 Mar 2009 21:41:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ULf7Qg079168; Mon, 30 Mar 2009 21:41:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ULf7Se079167; Mon, 30 Mar 2009 21:41:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903302141.n2ULf7Se079167@svn.freebsd.org> From: Rui Paulo Date: Mon, 30 Mar 2009 21:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190577 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 21:41:08 -0000 Author: rpaulo Date: Mon Mar 30 21:41:06 2009 New Revision: 190577 URL: http://svn.freebsd.org/changeset/base/190577 Log: MFP mesh11s: Add mesh debugging bit replacing the now deprecated RADKEYS. Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Mon Mar 30 21:32:33 2009 (r190576) +++ head/sys/net80211/ieee80211_var.h Mon Mar 30 21:41:06 2009 (r190577) @@ -704,7 +704,7 @@ ieee80211_htchanflags(const struct ieee8 #define IEEE80211_MSG_DOT1XSM 0x00010000 /* 802.1x state machine */ #define IEEE80211_MSG_RADIUS 0x00008000 /* 802.1x radius client */ #define IEEE80211_MSG_RADDUMP 0x00004000 /* dump 802.1x radius packets */ -#define IEEE80211_MSG_RADKEYS 0x00002000 /* dump 802.1x keys */ +#define IEEE80211_MSG_MESH 0x00002000 /* mesh networking */ #define IEEE80211_MSG_WPA 0x00001000 /* WPA/RSN protocol */ #define IEEE80211_MSG_ACL 0x00000800 /* ACL handling */ #define IEEE80211_MSG_WME 0x00000400 /* WME protocol */ From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 21:46:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B8231065670; Mon, 30 Mar 2009 21:46:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE03C8FC0A; Mon, 30 Mar 2009 21:46:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ULkoSG079350; Mon, 30 Mar 2009 21:46:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ULkogK079349; Mon, 30 Mar 2009 21:46:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903302146.n2ULkogK079349@svn.freebsd.org> From: Rui Paulo Date: Mon, 30 Mar 2009 21:46:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190578 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 21:46:51 -0000 Author: rpaulo Date: Mon Mar 30 21:46:50 2009 New Revision: 190578 URL: http://svn.freebsd.org/changeset/base/190578 Log: Fix typo in comment. Modified: head/sys/net80211/ieee80211_scan.h Modified: head/sys/net80211/ieee80211_scan.h ============================================================================== --- head/sys/net80211/ieee80211_scan.h Mon Mar 30 21:41:06 2009 (r190577) +++ head/sys/net80211/ieee80211_scan.h Mon Mar 30 21:46:50 2009 (r190578) @@ -42,7 +42,7 @@ * a callback when scanning on a ``passive channel'' when the * IEEE80211_FEXT_PROBECHAN flag is set. * - * A scan operation involves constructing a set of channels to inspec + * A scan operation involves constructing a set of channels to inspect * (the scan set), visiting each channel and collecting information * (e.g. what bss are present), and then analyzing the results to make * decisions like which bss to join. This process needs to be as fast From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 21:53:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46E181065689; Mon, 30 Mar 2009 21:53:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 321428FC19; Mon, 30 Mar 2009 21:53:29 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ULrTmi079564; Mon, 30 Mar 2009 21:53:29 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ULrSxx079540; Mon, 30 Mar 2009 21:53:28 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903302153.n2ULrSxx079540@svn.freebsd.org> From: Sam Leffler Date: Mon, 30 Mar 2009 21:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190579 - in head/sys: arm/conf dev/ath dev/ipw dev/iwi dev/iwn dev/malo dev/ral dev/usb/wlan dev/wi dev/wpi net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 21:53:31 -0000 Author: sam Date: Mon Mar 30 21:53:27 2009 New Revision: 190579 URL: http://svn.freebsd.org/changeset/base/190579 Log: Hoist 802.11 encapsulation up into net80211: o call ieee80211_encap in ieee80211_start so frames passed down to drivers are already encapsulated o remove ieee80211_encap calls in drivers o fixup wi so it recreates the 802.3 head it requires from the 802.11 header contents o move fast-frame aggregation from ath to net80211 (conditional on IEEE80211_SUPPORT_SUPERG): - aggregation is now done in ieee80211_start; it is enabled when the packets/sec exceeds ieee80211_ffppsmin (net.wlan.ffppsmin) and frames are held on a staging queue according to ieee80211_ffagemax (net.wlan.ffagemax) to wait for a frame to combine with - drivers must call back to age/flush the staging queue (ath does this on tx done, at swba, and on rx according to the state of the tx queues and/or the contents of the staging queue) - remove fast-frame-related data structures from ath - add ieee80211_ff_node_init and ieee80211_ff_node_cleanup to handle per-node fast-frames state (we reuse 11n tx ampdu state) o change ieee80211_encap calling convention to include an explicit vap so frames coming through a WDS vap are recognized w/o setting M_WDS With these changes any device able to tx/rx 3Kbyte+ frames can use fast-frames. Reviewed by: thompsa, rpaulo, avatar, imp, sephe Modified: head/sys/arm/conf/AVILA head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h head/sys/dev/ipw/if_ipw.c head/sys/dev/iwi/if_iwi.c head/sys/dev/iwn/if_iwn.c head/sys/dev/malo/if_malo.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/wi/if_wi.c head/sys/dev/wpi/if_wpi.c head/sys/net80211/ieee80211_freebsd.c head/sys/net80211/ieee80211_hostap.c head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h head/sys/net80211/ieee80211_sta.c head/sys/net80211/ieee80211_superg.c head/sys/net80211/ieee80211_superg.h head/sys/net80211/ieee80211_var.h Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/arm/conf/AVILA Mon Mar 30 21:53:27 2009 (r190579) @@ -51,6 +51,7 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options NFSCLIENT #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFS_LEGACYRPC options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/ath/if_ath.c Mon Mar 30 21:53:27 2009 (r190579) @@ -71,6 +71,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif #ifdef IEEE80211_SUPPORT_TDMA #include #endif @@ -1293,7 +1296,17 @@ ath_intr(void *arg) sc->sc_tdmaswba--; } else #endif + { ath_beacon_proc(sc, 0); +#ifdef IEEE80211_SUPPORT_SUPERG + /* + * Schedule the rx taskq in case there's no + * traffic so any frames held on the staging + * queue are aged and potentially flushed. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); +#endif + } } if (status & HAL_INT_RXEOL) { /* @@ -1662,320 +1675,6 @@ ath_reset_vap(struct ieee80211vap *vap, return ath_reset(ifp); } -static int -ath_ff_always(struct ath_txq *txq, struct ath_buf *bf) -{ - return 0; -} - -#if 0 -static int -ath_ff_ageflushtestdone(struct ath_txq *txq, struct ath_buf *bf) -{ - return (txq->axq_curage - bf->bf_age) < ATH_FF_STAGEMAX; -} -#endif - -/* - * Flush FF staging queue. - */ -static void -ath_ff_stageq_flush(struct ath_softc *sc, struct ath_txq *txq, - int (*ath_ff_flushdonetest)(struct ath_txq *txq, struct ath_buf *bf)) -{ - struct ath_buf *bf; - struct ieee80211_node *ni; - int pktlen, pri; - - for (;;) { - ATH_TXQ_LOCK(txq); - /* - * Go from the back (oldest) to front so we can - * stop early based on the age of the entry. - */ - bf = TAILQ_LAST(&txq->axq_stageq, axq_headtype); - if (bf == NULL || ath_ff_flushdonetest(txq, bf)) { - ATH_TXQ_UNLOCK(txq); - break; - } - - ni = bf->bf_node; - pri = M_WME_GETAC(bf->bf_m); - KASSERT(ATH_NODE(ni)->an_ff_buf[pri], - ("no bf on staging queue %p", bf)); - ATH_NODE(ni)->an_ff_buf[pri] = NULL; - TAILQ_REMOVE(&txq->axq_stageq, bf, bf_stagelist); - - ATH_TXQ_UNLOCK(txq); - - DPRINTF(sc, ATH_DEBUG_FF, "%s: flush frame, age %u\n", - __func__, bf->bf_age); - - sc->sc_stats.ast_ff_flush++; - - /* encap and xmit */ - bf->bf_m = ieee80211_encap(ni, bf->bf_m); - if (bf->bf_m == NULL) { - DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, - "%s: discard, encapsulation failure\n", - __func__); - sc->sc_stats.ast_tx_encap++; - goto bad; - } - pktlen = bf->bf_m->m_pkthdr.len; /* NB: don't reference below */ - if (ath_tx_start(sc, ni, bf, bf->bf_m) == 0) { -#if 0 /*XXX*/ - ifp->if_opackets++; -#endif - continue; - } - bad: - if (ni != NULL) - ieee80211_free_node(ni); - bf->bf_node = NULL; - if (bf->bf_m != NULL) { - m_freem(bf->bf_m); - bf->bf_m = NULL; - } - - ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); - ATH_TXBUF_UNLOCK(sc); - } -} - -static __inline u_int32_t -ath_ff_approx_txtime(struct ath_softc *sc, struct ath_node *an, struct mbuf *m) -{ - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - u_int32_t framelen; - struct ath_buf *bf; - - /* - * Approximate the frame length to be transmitted. A swag to add - * the following maximal values to the skb payload: - * - 32: 802.11 encap + CRC - * - 24: encryption overhead (if wep bit) - * - 4 + 6: fast-frame header and padding - * - 16: 2 LLC FF tunnel headers - * - 14: 1 802.3 FF tunnel header (skb already accounts for 2nd) - */ - framelen = m->m_pkthdr.len + 32 + 4 + 6 + 16 + 14; - if (ic->ic_flags & IEEE80211_F_PRIVACY) - framelen += 24; - bf = an->an_ff_buf[M_WME_GETAC(m)]; - if (bf != NULL) - framelen += bf->bf_m->m_pkthdr.len; - return ath_hal_computetxtime(sc->sc_ah, sc->sc_currates, framelen, - sc->sc_lastdatarix, AH_FALSE); -} - -/* - * Determine if a data frame may be aggregated via ff tunnelling. - * Note the caller is responsible for checking if the destination - * supports fast frames. - * - * NB: allowing EAPOL frames to be aggregated with other unicast traffic. - * Do 802.1x EAPOL frames proceed in the clear? Then they couldn't - * be aggregated with other types of frames when encryption is on? - * - * NB: assumes lock on an_ff_buf effectively held by txq lock mechanism. - */ -static __inline int -ath_ff_can_aggregate(struct ath_softc *sc, - struct ath_node *an, struct mbuf *m, int *flushq) -{ - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - struct ath_txq *txq; - u_int32_t txoplimit; - u_int pri; - - *flushq = 0; - - /* - * If there is no frame to combine with and the txq has - * fewer frames than the minimum required; then do not - * attempt to aggregate this frame. - */ - pri = M_WME_GETAC(m); - txq = sc->sc_ac2q[pri]; - if (an->an_ff_buf[pri] == NULL && txq->axq_depth < sc->sc_fftxqmin) - return 0; - /* - * When not in station mode never aggregate a multicast - * frame; this insures, for example, that a combined frame - * does not require multiple encryption keys when using - * 802.1x/WPA. - */ - if (ic->ic_opmode != IEEE80211_M_STA && - ETHER_IS_MULTICAST(mtod(m, struct ether_header *)->ether_dhost)) - return 0; - /* - * Consult the max bursting interval to insure a combined - * frame fits within the TxOp window. - */ - txoplimit = IEEE80211_TXOP_TO_US( - ic->ic_wme.wme_chanParams.cap_wmeParams[pri].wmep_txopLimit); - if (txoplimit != 0 && ath_ff_approx_txtime(sc, an, m) > txoplimit) { - DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, - "%s: FF TxOp violation\n", __func__); - if (an->an_ff_buf[pri] != NULL) - *flushq = 1; - return 0; - } - return 1; /* try to aggregate */ -} - -/* - * Check if the supplied frame can be partnered with an existing - * or pending frame. Return a reference to any frame that should be - * sent on return; otherwise return NULL. - */ -static struct mbuf * -ath_ff_check(struct ath_softc *sc, struct ath_txq *txq, - struct ath_buf *bf, struct mbuf *m, struct ieee80211_node *ni) -{ - struct ath_node *an = ATH_NODE(ni); - struct ath_buf *bfstaged; - int ff_flush, pri; - - /* - * Check if the supplied frame can be aggregated. - * - * NB: we use the txq lock to protect references to - * an->an_ff_txbuf in ath_ff_can_aggregate(). - */ - ATH_TXQ_LOCK(txq); - pri = M_WME_GETAC(m); - if (ath_ff_can_aggregate(sc, an, m, &ff_flush)) { - struct ath_buf *bfstaged = an->an_ff_buf[pri]; - if (bfstaged != NULL) { - /* - * A frame is available for partnering; remove - * it, chain it to this one, and encapsulate. - */ - an->an_ff_buf[pri] = NULL; - TAILQ_REMOVE(&txq->axq_stageq, bfstaged, bf_stagelist); - ATH_TXQ_UNLOCK(txq); - - /* - * Chain mbufs and add FF magic. - */ - DPRINTF(sc, ATH_DEBUG_FF, - "[%s] aggregate fast-frame, age %u\n", - ether_sprintf(ni->ni_macaddr), txq->axq_curage); - m->m_nextpkt = NULL; - bfstaged->bf_m->m_nextpkt = m; - m = bfstaged->bf_m; - bfstaged->bf_m = NULL; - m->m_flags |= M_FF; - /* - * Release the node reference held while - * the packet sat on an_ff_buf[] - */ - bfstaged->bf_node = NULL; - ieee80211_free_node(ni); - - /* - * Return bfstaged to the free list. - */ - ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bfstaged, bf_list); - ATH_TXBUF_UNLOCK(sc); - - return m; /* ready to go */ - } else { - /* - * No frame available, queue this frame to wait - * for a partner. Note that we hold the buffer - * and a reference to the node; we need the - * buffer in particular so we're certain we - * can flush the frame at a later time. - */ - DPRINTF(sc, ATH_DEBUG_FF, - "[%s] stage fast-frame, age %u\n", - ether_sprintf(ni->ni_macaddr), txq->axq_curage); - - bf->bf_m = m; - bf->bf_node = ni; /* NB: held reference */ - bf->bf_age = txq->axq_curage; - an->an_ff_buf[pri] = bf; - TAILQ_INSERT_HEAD(&txq->axq_stageq, bf, bf_stagelist); - ATH_TXQ_UNLOCK(txq); - - return NULL; /* consumed */ - } - } - /* - * Frame could not be aggregated, it needs to be returned - * to the caller for immediate transmission. In addition - * we check if we should first flush a frame from the - * staging queue before sending this one. - * - * NB: ath_ff_can_aggregate only marks ff_flush if a frame - * is present to flush. - */ - if (ff_flush) { - int pktlen; - - bfstaged = an->an_ff_buf[pri]; - an->an_ff_buf[pri] = NULL; - TAILQ_REMOVE(&txq->axq_stageq, bfstaged, bf_stagelist); - ATH_TXQ_UNLOCK(txq); - - DPRINTF(sc, ATH_DEBUG_FF, "[%s] flush staged frame\n", - ether_sprintf(an->an_node.ni_macaddr)); - - /* encap and xmit */ - bfstaged->bf_m = ieee80211_encap(ni, bfstaged->bf_m); - if (bfstaged->bf_m == NULL) { - DPRINTF(sc, ATH_DEBUG_XMIT | ATH_DEBUG_FF, - "%s: discard, encap failure\n", __func__); - sc->sc_stats.ast_tx_encap++; - goto ff_flushbad; - } - pktlen = bfstaged->bf_m->m_pkthdr.len; - if (ath_tx_start(sc, ni, bfstaged, bfstaged->bf_m)) { - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: discard, xmit failure\n", __func__); - ff_flushbad: - /* - * Unable to transmit frame that was on the staging - * queue. Reclaim the node reference and other - * resources. - */ - if (ni != NULL) - ieee80211_free_node(ni); - bfstaged->bf_node = NULL; - if (bfstaged->bf_m != NULL) { - m_freem(bfstaged->bf_m); - bfstaged->bf_m = NULL; - } - - ATH_TXBUF_LOCK(sc); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bfstaged, bf_list); - ATH_TXBUF_UNLOCK(sc); - } else { -#if 0 - ifp->if_opackets++; -#endif - } - } else { - if (an->an_ff_buf[pri] != NULL) { - /* - * XXX: out-of-order condition only occurs for AP - * mode and multicast. There may be no valid way - * to get this condition. - */ - DPRINTF(sc, ATH_DEBUG_FF, "[%s] out-of-order frame\n", - ether_sprintf(an->an_node.ni_macaddr)); - /* XXX stat */ - } - ATH_TXQ_UNLOCK(txq); - } - return m; -} - static struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc) { @@ -2070,9 +1769,7 @@ ath_start(struct ifnet *ifp) struct ieee80211_node *ni; struct ath_buf *bf; struct mbuf *m, *next; - struct ath_txq *txq; ath_bufhead frags; - int pri; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) return; @@ -2091,47 +1788,14 @@ ath_start(struct ifnet *ifp) ATH_TXBUF_UNLOCK(sc); break; } - STAILQ_INIT(&frags); ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - pri = M_WME_GETAC(m); - txq = sc->sc_ac2q[pri]; - if (IEEE80211_ATH_CAP(ni->ni_vap, ni, IEEE80211_NODE_FF)) { - /* - * Check queue length; if too deep drop this - * frame (tail drop considered good). - */ - if (txq->axq_depth >= sc->sc_fftxqmax) { - DPRINTF(sc, ATH_DEBUG_FF, - "[%s] tail drop on q %u depth %u\n", - ether_sprintf(ni->ni_macaddr), - txq->axq_qnum, txq->axq_depth); - sc->sc_stats.ast_tx_qfull++; - m_freem(m); - goto reclaim; - } - m = ath_ff_check(sc, txq, bf, m, ni); - if (m == NULL) { - /* NB: ni ref & bf held on stageq */ - continue; - } - } - ifp->if_opackets++; - /* - * Encapsulate the packet in prep for transmission. - */ - m = ieee80211_encap(ni, m); - if (m == NULL) { - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: encapsulation failure\n", __func__); - sc->sc_stats.ast_tx_encap++; - goto bad; - } /* * Check for fragmentation. If this frame * has been broken up verify we have enough * buffers to send all the fragments so all * go out or none... */ + STAILQ_INIT(&frags); if ((m->m_flags & M_FRAG) && !ath_txfrag_setup(sc, &frags, m, ni)) { DPRINTF(sc, ATH_DEBUG_XMIT, @@ -2140,6 +1804,7 @@ ath_start(struct ifnet *ifp) ath_freetx(m); goto bad; } + ifp->if_opackets++; nextfrag: /* * Pass the frame to the h/w for transmission. @@ -2189,13 +1854,6 @@ ath_start(struct ifnet *ifp) } sc->sc_wd_timer = 5; -#if 0 - /* - * Flush stale frames from the fast-frame staging queue. - */ - if (ic->ic_opmode != IEEE80211_M_STA) - ath_ff_stageq_flush(sc, txq, ath_ff_ageflushtestdone); -#endif } } @@ -4335,10 +3993,18 @@ rx_next: if (ngood) sc->sc_lastrx = tsf; - if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0 && - !IFQ_IS_EMPTY(&ifp->if_snd)) - ath_start(ifp); - + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { +#ifdef IEEE80211_SUPPORT_SUPERG + if (ic->ic_stageqdepth) { + ieee80211_age_stageq(ic, WME_AC_VO, 100); + ieee80211_age_stageq(ic, WME_AC_VI, 100); + ieee80211_age_stageq(ic, WME_AC_BE, 100); + ieee80211_age_stageq(ic, WME_AC_BK, 100); + } +#endif + if (!IFQ_IS_EMPTY(&ifp->if_snd)) + ath_start(ifp); + } #undef PA2DESC } @@ -4346,13 +4012,12 @@ static void ath_txq_init(struct ath_softc *sc, struct ath_txq *txq, int qnum) { txq->axq_qnum = qnum; + txq->axq_ac = 0; txq->axq_depth = 0; txq->axq_intrcnt = 0; txq->axq_link = NULL; STAILQ_INIT(&txq->axq_q); ATH_TXQ_LOCK_INIT(sc, txq); - TAILQ_INIT(&txq->axq_stageq); - txq->axq_curage = 0; } /* @@ -4429,6 +4094,7 @@ ath_tx_setup(struct ath_softc *sc, int a } txq = ath_txq_setup(sc, HAL_TX_QUEUE_DATA, haltype); if (txq != NULL) { + txq->axq_ac = ac; sc->sc_ac2q[ac] = txq; return 1; } else @@ -5292,13 +4958,6 @@ ath_tx_processq(struct ath_softc *sc, st ieee80211_process_callback(ni, bf->bf_m, (bf->bf_txflags & HAL_TXDESC_NOACK) == 0 ? ts->ts_status : HAL_TXERR_XRETRY); - /* - * Reclaim reference to node. - * - * NB: the node may be reclaimed here if, for example - * this is a DEAUTH message that was sent and the - * node was timed out due to inactivity. - */ ieee80211_free_node(ni); } bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, @@ -5316,11 +4975,13 @@ ath_tx_processq(struct ath_softc *sc, st STAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); ATH_TXBUF_UNLOCK(sc); } +#ifdef IEEE80211_SUPPORT_SUPERG /* * Flush fast-frame staging queue when traffic slows. */ if (txq->axq_depth <= 1) - ath_ff_stageq_flush(sc, txq, ath_ff_always); + ieee80211_flush_stageq(ic, txq->axq_ac); +#endif return nacked; } @@ -6920,16 +6581,6 @@ ath_sysctlattach(struct ath_softc *sc) "tpcts", CTLTYPE_INT | CTLFLAG_RW, sc, 0, ath_sysctl_tpcts, "I", "tx power for cts frames"); } - if (ath_hal_hasfastframes(sc->sc_ah)) { - sc->sc_fftxqmin = ATH_FF_TXQMIN; - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "fftxqmin", CTLFLAG_RW, &sc->sc_fftxqmin, 0, - "min frames before fast-frame staging"); - sc->sc_fftxqmax = ATH_FF_TXQMAX; - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "fftxqmax", CTLFLAG_RW, &sc->sc_fftxqmax, 0, - "max queued frames before tail drop"); - } if (ath_hal_hasrfsilent(ah)) { SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "rfsilent", CTLTYPE_INT | CTLFLAG_RW, sc, 0, Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/ath/if_athvar.h Mon Mar 30 21:53:27 2009 (r190579) @@ -71,10 +71,6 @@ #define ATH_KEYMAX 128 /* max key cache size we handle */ #define ATH_KEYBYTES (ATH_KEYMAX/NBBY) /* storage space in bytes */ -#define ATH_FF_TXQMIN 2 /* min txq depth for staging */ -#define ATH_FF_TXQMAX 50 /* maximum # of queued frames allowed */ -#define ATH_FF_STAGEMAX 5 /* max waiting period for staged frame*/ - struct taskqueue; struct kthread; struct ath_buf; @@ -106,8 +102,6 @@ struct ath_node { struct ath_buf { STAILQ_ENTRY(ath_buf) bf_list; - TAILQ_ENTRY(ath_buf) bf_stagelist; /* stage queue list */ - u_int32_t bf_age; /* age when placed on stageq */ int bf_nseg; uint16_t bf_txflags; /* tx descriptor flags */ uint16_t bf_flags; /* status flags (below) */ @@ -151,6 +145,7 @@ struct ath_descdma { struct ath_txq { u_int axq_qnum; /* hardware q number */ #define ATH_TXQ_SWQ (HAL_NUM_TX_QUEUES+1) /* qnum for s/w only queue */ + u_int axq_ac; /* WME AC */ u_int axq_flags; #define ATH_TXQ_PUTPENDING 0x0001 /* ath_hal_puttxbuf pending */ u_int axq_depth; /* queue depth (stat only) */ @@ -159,13 +154,6 @@ struct ath_txq { STAILQ_HEAD(, ath_buf) axq_q; /* transmit queue */ struct mtx axq_lock; /* lock on q and link */ char axq_name[12]; /* e.g. "ath0_txq4" */ - /* - * Fast-frame state. The staging queue holds awaiting - * a fast-frame pairing. Buffers on this queue are - * assigned an ``age'' and flushed when they wait too long. - */ - TAILQ_HEAD(axq_headtype, ath_buf) axq_stageq; - u_int32_t axq_curage; /* queue age */ }; #define ATH_TXQ_LOCK_INIT(_sc, _tq) do { \ @@ -181,7 +169,6 @@ struct ath_txq { #define ATH_TXQ_INSERT_TAIL(_tq, _elm, _field) do { \ STAILQ_INSERT_TAIL(&(_tq)->axq_q, (_elm), _field); \ (_tq)->axq_depth++; \ - (_tq)->axq_curage++; \ } while (0) #define ATH_TXQ_REMOVE_HEAD(_tq, _field) do { \ STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \ Modified: head/sys/dev/ipw/if_ipw.c ============================================================================== --- head/sys/dev/ipw/if_ipw.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/ipw/if_ipw.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1795,11 +1795,6 @@ ipw_start_locked(struct ifnet *ifp) break; } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - continue; - } if (ipw_tx_start(ifp, m, ni) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/iwi/if_iwi.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1982,13 +1982,6 @@ iwi_start_locked(struct ifnet *ifp) BPF_MTAP(ifp, m); ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } - if (iwi_tx_start(ifp, m, ni, ac) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/iwn/if_iwn.c Mon Mar 30 21:53:27 2009 (r190579) @@ -2122,12 +2122,6 @@ iwn_start_locked(struct ifnet *ifp) ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; pri = M_WME_GETAC(m); txq = &sc->txq[pri]; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ifp->if_oerrors++; - ieee80211_free_node(ni); - continue; - } if (txq->queued >= IWN_TX_RING_COUNT - 8) { /* XXX not right */ /* ring is nearly full, stop flow */ Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/malo/if_malo.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1290,20 +1290,9 @@ malo_start(struct ifnet *ifp) break; } /* - * Encapsulate the packet in prep for transmission. - */ - m = ieee80211_encap(ni, m); - if (m == NULL) { - DPRINTF(sc, MALO_DEBUG_XMIT, - "%s: encapsulation failure\n", __func__); - sc->malo_stats.mst_tx_encap++; - goto bad; - } - /* * Pass the frame to the h/w for transmission. */ if (malo_tx_start(sc, ni, bf, m)) { - bad: ifp->if_oerrors++; if (bf != NULL) { bf->bf_m = NULL; Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/ral/rt2560.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1963,15 +1963,7 @@ rt2560_start_locked(struct ifnet *ifp) sc->sc_flags |= RT2560_F_DATA_OACTIVE; break; } - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } - if (rt2560_tx_data(sc, m, ni) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/ral/rt2661.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1660,15 +1660,7 @@ rt2661_start_locked(struct ifnet *ifp) ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } - if (rt2661_tx_data(sc, m, ni, ac) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/usb/wlan/if_rum.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1354,12 +1354,6 @@ rum_start(struct ifnet *ifp) break; } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } if (rum_tx_data(sc, m, ni) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/usb/wlan/if_ural.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1436,12 +1436,6 @@ ural_start(struct ifnet *ifp) break; } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } if (ural_tx_data(sc, m, ni) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/usb/wlan/if_zyd.c Mon Mar 30 21:53:27 2009 (r190579) @@ -2697,12 +2697,6 @@ zyd_start(struct ifnet *ifp) break; } ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } if (zyd_tx_data(sc, m, ni) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/wi/if_wi.c Mon Mar 30 21:53:27 2009 (r190579) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -978,6 +979,7 @@ wi_start_locked(struct ifnet *ifp) struct mbuf *m0; struct ieee80211_key *k; struct wi_frame frmhdr; + const struct llc *llc; int cur; WI_LOCK_ASSERT(sc); @@ -996,19 +998,33 @@ wi_start_locked(struct ifnet *ifp) ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } - /* NB: copy before 802.11 header is prepended */ - m_copydata(m0, 0, ETHER_HDR_LEN, - (caddr_t)&frmhdr.wi_ehdr); - ni = (struct ieee80211_node *) m0->m_pkthdr.rcvif; - m0 = ieee80211_encap(ni, m0); - if (m0 == NULL) { - ifp->if_oerrors++; - ieee80211_free_node(ni); - continue; - } + /* reconstruct 802.3 header */ wh = mtod(m0, struct ieee80211_frame *); + switch (wh->i_fc[1]) { + case IEEE80211_FC1_DIR_TODS: + IEEE80211_ADDR_COPY(frmhdr.wi_ehdr.ether_shost, + wh->i_addr2); + IEEE80211_ADDR_COPY(frmhdr.wi_ehdr.ether_dhost, + wh->i_addr3); + break; + case IEEE80211_FC1_DIR_NODS: + IEEE80211_ADDR_COPY(frmhdr.wi_ehdr.ether_shost, + wh->i_addr2); + IEEE80211_ADDR_COPY(frmhdr.wi_ehdr.ether_dhost, + wh->i_addr1); + break; + case IEEE80211_FC1_DIR_FROMDS: + IEEE80211_ADDR_COPY(frmhdr.wi_ehdr.ether_shost, + wh->i_addr3); + IEEE80211_ADDR_COPY(frmhdr.wi_ehdr.ether_dhost, + wh->i_addr1); + break; + } + llc = (const struct llc *)( + mtod(m0, const uint8_t *) + ieee80211_hdrsize(wh)); + frmhdr.wi_ehdr.ether_type = llc->llc_snap.ether_type; frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); if (wh->i_fc[1] & IEEE80211_FC1_WEP) { k = ieee80211_crypto_encap(ni, m0); Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/dev/wpi/if_wpi.c Mon Mar 30 21:53:27 2009 (r190579) @@ -2048,7 +2048,6 @@ wpi_start_locked(struct ifnet *ifp) IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; - /* no QoS encapsulation for EAPOL frames */ ac = M_WME_GETAC(m); if (sc->txq[ac].queued > sc->txq[ac].count - 8) { /* there is no place left in this ring */ @@ -2057,12 +2056,6 @@ wpi_start_locked(struct ifnet *ifp) break; } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; - m = ieee80211_encap(ni, m); - if (m == NULL) { - ieee80211_free_node(ni); - ifp->if_oerrors++; - continue; - } if (wpi_tx_data(sc, m, ni, ac) != 0) { ieee80211_free_node(ni); ifp->if_oerrors++; Modified: head/sys/net80211/ieee80211_freebsd.c ============================================================================== --- head/sys/net80211/ieee80211_freebsd.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_freebsd.c Mon Mar 30 21:53:27 2009 (r190579) @@ -189,6 +189,15 @@ SYSCTL_PROC(_net_wlan, OID_AUTO, addba_b extern int ieee80211_addba_maxtries; SYSCTL_INT(_net_wlan, OID_AUTO, addba_maxtries, CTLFLAG_RW, &ieee80211_addba_maxtries, 0, "max ADDBA requests sent before backoff"); +#ifdef IEEE80211_SUPPORT_SUPERG +extern int ieee80211_ffppsmin; +SYSCTL_INT(_net_wlan, OID_AUTO, ffppsmin, CTLFLAG_RW, + &ieee80211_ffppsmin, 0, "min packet rate before fast-frame staging"); +extern int ieee80211_ffagemax; +SYSCTL_PROC(_net_wlan, OID_AUTO, ffagemax, CTLFLAG_RW, + &ieee80211_ffagemax, 0, ieee80211_sysctl_msecs_ticks, "I", + "max hold time for fast-frame staging (ms)"); +#endif /* IEEE80211_SUPPORT_SUPERG */ static int ieee80211_sysctl_inact(SYSCTL_HANDLER_ARGS) Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_hostap.c Mon Mar 30 21:53:27 2009 (r190579) @@ -2038,6 +2038,10 @@ hostap_recv_mgmt(struct ieee80211_node * ieee80211_ht_updatehtcap(ni, htcap); } else if (ni->ni_flags & IEEE80211_NODE_HT) ieee80211_ht_node_cleanup(ni); +#ifdef IEEE80211_SUPPORT_SUPERG + else if (ni->ni_ath_flags & IEEE80211_NODE_ATH) + ieee80211_ff_node_cleanup(ni); +#endif /* * Allow AMPDU operation only with unencrypted traffic * or AES-CCM; the 11n spec only specifies these ciphers Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_ioctl.h Mon Mar 30 21:53:27 2009 (r190579) @@ -217,7 +217,8 @@ struct ieee80211_stats { uint8_t is_rx_authfail_code; /* last rx'd auth fail reason */ uint32_t is_beacon_miss; /* beacon miss notification */ uint32_t is_rx_badstate; /* rx discard state != RUN */ - uint32_t is_spare[12]; + uint32_t is_ff_flush; /* ff's flush'd from stageq */ + uint32_t is_spare[11]; }; /* Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_node.c Mon Mar 30 21:53:27 2009 (r190579) @@ -929,6 +929,10 @@ node_cleanup(struct ieee80211_node *ni) */ if (ni->ni_flags & IEEE80211_NODE_HT) ieee80211_ht_node_cleanup(ni); +#ifdef IEEE80211_SUPPORT_SUPERG + else if (ni->ni_ath_flags & IEEE80211_NODE_ATH) + ieee80211_ff_node_cleanup(ni); +#endif /* * Clear AREF flag that marks the authorization refcnt bump * has happened. This is probably not needed as the node Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_output.c Mon Mar 30 21:53:27 2009 (r190579) @@ -217,6 +217,7 @@ ieee80211_start(struct ifnet *ifp) ieee80211_free_node(ni); continue; } + if ((ni->ni_flags & IEEE80211_NODE_PWR_MGT) && (m->m_flags & M_PWR_SAV) == 0) { /* @@ -241,23 +242,26 @@ ieee80211_start(struct ifnet *ifp) continue; } - BPF_MTAP(ifp, m); /* 802.11 tx path */ - + BPF_MTAP(ifp, m); /* 802.3 tx */ + +#ifdef IEEE80211_SUPPORT_SUPERG + if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF)) { + m = ieee80211_ff_check(ni, m); + if (m == NULL) { + /* NB: any ni ref held on stageq */ + continue; + } + } +#endif /* IEEE80211_SUPPORT_SUPERG */ /* - * XXX When ni is associated with a WDS link then - * the vap will be the WDS vap but ni_vap will point - * to the ap vap the station associated to. Once - * we handoff the packet to the driver the callback - * to ieee80211_encap won't be able to tell if the - * packet should be encapsulated for WDS or not (e.g. - * multicast frames will not be handled correctly). - * We hack this by marking the mbuf so ieee80211_encap - * can do the right thing. + * Encapsulate the packet in prep for transmission. */ - if (vap->iv_opmode == IEEE80211_M_WDS) - m->m_flags |= M_WDS; - else - m->m_flags &= ~M_WDS; + m = ieee80211_encap(vap, ni, m); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + ieee80211_free_node(ni); + continue; + } /* * Stash the node pointer and hand the frame off to @@ -267,7 +271,6 @@ ieee80211_start(struct ifnet *ifp) */ m->m_pkthdr.rcvif = (void *)ni; - /* XXX defer if_start calls? */ error = parent->if_transmit(parent, m); if (error != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ @@ -852,10 +855,10 @@ ieee80211_crypto_getmcastkey(struct ieee * marked EAPOL frames w/ M_EAPOL. */ struct mbuf * -ieee80211_encap(struct ieee80211_node *ni, struct mbuf *m) +ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, + struct mbuf *m) { #define WH4(wh) ((struct ieee80211_frame_addr4 *)(wh)) - struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct ether_header eh; struct ieee80211_frame *wh; @@ -955,6 +958,9 @@ ieee80211_encap(struct ieee80211_node *n llc->llc_snap.ether_type = eh.ether_type; } else { #ifdef IEEE80211_SUPPORT_SUPERG + /* + * Aggregated frame. + */ m = ieee80211_ff_encap(vap, m, hdrspace, key); if (m == NULL) #endif Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_proto.h Mon Mar 30 21:53:27 2009 (r190579) @@ -75,8 +75,9 @@ void ieee80211_start(struct ifnet *); int ieee80211_send_nulldata(struct ieee80211_node *); int ieee80211_classify(struct ieee80211_node *, struct mbuf *m); struct mbuf *ieee80211_mbuf_adjust(struct ieee80211vap *, int, - struct ieee80211_key *, struct mbuf *); -struct mbuf *ieee80211_encap(struct ieee80211_node *, struct mbuf *); + struct ieee80211_key *, struct mbuf *); +struct mbuf *ieee80211_encap(struct ieee80211vap *, struct ieee80211_node *, + struct mbuf *); int ieee80211_send_mgmt(struct ieee80211_node *, int, int); struct ieee80211_appie; int ieee80211_send_probereq(struct ieee80211_node *ni, Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_sta.c Mon Mar 30 21:53:27 2009 (r190579) @@ -1459,6 +1459,11 @@ sta_recv_mgmt(struct ieee80211_node *ni, ieee80211_setup_htrates(ni, htcap, IEEE80211_F_JOIN | IEEE80211_F_DOBRS); ieee80211_setup_basic_htrates(ni, htinfo); + } else { +#ifdef IEEE80211_SUPPORT_SUPERG + if (IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_ATH)) + ieee80211_ff_node_init(ni); +#endif } /* * Configure state now that we are associated. Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Mon Mar 30 21:46:50 2009 (r190578) +++ head/sys/net80211/ieee80211_superg.c Mon Mar 30 21:53:27 2009 (r190579) @@ -76,12 +76,21 @@ __FBSDID("$FreeBSD$"); #define ATH_FF_SNAP_ORGCODE_1 0x03 #define ATH_FF_SNAP_ORGCODE_2 0x7f +#define ATH_FF_TXQMIN 2 /* min txq depth for staging */ +#define ATH_FF_TXQMAX 50 /* maximum # of queued frames allowed */ +#define ATH_FF_STAGEMAX 5 /* max waiting period for staged frame*/ + #define ETHER_HEADER_COPY(dst, src) \ memcpy(dst, src, sizeof(struct ether_header)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 21:54:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4B301065673; Mon, 30 Mar 2009 21:54:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1CE18FC24; Mon, 30 Mar 2009 21:54:39 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2ULsdVO079640; Mon, 30 Mar 2009 21:54:39 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2ULsdII079639; Mon, 30 Mar 2009 21:54:39 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200903302154.n2ULsdII079639@svn.freebsd.org> From: Sam Leffler Date: Mon, 30 Mar 2009 21:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190580 - head/sys/arm/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 21:54:42 -0000 Author: sam Date: Mon Mar 30 21:54:39 2009 New Revision: 190580 URL: http://svn.freebsd.org/changeset/base/190580 Log: revert unintended change Modified: head/sys/arm/conf/AVILA Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Mon Mar 30 21:53:27 2009 (r190579) +++ head/sys/arm/conf/AVILA Mon Mar 30 21:54:39 2009 (r190580) @@ -51,7 +51,6 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options NFSCLIENT #Network Filesystem Client options NFS_ROOT #NFS usable as /, requires NFSCLIENT -options NFS_LEGACYRPC options BOOTP options BOOTP_NFSROOT options BOOTP_NFSV3 From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 22:18:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7631065695; Mon, 30 Mar 2009 22:18:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FD168FC3C; Mon, 30 Mar 2009 22:18:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2UMIdRa080205; Mon, 30 Mar 2009 22:18:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2UMIc6t080193; Mon, 30 Mar 2009 22:18:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200903302218.n2UMIc6t080193@svn.freebsd.org> From: Alexander Motin Date: Mon, 30 Mar 2009 22:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190581 - in head/sys: . amd64/include/xen arm/arm cddl/dev/dtnfsclient contrib/pf dev/ata dev/ata/chipsets dev/cxgb dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/i... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 22:18:41 -0000 Author: mav Date: Mon Mar 30 22:18:38 2009 New Revision: 190581 URL: http://svn.freebsd.org/changeset/base/190581 Log: Integrate user/mav/ata branch: Add ch_suspend/ch_resume methods for PCI controllers and implement them for AHCI. Refactor AHCI channel initialization according to it. Fix Port Multipliers operation. It is far from perfect yet, but works now. Tested with JMicron JMB363 AHCI + SiI 3726 PMP pair. Previous version was also tested with SiI 4726 PMP. Hardware sponsored by: Vitsch Electronics / VEHosting.nl Modified: head/sys/ (props changed) head/sys/amd64/include/xen/ (props changed) head/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) head/sys/cddl/dev/dtnfsclient/ (props changed) head/sys/contrib/pf/ (props changed) head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/ata-sata.c head/sys/dev/ata/ata-usb.c (props changed) head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-jmicron.c head/sys/dev/ata/chipsets/ata-marvell.c head/sys/dev/ata/chipsets/ata-nvidia.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ata/chipsets/ata-sis.c head/sys/dev/ata/chipsets/ata-via.c head/sys/dev/cxgb/ (props changed) head/sys/dev/sound/usb/uaudio.c (props changed) head/sys/dev/sound/usb/uaudio.h (props changed) head/sys/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/dev/sound/usb/uaudioreg.h (props changed) head/sys/dev/usb/README.TXT (props changed) head/sys/dev/usb/bluetooth/TODO.TXT (props changed) head/sys/dev/usb/bluetooth/ng_ubt.c (props changed) head/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) head/sys/dev/usb/bluetooth/ubtbcmfw.c (props changed) head/sys/dev/usb/controller/at91dci.c (props changed) head/sys/dev/usb/controller/at91dci.h (props changed) head/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) head/sys/dev/usb/controller/atmegadci.c (props changed) head/sys/dev/usb/controller/atmegadci.h (props changed) head/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) head/sys/dev/usb/controller/ehci.c (props changed) head/sys/dev/usb/controller/ehci.h (props changed) head/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) head/sys/dev/usb/controller/ehci_mbus.c (props changed) head/sys/dev/usb/controller/ehci_pci.c (props changed) head/sys/dev/usb/controller/musb_otg.c (props changed) head/sys/dev/usb/controller/musb_otg.h (props changed) head/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci.c (props changed) head/sys/dev/usb/controller/ohci.h (props changed) head/sys/dev/usb/controller/ohci_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci_pci.c (props changed) head/sys/dev/usb/controller/uhci.c (props changed) head/sys/dev/usb/controller/uhci.h (props changed) head/sys/dev/usb/controller/uhci_pci.c (props changed) head/sys/dev/usb/controller/usb_controller.c (props changed) head/sys/dev/usb/controller/uss820dci.c (props changed) head/sys/dev/usb/controller/uss820dci.h (props changed) head/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) head/sys/dev/usb/input/uhid.c (props changed) head/sys/dev/usb/input/ukbd.c (props changed) head/sys/dev/usb/input/ums.c (props changed) head/sys/dev/usb/input/usb_rdesc.h (props changed) head/sys/dev/usb/misc/udbp.c (props changed) head/sys/dev/usb/misc/udbp.h (props changed) head/sys/dev/usb/misc/ufm.c (props changed) head/sys/dev/usb/net/if_aue.c (props changed) head/sys/dev/usb/net/if_auereg.h (props changed) head/sys/dev/usb/net/if_axe.c (props changed) head/sys/dev/usb/net/if_axereg.h (props changed) head/sys/dev/usb/net/if_cdce.c (props changed) head/sys/dev/usb/net/if_cdcereg.h (props changed) head/sys/dev/usb/net/if_cue.c (props changed) head/sys/dev/usb/net/if_cuereg.h (props changed) head/sys/dev/usb/net/if_kue.c (props changed) head/sys/dev/usb/net/if_kuefw.h (props changed) head/sys/dev/usb/net/if_kuereg.h (props changed) head/sys/dev/usb/net/if_rue.c (props changed) head/sys/dev/usb/net/if_ruereg.h (props changed) head/sys/dev/usb/net/if_udav.c (props changed) head/sys/dev/usb/net/if_udavreg.h (props changed) head/sys/dev/usb/net/usb_ethernet.c (props changed) head/sys/dev/usb/net/usb_ethernet.h (props changed) head/sys/dev/usb/quirk/usb_quirk.c (props changed) head/sys/dev/usb/quirk/usb_quirk.h (props changed) head/sys/dev/usb/serial/u3g.c (props changed) head/sys/dev/usb/serial/uark.c (props changed) head/sys/dev/usb/serial/ubsa.c (props changed) head/sys/dev/usb/serial/ubser.c (props changed) head/sys/dev/usb/serial/uchcom.c (props changed) head/sys/dev/usb/serial/ucycom.c (props changed) head/sys/dev/usb/serial/ufoma.c (props changed) head/sys/dev/usb/serial/uftdi.c (props changed) head/sys/dev/usb/serial/uftdi_reg.h (props changed) head/sys/dev/usb/serial/ugensa.c (props changed) head/sys/dev/usb/serial/uipaq.c (props changed) head/sys/dev/usb/serial/ulpt.c (props changed) head/sys/dev/usb/serial/umct.c (props changed) head/sys/dev/usb/serial/umodem.c (props changed) head/sys/dev/usb/serial/umoscom.c (props changed) head/sys/dev/usb/serial/uplcom.c (props changed) head/sys/dev/usb/serial/usb_serial.c (props changed) head/sys/dev/usb/serial/usb_serial.h (props changed) head/sys/dev/usb/serial/uslcom.c (props changed) head/sys/dev/usb/serial/uvisor.c (props changed) head/sys/dev/usb/serial/uvscom.c (props changed) head/sys/dev/usb/storage/rio500_usb.h (props changed) head/sys/dev/usb/storage/umass.c (props changed) head/sys/dev/usb/storage/urio.c (props changed) head/sys/dev/usb/storage/ustorage_fs.c (props changed) head/sys/dev/usb/template/usb_template.c (props changed) head/sys/dev/usb/template/usb_template.h (props changed) head/sys/dev/usb/template/usb_template_cdce.c (props changed) head/sys/dev/usb/template/usb_template_msc.c (props changed) head/sys/dev/usb/template/usb_template_mtp.c (props changed) head/sys/dev/usb/ufm_ioctl.h (props changed) head/sys/dev/usb/usb.h (props changed) head/sys/dev/usb/usb_bus.h (props changed) head/sys/dev/usb/usb_busdma.c (props changed) head/sys/dev/usb/usb_busdma.h (props changed) head/sys/dev/usb/usb_cdc.h (props changed) head/sys/dev/usb/usb_compat_linux.c (props changed) head/sys/dev/usb/usb_compat_linux.h (props changed) head/sys/dev/usb/usb_controller.h (props changed) head/sys/dev/usb/usb_core.c (props changed) head/sys/dev/usb/usb_core.h (props changed) head/sys/dev/usb/usb_debug.c (props changed) head/sys/dev/usb/usb_debug.h (props changed) head/sys/dev/usb/usb_defs.h (props changed) head/sys/dev/usb/usb_dev.c (props changed) head/sys/dev/usb/usb_dev.h (props changed) head/sys/dev/usb/usb_device.c (props changed) head/sys/dev/usb/usb_device.h (props changed) head/sys/dev/usb/usb_dynamic.c (props changed) head/sys/dev/usb/usb_dynamic.h (props changed) head/sys/dev/usb/usb_endian.h (props changed) head/sys/dev/usb/usb_error.c (props changed) head/sys/dev/usb/usb_error.h (props changed) head/sys/dev/usb/usb_generic.c (props changed) head/sys/dev/usb/usb_generic.h (props changed) head/sys/dev/usb/usb_handle_request.c (props changed) head/sys/dev/usb/usb_handle_request.h (props changed) head/sys/dev/usb/usb_hid.c (props changed) head/sys/dev/usb/usb_hid.h (props changed) head/sys/dev/usb/usb_hub.c (props changed) head/sys/dev/usb/usb_hub.h (props changed) head/sys/dev/usb/usb_if.m (props changed) head/sys/dev/usb/usb_ioctl.h (props changed) head/sys/dev/usb/usb_lookup.c (props changed) head/sys/dev/usb/usb_lookup.h (props changed) head/sys/dev/usb/usb_mbuf.c (props changed) head/sys/dev/usb/usb_mbuf.h (props changed) head/sys/dev/usb/usb_mfunc.h (props changed) head/sys/dev/usb/usb_msctest.c (props changed) head/sys/dev/usb/usb_msctest.h (props changed) head/sys/dev/usb/usb_parse.c (props changed) head/sys/dev/usb/usb_parse.h (props changed) head/sys/dev/usb/usb_pci.h (props changed) head/sys/dev/usb/usb_process.c (props changed) head/sys/dev/usb/usb_process.h (props changed) head/sys/dev/usb/usb_request.c (props changed) head/sys/dev/usb/usb_request.h (props changed) head/sys/dev/usb/usb_revision.h (props changed) head/sys/dev/usb/usb_sw_transfer.c (props changed) head/sys/dev/usb/usb_sw_transfer.h (props changed) head/sys/dev/usb/usb_transfer.c (props changed) head/sys/dev/usb/usb_transfer.h (props changed) head/sys/dev/usb/usb_util.c (props changed) head/sys/dev/usb/usb_util.h (props changed) head/sys/dev/usb/usbdevs (props changed) head/sys/dev/usb/usbhid.h (props changed) head/sys/dev/usb/wlan/if_rum.c (props changed) head/sys/dev/usb/wlan/if_rumfw.h (props changed) head/sys/dev/usb/wlan/if_rumreg.h (props changed) head/sys/dev/usb/wlan/if_rumvar.h (props changed) head/sys/dev/usb/wlan/if_ural.c (props changed) head/sys/dev/usb/wlan/if_uralreg.h (props changed) head/sys/dev/usb/wlan/if_uralvar.h (props changed) head/sys/dev/usb/wlan/if_zyd.c (props changed) head/sys/dev/usb/wlan/if_zydfw.h (props changed) head/sys/dev/usb/wlan/if_zydreg.h (props changed) head/sys/dev/usb/wlan/usb_wlan.h (props changed) head/sys/dev/xen/netfront/ (props changed) head/sys/dev/xen/xenpci/ (props changed) head/sys/legacy/dev/ata/ata-usb.c (props changed) head/sys/legacy/dev/sound/usb/uaudio.c (props changed) head/sys/legacy/dev/sound/usb/uaudio.h (props changed) head/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) head/sys/legacy/dev/usb/ (props changed) head/sys/legacy/dev/usb/ehci_ixp4xx.c (props changed) head/sys/mips/mips/elf64_machdep.c (props changed) head/sys/modules/dtrace/dtnfsclient/ (props changed) head/sys/modules/ip6_mroute_mod/ (props changed) head/sys/modules/ipmi/ipmi_linux/ (props changed) head/sys/xen/evtchn.h (props changed) head/sys/xen/hypervisor.h (props changed) head/sys/xen/xen_intr.h (props changed) Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/ata-pci.c Mon Mar 30 22:18:38 2009 (r190581) @@ -584,22 +584,35 @@ ata_pcichannel_detach(device_t dev) static int ata_pcichannel_suspend(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); + int error; if (!ch->attached) return (0); - return ata_suspend(dev); + if ((error = ata_suspend(dev))) + return (error); + + if (ctlr->ch_suspend != NULL && (error = ctlr->ch_suspend(dev))) + return (error); + + return (0); } static int ata_pcichannel_resume(device_t dev) { + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); + int error; if (!ch->attached) return (0); + if (ctlr->ch_resume != NULL && (error = ctlr->ch_resume(dev))) + return (error); + return ata_resume(dev); } Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/ata-pci.h Mon Mar 30 22:18:38 2009 (r190581) @@ -57,6 +57,8 @@ struct ata_pci_controller { int (*resume)(device_t); int (*ch_attach)(device_t); int (*ch_detach)(device_t); + int (*ch_suspend)(device_t); + int (*ch_resume)(device_t); int (*locking)(device_t, int); void (*reset)(device_t); void (*setmode)(device_t, int); @@ -443,7 +445,9 @@ int ata_mode2idx(int mode); /* global prototypes ata-sata.c */ void ata_sata_phy_check_events(device_t dev); -int ata_sata_phy_reset(device_t dev); +int ata_sata_scr_read(struct ata_channel *ch, int port, int reg, uint32_t *val); +int ata_sata_scr_write(struct ata_channel *ch, int port, int reg, uint32_t val); +int ata_sata_phy_reset(device_t dev, int port, int quick); void ata_sata_setmode(device_t dev, int mode); int ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis); void ata_pm_identify(device_t dev); @@ -452,6 +456,8 @@ void ata_pm_identify(device_t dev); int ata_ahci_chipinit(device_t); int ata_ahci_ch_attach(device_t dev); int ata_ahci_ch_detach(device_t dev); +int ata_ahci_ch_suspend(device_t dev); +int ata_ahci_ch_resume(device_t dev); void ata_ahci_reset(device_t dev); int ata_marvell_edma_chipinit(device_t); int ata_sii_chipinit(device_t); Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/ata-sata.c Mon Mar 30 22:18:38 2009 (r190581) @@ -73,59 +73,141 @@ ata_sata_phy_check_events(device_t dev) } } +int +ata_sata_scr_read(struct ata_channel *ch, int port, int reg, uint32_t *val) +{ + int r; + + if (port < 0) { + *val = ATA_IDX_INL(ch, reg); + return (0); + } else { + switch (reg) { + case ATA_SSTATUS: + r = 0; + break; + case ATA_SERROR: + r = 1; + break; + case ATA_SCONTROL: + r = 2; + break; + default: + return (EINVAL); + } + return (ch->hw.pm_read(ch->dev, port, r, val)); + } +} + +int +ata_sata_scr_write(struct ata_channel *ch, int port, int reg, uint32_t val) +{ + int r; + + if (port < 0) { + ATA_IDX_OUTL(ch, reg, val); + return (0); + } else { + switch (reg) { + case ATA_SERROR: + r = 1; + break; + case ATA_SCONTROL: + r = 2; + break; + default: + return (EINVAL); + } + return (ch->hw.pm_write(ch->dev, port, r, val)); + } +} + static int -ata_sata_connect(struct ata_channel *ch) +ata_sata_connect(struct ata_channel *ch, int port) { u_int32_t status; int timeout; /* wait up to 1 second for "connect well" */ for (timeout = 0; timeout < 100 ; timeout++) { - status = ATA_IDX_INL(ch, ATA_SSTATUS); + if (ata_sata_scr_read(ch, port, ATA_SSTATUS, &status)) + return (0); if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1 || (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) break; ata_udelay(10000); } if (timeout >= 100) { - if (bootverbose) - device_printf(ch->dev, "SATA connect status=%08x\n", status); + if (bootverbose) { + if (port < 0) { + device_printf(ch->dev, "SATA connect timeout status=%08x\n", + status); + } else { + device_printf(ch->dev, "p%d: SATA connect timeout status=%08x\n", + port, status); + } + } return 0; } - if (bootverbose) - device_printf(ch->dev, "SATA connect time=%dms\n", timeout * 10); + if (bootverbose) { + if (port < 0) { + device_printf(ch->dev, "SATA connect time=%dms status=%08x\n", + timeout * 10, status); + } else { + device_printf(ch->dev, "p%d: SATA connect time=%dms status=%08x\n", + port, timeout * 10, status); + } + } /* clear SATA error register */ - ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR)); + ata_sata_scr_write(ch, port, ATA_SERROR, 0xffffffff); return 1; } int -ata_sata_phy_reset(device_t dev) +ata_sata_phy_reset(device_t dev, int port, int quick) { struct ata_channel *ch = device_get_softc(dev); int loop, retry; + uint32_t val; - if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) - return ata_sata_connect(ch); + if (quick) { + if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) + return (0); + if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) + return ata_sata_connect(ch, port); + } + if (bootverbose) { + if (port < 0) { + device_printf(dev, "hardware reset ...\n"); + } else { + device_printf(dev, "p%d: hardware reset ...\n", port); + } + } for (retry = 0; retry < 10; retry++) { for (loop = 0; loop < 10; loop++) { - ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_RESET); + if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET)) + return (0); ata_udelay(100); - if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == - ATA_SC_DET_RESET) + if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) + return (0); + if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_RESET) break; } ata_udelay(5000); for (loop = 0; loop < 10; loop++) { - ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_IDLE | - ATA_SC_IPM_DIS_PARTIAL | - ATA_SC_IPM_DIS_SLUMBER); + if (ata_sata_scr_write(ch, port, ATA_SCONTROL, + ATA_SC_DET_IDLE | + ATA_SC_IPM_DIS_PARTIAL | + ATA_SC_IPM_DIS_SLUMBER)) + return (0); ata_udelay(100); - if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 0) - return ata_sata_connect(ch); + if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) + return (0); + if ((val & ATA_SC_DET_MASK) == 0) + return ata_sata_connect(ch, port); } } return 0; @@ -237,14 +319,27 @@ ata_pm_identify(device_t dev) /* chip specific quirks */ switch (pm_chipid) { case 0x37261095: - /* Some of these bogusly reports 6 ports */ + /* This PM declares 6 ports, while only 5 of them are real. + * Port 5 is enclosure management bridge port, which has implementation + * problems, causing probe faults. Hide it for now. */ + device_printf(dev, "SiI 3726 (rev=%x) Port Multiplier with %d (5) ports\n", + pm_revision, pm_ports); pm_ports = 5; - device_printf(dev, "SiI 3726 r%x Portmultiplier with %d ports\n", + break; + + case 0x47261095: + /* This PM declares 7 ports, while only 5 of them are real. + * Port 5 is some fake "Config Disk" with 640 sectors size, + * port 6 is enclosure management bridge port. + * Both fake ports has implementation problems, causing + * probe faults. Hide them for now. */ + device_printf(dev, "SiI 4726 (rev=%x) Port Multiplier with %d (5) ports\n", pm_revision, pm_ports); + pm_ports = 5; break; default: - device_printf(dev, "Portmultiplier (id=%08x rev=%x) with %d ports\n", + device_printf(dev, "Port Multiplier (id=%08x rev=%x) with %d ports\n", pm_chipid, pm_revision, pm_ports); } @@ -253,41 +348,17 @@ ata_pm_identify(device_t dev) /* reset all ports and register if anything connected */ for (port=0; port < pm_ports; port++) { - u_int32_t signature, status; - int timeout; + u_int32_t signature; - if (ch->hw.pm_write(dev, port, 2, ATA_SC_DET_RESET)) { - device_printf(dev, "p%d: writing ATA_SC_DET_RESET failed\n", port); + if (!ata_sata_phy_reset(dev, port, 1)) continue; - } - - ata_udelay(5000); - - if (ch->hw.pm_write(dev, port, 2, ATA_SC_DET_IDLE)) { - device_printf(dev, "p%d: writing ATA_SC_DET_idle failed\n", port); - continue; - } - - ata_udelay(5000); - - /* wait up to 1 second for "connect well" */ - for (timeout = 0; timeout < 100 ; timeout++) { - ch->hw.pm_read(dev, port, 0, &status); - if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1 || - (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) - break; - ata_udelay(10000); - } - if (timeout >= 100) { - if (bootverbose) - device_printf(dev, "p%d: connect status=%08x\n", port, status); - continue; - } - if (bootverbose) - device_printf(dev, "p%d: connect time %dms\n", port, timeout * 10); - /* clear SERROR register */ - ch->hw.pm_write(dev, port, 1, 0xffffffff); + /* + * XXX: I have no idea how to properly wait for PMP port hardreset + * completion. Without this delay soft reset does not completes + * successfully. + */ + DELAY(1000000); signature = ch->hw.softreset(dev, port); Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-ahci.c Mon Mar 30 22:18:38 2009 (r190581) @@ -59,10 +59,16 @@ static int ata_ahci_begin_transaction(st static int ata_ahci_end_transaction(struct ata_request *request); static int ata_ahci_pm_read(device_t dev, int port, int reg, u_int32_t *result); static int ata_ahci_pm_write(device_t dev, int port, int reg, u_int32_t result); +static int ata_ahci_hardreset(device_t dev, int port, uint32_t *signature); static u_int32_t ata_ahci_softreset(device_t dev, int port); static void ata_ahci_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); static int ata_ahci_setup_fis(struct ata_ahci_cmd_tab *ctp, struct ata_request *equest); static void ata_ahci_dmainit(device_t dev); +static void ata_ahci_start(device_t dev); +static void ata_ahci_stop(device_t dev); +static void ata_ahci_clo(device_t dev); +static void ata_ahci_start_fr(device_t dev); +static void ata_ahci_stop_fr(device_t dev); /* * AHCI v1.x compliant SATA chipset support functions @@ -131,6 +137,8 @@ ata_ahci_chipinit(device_t dev) ctlr->reset = ata_ahci_reset; ctlr->ch_attach = ata_ahci_ch_attach; ctlr->ch_detach = ata_ahci_ch_detach; + ctlr->ch_suspend = ata_ahci_ch_suspend; + ctlr->ch_resume = ata_ahci_ch_resume; ctlr->setmode = ata_sata_setmode; ctlr->suspend = ata_ahci_suspend; ctlr->resume = ata_ahci_ctlr_reset; @@ -192,7 +200,6 @@ ata_ahci_suspend(device_t dev) return 0; } - int ata_ahci_ch_attach(device_t dev) { @@ -220,12 +227,22 @@ ata_ahci_ch_attach(device_t dev) ch->hw.pm_read = ata_ahci_pm_read; ch->hw.pm_write = ata_ahci_pm_write; + ata_ahci_ch_resume(dev); return 0; } int ata_ahci_ch_detach(device_t dev) { + + ata_ahci_ch_suspend(dev); + ata_dmafini(dev); + return (0); +} + +int +ata_ahci_ch_suspend(device_t dev) +{ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << 7; @@ -233,6 +250,8 @@ ata_ahci_ch_detach(device_t dev) /* Disable port interrupts. */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); /* Reset command register. */ + ata_ahci_stop(dev); + ata_ahci_stop_fr(dev); ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, 0); /* Allow everything including partial and slumber modes. */ @@ -243,7 +262,35 @@ ata_ahci_ch_detach(device_t dev) /* Disable PHY. */ ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_DISABLE); - ata_dmafini(dev); + return (0); +} + +int +ata_ahci_ch_resume(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + uint64_t work; + int offset = ch->unit << 7; + + /* Disable port interrupts */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); + + /* setup work areas */ + work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0xffffffff); + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLBU + offset, work >> 32); + + work = ch->dma.work_bus + ATA_AHCI_FB_OFFSET; + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FB + offset, work & 0xffffffff); + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBU + offset, work >> 32); + + /* activate the channel and power/spin up device */ + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, + (ATA_AHCI_P_CMD_ACTIVE | ATA_AHCI_P_CMD_POD | ATA_AHCI_P_CMD_SUD)); + ata_ahci_start_fr(dev); + ata_ahci_start(dev); + return (0); } @@ -366,9 +413,6 @@ ata_ahci_begin_transaction(struct ata_re ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) & ~ATA_AHCI_P_CMD_ATAPI); - /* set PM port to address */ - //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, (port << 8) | 0x00000001); - /* issue command to controller */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, (1 << request->tag)); @@ -465,9 +509,6 @@ ata_ahci_issue_cmd(device_t dev, u_int16 clp->bytecount = 0; clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET); - /* set PM port */ - //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, (port << 8) | 0x00000001); - /* issue command to controller */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1); @@ -480,7 +521,7 @@ ata_ahci_issue_cmd(device_t dev, u_int16 /* clear interrupts */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset, - ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset)); + ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset)); if (timeout && (count >= timeout)) { if (bootverbose) { @@ -559,7 +600,7 @@ ata_ahci_stop(device_t dev) /* kill off all activity on this channel */ cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, - cmd & ~(ATA_AHCI_P_CMD_FRE | ATA_AHCI_P_CMD_ST)); + cmd & ~ATA_AHCI_P_CMD_ST); /* XXX SOS this is not entirely wrong */ timeout = 0; @@ -617,10 +658,47 @@ ata_ahci_start(device_t dev) /* start operations on this channel */ cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, - cmd | (ATA_AHCI_P_CMD_FRE | ATA_AHCI_P_CMD_ST) | + cmd | ATA_AHCI_P_CMD_ST | (ch->devices & ATA_PORTMULTIPLIER ? ATA_AHCI_P_CMD_PMA : 0)); } +static void +ata_ahci_stop_fr(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + u_int32_t cmd; + int offset = ch->unit << 7; + int timeout; + + /* kill off all activity on this channel */ + cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, cmd & ~ATA_AHCI_P_CMD_FRE); + + timeout = 0; + do { + DELAY(1000); + if (timeout++ > 1000) { + device_printf(dev, "stopping AHCI FR engine failed\n"); + break; + } + } + while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) & ATA_AHCI_P_CMD_FR); +} + +static void +ata_ahci_start_fr(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + u_int32_t cmd; + int offset = ch->unit << 7; + + /* start FIS reception on this channel */ + cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, cmd | ATA_AHCI_P_CMD_FRE); +} + static int ata_ahci_wait_ready(device_t dev, int t) { @@ -628,13 +706,14 @@ ata_ahci_wait_ready(device_t dev, int t) struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << 7; int timeout = 0; + uint32_t val; - while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & + while ((val = ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset)) & (ATA_S_BUSY | ATA_S_DRQ)) { DELAY(1000); if (timeout++ > t) { - device_printf(dev, "port is not ready (timeout %dms)\n", t); - return (-1); + device_printf(dev, "port is not ready (timeout %dms) tfd = %08x\n", t, val); + return (EBUSY); } } if (bootverbose) @@ -642,6 +721,28 @@ ata_ahci_wait_ready(device_t dev, int t) return (0); } +static int +ata_ahci_hardreset(device_t dev, int port, uint32_t *signature) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + int offset = ch->unit << 7; + + *signature = 0xffffffff; + ata_ahci_stop(dev); + /* Reset port */ + if (!ata_sata_phy_reset(dev, port, 0)) + return (ENOENT); + /* Wait for clearing busy status. */ + if (ata_ahci_wait_ready(dev, 10000)) { + device_printf(dev, "hardware reset timeout\n"); + return (EBUSY); + } + *signature = ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); + ata_ahci_start(dev); + return (0); +} + static u_int32_t ata_ahci_softreset(device_t dev, int port) { @@ -679,9 +780,9 @@ ata_ahci_softreset(device_t dev, int por ctp->cfis[1] = port & 0x0f; //ctp->cfis[7] = ATA_D_LBA | ATA_D_IBM; ctp->cfis[15] = ATA_A_4BIT; - ata_ahci_issue_cmd(dev, 0, 1000); + ata_ahci_issue_cmd(dev, 0, 3000); - if (ata_ahci_wait_ready(dev, 1000)) { + if (ata_ahci_wait_ready(dev, 0)) { device_printf(dev, "software reset clear timeout\n"); return (-1); } @@ -694,7 +795,6 @@ ata_ahci_reset(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); - u_int64_t work; u_int32_t signature; int offset = ch->unit << 7; @@ -704,25 +804,7 @@ ata_ahci_reset(device_t dev) /* Disable port interrupts */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); - /* setup work areas */ - work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0xffffffff); - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLBU + offset, work >> 32); - - work = ch->dma.work_bus + ATA_AHCI_FB_OFFSET; - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FB + offset, work & 0xffffffff); - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBU + offset, work >> 32); - - /* activate the channel and power/spin up device */ - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, - (ATA_AHCI_P_CMD_ACTIVE | ATA_AHCI_P_CMD_POD | ATA_AHCI_P_CMD_SUD)); - - ata_ahci_stop(dev); - - /* enable FIS based switching */ - //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, 0x00000003); - - if (!ata_sata_phy_reset(dev)) { + if (ata_ahci_hardreset(dev, -1, &signature)) { if (bootverbose) device_printf(dev, "AHCI reset done: phy reset found no device\n"); ch->devices = 0; @@ -733,8 +815,6 @@ ata_ahci_reset(device_t dev) return; } - ata_ahci_start(dev); - /* enable wanted port interrupts */ ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, (ATA_AHCI_P_IX_CPD | ATA_AHCI_P_IX_TFE | ATA_AHCI_P_IX_HBF | @@ -743,9 +823,6 @@ ata_ahci_reset(device_t dev) ATA_AHCI_P_IX_UF | ATA_AHCI_P_IX_SDB | ATA_AHCI_P_IX_DS | ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR)); - /* Wait for initial TFD from device. */ - ata_ahci_wait_ready(dev, 10000); - /* only probe for PortMultiplier if HW has support */ if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { signature = ata_ahci_softreset(dev, ATA_PM); Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Mar 30 22:18:38 2009 (r190581) @@ -517,7 +517,7 @@ ata_intel_31244_tf_write(struct ata_requ static void ata_intel_31244_reset(device_t dev) { - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); } Modified: head/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-jmicron.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-jmicron.c Mon Mar 30 22:18:38 2009 (r190581) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); static int ata_jmicron_chipinit(device_t dev); static int ata_jmicron_ch_attach(device_t dev); static int ata_jmicron_ch_detach(device_t dev); +static int ata_jmicron_ch_suspend(device_t dev); +static int ata_jmicron_ch_resume(device_t dev); static void ata_jmicron_reset(device_t dev); static void ata_jmicron_setmode(device_t dev, int mode); @@ -127,6 +129,8 @@ ata_jmicron_chipinit(device_t dev) ctlr->ch_attach = ata_jmicron_ch_attach; ctlr->ch_detach = ata_jmicron_ch_detach; + ctlr->ch_suspend = ata_jmicron_ch_suspend; + ctlr->ch_resume = ata_jmicron_ch_resume; ctlr->reset = ata_jmicron_reset; ctlr->setmode = ata_jmicron_setmode; @@ -173,6 +177,30 @@ ata_jmicron_ch_detach(device_t dev) return (error); } +static int +ata_jmicron_ch_suspend(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + int error = 0; + + if (ch->unit < ctlr->chip->cfg1) + error = ata_ahci_ch_suspend(dev); + return error; +} + +static int +ata_jmicron_ch_resume(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); + struct ata_channel *ch = device_get_softc(dev); + int error = 0; + + if (ch->unit < ctlr->chip->cfg1) + error = ata_ahci_ch_resume(dev); + return (error); +} + static void ata_jmicron_reset(device_t dev) { Modified: head/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-marvell.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-marvell.c Mon Mar 30 22:18:38 2009 (r190581) @@ -503,7 +503,7 @@ ata_marvell_edma_reset(device_t dev) ATA_OUTL(ctlr->r_res1, 0x0200c + ATA_MV_EDMA_BASE(ch), ~0x0); /* enable channel and test for devices */ - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); /* enable EDMA machinery */ Modified: head/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Mar 30 22:18:38 2009 (r190581) @@ -249,7 +249,7 @@ ata_nvidia_status(device_t dev) static void ata_nvidia_reset(device_t dev) { - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); } Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Mar 30 22:18:38 2009 (r190581) @@ -769,7 +769,7 @@ ata_promise_mio_reset(device_t dev) if ((ctlr->chip->cfg2 == PR_SATA) || ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2))) { - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); /* reset and enable plug/unplug intr */ @@ -805,7 +805,7 @@ ata_promise_mio_reset(device_t dev) (ATA_INL(ctlr->r_res2, 0x414 + (ch->unit << 8)) & ~0x00000003) | 0x00000001); - if (ata_sata_phy_reset(dev)) { + if (ata_sata_phy_reset(dev, -1, 1)) { u_int32_t signature = ch->hw.softreset(dev, ATA_PM); if (1 | bootverbose) Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Mar 30 22:18:38 2009 (r190581) @@ -380,7 +380,7 @@ ata_sii_status(device_t dev) static void ata_sii_reset(device_t dev) { - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); } @@ -832,7 +832,7 @@ ata_siiprb_reset(device_t dev) } /* reset phy */ - if (!ata_sata_phy_reset(dev)) { + if (!ata_sata_phy_reset(dev, -1, 1)) { if (bootverbose) device_printf(dev, "phy reset found no device\n"); ch->devices = 0; Modified: head/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-sis.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-sis.c Mon Mar 30 22:18:38 2009 (r190581) @@ -226,7 +226,7 @@ ata_sis_ch_attach(device_t dev) static void ata_sis_reset(device_t dev) { - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); } Modified: head/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-via.c Mon Mar 30 21:54:39 2009 (r190580) +++ head/sys/dev/ata/chipsets/ata-via.c Mon Mar 30 22:18:38 2009 (r190581) @@ -269,7 +269,7 @@ ata_via_reset(device_t dev) if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) ata_generic_reset(dev); else - if (ata_sata_phy_reset(dev)) + if (ata_sata_phy_reset(dev, -1, 1)) ata_generic_reset(dev); } From owner-svn-src-head@FreeBSD.ORG Mon Mar 30 23:20:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 339CD1065670 for ; Mon, 30 Mar 2009 23:20:35 +0000 (UTC) (envelope-from sales@copatrade.com) Received: from fmailhost05.isp.att.net (fmailhost05.isp.att.net [204.127.217.105]) by mx1.freebsd.org (Postfix) with ESMTP id 1C39C8FC0C for ; Mon, 30 Mar 2009 23:20:35 +0000 (UTC) (envelope-from sales@copatrade.com) Received: from copa-1366cbf0eb (adsl-074-184-210-110.sip.asm.bellsouth.net[74.184.210.110]) by isp.att.net (frfwmhc05) with SMTP id <20090330230732H0500lo0vse>; Mon, 30 Mar 2009 23:07:32 +0000 X-Originating-IP: [74.184.210.110] Message-ID: <00213f7af03a627c86442b2122e64e49@copatrade.com> From: "CopaTrade" To: Date: Mon, 30 Mar 2009 18:07:21 -0500 MIME-Version: 1.0 X-Tracking: $$b73020c6-d5b7-4c4d-97a1-6c919ac1dd38$34$$ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Wireless PC Aircard Offer X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: CopaTrade List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 23:20:36 -0000 Probably something similar to: If you are seeing this message it it = probably because your email client in unable to view html. to view our = html newsletter either change the html viewing option from within your = email client or else you may laos view our newsletter online by clicking = here: http://www.yourdomain/yournewsletter.html ________________________________________________________________ *To prevent us from future contact unsubscribe using the link below: unsubscribe me = mailto:sales@copatrade.com?subject=3Dunsubscribe.me.xt:$$b73020c6-d5b7-4c4d= -97a1-6c919ac1dd38$34$$&body=3DPlease remove me xt:$$b73020c6-d5b7-4c4d-97a1-6c919ac1dd38$34$$ From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 01:59:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57FB61065670; Tue, 31 Mar 2009 01:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 463738FC0C; Tue, 31 Mar 2009 01:59:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V1xl1p084403; Tue, 31 Mar 2009 01:59:47 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V1xlEZ084402; Tue, 31 Mar 2009 01:59:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903310159.n2V1xlEZ084402@svn.freebsd.org> From: Warner Losh Date: Tue, 31 Mar 2009 01:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190583 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 01:59:47 -0000 Author: imp Date: Tue Mar 31 01:59:47 2009 New Revision: 190583 URL: http://svn.freebsd.org/changeset/base/190583 Log: Hmmmm... This can't be right... But it looks like the DL100xx chips don't have one of the clock cycles (the turn cycle) that the AX88x90 chips have. Make this conditional. But this seems totally crazy and can't possibly be right. Commit the fix for the moment until I can explore this mystery more deeply. On the plus side, the DL10022-based cards I have (D-Link DEF-670TXD and SMC8040TX) work after this fix. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 01:01:01 2009 (r190582) +++ head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 01:59:47 2009 (r190583) @@ -1115,7 +1115,9 @@ ed_miibus_readreg(device_t dev, int phy, (*sc->mii_writebits)(sc, ED_MII_READOP, ED_MII_OP_BITS); (*sc->mii_writebits)(sc, phy, ED_MII_PHY_BITS); (*sc->mii_writebits)(sc, reg, ED_MII_REG_BITS); - (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); + if (sc->chip_type == ED_CHIP_TYPE_AX88790 || + sc->chip_type == ED_CHIP_TYPE_AX88190) + (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); failed = (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); val = (*sc->mii_readbits)(sc, ED_MII_DATA_BITS); (*sc->mii_writebits)(sc, ED_MII_IDLE, ED_MII_IDLE_BITS); From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 02:50:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CFC9106567B; Tue, 31 Mar 2009 02:50:18 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0078FC1C; Tue, 31 Mar 2009 02:50:18 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V2oIT4085468; Tue, 31 Mar 2009 02:50:18 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V2oIYD085467; Tue, 31 Mar 2009 02:50:18 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <200903310250.n2V2oIYD085467@svn.freebsd.org> From: David Xu Date: Tue, 31 Mar 2009 02:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190585 - head/lib/libthr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 02:50:19 -0000 Author: davidxu Date: Tue Mar 31 02:50:18 2009 New Revision: 190585 URL: http://svn.freebsd.org/changeset/base/190585 Log: Turn on nodelete linker flag because libthr can not be unloaded safely, it does hook on to libc. Modified: head/lib/libthr/Makefile Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Tue Mar 31 02:29:42 2009 (r190584) +++ head/lib/libthr/Makefile Tue Mar 31 02:50:18 2009 (r190585) @@ -25,6 +25,7 @@ CFLAGS+=-I${.CURDIR}/../../libexec/rtld- CFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_ARCH} CFLAGS+=-I${.CURDIR}/../libthread_db CFLAGS+=-Winline +LDFLAGS+=-Wl,-znodelete VERSION_DEF=${.CURDIR}/../libc/Versions.def SYMBOL_MAPS=${.CURDIR}/pthread.map From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 02:50:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6B9106574D; Tue, 31 Mar 2009 02:50:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 488C28FC0A; Tue, 31 Mar 2009 02:50:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V2ofHg085509; Tue, 31 Mar 2009 02:50:41 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V2of6K085508; Tue, 31 Mar 2009 02:50:41 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903310250.n2V2of6K085508@svn.freebsd.org> From: Warner Losh Date: Tue, 31 Mar 2009 02:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190586 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 02:50:42 -0000 Author: imp Date: Tue Mar 31 02:50:41 2009 New Revision: 190586 URL: http://svn.freebsd.org/changeset/base/190586 Log: Go back to filtering all PHY addresses above 16 since at least two cards still have issues with them. Maybe this is a silicon rev? In any case, doing the filtering only for the AX88790 for the moment. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 02:50:18 2009 (r190585) +++ head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 02:50:41 2009 (r190586) @@ -1101,8 +1101,14 @@ ed_miibus_readreg(device_t dev, int phy, * the internal PHY, a bit has to be set, when accessing the external * PHYs, it must be clear. See Errata 1, page 51, in the AX88790 * datasheet for more details. + * + * Also, PHYs above 16 appear to be phantoms on some cards, but not + * others. Registers read for this are often the same as prior values + * read. Filter all register requests to 17-31. */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { + if (phy > 0x10) + return (0); if (phy == 0x10) ed_asic_outb(sc, ED_AX88X90_GPIO, ED_AX88X90_GPIO_INT_PHY); @@ -1130,15 +1136,10 @@ ed_miibus_writereg(device_t dev, int phy struct ed_softc *sc; sc = device_get_softc(dev); - /* - * The AX88790 has an interesting quirk. It has an internal phy that - * needs a special bit set to access, but can also have additional - * external PHYs set for things like HomeNET media. When accessing - * the internal PHY, a bit has to be set, when accessing the external - * PHYs, it must be clear. See Errata 1, page 51, in the AX88790 - * datasheet for more details. - */ + /* See ed_miibus_readreg for details */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { + if (phy > 0x10) + return (0); if (phy == 0x10) ed_asic_outb(sc, ED_AX88X90_GPIO, ED_AX88X90_GPIO_INT_PHY); From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 03:29:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED6FD1065672; Tue, 31 Mar 2009 03:29:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB2348FC1B; Tue, 31 Mar 2009 03:29:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V3T5Ip086466; Tue, 31 Mar 2009 03:29:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V3T5N8086465; Tue, 31 Mar 2009 03:29:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200903310329.n2V3T5N8086465@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 31 Mar 2009 03:29:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190587 - head/sys/dev/re X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 03:29:06 -0000 Author: yongari Date: Tue Mar 31 03:29:05 2009 New Revision: 190587 URL: http://svn.freebsd.org/changeset/base/190587 Log: Partial revert r185756. It seems that RTL8168D and RTL8102EL requires additional settle time to complete RL_PHYAR register write. Accessing RL_PHYAR register right after the write causes errors for subsequent PHY register accesses. Tested by: george at luckytele dot com, Steve Wills < STEVE at stevenwills dot com > Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Mar 31 02:50:41 2009 (r190586) +++ head/sys/dev/re/if_re.c Tue Mar 31 03:29:05 2009 (r190587) @@ -419,6 +419,7 @@ re_gmii_readreg(device_t dev, int phy, i } CSR_WRITE_4(sc, RL_PHYAR, reg << 16); + DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); @@ -446,6 +447,7 @@ re_gmii_writereg(device_t dev, int phy, CSR_WRITE_4(sc, RL_PHYAR, (reg << 16) | (data & RL_PHYAR_PHYDATA) | RL_PHYAR_BUSY); + DELAY(1000); for (i = 0; i < RL_PHY_TIMEOUT; i++) { rval = CSR_READ_4(sc, RL_PHYAR); From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 07:20:43 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5A8F1065672; Tue, 31 Mar 2009 07:20:43 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id ED8348FC08; Tue, 31 Mar 2009 07:20:41 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A52EC9CB0A0; Tue, 31 Mar 2009 09:19:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MJ9a8XIhDywI; Tue, 31 Mar 2009 09:19:56 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 1BA339CB121; Tue, 31 Mar 2009 09:19:56 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n2V7Ju5x006857; Tue, 31 Mar 2009 09:19:56 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 31 Mar 2009 09:19:56 +0200 From: Roman Divacky To: Alexander Motin Message-ID: <20090331071956.GA6799@freebsd.org> References: <200903302218.n2UMIc6t080193@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903302218.n2UMIc6t080193@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190581 - in head/sys: . amd64/include/xen arm/arm cddl/dev/dtnfsclient contrib/pf dev/ata dev/ata/chipsets dev/cxgb dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/i... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 07:20:44 -0000 are you sure about the merge info? On Mon, Mar 30, 2009 at 10:18:38PM +0000, Alexander Motin wrote: > Author: mav > Date: Mon Mar 30 22:18:38 2009 > New Revision: 190581 > URL: http://svn.freebsd.org/changeset/base/190581 > > Log: > Integrate user/mav/ata branch: > > Add ch_suspend/ch_resume methods for PCI controllers and implement them > for AHCI. Refactor AHCI channel initialization according to it. > > Fix Port Multipliers operation. It is far from perfect yet, but works now. > Tested with JMicron JMB363 AHCI + SiI 3726 PMP pair. > Previous version was also tested with SiI 4726 PMP. > > Hardware sponsored by: Vitsch Electronics / VEHosting.nl > > Modified: > head/sys/ (props changed) > head/sys/amd64/include/xen/ (props changed) > head/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) > head/sys/cddl/dev/dtnfsclient/ (props changed) > head/sys/contrib/pf/ (props changed) > head/sys/dev/ata/ata-pci.c > head/sys/dev/ata/ata-pci.h > head/sys/dev/ata/ata-sata.c > head/sys/dev/ata/ata-usb.c (props changed) > head/sys/dev/ata/chipsets/ata-ahci.c > head/sys/dev/ata/chipsets/ata-intel.c > head/sys/dev/ata/chipsets/ata-jmicron.c > head/sys/dev/ata/chipsets/ata-marvell.c > head/sys/dev/ata/chipsets/ata-nvidia.c > head/sys/dev/ata/chipsets/ata-promise.c > head/sys/dev/ata/chipsets/ata-siliconimage.c > head/sys/dev/ata/chipsets/ata-sis.c > head/sys/dev/ata/chipsets/ata-via.c > head/sys/dev/cxgb/ (props changed) > head/sys/dev/sound/usb/uaudio.c (props changed) > head/sys/dev/sound/usb/uaudio.h (props changed) > head/sys/dev/sound/usb/uaudio_pcm.c (props changed) > head/sys/dev/sound/usb/uaudioreg.h (props changed) > head/sys/dev/usb/README.TXT (props changed) > head/sys/dev/usb/bluetooth/TODO.TXT (props changed) > head/sys/dev/usb/bluetooth/ng_ubt.c (props changed) > head/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) > head/sys/dev/usb/bluetooth/ubtbcmfw.c (props changed) > head/sys/dev/usb/controller/at91dci.c (props changed) > head/sys/dev/usb/controller/at91dci.h (props changed) > head/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) > head/sys/dev/usb/controller/atmegadci.c (props changed) > head/sys/dev/usb/controller/atmegadci.h (props changed) > head/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) > head/sys/dev/usb/controller/ehci.c (props changed) > head/sys/dev/usb/controller/ehci.h (props changed) > head/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) > head/sys/dev/usb/controller/ehci_mbus.c (props changed) > head/sys/dev/usb/controller/ehci_pci.c (props changed) > head/sys/dev/usb/controller/musb_otg.c (props changed) > head/sys/dev/usb/controller/musb_otg.h (props changed) > head/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) > head/sys/dev/usb/controller/ohci.c (props changed) > head/sys/dev/usb/controller/ohci.h (props changed) > head/sys/dev/usb/controller/ohci_atmelarm.c (props changed) > head/sys/dev/usb/controller/ohci_pci.c (props changed) > head/sys/dev/usb/controller/uhci.c (props changed) > head/sys/dev/usb/controller/uhci.h (props changed) > head/sys/dev/usb/controller/uhci_pci.c (props changed) > head/sys/dev/usb/controller/usb_controller.c (props changed) > head/sys/dev/usb/controller/uss820dci.c (props changed) > head/sys/dev/usb/controller/uss820dci.h (props changed) > head/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) > head/sys/dev/usb/input/uhid.c (props changed) > head/sys/dev/usb/input/ukbd.c (props changed) > head/sys/dev/usb/input/ums.c (props changed) > head/sys/dev/usb/input/usb_rdesc.h (props changed) > head/sys/dev/usb/misc/udbp.c (props changed) > head/sys/dev/usb/misc/udbp.h (props changed) > head/sys/dev/usb/misc/ufm.c (props changed) > head/sys/dev/usb/net/if_aue.c (props changed) > head/sys/dev/usb/net/if_auereg.h (props changed) > head/sys/dev/usb/net/if_axe.c (props changed) > head/sys/dev/usb/net/if_axereg.h (props changed) > head/sys/dev/usb/net/if_cdce.c (props changed) > head/sys/dev/usb/net/if_cdcereg.h (props changed) > head/sys/dev/usb/net/if_cue.c (props changed) > head/sys/dev/usb/net/if_cuereg.h (props changed) > head/sys/dev/usb/net/if_kue.c (props changed) > head/sys/dev/usb/net/if_kuefw.h (props changed) > head/sys/dev/usb/net/if_kuereg.h (props changed) > head/sys/dev/usb/net/if_rue.c (props changed) > head/sys/dev/usb/net/if_ruereg.h (props changed) > head/sys/dev/usb/net/if_udav.c (props changed) > head/sys/dev/usb/net/if_udavreg.h (props changed) > head/sys/dev/usb/net/usb_ethernet.c (props changed) > head/sys/dev/usb/net/usb_ethernet.h (props changed) > head/sys/dev/usb/quirk/usb_quirk.c (props changed) > head/sys/dev/usb/quirk/usb_quirk.h (props changed) > head/sys/dev/usb/serial/u3g.c (props changed) > head/sys/dev/usb/serial/uark.c (props changed) > head/sys/dev/usb/serial/ubsa.c (props changed) > head/sys/dev/usb/serial/ubser.c (props changed) > head/sys/dev/usb/serial/uchcom.c (props changed) > head/sys/dev/usb/serial/ucycom.c (props changed) > head/sys/dev/usb/serial/ufoma.c (props changed) > head/sys/dev/usb/serial/uftdi.c (props changed) > head/sys/dev/usb/serial/uftdi_reg.h (props changed) > head/sys/dev/usb/serial/ugensa.c (props changed) > head/sys/dev/usb/serial/uipaq.c (props changed) > head/sys/dev/usb/serial/ulpt.c (props changed) > head/sys/dev/usb/serial/umct.c (props changed) > head/sys/dev/usb/serial/umodem.c (props changed) > head/sys/dev/usb/serial/umoscom.c (props changed) > head/sys/dev/usb/serial/uplcom.c (props changed) > head/sys/dev/usb/serial/usb_serial.c (props changed) > head/sys/dev/usb/serial/usb_serial.h (props changed) > head/sys/dev/usb/serial/uslcom.c (props changed) > head/sys/dev/usb/serial/uvisor.c (props changed) > head/sys/dev/usb/serial/uvscom.c (props changed) > head/sys/dev/usb/storage/rio500_usb.h (props changed) > head/sys/dev/usb/storage/umass.c (props changed) > head/sys/dev/usb/storage/urio.c (props changed) > head/sys/dev/usb/storage/ustorage_fs.c (props changed) > head/sys/dev/usb/template/usb_template.c (props changed) > head/sys/dev/usb/template/usb_template.h (props changed) > head/sys/dev/usb/template/usb_template_cdce.c (props changed) > head/sys/dev/usb/template/usb_template_msc.c (props changed) > head/sys/dev/usb/template/usb_template_mtp.c (props changed) > head/sys/dev/usb/ufm_ioctl.h (props changed) > head/sys/dev/usb/usb.h (props changed) > head/sys/dev/usb/usb_bus.h (props changed) > head/sys/dev/usb/usb_busdma.c (props changed) > head/sys/dev/usb/usb_busdma.h (props changed) > head/sys/dev/usb/usb_cdc.h (props changed) > head/sys/dev/usb/usb_compat_linux.c (props changed) > head/sys/dev/usb/usb_compat_linux.h (props changed) > head/sys/dev/usb/usb_controller.h (props changed) > head/sys/dev/usb/usb_core.c (props changed) > head/sys/dev/usb/usb_core.h (props changed) > head/sys/dev/usb/usb_debug.c (props changed) > head/sys/dev/usb/usb_debug.h (props changed) > head/sys/dev/usb/usb_defs.h (props changed) > head/sys/dev/usb/usb_dev.c (props changed) > head/sys/dev/usb/usb_dev.h (props changed) > head/sys/dev/usb/usb_device.c (props changed) > head/sys/dev/usb/usb_device.h (props changed) > head/sys/dev/usb/usb_dynamic.c (props changed) > head/sys/dev/usb/usb_dynamic.h (props changed) > head/sys/dev/usb/usb_endian.h (props changed) > head/sys/dev/usb/usb_error.c (props changed) > head/sys/dev/usb/usb_error.h (props changed) > head/sys/dev/usb/usb_generic.c (props changed) > head/sys/dev/usb/usb_generic.h (props changed) > head/sys/dev/usb/usb_handle_request.c (props changed) > head/sys/dev/usb/usb_handle_request.h (props changed) > head/sys/dev/usb/usb_hid.c (props changed) > head/sys/dev/usb/usb_hid.h (props changed) > head/sys/dev/usb/usb_hub.c (props changed) > head/sys/dev/usb/usb_hub.h (props changed) > head/sys/dev/usb/usb_if.m (props changed) > head/sys/dev/usb/usb_ioctl.h (props changed) > head/sys/dev/usb/usb_lookup.c (props changed) > head/sys/dev/usb/usb_lookup.h (props changed) > head/sys/dev/usb/usb_mbuf.c (props changed) > head/sys/dev/usb/usb_mbuf.h (props changed) > head/sys/dev/usb/usb_mfunc.h (props changed) > head/sys/dev/usb/usb_msctest.c (props changed) > head/sys/dev/usb/usb_msctest.h (props changed) > head/sys/dev/usb/usb_parse.c (props changed) > head/sys/dev/usb/usb_parse.h (props changed) > head/sys/dev/usb/usb_pci.h (props changed) > head/sys/dev/usb/usb_process.c (props changed) > head/sys/dev/usb/usb_process.h (props changed) > head/sys/dev/usb/usb_request.c (props changed) > head/sys/dev/usb/usb_request.h (props changed) > head/sys/dev/usb/usb_revision.h (props changed) > head/sys/dev/usb/usb_sw_transfer.c (props changed) > head/sys/dev/usb/usb_sw_transfer.h (props changed) > head/sys/dev/usb/usb_transfer.c (props changed) > head/sys/dev/usb/usb_transfer.h (props changed) > head/sys/dev/usb/usb_util.c (props changed) > head/sys/dev/usb/usb_util.h (props changed) > head/sys/dev/usb/usbdevs (props changed) > head/sys/dev/usb/usbhid.h (props changed) > head/sys/dev/usb/wlan/if_rum.c (props changed) > head/sys/dev/usb/wlan/if_rumfw.h (props changed) > head/sys/dev/usb/wlan/if_rumreg.h (props changed) > head/sys/dev/usb/wlan/if_rumvar.h (props changed) > head/sys/dev/usb/wlan/if_ural.c (props changed) > head/sys/dev/usb/wlan/if_uralreg.h (props changed) > head/sys/dev/usb/wlan/if_uralvar.h (props changed) > head/sys/dev/usb/wlan/if_zyd.c (props changed) > head/sys/dev/usb/wlan/if_zydfw.h (props changed) > head/sys/dev/usb/wlan/if_zydreg.h (props changed) > head/sys/dev/usb/wlan/usb_wlan.h (props changed) > head/sys/dev/xen/netfront/ (props changed) > head/sys/dev/xen/xenpci/ (props changed) > head/sys/legacy/dev/ata/ata-usb.c (props changed) > head/sys/legacy/dev/sound/usb/uaudio.c (props changed) > head/sys/legacy/dev/sound/usb/uaudio.h (props changed) > head/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) > head/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) > head/sys/legacy/dev/usb/ (props changed) > head/sys/legacy/dev/usb/ehci_ixp4xx.c (props changed) > head/sys/mips/mips/elf64_machdep.c (props changed) > head/sys/modules/dtrace/dtnfsclient/ (props changed) > head/sys/modules/ip6_mroute_mod/ (props changed) > head/sys/modules/ipmi/ipmi_linux/ (props changed) > head/sys/xen/evtchn.h (props changed) > head/sys/xen/hypervisor.h (props changed) > head/sys/xen/xen_intr.h (props changed) > > Modified: head/sys/dev/ata/ata-pci.c > ============================================================================== > --- head/sys/dev/ata/ata-pci.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/ata-pci.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -584,22 +584,35 @@ ata_pcichannel_detach(device_t dev) > static int > ata_pcichannel_suspend(device_t dev) > { > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > struct ata_channel *ch = device_get_softc(dev); > + int error; > > if (!ch->attached) > return (0); > > - return ata_suspend(dev); > + if ((error = ata_suspend(dev))) > + return (error); > + > + if (ctlr->ch_suspend != NULL && (error = ctlr->ch_suspend(dev))) > + return (error); > + > + return (0); > } > > static int > ata_pcichannel_resume(device_t dev) > { > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > struct ata_channel *ch = device_get_softc(dev); > + int error; > > if (!ch->attached) > return (0); > > + if (ctlr->ch_resume != NULL && (error = ctlr->ch_resume(dev))) > + return (error); > + > return ata_resume(dev); > } > > > Modified: head/sys/dev/ata/ata-pci.h > ============================================================================== > --- head/sys/dev/ata/ata-pci.h Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/ata-pci.h Mon Mar 30 22:18:38 2009 (r190581) > @@ -57,6 +57,8 @@ struct ata_pci_controller { > int (*resume)(device_t); > int (*ch_attach)(device_t); > int (*ch_detach)(device_t); > + int (*ch_suspend)(device_t); > + int (*ch_resume)(device_t); > int (*locking)(device_t, int); > void (*reset)(device_t); > void (*setmode)(device_t, int); > @@ -443,7 +445,9 @@ int ata_mode2idx(int mode); > > /* global prototypes ata-sata.c */ > void ata_sata_phy_check_events(device_t dev); > -int ata_sata_phy_reset(device_t dev); > +int ata_sata_scr_read(struct ata_channel *ch, int port, int reg, uint32_t *val); > +int ata_sata_scr_write(struct ata_channel *ch, int port, int reg, uint32_t val); > +int ata_sata_phy_reset(device_t dev, int port, int quick); > void ata_sata_setmode(device_t dev, int mode); > int ata_request2fis_h2d(struct ata_request *request, u_int8_t *fis); > void ata_pm_identify(device_t dev); > @@ -452,6 +456,8 @@ void ata_pm_identify(device_t dev); > int ata_ahci_chipinit(device_t); > int ata_ahci_ch_attach(device_t dev); > int ata_ahci_ch_detach(device_t dev); > +int ata_ahci_ch_suspend(device_t dev); > +int ata_ahci_ch_resume(device_t dev); > void ata_ahci_reset(device_t dev); > int ata_marvell_edma_chipinit(device_t); > int ata_sii_chipinit(device_t); > > Modified: head/sys/dev/ata/ata-sata.c > ============================================================================== > --- head/sys/dev/ata/ata-sata.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/ata-sata.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -73,59 +73,141 @@ ata_sata_phy_check_events(device_t dev) > } > } > > +int > +ata_sata_scr_read(struct ata_channel *ch, int port, int reg, uint32_t *val) > +{ > + int r; > + > + if (port < 0) { > + *val = ATA_IDX_INL(ch, reg); > + return (0); > + } else { > + switch (reg) { > + case ATA_SSTATUS: > + r = 0; > + break; > + case ATA_SERROR: > + r = 1; > + break; > + case ATA_SCONTROL: > + r = 2; > + break; > + default: > + return (EINVAL); > + } > + return (ch->hw.pm_read(ch->dev, port, r, val)); > + } > +} > + > +int > +ata_sata_scr_write(struct ata_channel *ch, int port, int reg, uint32_t val) > +{ > + int r; > + > + if (port < 0) { > + ATA_IDX_OUTL(ch, reg, val); > + return (0); > + } else { > + switch (reg) { > + case ATA_SERROR: > + r = 1; > + break; > + case ATA_SCONTROL: > + r = 2; > + break; > + default: > + return (EINVAL); > + } > + return (ch->hw.pm_write(ch->dev, port, r, val)); > + } > +} > + > static int > -ata_sata_connect(struct ata_channel *ch) > +ata_sata_connect(struct ata_channel *ch, int port) > { > u_int32_t status; > int timeout; > > /* wait up to 1 second for "connect well" */ > for (timeout = 0; timeout < 100 ; timeout++) { > - status = ATA_IDX_INL(ch, ATA_SSTATUS); > + if (ata_sata_scr_read(ch, port, ATA_SSTATUS, &status)) > + return (0); > if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1 || > (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) > break; > ata_udelay(10000); > } > if (timeout >= 100) { > - if (bootverbose) > - device_printf(ch->dev, "SATA connect status=%08x\n", status); > + if (bootverbose) { > + if (port < 0) { > + device_printf(ch->dev, "SATA connect timeout status=%08x\n", > + status); > + } else { > + device_printf(ch->dev, "p%d: SATA connect timeout status=%08x\n", > + port, status); > + } > + } > return 0; > } > - if (bootverbose) > - device_printf(ch->dev, "SATA connect time=%dms\n", timeout * 10); > + if (bootverbose) { > + if (port < 0) { > + device_printf(ch->dev, "SATA connect time=%dms status=%08x\n", > + timeout * 10, status); > + } else { > + device_printf(ch->dev, "p%d: SATA connect time=%dms status=%08x\n", > + port, timeout * 10, status); > + } > + } > > /* clear SATA error register */ > - ATA_IDX_OUTL(ch, ATA_SERROR, ATA_IDX_INL(ch, ATA_SERROR)); > + ata_sata_scr_write(ch, port, ATA_SERROR, 0xffffffff); > > return 1; > } > > int > -ata_sata_phy_reset(device_t dev) > +ata_sata_phy_reset(device_t dev, int port, int quick) > { > struct ata_channel *ch = device_get_softc(dev); > int loop, retry; > + uint32_t val; > > - if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) > - return ata_sata_connect(ch); > + if (quick) { > + if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) > + return (0); > + if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_IDLE) > + return ata_sata_connect(ch, port); > + } > > + if (bootverbose) { > + if (port < 0) { > + device_printf(dev, "hardware reset ...\n"); > + } else { > + device_printf(dev, "p%d: hardware reset ...\n", port); > + } > + } > for (retry = 0; retry < 10; retry++) { > for (loop = 0; loop < 10; loop++) { > - ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_RESET); > + if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET)) > + return (0); > ata_udelay(100); > - if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == > - ATA_SC_DET_RESET) > + if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) > + return (0); > + if ((val & ATA_SC_DET_MASK) == ATA_SC_DET_RESET) > break; > } > ata_udelay(5000); > for (loop = 0; loop < 10; loop++) { > - ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_IDLE | > - ATA_SC_IPM_DIS_PARTIAL | > - ATA_SC_IPM_DIS_SLUMBER); > + if (ata_sata_scr_write(ch, port, ATA_SCONTROL, > + ATA_SC_DET_IDLE | > + ATA_SC_IPM_DIS_PARTIAL | > + ATA_SC_IPM_DIS_SLUMBER)) > + return (0); > ata_udelay(100); > - if ((ATA_IDX_INL(ch, ATA_SCONTROL) & ATA_SC_DET_MASK) == 0) > - return ata_sata_connect(ch); > + if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) > + return (0); > + if ((val & ATA_SC_DET_MASK) == 0) > + return ata_sata_connect(ch, port); > } > } > return 0; > @@ -237,14 +319,27 @@ ata_pm_identify(device_t dev) > /* chip specific quirks */ > switch (pm_chipid) { > case 0x37261095: > - /* Some of these bogusly reports 6 ports */ > + /* This PM declares 6 ports, while only 5 of them are real. > + * Port 5 is enclosure management bridge port, which has implementation > + * problems, causing probe faults. Hide it for now. */ > + device_printf(dev, "SiI 3726 (rev=%x) Port Multiplier with %d (5) ports\n", > + pm_revision, pm_ports); > pm_ports = 5; > - device_printf(dev, "SiI 3726 r%x Portmultiplier with %d ports\n", > + break; > + > + case 0x47261095: > + /* This PM declares 7 ports, while only 5 of them are real. > + * Port 5 is some fake "Config Disk" with 640 sectors size, > + * port 6 is enclosure management bridge port. > + * Both fake ports has implementation problems, causing > + * probe faults. Hide them for now. */ > + device_printf(dev, "SiI 4726 (rev=%x) Port Multiplier with %d (5) ports\n", > pm_revision, pm_ports); > + pm_ports = 5; > break; > > default: > - device_printf(dev, "Portmultiplier (id=%08x rev=%x) with %d ports\n", > + device_printf(dev, "Port Multiplier (id=%08x rev=%x) with %d ports\n", > pm_chipid, pm_revision, pm_ports); > } > > @@ -253,41 +348,17 @@ ata_pm_identify(device_t dev) > > /* reset all ports and register if anything connected */ > for (port=0; port < pm_ports; port++) { > - u_int32_t signature, status; > - int timeout; > + u_int32_t signature; > > - if (ch->hw.pm_write(dev, port, 2, ATA_SC_DET_RESET)) { > - device_printf(dev, "p%d: writing ATA_SC_DET_RESET failed\n", port); > + if (!ata_sata_phy_reset(dev, port, 1)) > continue; > - } > - > - ata_udelay(5000); > - > - if (ch->hw.pm_write(dev, port, 2, ATA_SC_DET_IDLE)) { > - device_printf(dev, "p%d: writing ATA_SC_DET_idle failed\n", port); > - continue; > - } > - > - ata_udelay(5000); > - > - /* wait up to 1 second for "connect well" */ > - for (timeout = 0; timeout < 100 ; timeout++) { > - ch->hw.pm_read(dev, port, 0, &status); > - if ((status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN1 || > - (status & ATA_SS_CONWELL_MASK) == ATA_SS_CONWELL_GEN2) > - break; > - ata_udelay(10000); > - } > - if (timeout >= 100) { > - if (bootverbose) > - device_printf(dev, "p%d: connect status=%08x\n", port, status); > - continue; > - } > - if (bootverbose) > - device_printf(dev, "p%d: connect time %dms\n", port, timeout * 10); > > - /* clear SERROR register */ > - ch->hw.pm_write(dev, port, 1, 0xffffffff); > + /* > + * XXX: I have no idea how to properly wait for PMP port hardreset > + * completion. Without this delay soft reset does not completes > + * successfully. > + */ > + DELAY(1000000); > > signature = ch->hw.softreset(dev, port); > > > Modified: head/sys/dev/ata/chipsets/ata-ahci.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-ahci.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-ahci.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -59,10 +59,16 @@ static int ata_ahci_begin_transaction(st > static int ata_ahci_end_transaction(struct ata_request *request); > static int ata_ahci_pm_read(device_t dev, int port, int reg, u_int32_t *result); > static int ata_ahci_pm_write(device_t dev, int port, int reg, u_int32_t result); > +static int ata_ahci_hardreset(device_t dev, int port, uint32_t *signature); > static u_int32_t ata_ahci_softreset(device_t dev, int port); > static void ata_ahci_dmasetprd(void *xsc, bus_dma_segment_t *segs, int nsegs, int error); > static int ata_ahci_setup_fis(struct ata_ahci_cmd_tab *ctp, struct ata_request *equest); > static void ata_ahci_dmainit(device_t dev); > +static void ata_ahci_start(device_t dev); > +static void ata_ahci_stop(device_t dev); > +static void ata_ahci_clo(device_t dev); > +static void ata_ahci_start_fr(device_t dev); > +static void ata_ahci_stop_fr(device_t dev); > > /* > * AHCI v1.x compliant SATA chipset support functions > @@ -131,6 +137,8 @@ ata_ahci_chipinit(device_t dev) > ctlr->reset = ata_ahci_reset; > ctlr->ch_attach = ata_ahci_ch_attach; > ctlr->ch_detach = ata_ahci_ch_detach; > + ctlr->ch_suspend = ata_ahci_ch_suspend; > + ctlr->ch_resume = ata_ahci_ch_resume; > ctlr->setmode = ata_sata_setmode; > ctlr->suspend = ata_ahci_suspend; > ctlr->resume = ata_ahci_ctlr_reset; > @@ -192,7 +200,6 @@ ata_ahci_suspend(device_t dev) > return 0; > } > > - > int > ata_ahci_ch_attach(device_t dev) > { > @@ -220,12 +227,22 @@ ata_ahci_ch_attach(device_t dev) > ch->hw.pm_read = ata_ahci_pm_read; > ch->hw.pm_write = ata_ahci_pm_write; > > + ata_ahci_ch_resume(dev); > return 0; > } > > int > ata_ahci_ch_detach(device_t dev) > { > + > + ata_ahci_ch_suspend(dev); > + ata_dmafini(dev); > + return (0); > +} > + > +int > +ata_ahci_ch_suspend(device_t dev) > +{ > struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > struct ata_channel *ch = device_get_softc(dev); > int offset = ch->unit << 7; > @@ -233,6 +250,8 @@ ata_ahci_ch_detach(device_t dev) > /* Disable port interrupts. */ > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); > /* Reset command register. */ > + ata_ahci_stop(dev); > + ata_ahci_stop_fr(dev); > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, 0); > > /* Allow everything including partial and slumber modes. */ > @@ -243,7 +262,35 @@ ata_ahci_ch_detach(device_t dev) > /* Disable PHY. */ > ATA_IDX_OUTL(ch, ATA_SCONTROL, ATA_SC_DET_DISABLE); > > - ata_dmafini(dev); > + return (0); > +} > + > +int > +ata_ahci_ch_resume(device_t dev) > +{ > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > + struct ata_channel *ch = device_get_softc(dev); > + uint64_t work; > + int offset = ch->unit << 7; > + > + /* Disable port interrupts */ > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); > + > + /* setup work areas */ > + work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0xffffffff); > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLBU + offset, work >> 32); > + > + work = ch->dma.work_bus + ATA_AHCI_FB_OFFSET; > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FB + offset, work & 0xffffffff); > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBU + offset, work >> 32); > + > + /* activate the channel and power/spin up device */ > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, > + (ATA_AHCI_P_CMD_ACTIVE | ATA_AHCI_P_CMD_POD | ATA_AHCI_P_CMD_SUD)); > + ata_ahci_start_fr(dev); > + ata_ahci_start(dev); > + > return (0); > } > > @@ -366,9 +413,6 @@ ata_ahci_begin_transaction(struct ata_re > ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) & > ~ATA_AHCI_P_CMD_ATAPI); > > - /* set PM port to address */ > - //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, (port << 8) | 0x00000001); > - > /* issue command to controller */ > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, (1 << request->tag)); > > @@ -465,9 +509,6 @@ ata_ahci_issue_cmd(device_t dev, u_int16 > clp->bytecount = 0; > clp->cmd_table_phys = htole64(ch->dma.work_bus + ATA_AHCI_CT_OFFSET); > > - /* set PM port */ > - //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, (port << 8) | 0x00000001); > - > /* issue command to controller */ > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CI + offset, 1); > > @@ -480,7 +521,7 @@ ata_ahci_issue_cmd(device_t dev, u_int16 > > /* clear interrupts */ > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IS + offset, > - ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset)); > + ATA_INL(ctlr->r_res2, ATA_AHCI_P_IS + offset)); > > if (timeout && (count >= timeout)) { > if (bootverbose) { > @@ -559,7 +600,7 @@ ata_ahci_stop(device_t dev) > /* kill off all activity on this channel */ > cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, > - cmd & ~(ATA_AHCI_P_CMD_FRE | ATA_AHCI_P_CMD_ST)); > + cmd & ~ATA_AHCI_P_CMD_ST); > > /* XXX SOS this is not entirely wrong */ > timeout = 0; > @@ -617,10 +658,47 @@ ata_ahci_start(device_t dev) > /* start operations on this channel */ > cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, > - cmd | (ATA_AHCI_P_CMD_FRE | ATA_AHCI_P_CMD_ST) | > + cmd | ATA_AHCI_P_CMD_ST | > (ch->devices & ATA_PORTMULTIPLIER ? ATA_AHCI_P_CMD_PMA : 0)); > } > > +static void > +ata_ahci_stop_fr(device_t dev) > +{ > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > + struct ata_channel *ch = device_get_softc(dev); > + u_int32_t cmd; > + int offset = ch->unit << 7; > + int timeout; > + > + /* kill off all activity on this channel */ > + cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, cmd & ~ATA_AHCI_P_CMD_FRE); > + > + timeout = 0; > + do { > + DELAY(1000); > + if (timeout++ > 1000) { > + device_printf(dev, "stopping AHCI FR engine failed\n"); > + break; > + } > + } > + while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset) & ATA_AHCI_P_CMD_FR); > +} > + > +static void > +ata_ahci_start_fr(device_t dev) > +{ > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > + struct ata_channel *ch = device_get_softc(dev); > + u_int32_t cmd; > + int offset = ch->unit << 7; > + > + /* start FIS reception on this channel */ > + cmd = ATA_INL(ctlr->r_res2, ATA_AHCI_P_CMD + offset); > + ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, cmd | ATA_AHCI_P_CMD_FRE); > +} > + > static int > ata_ahci_wait_ready(device_t dev, int t) > { > @@ -628,13 +706,14 @@ ata_ahci_wait_ready(device_t dev, int t) > struct ata_channel *ch = device_get_softc(dev); > int offset = ch->unit << 7; > int timeout = 0; > + uint32_t val; > > - while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & > + while ((val = ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset)) & > (ATA_S_BUSY | ATA_S_DRQ)) { > DELAY(1000); > if (timeout++ > t) { > - device_printf(dev, "port is not ready (timeout %dms)\n", t); > - return (-1); > + device_printf(dev, "port is not ready (timeout %dms) tfd = %08x\n", t, val); > + return (EBUSY); > } > } > if (bootverbose) > @@ -642,6 +721,28 @@ ata_ahci_wait_ready(device_t dev, int t) > return (0); > } > > +static int > +ata_ahci_hardreset(device_t dev, int port, uint32_t *signature) > +{ > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > + struct ata_channel *ch = device_get_softc(dev); > + int offset = ch->unit << 7; > + > + *signature = 0xffffffff; > + ata_ahci_stop(dev); > + /* Reset port */ > + if (!ata_sata_phy_reset(dev, port, 0)) > + return (ENOENT); > + /* Wait for clearing busy status. */ > + if (ata_ahci_wait_ready(dev, 10000)) { > + device_printf(dev, "hardware reset timeout\n"); > + return (EBUSY); > + } > + *signature = ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); > + ata_ahci_start(dev); > + return (0); > +} > + > static u_int32_t > ata_ahci_softreset(device_t dev, int port) > { > @@ -679,9 +780,9 @@ ata_ahci_softreset(device_t dev, int por > ctp->cfis[1] = port & 0x0f; > //ctp->cfis[7] = ATA_D_LBA | ATA_D_IBM; > ctp->cfis[15] = ATA_A_4BIT; > - ata_ahci_issue_cmd(dev, 0, 1000); > + ata_ahci_issue_cmd(dev, 0, 3000); > > - if (ata_ahci_wait_ready(dev, 1000)) { > + if (ata_ahci_wait_ready(dev, 0)) { > device_printf(dev, "software reset clear timeout\n"); > return (-1); > } > @@ -694,7 +795,6 @@ ata_ahci_reset(device_t dev) > { > struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > struct ata_channel *ch = device_get_softc(dev); > - u_int64_t work; > u_int32_t signature; > int offset = ch->unit << 7; > > @@ -704,25 +804,7 @@ ata_ahci_reset(device_t dev) > /* Disable port interrupts */ > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, 0); > > - /* setup work areas */ > - work = ch->dma.work_bus + ATA_AHCI_CL_OFFSET; > - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLB + offset, work & 0xffffffff); > - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CLBU + offset, work >> 32); > - > - work = ch->dma.work_bus + ATA_AHCI_FB_OFFSET; > - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FB + offset, work & 0xffffffff); > - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBU + offset, work >> 32); > - > - /* activate the channel and power/spin up device */ > - ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_CMD + offset, > - (ATA_AHCI_P_CMD_ACTIVE | ATA_AHCI_P_CMD_POD | ATA_AHCI_P_CMD_SUD)); > - > - ata_ahci_stop(dev); > - > - /* enable FIS based switching */ > - //ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_FBS + offset, 0x00000003); > - > - if (!ata_sata_phy_reset(dev)) { > + if (ata_ahci_hardreset(dev, -1, &signature)) { > if (bootverbose) > device_printf(dev, "AHCI reset done: phy reset found no device\n"); > ch->devices = 0; > @@ -733,8 +815,6 @@ ata_ahci_reset(device_t dev) > return; > } > > - ata_ahci_start(dev); > - > /* enable wanted port interrupts */ > ATA_OUTL(ctlr->r_res2, ATA_AHCI_P_IE + offset, > (ATA_AHCI_P_IX_CPD | ATA_AHCI_P_IX_TFE | ATA_AHCI_P_IX_HBF | > @@ -743,9 +823,6 @@ ata_ahci_reset(device_t dev) > ATA_AHCI_P_IX_UF | ATA_AHCI_P_IX_SDB | ATA_AHCI_P_IX_DS | > ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR)); > > - /* Wait for initial TFD from device. */ > - ata_ahci_wait_ready(dev, 10000); > - > /* only probe for PortMultiplier if HW has support */ > if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) { > signature = ata_ahci_softreset(dev, ATA_PM); > > Modified: head/sys/dev/ata/chipsets/ata-intel.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-intel.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -517,7 +517,7 @@ ata_intel_31244_tf_write(struct ata_requ > static void > ata_intel_31244_reset(device_t dev) > { > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > } > > > Modified: head/sys/dev/ata/chipsets/ata-jmicron.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-jmicron.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-jmicron.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); > static int ata_jmicron_chipinit(device_t dev); > static int ata_jmicron_ch_attach(device_t dev); > static int ata_jmicron_ch_detach(device_t dev); > +static int ata_jmicron_ch_suspend(device_t dev); > +static int ata_jmicron_ch_resume(device_t dev); > static void ata_jmicron_reset(device_t dev); > static void ata_jmicron_setmode(device_t dev, int mode); > > @@ -127,6 +129,8 @@ ata_jmicron_chipinit(device_t dev) > > ctlr->ch_attach = ata_jmicron_ch_attach; > ctlr->ch_detach = ata_jmicron_ch_detach; > + ctlr->ch_suspend = ata_jmicron_ch_suspend; > + ctlr->ch_resume = ata_jmicron_ch_resume; > ctlr->reset = ata_jmicron_reset; > ctlr->setmode = ata_jmicron_setmode; > > @@ -173,6 +177,30 @@ ata_jmicron_ch_detach(device_t dev) > return (error); > } > > +static int > +ata_jmicron_ch_suspend(device_t dev) > +{ > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > + struct ata_channel *ch = device_get_softc(dev); > + int error = 0; > + > + if (ch->unit < ctlr->chip->cfg1) > + error = ata_ahci_ch_suspend(dev); > + return error; > +} > + > +static int > +ata_jmicron_ch_resume(device_t dev) > +{ > + struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); > + struct ata_channel *ch = device_get_softc(dev); > + int error = 0; > + > + if (ch->unit < ctlr->chip->cfg1) > + error = ata_ahci_ch_resume(dev); > + return (error); > +} > + > static void > ata_jmicron_reset(device_t dev) > { > > Modified: head/sys/dev/ata/chipsets/ata-marvell.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-marvell.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-marvell.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -503,7 +503,7 @@ ata_marvell_edma_reset(device_t dev) > ATA_OUTL(ctlr->r_res1, 0x0200c + ATA_MV_EDMA_BASE(ch), ~0x0); > > /* enable channel and test for devices */ > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > > /* enable EDMA machinery */ > > Modified: head/sys/dev/ata/chipsets/ata-nvidia.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-nvidia.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-nvidia.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -249,7 +249,7 @@ ata_nvidia_status(device_t dev) > static void > ata_nvidia_reset(device_t dev) > { > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > } > > > Modified: head/sys/dev/ata/chipsets/ata-promise.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-promise.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-promise.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -769,7 +769,7 @@ ata_promise_mio_reset(device_t dev) > if ((ctlr->chip->cfg2 == PR_SATA) || > ((ctlr->chip->cfg2 == PR_CMBO) && (ch->unit < 2))) { > > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > > /* reset and enable plug/unplug intr */ > @@ -805,7 +805,7 @@ ata_promise_mio_reset(device_t dev) > (ATA_INL(ctlr->r_res2, 0x414 + (ch->unit << 8)) & > ~0x00000003) | 0x00000001); > > - if (ata_sata_phy_reset(dev)) { > + if (ata_sata_phy_reset(dev, -1, 1)) { > u_int32_t signature = ch->hw.softreset(dev, ATA_PM); > > if (1 | bootverbose) > > Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -380,7 +380,7 @@ ata_sii_status(device_t dev) > static void > ata_sii_reset(device_t dev) > { > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > } > > @@ -832,7 +832,7 @@ ata_siiprb_reset(device_t dev) > } > > /* reset phy */ > - if (!ata_sata_phy_reset(dev)) { > + if (!ata_sata_phy_reset(dev, -1, 1)) { > if (bootverbose) > device_printf(dev, "phy reset found no device\n"); > ch->devices = 0; > > Modified: head/sys/dev/ata/chipsets/ata-sis.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-sis.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-sis.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -226,7 +226,7 @@ ata_sis_ch_attach(device_t dev) > static void > ata_sis_reset(device_t dev) > { > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > } > > > Modified: head/sys/dev/ata/chipsets/ata-via.c > ============================================================================== > --- head/sys/dev/ata/chipsets/ata-via.c Mon Mar 30 21:54:39 2009 (r190580) > +++ head/sys/dev/ata/chipsets/ata-via.c Mon Mar 30 22:18:38 2009 (r190581) > @@ -269,7 +269,7 @@ ata_via_reset(device_t dev) > if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) > ata_generic_reset(dev); > else > - if (ata_sata_phy_reset(dev)) > + if (ata_sata_phy_reset(dev, -1, 1)) > ata_generic_reset(dev); > } > From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 07:27:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 210A91065676; Tue, 31 Mar 2009 07:27:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 332788FC18; Tue, 31 Mar 2009 07:27:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from [212.86.226.226] (account mav@alkar.net HELO mavbook.mavhome.dp.ua) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPSA id 238915572; Tue, 31 Mar 2009 10:27:18 +0300 Message-ID: <49D1C5D5.9060406@FreeBSD.org> Date: Tue, 31 Mar 2009 10:27:17 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.21 (X11/20090329) MIME-Version: 1.0 To: Roman Divacky References: <200903302218.n2UMIc6t080193@svn.freebsd.org> <20090331071956.GA6799@freebsd.org> In-Reply-To: <20090331071956.GA6799@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190581 - in head/sys: . amd64/include/xen arm/arm cddl/dev/dtnfsclient contrib/pf dev/ata dev/ata/chipsets dev/cxgb dev/sound/usb dev/usb dev/usb/bluetooth dev/usb/controller dev/usb/i... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 07:27:20 -0000 Roman Divacky wrote: > are you sure about the merge info? Sure about what? It is not my mergeinfo, it is already in HEAD. When mergeinfo already exist, svn adds new one with every merge. I have asked about this some days ago on the list, but had no any propositions, so proceeded. > On Mon, Mar 30, 2009 at 10:18:38PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Mon Mar 30 22:18:38 2009 >> New Revision: 190581 >> URL: http://svn.freebsd.org/changeset/base/190581 >> >> Log: >> Integrate user/mav/ata branch: >> >> Add ch_suspend/ch_resume methods for PCI controllers and implement them >> for AHCI. Refactor AHCI channel initialization according to it. >> >> Fix Port Multipliers operation. It is far from perfect yet, but works now. >> Tested with JMicron JMB363 AHCI + SiI 3726 PMP pair. >> Previous version was also tested with SiI 4726 PMP. >> >> Hardware sponsored by: Vitsch Electronics / VEHosting.nl -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 07:40:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A9131065748; Tue, 31 Mar 2009 07:40:37 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED5268FC19; Tue, 31 Mar 2009 07:40:36 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2V7eavl091144; Tue, 31 Mar 2009 07:40:36 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2V7eaKO091142; Tue, 31 Mar 2009 07:40:36 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <200903310740.n2V7eaKO091142@svn.freebsd.org> From: Kevin Lo Date: Tue, 31 Mar 2009 07:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190588 - in head/sys/dev/usb: . wlan X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 07:40:38 -0000 Author: kevlo Date: Tue Mar 31 07:40:36 2009 New Revision: 190588 URL: http://svn.freebsd.org/changeset/base/190588 Log: Add another rum(4) device found in http://www.fit-pc.com/new/whats-new.html Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Mar 31 03:29:05 2009 (r190587) +++ head/sys/dev/usb/usbdevs Tue Mar 31 07:40:36 2009 (r190588) @@ -2027,6 +2027,7 @@ product PUTERCOM UPA100 0x047e USB-1284 /* Qcom products */ product QCOM RT2573 0x6196 RT2573 product QCOM RT2573_2 0x6229 RT2573 +product QCOM RT2573_3 0x6238 RT2573 /* Qualcomm products */ product QUALCOMM CDMA_MSM 0x6000 CDMA Technologies MSM phone Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Tue Mar 31 03:29:05 2009 (r190587) +++ head/sys/dev/usb/wlan/if_rum.c Tue Mar 31 07:40:36 2009 (r190588) @@ -95,6 +95,7 @@ static const struct usb2_device_id rum_d { USB_VP(USB_VENDOR_PLANEX2, USB_PRODUCT_PLANEX2_GWUSMM) }, { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573) }, { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_2) }, + { USB_VP(USB_VENDOR_QCOM, USB_PRODUCT_QCOM_RT2573_3) }, { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573) }, { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2573_2) }, { USB_VP(USB_VENDOR_RALINK, USB_PRODUCT_RALINK_RT2671) }, From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 10:34:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 508D21065672; Tue, 31 Mar 2009 10:34:55 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3208FC08; Tue, 31 Mar 2009 10:34:55 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VAYtVf094515; Tue, 31 Mar 2009 10:34:55 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VAYtpW094514; Tue, 31 Mar 2009 10:34:55 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200903311034.n2VAYtpW094514@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 31 Mar 2009 10:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190590 - head/sys/dev/malo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 10:34:55 -0000 Author: weongyo Date: Tue Mar 31 10:34:54 2009 New Revision: 190590 URL: http://svn.freebsd.org/changeset/base/190590 Log: fix a bug that it passed a incorrect flag BUS_DMA_ALLOCNOW to create a device specific DMA tag. On amd64 it could exhaust all of bounce pages when bus_dma_tag_create(9) is called at malo_pci_attach() then as result in next turn it returns ENOMEM. This fix a attach fail on amd64. Pointed by: yongari Tested by: dchagin MFC after: 3 days Modified: head/sys/dev/malo/if_malo_pci.c Modified: head/sys/dev/malo/if_malo_pci.c ============================================================================== --- head/sys/dev/malo/if_malo_pci.c Tue Mar 31 09:54:54 2009 (r190589) +++ head/sys/dev/malo/if_malo_pci.c Tue Mar 31 10:34:54 2009 (r190590) @@ -245,7 +245,7 @@ malo_pci_attach(device_t dev) BUS_SPACE_MAXADDR, /* maxsize */ 0, /* nsegments */ BUS_SPACE_MAXADDR, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ + 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ &sc->malo_dmat)) { From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 11:04:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 987071065675; Tue, 31 Mar 2009 11:04:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 867AD8FC1C; Tue, 31 Mar 2009 11:04:51 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VB4pIr098281; Tue, 31 Mar 2009 11:04:51 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VB4pHx098280; Tue, 31 Mar 2009 11:04:51 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200903311104.n2VB4pHx098280@svn.freebsd.org> From: Rui Paulo Date: Tue, 31 Mar 2009 11:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190591 - head/contrib/libpcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 11:04:52 -0000 Author: rpaulo Date: Tue Mar 31 11:04:51 2009 New Revision: 190591 URL: http://svn.freebsd.org/changeset/base/190591 Log: Remove a dangling extern "C" declaration that was missed during the merge. Fixes C++ ports using libpcap (nmap, for example). Submitted by: Daniel Roethlisberger Modified: head/contrib/libpcap/pcap.h Modified: head/contrib/libpcap/pcap.h ============================================================================== --- head/contrib/libpcap/pcap.h Tue Mar 31 10:34:54 2009 (r190590) +++ head/contrib/libpcap/pcap.h Tue Mar 31 11:04:51 2009 (r190591) @@ -53,10 +53,6 @@ #include -#ifdef __cplusplus -extern "C" { -#endif - #define PCAP_VERSION_MAJOR 2 #define PCAP_VERSION_MINOR 4 From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 14:30:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50FD31065722; Tue, 31 Mar 2009 14:30:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FE2C8FC2E; Tue, 31 Mar 2009 14:30:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VEUlcG002557; Tue, 31 Mar 2009 14:30:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VEUlSG002556; Tue, 31 Mar 2009 14:30:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903311430.n2VEUlSG002556@svn.freebsd.org> From: John Baldwin Date: Tue, 31 Mar 2009 14:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190593 - head/lib/libstand X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 14:30:48 -0000 Author: jhb Date: Tue Mar 31 14:30:46 2009 New Revision: 190593 URL: http://svn.freebsd.org/changeset/base/190593 Log: Fix an off-by-one buffer overflow in ngets(). Submitted by: Bruce Can MFC after: 1 month Modified: head/lib/libstand/gets.c Modified: head/lib/libstand/gets.c ============================================================================== --- head/lib/libstand/gets.c Tue Mar 31 12:51:49 2009 (r190592) +++ head/lib/libstand/gets.c Tue Mar 31 14:30:46 2009 (r190593) @@ -74,7 +74,7 @@ ngets(char *buf, int n) putchar('\n'); break; default: - if ((n < 1) || ((lp - buf) < n)) { + if ((n < 1) || ((lp - buf) < n - 1)) { *lp++ = c; putchar(c); } From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 17:52:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AD1F106564A; Tue, 31 Mar 2009 17:52:05 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7707F8FC08; Tue, 31 Mar 2009 17:52:05 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VHq5mZ006352; Tue, 31 Mar 2009 17:52:05 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VHq5ee006350; Tue, 31 Mar 2009 17:52:05 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200903311752.n2VHq5ee006350@svn.freebsd.org> From: Robert Noland Date: Tue, 31 Mar 2009 17:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190595 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 17:52:06 -0000 Author: rnoland Date: Tue Mar 31 17:52:05 2009 New Revision: 190595 URL: http://svn.freebsd.org/changeset/base/190595 Log: Simplify the radeon microcode loading. Submitted by: Christoph Mallon MFC after: 3 days Modified: head/sys/dev/drm/r600_cp.c head/sys/dev/drm/radeon_cp.c Modified: head/sys/dev/drm/r600_cp.c ============================================================================== --- head/sys/dev/drm/r600_cp.c Tue Mar 31 16:44:07 2009 (r190594) +++ head/sys/dev/drm/r600_cp.c Tue Mar 31 17:52:05 2009 (r190595) @@ -282,6 +282,8 @@ static void r600_vm_init(struct drm_devi /* load r600 microcode */ static void r600_cp_load_microcode(drm_radeon_private_t *dev_priv) { + const u32 (*cp)[3]; + const u32 *pfp; int i; r600_do_cp_stop(dev_priv); @@ -298,116 +300,60 @@ static void r600_cp_load_microcode(drm_r RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R600)) { - DRM_INFO("Loading R600 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - R600_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - R600_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - R600_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading R600 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, R600_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV610)) { - DRM_INFO("Loading RV610 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV610_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV610_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV610_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV610 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV610_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV630)) { - DRM_INFO("Loading RV630 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV630_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV630_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV630_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV630 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV630_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV620)) { - DRM_INFO("Loading RV620 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV620_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV620_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV620_cp_microcode[i][2]); - } - - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV620 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV620_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV635)) { - DRM_INFO("Loading RV635 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV635_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV635_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV635_cp_microcode[i][2]); - } + switch (dev_priv->flags & RADEON_FAMILY_MASK) { + case CHIP_R600: + DRM_INFO("Loading R600 Microcode\n"); + cp = R600_cp_microcode; + pfp = R600_pfp_microcode; + break; + case CHIP_RV610: + DRM_INFO("Loading RV610 Microcode\n"); + cp = RV610_cp_microcode; + pfp = RV610_pfp_microcode; + break; + case CHIP_RV630: + DRM_INFO("Loading RV630 Microcode\n"); + cp = RV630_cp_microcode; + pfp = RV630_pfp_microcode; + break; + case CHIP_RV620: + DRM_INFO("Loading RV620 Microcode\n"); + cp = RV620_cp_microcode; + pfp = RV620_pfp_microcode; + break; + case CHIP_RV635: + DRM_INFO("Loading RV635 Microcode\n"); + cp = RV635_cp_microcode; + pfp = RV635_pfp_microcode; + break; + case CHIP_RV670: + DRM_INFO("Loading RV670 Microcode\n"); + cp = RV670_cp_microcode; + pfp = RV670_pfp_microcode; + break; + case CHIP_RS780: + DRM_INFO("Loading RS780 Microcode\n"); + cp = RS780_cp_microcode; + pfp = RS780_pfp_microcode; + break; + default: + goto no_microcode; + } - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV635 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV635_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV670)) { - DRM_INFO("Loading RV670 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RV670_cp_microcode[i][2]); - } + for (i = 0; i != PM4_UCODE_SIZE; i++) { + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][0]); + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][1]); + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][2]); + } - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV670 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV670_pfp_microcode[i]); - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS780)) { - DRM_INFO("Loading RS780 CP Microcode\n"); - for (i = 0; i < PM4_UCODE_SIZE; i++) { - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RS780_cp_microcode[i][0]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RS780_cp_microcode[i][1]); - RADEON_WRITE(R600_CP_ME_RAM_DATA, - RS780_cp_microcode[i][2]); - } + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); + for (i = 0; i != PFP_UCODE_SIZE; i++) + RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); +no_microcode:; - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RS780 PFP Microcode\n"); - for (i = 0; i < PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RS780_pfp_microcode[i]); - } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_RADDR, 0); - } static void r700_vm_init(struct drm_device *dev) @@ -465,6 +411,8 @@ static void r700_vm_init(struct drm_devi /* load r600 microcode */ static void r700_cp_load_microcode(drm_radeon_private_t *dev_priv) { + const u32 *pfp; + const u32 *cp; int i; r600_do_cp_stop(dev_priv); @@ -479,51 +427,40 @@ static void r700_cp_load_microcode(drm_r DRM_UDELAY(15000); RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); + switch (dev_priv->flags & RADEON_FAMILY_MASK) { + case CHIP_RV770: + DRM_INFO("Loading RV770 Microcode\n"); + pfp = RV770_pfp_microcode; + cp = RV770_cp_microcode; + break; + case CHIP_RV730: + DRM_INFO("Loading RV730 Microcode\n"); + pfp = RV730_pfp_microcode; + cp = RV730_cp_microcode; + break; + case CHIP_RV710: + DRM_INFO("Loading RV710 Microcode\n"); + pfp = RV710_pfp_microcode; + cp = RV710_cp_microcode; + break; + default: + goto no_microcode; + } + + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); + for (i = 0; i != R700_PFP_UCODE_SIZE; i++) + RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV770)) { - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV770 PFP Microcode\n"); - for (i = 0; i < R700_PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV770_pfp_microcode[i]); - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - DRM_INFO("Loading RV770 CP Microcode\n"); - for (i = 0; i < R700_PM4_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_ME_RAM_DATA, RV770_cp_microcode[i]); - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV730)) { - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV730 PFP Microcode\n"); - for (i = 0; i < R700_PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV730_pfp_microcode[i]); - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - DRM_INFO("Loading RV730 CP Microcode\n"); - for (i = 0; i < R700_PM4_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_ME_RAM_DATA, RV730_cp_microcode[i]); - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV710)) { - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - DRM_INFO("Loading RV710 PFP Microcode\n"); - for (i = 0; i < R700_PFP_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_PFP_UCODE_DATA, RV710_pfp_microcode[i]); - RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - DRM_INFO("Loading RV710 CP Microcode\n"); - for (i = 0; i < R700_PM4_UCODE_SIZE; i++) - RADEON_WRITE(R600_CP_ME_RAM_DATA, RV710_cp_microcode[i]); - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); + RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); + for (i = 0; i != R700_PM4_UCODE_SIZE; i++) + RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i]); + RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); +no_microcode:; - } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_RADDR, 0); - } static void r600_test_writeback(drm_radeon_private_t *dev_priv) Modified: head/sys/dev/drm/radeon_cp.c ============================================================================== --- head/sys/dev/drm/radeon_cp.c Tue Mar 31 16:44:07 2009 (r190594) +++ head/sys/dev/drm/radeon_cp.c Tue Mar 31 17:52:05 2009 (r190595) @@ -455,88 +455,70 @@ static void radeon_init_pipes(drm_radeon /* Load the microcode for the CP */ static void radeon_cp_load_microcode(drm_radeon_private_t * dev_priv) { + const u32 (*cp)[2]; int i; + DRM_DEBUG("\n"); radeon_do_wait_for_idle(dev_priv); RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); - if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R100) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV100) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV200) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS100) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS200)) { + switch (dev_priv->flags & RADEON_FAMILY_MASK) { + case CHIP_R100: + case CHIP_RV100: + case CHIP_RV200: + case CHIP_RS100: + case CHIP_RS200: DRM_INFO("Loading R100 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R100_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R100_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R200) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV250) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV280) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS300)) { + cp = R100_cp_microcode; + break; + case CHIP_R200: + case CHIP_RV250: + case CHIP_RV280: + case CHIP_RS300: DRM_INFO("Loading R200 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R200_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R200_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R300) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R350) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV350) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV380) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS400) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS480)) { + cp = R200_cp_microcode; + break; + case CHIP_R300: + case CHIP_R350: + case CHIP_RV350: + case CHIP_RV380: + case CHIP_RS400: + case CHIP_RS480: DRM_INFO("Loading R300 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R300_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R300_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R420) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R423) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV410)) { + cp = R300_cp_microcode; + break; + case CHIP_R420: + case CHIP_R423: + case CHIP_RV410: DRM_INFO("Loading R400 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R420_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R420_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS740)) { + cp = R420_cp_microcode; + break; + case CHIP_RS690: + case CHIP_RS740: DRM_INFO("Loading RS690/RS740 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - RS690_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - RS690_cp_microcode[i][0]); - } - } else if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS600) { + cp = RS690_cp_microcode; + break; + case CHIP_RS600: DRM_INFO("Loading RS600 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - RS600_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - RS600_cp_microcode[i][0]); - } - } else if (((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV515) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R520) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV530) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_R580) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV560) || - ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RV570)) { + cp = RS600_cp_microcode; + break; + case CHIP_RV515: + case CHIP_R520: + case CHIP_RV530: + case CHIP_R580: + case CHIP_RV560: + case CHIP_RV570: DRM_INFO("Loading R500 Microcode\n"); - for (i = 0; i < 256; i++) { - RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, - R520_cp_microcode[i][1]); - RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, - R520_cp_microcode[i][0]); - } + cp = R520_cp_microcode; + break; + default: + return; + } + + for (i = 0; i != 256; i++) { + RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, cp[i][1]); + RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, cp[i][0]); } } From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 18:25:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CB5A1065695; Tue, 31 Mar 2009 18:25:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 689E08FC20; Tue, 31 Mar 2009 18:25:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VIP912007066; Tue, 31 Mar 2009 18:25:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VIP9ir007065; Tue, 31 Mar 2009 18:25:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903311825.n2VIP9ir007065@svn.freebsd.org> From: Warner Losh Date: Tue, 31 Mar 2009 18:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190596 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 18:25:11 -0000 Author: imp Date: Tue Mar 31 18:25:09 2009 New Revision: 190596 URL: http://svn.freebsd.org/changeset/base/190596 Log: o Minor tweaks to the AX88x90 probe routine, mostly related to comments. o Don't run through the register initialization in the read mac routine for the AX88x90. It duplicates other stuff that we do. o Eliminate the 10ms delay after we reset the AX88x90. We already wait for the appropriate bits to indicate reset is done. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 17:52:05 2009 (r190595) +++ head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 18:25:09 2009 (r190596) @@ -730,10 +730,10 @@ ed_pccard_ax88x90_reset(struct ed_softc ed_nic_outb(sc, ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0); ed_asic_outb(sc, ED_NOVELL_RESET, ed_asic_inb(sc, ED_NOVELL_RESET)); - /* Wait for the interrupt to fire */ - for (i = 10000; i > 0; i--) - if (ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) - break; + /* Wait for the RST bit to assert, but cap it at 10ms */ + for (i = 10000; !(ed_nic_inb(sc, ED_P0_ISR) & ED_ISR_RST) && i > 0; + i--) + continue; ed_nic_outb(sc, ED_P0_ISR, ED_ISR_RST); /* ACK INTR */ if (i == 0) device_printf(sc->dev, "Reset didn't finish\n"); @@ -751,7 +751,6 @@ ed_probe_ax88x90_generic(device_t dev, i char test_buffer[32]; ed_pccard_ax88x90_reset(sc); - DELAY(10 * 1000); /* Make sure that we really have an 8390 based board */ if (!ed_probe_generic8390(sc)) @@ -762,42 +761,35 @@ ed_probe_ax88x90_generic(device_t dev, i sc->cr_proto = ED_CR_RD2; /* - * Test the ability to read and write to the NIC memory. - */ - - /* * This prevents packets from being stored in the NIC memory when the - * readmem routine turns on the start bit in the CR. + * readmem routine turns on the start bit in the CR. We write some + * bytes in word mode and verify we can read them back. If we can't + * then we don't have an AX88x90 chip here. */ ed_nic_outb(sc, ED_P0_RCR, ED_RCR_MON); - - /* Temporarily initialize DCR for byte operations */ - ed_nic_outb(sc, ED_P0_DCR, ED_DCR_FT1 | ED_DCR_LS); sc->isa16bit = 1; ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); ed_nic_outb(sc, ED_P0_PSTART, 16384 / ED_PAGE_SIZE); ed_nic_outb(sc, ED_P0_PSTOP, 32768 / ED_PAGE_SIZE); - /* - * Write a test pattern in word mode. If this also fails, then - * we don't know what this board is. - */ ed_pio_writemem(sc, test_pattern, 16384, sizeof(test_pattern)); ed_pio_readmem(sc, 16384, test_buffer, sizeof(test_pattern)); if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) != 0) return (ENXIO); + + /* + * Hard code values based on the datasheet. We're NE-2000 compatible + * NIC with 16kb of packet memory starting at 16k offset. We assume + * that the writes to ED_P0_START and ED_P0_STOP reflect the values + * below. + */ sc->type = ED_TYPE_NE2000; if (ed_asic_inb(sc, ED_AX88X90_TEST) != 0) sc->chip_type = ED_CHIP_TYPE_AX88790; else sc->chip_type = ED_CHIP_TYPE_AX88190; - - /* 8k of memory plus an additional 8k if 16bit */ - memsize = 8192 + sc->isa16bit * 8192; + memsize = 16 * 1024; sc->mem_size = memsize; - - /* NIC memory doesn't start at zero on an NE board */ - /* The start address is tied to the bus width */ - sc->mem_start = 8192 + sc->isa16bit * 8192; + sc->mem_start = 16 * 1024; sc->mem_end = sc->mem_start + memsize; sc->tx_page_start = memsize / ED_PAGE_SIZE; sc->txb_cnt = 2; @@ -815,30 +807,7 @@ static int ed_pccard_ax88x90_enaddr(struct ed_softc *sc) { int i, j; - struct { - unsigned char offset, value; - } pg_seq[] = { - /* Select Page0 */ - {ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0}, - {ED_P0_DCR, 0x01}, - {ED_P0_RBCR0, 0x00}, /* Clear the count regs. */ - {ED_P0_RBCR1, 0x00}, - {ED_P0_IMR, 0x00}, /* Mask completion irq. */ - {ED_P0_ISR, 0xff}, - {ED_P0_RCR, ED_RCR_MON | ED_RCR_INTT}, /* Set To Monitor */ - {ED_P0_TCR, ED_TCR_LB0}, /* loopback mode. */ - {ED_P0_RBCR0, 0x20}, - {ED_P0_RBCR1, 0x00}, - {ED_P0_RSAR0, 0x00}, - {ED_P0_RSAR1, 0x04}, - {ED_P0_CR, ED_CR_RD0 | ED_CR_STA | ED_CR_PAGE_0}, - }; - - /* Card Settings */ - for (i = 0; i < sizeof(pg_seq) / sizeof(pg_seq[0]); i++) - ed_nic_outb(sc, pg_seq[i].offset, pg_seq[i].value); - - /* Get Data */ + /* Get MAC address */ for (i = 0; i < ETHER_ADDR_LEN; i += 2) { j = ed_asic_inw(sc, 0); sc->enaddr[i] = j & 0xff; From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 19:20:04 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 600151065675; Tue, 31 Mar 2009 19:20:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D4638FC1C; Tue, 31 Mar 2009 19:20:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VJK4Xq008065; Tue, 31 Mar 2009 19:20:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VJK4Wu008064; Tue, 31 Mar 2009 19:20:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903311920.n2VJK4Wu008064@svn.freebsd.org> From: Warner Losh Date: Tue, 31 Mar 2009 19:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190597 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 19:20:04 -0000 Author: imp Date: Tue Mar 31 19:20:03 2009 New Revision: 190597 URL: http://svn.freebsd.org/changeset/base/190597 Log: It turns out that the initialization is required since it sets up the readout of the MAC address. The 10ms delay was really needed. Ooops. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 18:25:09 2009 (r190596) +++ head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 19:20:03 2009 (r190597) @@ -751,6 +751,7 @@ ed_probe_ax88x90_generic(device_t dev, i char test_buffer[32]; ed_pccard_ax88x90_reset(sc); + DELAY(10*1000); /* Make sure that we really have an 8390 based board */ if (!ed_probe_generic8390(sc)) @@ -807,6 +808,29 @@ static int ed_pccard_ax88x90_enaddr(struct ed_softc *sc) { int i, j; + struct { + unsigned char offset, value; + } pg_seq[] = { + /* Select Page0 */ + {ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0}, + {ED_P0_DCR, ED_DCR_WTS}, /* Word access to SRAM */ + {ED_P0_RBCR0, 0x00}, /* Clear the count regs. */ + {ED_P0_RBCR1, 0x00}, + {ED_P0_IMR, 0x00}, /* Mask completion irq. */ + {ED_P0_ISR, 0xff}, /* ACK them all */ + {ED_P0_RCR, ED_RCR_MON | ED_RCR_INTT}, /* Set To Monitor */ + {ED_P0_TCR, ED_TCR_LB0}, /* loopback mode. */ + {ED_P0_RBCR0, 0x20}, /* 32byte DMA */ + {ED_P0_RBCR1, 0x00}, + {ED_P0_RSAR0, 0x00}, /* Read address is 0x0400 */ + {ED_P0_RSAR1, 0x04}, /* for MAC ADDR */ + {ED_P0_CR, ED_CR_RD0 | ED_CR_STA | ED_CR_PAGE_0}, + }; + + /* Card Settings */ + for (i = 0; i < sizeof(pg_seq) / sizeof(pg_seq[0]); i++) + ed_nic_outb(sc, pg_seq[i].offset, pg_seq[i].value); + /* Get MAC address */ for (i = 0; i < ETHER_ADDR_LEN; i += 2) { j = ed_asic_inw(sc, 0); From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 19:23:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E34AB1065687; Tue, 31 Mar 2009 19:23:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B264E8FC19; Tue, 31 Mar 2009 19:23:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VJNxiP008171; Tue, 31 Mar 2009 19:23:59 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VJNxXm008170; Tue, 31 Mar 2009 19:23:59 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200903311923.n2VJNxXm008170@svn.freebsd.org> From: Warner Losh Date: Tue, 31 Mar 2009 19:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190598 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 19:24:00 -0000 Author: imp Date: Tue Mar 31 19:23:59 2009 New Revision: 190598 URL: http://svn.freebsd.org/changeset/base/190598 Log: Add additional data on the MIIBUS WTF that I committed earlier. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 19:20:03 2009 (r190597) +++ head/sys/dev/ed/if_ed_pccard.c Tue Mar 31 19:23:59 2009 (r190598) @@ -1098,6 +1098,10 @@ ed_miibus_readreg(device_t dev, int phy, * Also, PHYs above 16 appear to be phantoms on some cards, but not * others. Registers read for this are often the same as prior values * read. Filter all register requests to 17-31. + * + * I can't explain it, since I don't have the DL100xx data sheets, but + * the DL100xx chips do 13-bits before the 'ACK' but, but the AX88x90 + * chips have 14. The linux pcnet and axnet drivers confirm this. */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { if (phy > 0x10) From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 21:02:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D4FE1065674; Tue, 31 Mar 2009 21:02:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8588FC1B; Tue, 31 Mar 2009 21:02:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VL2tKc010043; Tue, 31 Mar 2009 21:02:55 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VL2t5f010040; Tue, 31 Mar 2009 21:02:55 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903312102.n2VL2t5f010040@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 31 Mar 2009 21:02:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190599 - in head/sys: amd64/amd64 boot/i386/libi386 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 21:02:56 -0000 Author: jkim Date: Tue Mar 31 21:02:55 2009 New Revision: 190599 URL: http://svn.freebsd.org/changeset/base/190599 Log: Probe size of installed memory modules from loader and display it as 'real memory' instead of Maxmem if the value is available. Note amd64 displayed physmem as 'usable memory' since machdep.c r1.640 to unconfuse users. Now it is consistent across amd64 and i386 again. While I am here, clean up smbios.c a bit and update copyright date. Reviewed by: jhb Modified: head/sys/amd64/amd64/machdep.c head/sys/boot/i386/libi386/smbios.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 31 19:23:59 2009 (r190598) +++ head/sys/amd64/amd64/machdep.c Tue Mar 31 21:02:55 2009 (r190599) @@ -196,6 +196,7 @@ static void cpu_startup(dummy) void *dummy; { + uintmax_t memsize; char *sysenv; /* @@ -226,8 +227,17 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("usable memory = %ju (%ju MB)\n", ptoa((uintmax_t)physmem), - ptoa((uintmax_t)physmem) / 1048576); + sysenv = getenv("smbios.memory.enabled"); + if (sysenv != NULL) { + memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10); + freeenv(sysenv); + } + if (memsize > 0) + printf("real memory = %ju (%ju MB)\n", memsize << 10, + memsize >> 10); + else + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), + ptoa((uintmax_t)Maxmem) / 1048576); realmem = Maxmem; /* * Display any holes after the first chunk of extended memory. @@ -250,7 +260,7 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); - printf("avail memory = %ju (%ju MB)\n", + printf("avail memory = %ju (%ju MB)\n", ptoa((uintmax_t)cnt.v_free_count), ptoa((uintmax_t)cnt.v_free_count) / 1048576); Modified: head/sys/boot/i386/libi386/smbios.c ============================================================================== --- head/sys/boot/i386/libi386/smbios.c Tue Mar 31 19:23:59 2009 (r190598) +++ head/sys/boot/i386/libi386/smbios.c Tue Mar 31 21:02:55 2009 (r190599) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005, 2006 Jung-uk Kim + * Copyright (c) 2005-2009 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #define SMBIOS_SIG "_SM_" #define SMBIOS_DMI_SIG "_DMI_" +static uint32_t smbios_enabled_memory = 0; +static uint32_t smbios_old_enabled_memory = 0; static uint8_t smbios_enabled_sockets = 0; static uint8_t smbios_populated_sockets = 0; @@ -89,16 +91,27 @@ smbios_detect(void) for (dmi = addr = PTOV(paddr), i = 0; dmi - addr < length && i < count; i++) dmi = smbios_parse_table(dmi); - sprintf(buf, "%d", smbios_enabled_sockets); - setenv("smbios.socket.enabled", buf, 1); - sprintf(buf, "%d", smbios_populated_sockets); - setenv("smbios.socket.populated", buf, 1); + if (smbios_enabled_memory > 0 || smbios_old_enabled_memory > 0) { + sprintf(buf, "%u", smbios_enabled_memory > 0 ? + smbios_enabled_memory : smbios_old_enabled_memory); + setenv("smbios.memory.enabled", buf, 1); + } + if (smbios_enabled_sockets > 0) { + sprintf(buf, "%u", smbios_enabled_sockets); + setenv("smbios.socket.enabled", buf, 1); + } + if (smbios_populated_sockets > 0) { + sprintf(buf, "%u", smbios_populated_sockets); + setenv("smbios.socket.populated", buf, 1); + } } static uint8_t * smbios_parse_table(const uint8_t *dmi) { uint8_t *dp; + uint16_t size; + uint8_t osize; switch(dmi[0]) { case 0: /* Type 0: BIOS */ @@ -159,10 +172,43 @@ smbios_parse_table(const uint8_t *dmi) smbios_populated_sockets++; break; + case 6: /* Type 6: Memory Module Information (Obsolete) */ + /* + * Offset 0Ah: Enabled Size + * + * Bit 7 Bank connection + * 1 - Double-bank connection + * 0 - Single-bank connection + * Bit 6:0 Size (n), where 2**n is the size in MB + * 7Dh - Not determinable (Installed Size only) + * 7Eh - Module is installed, but no memory + * has been enabled + * 7Fh - Not installed + */ + osize = dmi[0x0a] & 0x7f; + if (osize > 0 && osize < 22) + smbios_old_enabled_memory += (1U << (osize + 10)); + break; + + case 17: /* Type 17: Memory Device */ + /* + * Offset 0Ch: Size + * + * Bit 15 Granularity + * 1 - Value is in kilobytes units + * 0 - Value is in megabytes units + * Bit 14:0 Size + */ + size = *(uint16_t *)(dmi + 0x0c); + if (size != 0 && size != 0xffff) + smbios_enabled_memory += (size & 0x8000) != 0 ? + (size & 0x7fff) : ((uint32_t)size << 10); + break; + default: /* skip other types */ break; } - + /* find structure terminator */ dp = __DECONST(uint8_t *, dmi + dmi[1]); while (dp[0] != 0 || dp[1] != 0) Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Mar 31 19:23:59 2009 (r190598) +++ head/sys/i386/i386/machdep.c Tue Mar 31 21:02:55 2009 (r190599) @@ -243,6 +243,7 @@ static void cpu_startup(dummy) void *dummy; { + uintmax_t memsize; char *sysenv; /* @@ -273,8 +274,17 @@ cpu_startup(dummy) #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), - ptoa((uintmax_t)Maxmem) / 1048576); + sysenv = getenv("smbios.memory.enabled"); + if (sysenv != NULL) { + memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10); + freeenv(sysenv); + } + if (memsize > 0) + printf("real memory = %ju (%ju MB)\n", memsize << 10, + memsize >> 10); + else + printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem), + ptoa((uintmax_t)Maxmem) / 1048576); realmem = Maxmem; /* * Display any holes after the first chunk of extended memory. From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 21:14:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65ED91065672; Tue, 31 Mar 2009 21:14:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B798FC22; Tue, 31 Mar 2009 21:14:06 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VLE6KM010304; Tue, 31 Mar 2009 21:14:06 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VLE5SX010302; Tue, 31 Mar 2009 21:14:05 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200903312114.n2VLE5SX010302@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 31 Mar 2009 21:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190600 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 21:14:06 -0000 Author: jkim Date: Tue Mar 31 21:14:05 2009 New Revision: 190600 URL: http://svn.freebsd.org/changeset/base/190600 Log: Fix an uninitialized variable from the previous commit. Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Mar 31 21:02:55 2009 (r190599) +++ head/sys/amd64/amd64/machdep.c Tue Mar 31 21:14:05 2009 (r190600) @@ -231,7 +231,8 @@ cpu_startup(dummy) if (sysenv != NULL) { memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10); freeenv(sysenv); - } + } else + memsize = 0; if (memsize > 0) printf("real memory = %ju (%ju MB)\n", memsize << 10, memsize >> 10); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Mar 31 21:02:55 2009 (r190599) +++ head/sys/i386/i386/machdep.c Tue Mar 31 21:14:05 2009 (r190600) @@ -278,7 +278,8 @@ cpu_startup(dummy) if (sysenv != NULL) { memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10); freeenv(sysenv); - } + } else + memsize = 0; if (memsize > 0) printf("real memory = %ju (%ju MB)\n", memsize << 10, memsize >> 10); From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 23:02:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 737DB106564A; Tue, 31 Mar 2009 23:02:51 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 620118FC15; Tue, 31 Mar 2009 23:02:51 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VN2pAh012360; Tue, 31 Mar 2009 23:02:51 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VN2pdE012359; Tue, 31 Mar 2009 23:02:51 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200903312302.n2VN2pdE012359@svn.freebsd.org> From: Olivier Houchard Date: Tue, 31 Mar 2009 23:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190601 - head/libexec/bootpd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 23:02:52 -0000 Author: cognet Date: Tue Mar 31 23:02:51 2009 New Revision: 190601 URL: http://svn.freebsd.org/changeset/base/190601 Log: Use RTF_LLDATA. Modified: head/libexec/bootpd/rtmsg.c Modified: head/libexec/bootpd/rtmsg.c ============================================================================== --- head/libexec/bootpd/rtmsg.c Tue Mar 31 21:14:05 2009 (r190600) +++ head/libexec/bootpd/rtmsg.c Tue Mar 31 23:02:51 2009 (r190601) @@ -208,7 +208,7 @@ static int rtmsg(cmd) rtm->rtm_addrs |= RTA_GATEWAY; rtm->rtm_rmx.rmx_expire = expire_time; rtm->rtm_inits = RTV_EXPIRE; - rtm->rtm_flags |= (RTF_HOST | RTF_STATIC); + rtm->rtm_flags |= (RTF_HOST | RTF_STATIC | RTF_LLDATA); sin_m.sin_other = 0; if (doing_proxy) { if (export_only) From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 23:06:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E3A1065673; Tue, 31 Mar 2009 23:06:20 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65E418FC24; Tue, 31 Mar 2009 23:06:20 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VN6KB8012460; Tue, 31 Mar 2009 23:06:20 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VN6KBd012459; Tue, 31 Mar 2009 23:06:20 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200903312306.n2VN6KBd012459@svn.freebsd.org> From: Olivier Houchard Date: Tue, 31 Mar 2009 23:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190602 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 23:06:20 -0000 Author: cognet Date: Tue Mar 31 23:06:20 2009 New Revision: 190602 URL: http://svn.freebsd.org/changeset/base/190602 Log: Use Oxf0000000 instead of 0xff000000 to guess the physical address, relative to the virtual one. I may had a reason at some point to use the later, but can't remember which, and it can leads to issues. Reported by: Guillaume Ballet Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Tue Mar 31 23:02:51 2009 (r190601) +++ head/sys/arm/arm/locore.S Tue Mar 31 23:06:20 2009 (r190602) @@ -110,7 +110,7 @@ from_ram: nop #endif adr r7, Lunmapped - bic r7, r7, #0xff000000 + bic r7, r7, #0xf0000000 orr r7, r7, #PHYSADDR @@ -144,7 +144,7 @@ Lunmapped: ldmia r4!, {r1,r2,r3} /* # of sections, VA, PA|attr */ cmp r1, #0 adrne r5, 2b - bicne r5, r5, #0xff000000 + bicne r5, r5, #0xf0000000 orrne r5, r5, #PHYSADDR movne pc, r5 From owner-svn-src-head@FreeBSD.ORG Tue Mar 31 23:47:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7966A106566C; Tue, 31 Mar 2009 23:47:18 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67C308FC14; Tue, 31 Mar 2009 23:47:18 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2VNlIph013221; Tue, 31 Mar 2009 23:47:18 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2VNlIZk013220; Tue, 31 Mar 2009 23:47:18 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <200903312347.n2VNlIZk013220@svn.freebsd.org> From: Olivier Houchard Date: Tue, 31 Mar 2009 23:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190603 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Mar 2009 23:47:18 -0000 Author: cognet Date: Tue Mar 31 23:47:18 2009 New Revision: 190603 URL: http://svn.freebsd.org/changeset/base/190603 Log: Fix the userland, RAS, version of atomic_fetchadd_32 : return the correct value, and do not store the wrong one in the supplied pointer. Submitted by: Mark Tinguely Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Tue Mar 31 23:06:20 2009 (r190602) +++ head/sys/arm/include/atomic.h Tue Mar 31 23:47:18 2009 (r190603) @@ -264,22 +264,23 @@ atomic_clear_32(volatile uint32_t *addre static __inline uint32_t atomic_fetchadd_32(volatile uint32_t *p, uint32_t v) { - uint32_t start, ras_start = ARM_RAS_START; + uint32_t start, tmp, ras_start = ARM_RAS_START; __asm __volatile("1:\n" "adr %1, 1b\n" "str %1, [%0]\n" "adr %1, 2f\n" "str %1, [%0, #4]\n" - "ldr %1, [%2]\n" - "add %1, %1, %3\n" - "str %0, [%2]\n" + "ldr %1, [%3]\n" + "mov %2, %1\n" + "add %2, %2, %4\n" + "str %2, [%3]\n" "2:\n" - "mov %3, #0\n" - "str %3, [%0]\n" - "mov %3, #0xffffffff\n" - "str %3, [%0, #4]\n" - : "+r" (ras_start), "=r" (start), "+r" (p), "+r" (v) + "mov %2, #0\n" + "str %2, [%0]\n" + "mov %2, #0xffffffff\n" + "str %2, [%0, #4]\n" + : "+r" (ras_start), "=r" (start), "=r" (tmp), "+r" (p), "+r" (v) : : "memory"); return (start); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 04:36:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581FE1065676; Wed, 1 Apr 2009 04:36:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 467758FC2A; Wed, 1 Apr 2009 04:36:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n314abK0018865; Wed, 1 Apr 2009 04:36:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n314abx2018864; Wed, 1 Apr 2009 04:36:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200904010436.n314abx2018864@svn.freebsd.org> From: Alan Cox Date: Wed, 1 Apr 2009 04:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190604 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 04:36:38 -0000 Author: alc Date: Wed Apr 1 04:36:37 2009 New Revision: 190604 URL: http://svn.freebsd.org/changeset/base/190604 Log: Eliminate dead code. Reviewed by: jhb Modified: head/sys/vm/vm_extern.h Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Tue Mar 31 23:47:18 2009 (r190603) +++ head/sys/vm/vm_extern.h Wed Apr 1 04:36:37 2009 (r190604) @@ -42,19 +42,6 @@ struct vnode; #ifdef _KERNEL -#ifdef TYPEDEF_FOR_UAP -int getpagesize(struct thread *, void *, int *); -int madvise(struct thread *, void *, int *); -int mincore(struct thread *, void *, int *); -int mprotect(struct thread *, void *, int *); -int msync(struct thread *, void *, int *); -int munmap(struct thread *, void *, int *); -int obreak(struct thread *, void *, int *); -int sbrk(struct thread *, void *, int *); -int sstk(struct thread *, void *, int *); -int swapon(struct thread *, void *, int *); -#endif /* TYPEDEF_FOR_UAP */ - int kernacc(void *, int, int); vm_offset_t kmem_alloc(vm_map_t, vm_size_t); vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t); From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 04:51:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B238106566B for ; Wed, 1 Apr 2009 04:51:09 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id E753A8FC14 for ; Wed, 1 Apr 2009 04:51:08 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 238BC1CC50; Wed, 1 Apr 2009 06:52:45 +0200 (CEST) Resent-From: ed@80386.nl Resent-Date: Wed, 1 Apr 2009 06:52:45 +0200 Resent-Message-ID: <20090401045245.GA13393@hoeg.nl> Resent-To: svn-src-head@freebsd.org Date: Wed, 1 Apr 2009 06:47:38 +0200 From: Ed Schouten To: src-committers@freebsd.org, svn-src-user@freebsd.org Message-ID: <20090401044738.GB1258@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: Subject: svn commit: r190605 - head: . contrib/gcc gnu/lib/csu gnu/lib/libg2c gnu/lib/libgcc gnu/lib/libgcov gnu/lib/go... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 04:51:10 -0000 Author: ed Date: Wed Apr 1 04:45:12 2009 New Revision: 190605 URL: http://svn.freebsd.org/changeset/base/190605 Log: Remove GCC in preparation of the Clang import. Approved by: core Tested by: rdivacky, db, brooks Deleted: head/contrib/gcc/ head/gnu/lib/csu/ head/gnu/lib/libg2c/ head/gnu/lib/libgcc/ head/gnu/lib/libgcov/ head/gnu/lib/libgomp/ head/gnu/lib/libobjc/ head/gnu/lib/libstdc++/ head/gnu/usr.bin/cc/ head/gnu/usr.bin/cc/ Modified: head/Makefile.inc1 head/share/mk/bsd.cpu.mk head/share/mk/bsd.libnames.mk head/share/mk/bsd.sys.mk Modified: Makefile.inc1 =================================================================== --- Makefile.inc1 (revision 190604) +++ Makefile.inc1 (revision 190605) @@ -1051,14 +1051,9 @@ ${MAKE} -f Makefile.inc1 _prebuild_libs; \ ${MAKE} -f Makefile.inc1 _generic_libs; -# -# static libgcc.a prerequisite for shared libc -# -_prereq_libs= gnu/lib/libgcc - # These dependencies are not automatically generated: # -# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before +# gnu/lib/csu, lib/csu and lib/libc must be built before # all shared libraries for ELF. # _startup_libs= gnu/lib/csu @@ -1067,11 +1062,8 @@ .else _startup_libs+= lib/csu/${MACHINE_ARCH} .endif -_startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libc -gnu/lib/libgcc__L: lib/libc__L - _prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \ ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libroken} \ ${_kerberos5_lib_libheimntlm} ${_kerberos5_lib_libgssapi_krb5} \ Modified: share/mk/bsd.cpu.mk =================================================================== --- share/mk/bsd.cpu.mk (revision 190604) +++ share/mk/bsd.cpu.mk (revision 190605) @@ -60,83 +60,6 @@ . endif . endif -############################################################################### -# Logic to set up correct gcc optimization flag. This must be included -# after /etc/make.conf so it can react to the local value of CPUTYPE -# defined therein. Consult: -# http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/IA_002d64-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html -# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html - -. if ${MACHINE_ARCH} == "i386" -. if ${CPUTYPE} == "crusoe" -_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -. elif ${CPUTYPE} == "k5" -_CPUCFLAGS = -march=pentium -. else -_CPUCFLAGS = -march=${CPUTYPE} -. endif # GCC on 'i386' -. if ${CPUTYPE} == "crusoe" -_ICC_CPUCFLAGS = -tpp6 -xiM -. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ - ${CPUTYPE} == "athlon-4" -_ICC_CPUCFLAGS = -tpp6 -xiMK -. elif ${CPUTYPE} == "athlon-tbird" || ${CPUTYPE} == "athlon" -_ICC_CPUCFLAGS = -tpp6 -xiM -. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "k6" -_ICC_CPUCFLAGS = -tpp6 -xi -. elif ${CPUTYPE} == "k5" -_ICC_CPUCFLAGS = -tpp5 -. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" -_ICC_CPUCFLAGS = -tpp7 -xiMKW -. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m" || \ - ${CPUTYPE} == "pentium-m" -_ICC_CPUCFLAGS = -tpp6 -xiMK -. elif ${CPUTYPE} == "pentium2" || ${CPUTYPE} == "pentiumpro" -_ICC_CPUCFLAGS = -tpp6 -xiM -. elif ${CPUTYPE} == "pentium-mmx" -_ICC_CPUCFLAGS = -tpp5 -xM -. elif ${CPUTYPE} == "pentium" -_ICC_CPUCFLAGS = -tpp5 -. else -_ICC_CPUCFLAGS = -. endif # ICC on 'i386' -. elif ${MACHINE_ARCH} == "amd64" -_CPUCFLAGS = -march=${CPUTYPE} -. elif ${MACHINE_ARCH} == "arm" -. if ${CPUTYPE} == "xscale" -#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself -#_CPUCFLAGS = -mcpu=xscale -_CPUCFLAGS = -march=armv5te -D__XSCALE__ -. else -_CPUCFLAGS = -mcpu=${CPUTYPE} -. endif -. elif ${MACHINE_ARCH} == "powerpc" -. if ${CPUTYPE} == "e500" -MACHINE_CPU = booke -_CPUCFLAGS = -Wa,-me500 -msoft-float -. else -_CPUCFLAGS = -mcpu=${CPUTYPE} -. endif -. elif ${MACHINE_ARCH} == "mips" -. if ${CPUTYPE} == "mips32" -_CPUCFLAGS = -march=mips32 -. elif ${CPUTYPE} == "mips32r2" -_CPUCFLAGS = -march=mips32r2 -. elif ${CPUTYPE} == "mips64" -_CPUCFLAGS = -march=mips64 -. elif ${CPUTYPE} == "mips64r2" -_CPUCFLAGS = -march=mips64r2 -. elif ${CPUTYPE} == "mips4kc" -_CPUCFLAGS = -march=4kc -. elif ${CPUTYPE} == "mips24kc" -_CPUCFLAGS = -march=24kc -. endif -. endif - # Set up the list of CPU features based on the CPU type. This is an # unordered list to make it easy for client makefiles to test for the # presence of a CPU feature. Modified: share/mk/bsd.libnames.mk =================================================================== --- share/mk/bsd.libnames.mk (revision 190604) +++ share/mk/bsd.libnames.mk (revision 190605) @@ -50,8 +50,6 @@ LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBFTPIO?= ${DESTDIR}${LIBDIR}/libftpio.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a -LIBGCC?= ${DESTDIR}${LIBDIR}/libgcc.a -LIBGCC_PIC?= ${DESTDIR}${LIBDIR}/libgcc_pic.a LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a Modified: share/mk/bsd.sys.mk =================================================================== --- share/mk/bsd.sys.mk (revision 190604) +++ share/mk/bsd.sys.mk (revision 190605) @@ -4,9 +4,9 @@ # sources. # Enable various levels of compiler warning checks. These may be -# overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS. +# overridden by defining NO_WARNS. -# for GCC: http://gcc.gnu.org/onlinedocs/gcc-3.0.4/gcc_3.html#IDX143 +# for LLVM: http://llvm.org/docs/ProgrammersManual.html # the default is gnu99 for now CSTD ?= gnu99 From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 07:13:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF425106566B; Wed, 1 Apr 2009 07:13:22 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E0858FC14; Wed, 1 Apr 2009 07:13:22 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n317DLuw022135; Wed, 1 Apr 2009 07:13:21 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n317DLPr022134; Wed, 1 Apr 2009 07:13:21 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010713.n317DLPr022134@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 07:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190608 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 07:13:23 -0000 Author: trhodes Date: Wed Apr 1 07:13:21 2009 New Revision: 190608 URL: http://svn.freebsd.org/changeset/base/190608 Log: Remove KSE bits, cross reference libthr.3. PR: 132392 Submitted by: Niclas Zeising (original version) Modified: head/share/man/man3/pthread.3 Modified: head/share/man/man3/pthread.3 ============================================================================== --- head/share/man/man3/pthread.3 Wed Apr 1 06:18:51 2009 (r190607) +++ head/share/man/man3/pthread.3 Wed Apr 1 07:13:21 2009 (r190608) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2007 +.Dd April 1, 2009 .Dt PTHREAD 3 .Os .Sh NAME @@ -469,15 +469,15 @@ cancellation stack. .Sh IMPLEMENTATION NOTES The current .Fx -POSIX thread implementation is built in two libraries, +POSIX thread implementation is built into the .Lb libthr , -and -.Lb libkse . -They contain both thread-safe versions of +library. +It contains thread-safe versions of .Lb libc functions and the thread functions. -Threaded applications are linked with one of these libraries. +Threaded applications are linked with this library. .Sh SEE ALSO +.Xr libthr 3 , .Xr pthread_atfork 3 , .Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 08:08:26 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB900106566C; Wed, 1 Apr 2009 08:08:26 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA1B68FC25; Wed, 1 Apr 2009 08:08:25 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3188Pbh023130; Wed, 1 Apr 2009 08:08:25 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3188PvJ023129; Wed, 1 Apr 2009 08:08:25 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010808.n3188PvJ023129@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 08:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190609 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 08:08:27 -0000 Author: trhodes Date: Wed Apr 1 08:08:25 2009 New Revision: 190609 URL: http://svn.freebsd.org/changeset/base/190609 Log: On second thought, remove the comma too. Modified: head/share/man/man3/pthread.3 Modified: head/share/man/man3/pthread.3 ============================================================================== --- head/share/man/man3/pthread.3 Wed Apr 1 07:13:21 2009 (r190608) +++ head/share/man/man3/pthread.3 Wed Apr 1 08:08:25 2009 (r190609) @@ -470,7 +470,7 @@ cancellation stack. The current .Fx POSIX thread implementation is built into the -.Lb libthr , +.Lb libthr library. It contains thread-safe versions of .Lb libc From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 08:33:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1B9E106566C; Wed, 1 Apr 2009 08:33:54 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903DD8FC17; Wed, 1 Apr 2009 08:33:54 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n318XsjO023815; Wed, 1 Apr 2009 08:33:54 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n318Xswe023813; Wed, 1 Apr 2009 08:33:54 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010833.n318Xswe023813@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 08:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190610 - in head: usr.bin/cut usr.sbin/chown X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 08:33:55 -0000 Author: trhodes Date: Wed Apr 1 08:33:54 2009 New Revision: 190610 URL: http://svn.freebsd.org/changeset/base/190610 Log: Fix punctuation. PR: 132834 Submitted by: "Alan R. S. Bueno" Modified: head/usr.bin/cut/cut.1 head/usr.sbin/chown/chgrp.1 Modified: head/usr.bin/cut/cut.1 ============================================================================== --- head/usr.bin/cut/cut.1 Wed Apr 1 08:08:25 2009 (r190609) +++ head/usr.bin/cut/cut.1 Wed Apr 1 08:33:54 2009 (r190610) @@ -112,7 +112,7 @@ The specifies fields, separated in the input by the field delimiter character (see the .Fl d -option.) +option). Output fields are separated by a single occurrence of the field delimiter character. .It Fl n Modified: head/usr.sbin/chown/chgrp.1 ============================================================================== --- head/usr.sbin/chown/chgrp.1 Wed Apr 1 08:08:25 2009 (r190609) +++ head/usr.sbin/chown/chgrp.1 Wed Apr 1 08:33:54 2009 (r190610) @@ -61,7 +61,7 @@ The following options are available: If the .Fl R option is specified, symbolic links on the command line are followed. -(Symbolic links encountered in the tree traversal are not followed). +(Symbolic links encountered in the tree traversal are not followed.) .It Fl L If the .Fl R From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 09:22:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F7B2106564A; Wed, 1 Apr 2009 09:22:25 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8AF8FC19; Wed, 1 Apr 2009 09:22:25 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n319MP0W024823; Wed, 1 Apr 2009 09:22:25 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n319MP0Z024822; Wed, 1 Apr 2009 09:22:25 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010922.n319MP0Z024822@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 09:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190611 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 09:22:26 -0000 Author: trhodes Date: Wed Apr 1 09:22:25 2009 New Revision: 190611 URL: http://svn.freebsd.org/changeset/base/190611 Log: Remove the fla.4 manual page, the driver was nuked over four years ago. Noticed by: rene Prodded by: brueffer Deleted: head/share/man/man4/fla.4 Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Wed Apr 1 08:33:54 2009 (r190610) +++ head/share/man/man4/Makefile Wed Apr 1 09:22:25 2009 (r190611) @@ -95,7 +95,6 @@ MAN= aac.4 \ fd.4 \ fdc.4 \ firewire.4 \ - fla.4 \ fpa.4 \ fwe.4 \ fwip.4 \ From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 09:27:46 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B5E10656CA; Wed, 1 Apr 2009 09:27:46 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52BE98FC1C; Wed, 1 Apr 2009 09:27:46 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n319Rk8r024966; Wed, 1 Apr 2009 09:27:46 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n319Rjpx024964; Wed, 1 Apr 2009 09:27:45 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010927.n319Rjpx024964@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 09:27:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190612 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 09:27:47 -0000 Author: trhodes Date: Wed Apr 1 09:27:45 2009 New Revision: 190612 URL: http://svn.freebsd.org/changeset/base/190612 Log: Add an entry for fla.4. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Apr 1 09:22:25 2009 (r190611) +++ head/ObsoleteFiles.inc Wed Apr 1 09:27:45 2009 (r190612) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20090401: fla.4 was removed +OLD_FILES+=usr/share/man/man4/fla.4.gz # 20090319: uscanner(4) has been removed OLD_FILES+=usr/share/man/man4/uscanner.4.gz # 20090313: k8temp(4) renamed to amdtemp(4) From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 09:37:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E5A61065670; Wed, 1 Apr 2009 09:37:00 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DA4C8FC13; Wed, 1 Apr 2009 09:37:00 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n319b0aj025180; Wed, 1 Apr 2009 09:37:00 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n319b0x7025178; Wed, 1 Apr 2009 09:37:00 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904010937.n319b0x7025178@svn.freebsd.org> From: Tom Rhodes Date: Wed, 1 Apr 2009 09:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190613 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 09:37:01 -0000 Author: trhodes Date: Wed Apr 1 09:37:00 2009 New Revision: 190613 URL: http://svn.freebsd.org/changeset/base/190613 Log: Use the real removal date for fla(4), put the entry with other 2004* entries. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Apr 1 09:27:45 2009 (r190612) +++ head/ObsoleteFiles.inc Wed Apr 1 09:37:00 2009 (r190613) @@ -14,8 +14,6 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # -# 20090401: fla.4 was removed -OLD_FILES+=usr/share/man/man4/fla.4.gz # 20090319: uscanner(4) has been removed OLD_FILES+=usr/share/man/man4/uscanner.4.gz # 20090313: k8temp(4) renamed to amdtemp(4) @@ -1442,6 +1440,8 @@ OLD_FILES+=lib/geom/geom_concat.so.1 OLD_FILES+=lib/geom/geom_label.so.1 OLD_FILES+=lib/geom/geom_nop.so.1 OLD_FILES+=lib/geom/geom_stripe.so.1 +# 20040713: fla(4) removed. +OLD_FILES+=usr/share/man/man4/fla.4.gz # 200407XX OLD_FILES+=usr/sbin/kernbb OLD_FILES+=usr/sbin/ntp-genkeys From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 12:31:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B6BA106567E; Wed, 1 Apr 2009 12:31:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC5F38FC17; Wed, 1 Apr 2009 12:31:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31CV4q1031659; Wed, 1 Apr 2009 12:31:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31CV42u031658; Wed, 1 Apr 2009 12:31:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011231.n31CV42u031658@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 12:31:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190615 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 12:31:06 -0000 Author: kib Date: Wed Apr 1 12:31:04 2009 New Revision: 190615 URL: http://svn.freebsd.org/changeset/base/190615 Log: Provide convenient definition of the union descriptor, similar to the i386 one. Fully enumerate system segments and gate types. In collaboration with: pho Reviewed by: jhb Modified: head/sys/amd64/include/segments.h Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Wed Apr 1 10:58:50 2009 (r190614) +++ head/sys/amd64/include/segments.h Wed Apr 1 12:31:04 2009 (r190615) @@ -108,12 +108,29 @@ struct gate_descriptor { u_int64_t sd_xx1:32; } __packed; +/* + * Generic descriptor + */ +union descriptor { + struct user_segment_descriptor sd; + struct gate_descriptor gd; +}; + /* system segments and gate types */ #define SDT_SYSNULL 0 /* system null */ +#define SDT_SYS286TSS 1 /* system 286 TSS available */ #define SDT_SYSLDT 2 /* system 64 bit local descriptor table */ +#define SDT_SYS286BSY 3 /* system 286 TSS busy */ +#define SDT_SYS286CGT 4 /* system 286 call gate */ +#define SDT_SYSTASKGT 5 /* system task gate */ +#define SDT_SYS286IGT 6 /* system 286 interrupt gate */ +#define SDT_SYS286TGT 7 /* system 286 trap gate */ +#define SDT_SYSNULL2 8 /* system null again */ #define SDT_SYSTSS 9 /* system available 64 bit TSS */ +#define SDT_SYSNULL3 10 /* system null again */ #define SDT_SYSBSY 11 /* system busy 64 bit TSS */ #define SDT_SYSCGT 12 /* system 64 bit call gate */ +#define SDT_SYSNULL4 13 /* system null again */ #define SDT_SYSIGT 14 /* system 64 bit interrupt gate */ #define SDT_SYSTGT 15 /* system 64 bit trap gate */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 12:44:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35010106564A; Wed, 1 Apr 2009 12:44:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22D348FC1A; Wed, 1 Apr 2009 12:44:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31CiIav031951; Wed, 1 Apr 2009 12:44:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31CiHub031947; Wed, 1 Apr 2009 12:44:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011244.n31CiHub031947@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 12:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190616 - in head/sys: amd64/include compat/ia32 i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 12:44:18 -0000 Author: kib Date: Wed Apr 1 12:44:17 2009 New Revision: 190616 URL: http://svn.freebsd.org/changeset/base/190616 Log: Add all segment registers for the amd64 CPU to struct reg and mcontext. To keep these structures ABI-compatible, half the size of r_trapno, r_err, mc_trapno, mc_flags. Add fsbase and gsbase to mcontext on both amd64 and i386. Add flags to amd64 mcontext to indicate that it contains valid segments or bases. In collaboration with: pho Discussed with: peter Reviewed by: jhb Modified: head/sys/amd64/include/reg.h head/sys/amd64/include/ucontext.h head/sys/compat/ia32/ia32_signal.h head/sys/i386/include/ucontext.h Modified: head/sys/amd64/include/reg.h ============================================================================== --- head/sys/amd64/include/reg.h Wed Apr 1 12:31:04 2009 (r190615) +++ head/sys/amd64/include/reg.h Wed Apr 1 12:44:17 2009 (r190616) @@ -56,8 +56,12 @@ struct reg { register_t r_rdx; register_t r_rcx; register_t r_rax; - register_t r_trapno; - register_t r_err; + uint32_t r_trapno; + uint16_t r_fs; + uint16_t r_gs; + uint32_t r_err; + uint16_t r_es; + uint16_t r_ds; register_t r_rip; register_t r_cs; register_t r_rflags; Modified: head/sys/amd64/include/ucontext.h ============================================================================== --- head/sys/amd64/include/ucontext.h Wed Apr 1 12:31:04 2009 (r190615) +++ head/sys/amd64/include/ucontext.h Wed Apr 1 12:44:17 2009 (r190616) @@ -32,9 +32,16 @@ #ifndef _MACHINE_UCONTEXT_H_ #define _MACHINE_UCONTEXT_H_ +/* + * mc_trapno bits. Shall be in sync with TF_XXX. + */ +#define _MC_HASSEGS 0x1 +#define _MC_HASBASES 0x2 +#define _MC_FLAG_MASK (_MC_HASSEGS | _MC_HASBASES) + typedef struct __mcontext { /* - * The first 20 fields must match the definition of + * The first 24 fields must match the definition of * sigcontext. So that we can support sigcontext * and ucontext_t at the same time. */ @@ -54,9 +61,13 @@ typedef struct __mcontext { __register_t mc_r13; __register_t mc_r14; __register_t mc_r15; - __register_t mc_trapno; + __uint32_t mc_trapno; + __uint16_t mc_fs; + __uint16_t mc_gs; __register_t mc_addr; - __register_t mc_flags; + __uint32_t mc_flags; + __uint16_t mc_es; + __uint16_t mc_ds; __register_t mc_err; __register_t mc_rip; __register_t mc_cs; @@ -65,6 +76,7 @@ typedef struct __mcontext { __register_t mc_ss; long mc_len; /* sizeof(mcontext_t) */ + #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */ #define _MC_FPFMT_XMM 0x10002 long mc_fpformat; @@ -76,7 +88,11 @@ typedef struct __mcontext { * See for the internals of mc_fpstate[]. */ long mc_fpstate[64] __aligned(16); - long mc_spare[8]; + + __register_t mc_fsbase; + __register_t mc_gsbase; + + long mc_spare[6]; } mcontext_t; #endif /* !_MACHINE_UCONTEXT_H_ */ Modified: head/sys/compat/ia32/ia32_signal.h ============================================================================== --- head/sys/compat/ia32/ia32_signal.h Wed Apr 1 12:31:04 2009 (r190615) +++ head/sys/compat/ia32/ia32_signal.h Wed Apr 1 12:44:17 2009 (r190616) @@ -59,7 +59,9 @@ struct ia32_mcontext { * See for the internals of mc_fpstate[]. */ u_int32_t mc_fpstate[128] __aligned(16); - u_int32_t mc_spare2[8]; + u_int32_t mc_fsbase; + u_int32_t mc_gsbase; + u_int32_t mc_spare2[6]; }; struct ia32_ucontext { Modified: head/sys/i386/include/ucontext.h ============================================================================== --- head/sys/i386/include/ucontext.h Wed Apr 1 12:31:04 2009 (r190615) +++ head/sys/i386/include/ucontext.h Wed Apr 1 12:44:17 2009 (r190616) @@ -72,10 +72,15 @@ typedef struct __mcontext { * See for the internals of mc_fpstate[]. */ int mc_fpstate[128] __aligned(16); - int mc_spare2[8]; + + __register_t mc_fsbase; + __register_t mc_gsbase; + + int mc_spare2[6]; } mcontext_t; #if defined(_KERNEL) && defined(COMPAT_FREEBSD4) + struct mcontext4 { __register_t mc_onstack; /* XXX - sigcontext compat. */ __register_t mc_gs; /* machine state (struct trapframe) */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 12:46:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B508410656E4; Wed, 1 Apr 2009 12:46:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3D948FC26; Wed, 1 Apr 2009 12:46:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31Ck5O8032029; Wed, 1 Apr 2009 12:46:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31Ck58x032028; Wed, 1 Apr 2009 12:46:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011246.n31Ck58x032028@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 12:46:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190617 - head/sys/i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 12:46:06 -0000 Author: kib Date: Wed Apr 1 12:46:05 2009 New Revision: 190617 URL: http://svn.freebsd.org/changeset/base/190617 Log: Fill the fsbase and gsbase fields of the mcontext structure on i386. In collaboration with: pho Discussed with: peter Reviewed by: jhb Modified: head/sys/i386/i386/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Apr 1 12:44:17 2009 (r190616) +++ head/sys/i386/i386/machdep.c Wed Apr 1 12:46:05 2009 (r190617) @@ -589,6 +589,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, struct sigacts *psp; char *sp; struct trapframe *regs; + struct segment_descriptor *sdp; int sig; int oonstack; @@ -625,6 +626,15 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); + /* + * Unconditionally fill the fsbase and gsbase into the mcontext. + */ + sdp = &td->td_pcb->pcb_gsd; + sf.sf_uc.uc_mcontext.mc_fsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; + sdp = &td->td_pcb->pcb_fsd; + sf.sf_uc.uc_mcontext.mc_gsbase = sdp->sd_hibase << 24 | + sdp->sd_lobase; /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && @@ -3078,6 +3088,7 @@ int get_mcontext(struct thread *td, mcontext_t *mcp, int flags) { struct trapframe *tp; + struct segment_descriptor *sdp; tp = td->td_frame; @@ -3109,6 +3120,11 @@ get_mcontext(struct thread *td, mcontext mcp->mc_ss = tp->tf_ss; mcp->mc_len = sizeof(*mcp); get_fpcontext(td, mcp); + sdp = &td->td_pcb->pcb_gsd; + mcp->mc_fsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + sdp = &td->td_pcb->pcb_fsd; + mcp->mc_gsbase = sdp->sd_hibase << 24 | sdp->sd_lobase; + return (0); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 12:48:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EF2B1065675; Wed, 1 Apr 2009 12:48:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8268FC15; Wed, 1 Apr 2009 12:48:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31CmIuk032104; Wed, 1 Apr 2009 12:48:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31CmIHh032103; Wed, 1 Apr 2009 12:48:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011248.n31CmIHh032103@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 12:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190618 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 12:48:19 -0000 Author: kib Date: Wed Apr 1 12:48:17 2009 New Revision: 190618 URL: http://svn.freebsd.org/changeset/base/190618 Log: Fully enumerate all i386 sysarch commands an amd64 include file. Provides i386/freebsd API-compatible definitions for the argument structures of the above sysarch commands. struct i386_ioperm_args definition is ABI-compatible. In collaboration with: pho Reviewed by: jhb Modified: head/sys/amd64/include/sysarch.h Modified: head/sys/amd64/include/sysarch.h ============================================================================== --- head/sys/amd64/include/sysarch.h Wed Apr 1 12:46:05 2009 (r190617) +++ head/sys/amd64/include/sysarch.h Wed Apr 1 12:48:17 2009 (r190618) @@ -35,6 +35,15 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ +#define I386_GET_LDT 0 +#define I386_SET_LDT 1 +#define LDT_AUTO_ALLOC 0xffffffff + /* I386_IOPL */ +#define I386_GET_IOPERM 3 +#define I386_SET_IOPERM 4 + +/* XXX Not implementable #define I386_VM86 6 */ + #define I386_GET_FSBASE 7 #define I386_SET_FSBASE 8 #define I386_GET_GSBASE 9 @@ -46,6 +55,18 @@ #define AMD64_GET_GSBASE 130 #define AMD64_SET_GSBASE 131 +struct i386_ldt_args { + unsigned int start; + struct user_segment_descriptor *descs __packed; + unsigned int num; +}; + +struct i386_ioperm_args { + unsigned int start; + unsigned int length; + int enable; +}; + #ifndef _KERNEL #include From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 12:53:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB58D106564A; Wed, 1 Apr 2009 12:53:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A92758FC0C; Wed, 1 Apr 2009 12:53:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31Cr1N1032223; Wed, 1 Apr 2009 12:53:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31Cr1qL032221; Wed, 1 Apr 2009 12:53:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011253.n31Cr1qL032221@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 12:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190619 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 12:53:02 -0000 Author: kib Date: Wed Apr 1 12:53:01 2009 New Revision: 190619 URL: http://svn.freebsd.org/changeset/base/190619 Log: Add separate gdt descriptors for %fs and %gs on amd64. Reorder amd64 gdt descriptors so that user-accessible selectors are the same as on i386. At least Wine hard-codes this into the binary. In collaboration with: pho Reviewed by: jhb Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/include/segments.h Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Apr 1 12:48:17 2009 (r190618) +++ head/sys/amd64/amd64/machdep.c Wed Apr 1 12:53:01 2009 (r190619) @@ -826,7 +826,12 @@ CTASSERT(sizeof(struct nmi_pcpu) == 16); struct amd64tss common_tss[MAXCPU]; -/* software prototypes -- in more palatable form */ +/* + * Software prototypes -- in more palatable form. + * + * Keep GUFS32, GUGS32, GUCODE32 and GUDATA at the same + * slots as corresponding segments for i386 kernel. + */ struct soft_segment_descriptor gdt_segs[] = { /* GNULL_SEL 0 Null Descriptor */ { .ssd_base = 0x0, @@ -837,7 +842,34 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 0, .ssd_def32 = 0, .ssd_gran = 0 }, -/* GCODE_SEL 1 Code Descriptor for kernel */ +/* GNULL2_SEL 1 Null Descriptor */ +{ .ssd_base = 0x0, + .ssd_limit = 0x0, + .ssd_type = 0, + .ssd_dpl = 0, + .ssd_p = 0, + .ssd_long = 0, + .ssd_def32 = 0, + .ssd_gran = 0 }, +/* GUFS32_SEL 2 32 bit %gs Descriptor for user */ +{ .ssd_base = 0x0, + .ssd_limit = 0xfffff, + .ssd_type = SDT_MEMRWA, + .ssd_dpl = SEL_UPL, + .ssd_p = 1, + .ssd_long = 0, + .ssd_def32 = 1, + .ssd_gran = 1 }, +/* GUGS32_SEL 3 32 bit %fs Descriptor for user */ +{ .ssd_base = 0x0, + .ssd_limit = 0xfffff, + .ssd_type = SDT_MEMRWA, + .ssd_dpl = SEL_UPL, + .ssd_p = 1, + .ssd_long = 0, + .ssd_def32 = 1, + .ssd_gran = 1 }, +/* GCODE_SEL 4 Code Descriptor for kernel */ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMERA, @@ -846,7 +878,7 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 1, .ssd_def32 = 0, .ssd_gran = 1 }, -/* GDATA_SEL 2 Data Descriptor for kernel */ +/* GDATA_SEL 5 Data Descriptor for kernel */ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMRWA, @@ -855,7 +887,7 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 1, .ssd_def32 = 0, .ssd_gran = 1 }, -/* GUCODE32_SEL 3 32 bit Code Descriptor for user */ +/* GUCODE32_SEL 6 32 bit Code Descriptor for user */ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMERA, @@ -864,7 +896,7 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 0, .ssd_def32 = 1, .ssd_gran = 1 }, -/* GUDATA_SEL 4 32/64 bit Data Descriptor for user */ +/* GUDATA_SEL 7 32/64 bit Data Descriptor for user */ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMRWA, @@ -873,7 +905,7 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 0, .ssd_def32 = 1, .ssd_gran = 1 }, -/* GUCODE_SEL 5 64 bit Code Descriptor for user */ +/* GUCODE_SEL 8 64 bit Code Descriptor for user */ { .ssd_base = 0x0, .ssd_limit = 0xfffff, .ssd_type = SDT_MEMERA, @@ -882,9 +914,9 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 1, .ssd_def32 = 0, .ssd_gran = 1 }, -/* GPROC0_SEL 6 Proc 0 Tss Descriptor */ +/* GPROC0_SEL 9 Proc 0 Tss Descriptor */ { .ssd_base = 0x0, - .ssd_limit = sizeof(struct amd64tss)-1, + .ssd_limit = sizeof(struct amd64tss) + IOPAGES * PAGE_SIZE - 1, .ssd_type = SDT_SYSTSS, .ssd_dpl = SEL_KPL, .ssd_p = 1, @@ -900,15 +932,24 @@ struct soft_segment_descriptor gdt_segs[ .ssd_long = 0, .ssd_def32 = 0, .ssd_gran = 0 }, -/* GUGS32_SEL 8 32 bit GS Descriptor for user */ +/* GUSERLDT_SEL 11 LDT Descriptor */ { .ssd_base = 0x0, - .ssd_limit = 0xfffff, - .ssd_type = SDT_MEMRWA, - .ssd_dpl = SEL_UPL, - .ssd_p = 1, + .ssd_limit = 0x0, + .ssd_type = 0, + .ssd_dpl = 0, + .ssd_p = 0, .ssd_long = 0, - .ssd_def32 = 1, - .ssd_gran = 1 }, + .ssd_def32 = 0, + .ssd_gran = 0 }, +/* GUSERLDT_SEL 12 LDT Descriptor, double size */ +{ .ssd_base = 0x0, + .ssd_limit = 0x0, + .ssd_type = 0, + .ssd_dpl = 0, + .ssd_p = 0, + .ssd_long = 0, + .ssd_def32 = 0, + .ssd_gran = 0 }, }; void Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Wed Apr 1 12:48:17 2009 (r190618) +++ head/sys/amd64/include/segments.h Wed Apr 1 12:53:01 2009 (r190619) @@ -212,15 +212,19 @@ struct region_descriptor { * Entries in the Global Descriptor Table (GDT) */ #define GNULL_SEL 0 /* Null Descriptor */ -#define GCODE_SEL 1 /* Kernel Code Descriptor */ -#define GDATA_SEL 2 /* Kernel Data Descriptor */ -#define GUCODE32_SEL 3 /* User 32 bit code Descriptor */ -#define GUDATA_SEL 4 /* User 32/64 bit Data Descriptor */ -#define GUCODE_SEL 5 /* User 64 bit Code Descriptor */ -#define GPROC0_SEL 6 /* TSS for entering kernel etc */ -/* slot 7 is second half of GPROC0_SEL */ -#define GUGS32_SEL 8 /* User 32 bit GS Descriptor */ -#define NGDT 9 +#define GNULL2_SEL 1 /* Null Descriptor */ +#define GUFS32_SEL 2 /* User 32 bit %fs Descriptor */ +#define GUGS32_SEL 3 /* User 32 bit %gs Descriptor */ +#define GCODE_SEL 4 /* Kernel Code Descriptor */ +#define GDATA_SEL 5 /* Kernel Data Descriptor */ +#define GUCODE32_SEL 6 /* User 32 bit code Descriptor */ +#define GUDATA_SEL 7 /* User 32/64 bit Data Descriptor */ +#define GUCODE_SEL 8 /* User 64 bit Code Descriptor */ +#define GPROC0_SEL 9 /* TSS for entering kernel etc */ +/* slot 10 is second half of GPROC0_SEL */ +#define GUSERLDT_SEL 11 /* LDT */ +/* slot 11 is second half of GUSERLDT_SEL */ +#define NGDT 13 #ifdef _KERNEL extern struct user_segment_descriptor gdt[]; From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 13:09:27 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F37B4106573D; Wed, 1 Apr 2009 13:09:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF1E48FC0A; Wed, 1 Apr 2009 13:09:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31D9QmG032652; Wed, 1 Apr 2009 13:09:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31D9QqM032643; Wed, 1 Apr 2009 13:09:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011309.n31D9QqM032643@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 13:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190620 - in head/sys: amd64/acpica amd64/amd64 amd64/ia32 amd64/include amd64/linux32 conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 13:09:27 -0000 Author: kib Date: Wed Apr 1 13:09:26 2009 New Revision: 190620 URL: http://svn.freebsd.org/changeset/base/190620 Log: Save and restore segment registers on amd64 when entering and leaving the kernel on amd64. Fill and read segment registers for mcontext and signals. Handle traps caused by restoration of the invalidated selectors. Implement user-mode creation and manipulation of the process-specific LDT descriptors for amd64, see sysarch(2). Implement support for TSS i/o port access permission bitmap for amd64. Context-switch LDT and TSS. Do not save and restore segment registers on the context switch, that is handled by kernel enter/leave trampolines now. Remove segment restore code from the signal trampolines for freebsd/amd64, freebsd/ia32 and linux/i386 for the same reason. Implement amd64-specific compat shims for sysarch. Linuxolator (temporary ?) switched to use gsbase for thread_area pointer. TODO: Currently, gdb is not adapted to show segment registers from struct reg. Also, no machine-depended ptrace command is added to set segment registers for debugged process. In collaboration with: pho Discussed with: peter Reviewed by: jhb Linuxolator tested by: dchagin Added: head/sys/amd64/ia32/ia32_misc.c (contents, props changed) Modified: head/sys/amd64/acpica/acpi_switch.S head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/cpu_switch.S head/sys/amd64/amd64/db_interface.c head/sys/amd64/amd64/db_trace.c head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/trap.c head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/ia32/ia32_exception.S head/sys/amd64/ia32/ia32_reg.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/ia32/ia32_sigtramp.S head/sys/amd64/include/asmacros.h head/sys/amd64/include/frame.h head/sys/amd64/include/md_var.h head/sys/amd64/include/pcb.h head/sys/amd64/include/pcpu.h head/sys/amd64/include/proc.h head/sys/amd64/include/segments.h head/sys/amd64/include/sysarch.h head/sys/amd64/linux32/linux32_locore.s head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/conf/files.amd64 Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/acpica/acpi_switch.S Wed Apr 1 13:09:26 2009 (r190620) @@ -64,12 +64,17 @@ ENTRY(acpi_restorecpu) /* Fetch PCB. */ movq WAKEUP_CTX(xpcb), %r11 - /* Restore segment registers. */ - mov WAKEUP_PCB(DS), %ds - mov WAKEUP_PCB(ES), %es - mov WAKEUP_XPCB(SS), %ss - mov WAKEUP_PCB(FS), %fs - mov WAKEUP_PCB(GS), %gs + /* Force kernel segment registers. */ + movl $KDSEL, %eax + movw %ax, %ds + movl $KDSEL, %eax + movw %ax, %es + movl $KDSEL, %eax + movw %ax, %ss + movl $KUF32SEL, %eax + movw %ax, %fs + movl $KUG32SEL, %eax + movw %ax, %gs movl $MSR_FSBASE, %ecx movl WAKEUP_PCB(FSBASE), %eax Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/apic_vector.S Wed Apr 1 13:09:26 2009 (r190620) @@ -219,9 +219,7 @@ IDTVEC(cpustop) movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ call cpustop_handler - - POP_FRAME - iretq + jmp doreti /* * Executed by a CPU when it receives an IPI_SUSPEND from another CPU. @@ -251,6 +249,5 @@ IDTVEC(rendezvous) call smp_rendezvous_action movq lapic, %rax movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ - POP_FRAME /* Why not doreti? */ - iretq + jmp doreti #endif /* SMP */ Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/cpu_switch.S Wed Apr 1 13:09:26 2009 (r190620) @@ -75,8 +75,6 @@ ENTRY(cpu_throw) 1: movq TD_PCB(%rdi),%r8 /* Old pcb */ movl PCPU(CPUID), %eax - movq PCB_FSBASE(%r8),%r9 - movq PCB_GSBASE(%r8),%r10 /* release bit from old pm_active */ movq TD_PROC(%rdi), %rdx /* oldtd->td_proc */ movq P_VMSPACE(%rdx), %rdx /* proc->p_vmspace */ @@ -110,28 +108,6 @@ ENTRY(cpu_switch) movq %rbx,PCB_RBX(%r8) movq %rax,PCB_RIP(%r8) - /* - * Reread fs and gs bases. Explicit fs segment register load - * by the usermode code may change actual fs base without - * updating pcb_{fs,gs}base. - * - * %rdx still contains the mtx, save %rdx around rdmsr. - */ - movq %rdx,%r11 - movl $MSR_FSBASE,%ecx - rdmsr - shlq $32,%rdx - leaq (%rax,%rdx),%r9 - movl $MSR_KGSBASE,%ecx - rdmsr - shlq $32,%rdx - leaq (%rax,%rdx),%r10 - movq %r11,%rdx - - testl $PCB_32BIT,PCB_FLAGS(%r8) - jnz store_seg -done_store_seg: - testl $PCB_DBREGS,PCB_FLAGS(%r8) jnz store_dr /* static predict not taken */ done_store_dr: @@ -192,36 +168,47 @@ sw1: testl $TDP_KTHREAD,TD_PFLAGS(%rsi) jnz do_kthread - testl $PCB_32BIT,PCB_FLAGS(%r8) - jnz load_seg -done_load_seg: - - cmpq PCB_FSBASE(%r8),%r9 - jz 1f - /* Restore userland %fs */ -restore_fsbase: - movl $MSR_FSBASE,%ecx + /* + * Load ldt register + */ + movq TD_PROC(%rsi),%rcx + cmpq $0, P_MD+MD_LDT(%rcx) + jne do_ldt + xorl %eax,%eax +ld_ldt: lldt %ax + + /* Restore fs base in GDT */ movl PCB_FSBASE(%r8),%eax - movl PCB_FSBASE+4(%r8),%edx - wrmsr -1: - cmpq PCB_GSBASE(%r8),%r10 - jz 2f - /* Restore userland %gs */ - movl $MSR_KGSBASE,%ecx + movq PCPU(FS32P),%rdx + movw %ax,2(%rdx) + shrl $16,%eax + movb %al,4(%rdx) + shrl $8,%eax + movb %al,7(%rdx) + + /* Restore gs base in GDT */ movl PCB_GSBASE(%r8),%eax - movl PCB_GSBASE+4(%r8),%edx - wrmsr -2: + movq PCPU(GS32P),%rdx + movw %ax,2(%rdx) + shrl $16,%eax + movb %al,4(%rdx) + shrl $8,%eax + movb %al,7(%rdx) -do_tss: +do_kthread: + /* Do we need to reload tss ? */ + movq PCPU(TSSP),%rax + movq PCB_TSSP(%r8),%rdx + testq %rdx,%rdx + cmovzq PCPU(COMMONTSSP),%rdx + cmpq %rax,%rdx + jne do_tss +done_tss: + movq %r8,PCPU(RSP0) + movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ - movq PCPU(TSSP), %rax - movq %r8, PCPU(RSP0) - movq %r8, PCPU(CURPCB) - addq $COMMON_TSS_RSP0, %rax - movq %rsi, PCPU(CURTHREAD) /* into next thread */ - movq %r8, (%rax) + movq %r8,COMMON_TSS_RSP0(%rdx) + movq %rsi,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) @@ -250,45 +237,6 @@ done_load_dr: * We use jumps rather than call in order to avoid the stack. */ -do_kthread: - /* - * Copy old fs/gsbase to new kthread pcb for future switches - * This maintains curpcb->pcb_[fg]sbase as caches of the MSR - */ - movq %r9,PCB_FSBASE(%r8) - movq %r10,PCB_GSBASE(%r8) - jmp do_tss - -store_seg: - mov %gs,PCB_GS(%r8) - testl $PCB_GS32BIT,PCB_FLAGS(%r8) - jnz 2f -1: mov %ds,PCB_DS(%r8) - mov %es,PCB_ES(%r8) - mov %fs,PCB_FS(%r8) - jmp done_store_seg -2: movq PCPU(GS32P),%rax - movq (%rax),%rax - movq %rax,PCB_GS32SD(%r8) - jmp 1b - -load_seg: - testl $PCB_GS32BIT,PCB_FLAGS(%r8) - jnz 2f -1: movl $MSR_GSBASE,%ecx - rdmsr - mov PCB_GS(%r8),%gs - wrmsr - mov PCB_DS(%r8),%ds - mov PCB_ES(%r8),%es - mov PCB_FS(%r8),%fs - jmp restore_fsbase - /* Restore userland %gs while preserving kernel gsbase */ -2: movq PCPU(GS32P),%rax - movq PCB_GS32SD(%r8),%rcx - movq %rcx,(%rax) - jmp 1b - store_dr: movq %dr7,%rax /* yes, do the save */ movq %dr0,%r15 @@ -325,6 +273,29 @@ load_dr: movq %r11,%dr6 movq %rax,%dr7 jmp done_load_dr + +do_tss: movq %rdx,PCPU(TSSP) + movq %rdx,%rcx + movq PCPU(TSS),%rax + movw %rcx,2(%rax) + shrq $16,%rcx + movb %cl,4(%rax) + shrq $8,%rcx + movb %cl,7(%rax) + shrq $8,%rcx + movl %ecx,8(%rax) + movb $0x89,5(%rax) /* unset busy */ + movl $TSSSEL,%eax + ltr %ax + jmp done_tss + +do_ldt: movq PCPU(LDT),%rax + movq P_MD+MD_LDT_SD(%rcx),%rdx + movq %rdx,(%rax) + movq P_MD+MD_LDT_SD+8(%rcx),%rdx + movq %rdx,8(%rax) + movl $LDTSEL,%eax + jmp ld_ldt END(cpu_switch) /* @@ -398,12 +369,6 @@ ENTRY(savectx2) movq (%rsp),%rax movq %rax,PCB_RIP(%r8) - mov %ds,PCB_DS(%r8) - mov %es,PCB_ES(%r8) - mov %ss,XPCB_SS(%r8) - mov %fs,PCB_FS(%r8) - mov %gs,PCB_GS(%r8) - movq %rbx,PCB_RBX(%r8) movq %rsp,PCB_RSP(%r8) movq %rbp,PCB_RBP(%r8) Modified: head/sys/amd64/amd64/db_interface.c ============================================================================== --- head/sys/amd64/amd64/db_interface.c Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/db_interface.c Wed Apr 1 13:09:26 2009 (r190620) @@ -139,7 +139,11 @@ void db_show_mdpcpu(struct pcpu *pc) { -#if 0 - db_printf("currentldt = 0x%x\n", pc->pc_currentldt); -#endif + db_printf("curpmap = %p\n", pc->pc_curpmap); + db_printf("tssp = %p\n", pc->pc_tssp); + db_printf("commontssp = %p\n", pc->pc_commontssp); + db_printf("rsp0 = 0x%lx\n", pc->pc_rsp0); + db_printf("gs32p = %p\n", pc->pc_gs32p); + db_printf("ldt = %p\n", pc->pc_ldt); + db_printf("tss = %p\n", pc->pc_tss); } Modified: head/sys/amd64/amd64/db_trace.c ============================================================================== --- head/sys/amd64/amd64/db_trace.c Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/db_trace.c Wed Apr 1 13:09:26 2009 (r190620) @@ -69,12 +69,10 @@ static db_varfcn_t db_ss; #define DB_OFFSET(x) (db_expr_t *)offsetof(struct trapframe, x) struct db_variable db_regs[] = { { "cs", DB_OFFSET(tf_cs), db_frame }, -#if 0 { "ds", DB_OFFSET(tf_ds), db_frame }, { "es", DB_OFFSET(tf_es), db_frame }, { "fs", DB_OFFSET(tf_fs), db_frame }, { "gs", DB_OFFSET(tf_gs), db_frame }, -#endif { "ss", NULL, db_ss }, { "rax", DB_OFFSET(tf_rax), db_frame }, { "rcx", DB_OFFSET(tf_rcx), db_frame }, @@ -94,7 +92,7 @@ struct db_variable db_regs[] = { { "r15", DB_OFFSET(tf_r15), db_frame }, { "rip", DB_OFFSET(tf_rip), db_frame }, { "rflags", DB_OFFSET(tf_rflags), db_frame }, -#define DB_N_SHOW_REGS 20 /* Don't show registers after here. */ +#define DB_N_SHOW_REGS 24 /* Don't show registers after here. */ { "dr0", NULL, db_dr0 }, { "dr1", NULL, db_dr1 }, { "dr2", NULL, db_dr2 }, @@ -357,7 +355,7 @@ db_nextframe(struct amd64_frame **fp, db rbp = tf->tf_rbp; switch (frame_type) { case TRAP: - db_printf("--- trap %#lr", tf->tf_trapno); + db_printf("--- trap %#r", tf->tf_trapno); break; case SYSCALL: db_printf("--- syscall"); Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/exception.S Wed Apr 1 13:09:26 2009 (r190620) @@ -42,6 +42,7 @@ #include #include #include +#include #include "assym.s" @@ -99,7 +100,7 @@ MCOUNT_LABEL(btrap) /* Traps that we leave interrupts disabled for.. */ #define TRAP_NOEN(a) \ subq $TF_RIP,%rsp; \ - movq $(a),TF_TRAPNO(%rsp) ; \ + movl $(a),TF_TRAPNO(%rsp) ; \ movq $0,TF_ADDR(%rsp) ; \ movq $0,TF_ERR(%rsp) ; \ jmp alltraps_noen @@ -111,7 +112,7 @@ IDTVEC(bpt) /* Regular traps; The cpu does not supply tf_err for these. */ #define TRAP(a) \ subq $TF_RIP,%rsp; \ - movq $(a),TF_TRAPNO(%rsp) ; \ + movl $(a),TF_TRAPNO(%rsp) ; \ movq $0,TF_ADDR(%rsp) ; \ movq $0,TF_ERR(%rsp) ; \ jmp alltraps @@ -139,7 +140,7 @@ IDTVEC(xmm) /* This group of traps have tf_err already pushed by the cpu */ #define TRAP_ERR(a) \ subq $TF_ERR,%rsp; \ - movq $(a),TF_TRAPNO(%rsp) ; \ + movl $(a),TF_TRAPNO(%rsp) ; \ movq $0,TF_ADDR(%rsp) ; \ jmp alltraps IDTVEC(tss) @@ -164,6 +165,10 @@ alltraps: testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz alltraps_testi /* already running with kernel GS.base */ swapgs + movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) alltraps_testi: testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs @@ -185,6 +190,7 @@ alltraps_pushregs_no_rdi: movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) + movl $TF_HASSEGS,TF_FLAGS(%rsp) FAKE_MCOUNT(TF_RIP(%rsp)) #ifdef KDTRACE_HOOKS /* @@ -193,7 +199,7 @@ alltraps_pushregs_no_rdi: * interrupt. For all other trap types, just handle them in * the usual way. */ - cmpq $T_BPTFLT,TF_TRAPNO(%rsp) + cmpl $T_BPTFLT,TF_TRAPNO(%rsp) jne calltrap /* Check if there is no DTrace hook registered. */ @@ -228,13 +234,17 @@ calltrap: .type alltraps_noen,@function alltraps_noen: testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz alltraps_pushregs /* already running with kernel GS.base */ + jz 1f /* already running with kernel GS.base */ swapgs +1: movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) jmp alltraps_pushregs IDTVEC(dblfault) subq $TF_ERR,%rsp - movq $T_DOUBLEFLT,TF_TRAPNO(%rsp) + movl $T_DOUBLEFLT,TF_TRAPNO(%rsp) movq $0,TF_ADDR(%rsp) movq $0,TF_ERR(%rsp) movq %rdi,TF_RDI(%rsp) @@ -252,6 +262,11 @@ IDTVEC(dblfault) movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) + movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) + movl $TF_HASSEGS,TF_FLAGS(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs @@ -262,7 +277,7 @@ IDTVEC(dblfault) IDTVEC(page) subq $TF_ERR,%rsp - movq $T_PAGEFLT,TF_TRAPNO(%rsp) + movl $T_PAGEFLT,TF_TRAPNO(%rsp) testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs @@ -270,6 +285,10 @@ IDTVEC(page) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ movq %cr2,%rdi /* preserve %cr2 before .. */ movq %rdi,TF_ADDR(%rsp) /* enabling interrupts. */ + movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs_no_rdi sti @@ -283,17 +302,19 @@ IDTVEC(page) */ IDTVEC(prot) subq $TF_ERR,%rsp - movq $T_PROTFLT,TF_TRAPNO(%rsp) + movl $T_PROTFLT,TF_TRAPNO(%rsp) movq $0,TF_ADDR(%rsp) movq %rdi,TF_RDI(%rsp) /* free up a GP register */ leaq doreti_iret(%rip),%rdi cmpq %rdi,TF_RIP(%rsp) - je 2f /* kernel but with user gsbase!! */ + je 1f /* kernel but with user gsbase!! */ testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ - jz 1f /* already running with kernel GS.base */ -2: - swapgs -1: + jz 2f /* already running with kernel GS.base */ +1: swapgs +2: movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) testl $PSL_I,TF_RFLAGS(%rsp) jz alltraps_pushregs_no_rdi sti @@ -316,6 +337,10 @@ IDTVEC(fast_syscall) movq %rcx,TF_RIP(%rsp) /* %rcx original value is in %r10 */ movq PCPU(SCRATCH_RSP),%r11 /* %r11 already saved */ movq %r11,TF_RSP(%rsp) /* user stack pointer */ + movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) sti movq $KUDSEL,TF_SS(%rsp) movq $KUCSEL,TF_CS(%rsp) @@ -333,40 +358,11 @@ IDTVEC(fast_syscall) movq %r13,TF_R13(%rsp) /* C preserved */ movq %r14,TF_R14(%rsp) /* C preserved */ movq %r15,TF_R15(%rsp) /* C preserved */ + movl $TF_HASSEGS,TF_FLAGS(%rsp) FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi call syscall movq PCPU(CURPCB),%rax - testq $PCB_FULLCTX,PCB_FLAGS(%rax) - jne 3f -1: /* Check for and handle AST's on return to userland */ - cli - movq PCPU(CURTHREAD),%rax - testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) - je 2f - sti - movq %rsp, %rdi - call ast - jmp 1b -2: /* restore preserved registers */ - MEXITCOUNT - movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ - movq TF_RSI(%rsp),%rsi /* bonus: preserve arg 2 */ - movq TF_RDX(%rsp),%rdx /* return value 2 */ - movq TF_RAX(%rsp),%rax /* return value 1 */ - movq TF_RBX(%rsp),%rbx /* C preserved */ - movq TF_RBP(%rsp),%rbp /* C preserved */ - movq TF_R12(%rsp),%r12 /* C preserved */ - movq TF_R13(%rsp),%r13 /* C preserved */ - movq TF_R14(%rsp),%r14 /* C preserved */ - movq TF_R15(%rsp),%r15 /* C preserved */ - movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ - movq TF_RIP(%rsp),%rcx /* original %rip */ - movq TF_RSP(%rsp),%r9 /* user stack pointer */ - movq %r9,%rsp /* original %rsp */ - swapgs - sysretq -3: /* Requested full context restore, use doreti for that */ andq $~PCB_FULLCTX,PCB_FLAGS(%rax) MEXITCOUNT jmp doreti @@ -405,7 +401,7 @@ IDTVEC(fast_syscall32) IDTVEC(nmi) subq $TF_RIP,%rsp - movq $(T_NMI),TF_TRAPNO(%rsp) + movl $(T_NMI),TF_TRAPNO(%rsp) movq $0,TF_ADDR(%rsp) movq $0,TF_ERR(%rsp) movq %rdi,TF_RDI(%rsp) @@ -423,6 +419,11 @@ IDTVEC(nmi) movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) + movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) + movl $TF_HASSEGS,TF_FLAGS(%rsp) xorl %ebx,%ebx testb $SEL_RPL_MASK,TF_CS(%rsp) jnz nmi_fromuserspace @@ -515,9 +516,7 @@ outofnmi: nocallchain: #endif testl %ebx,%ebx - jz nmi_kernelexit - swapgs - jmp nmi_restoreregs + jnz doreti_exit nmi_kernelexit: /* * Put back the preserved MSR_GSBASE value. @@ -633,7 +632,55 @@ doreti_ast: */ doreti_exit: MEXITCOUNT - movq TF_RDI(%rsp),%rdi + movq PCPU(CURTHREAD),%r8 + movq TD_PCB(%r8),%r8 + + /* + * Do not reload segment registers for kernel. + * Since we do not reload segments registers with sane + * values on kernel entry, descriptors referenced by + * segments registers may be not valid. This is fatal + * for the usermode, but is innocent for the kernel. + */ + testb $SEL_RPL_MASK,TF_CS(%rsp) + jz ld_regs + + testl $TF_HASSEGS,TF_FLAGS(%rsp) + je set_segs + +do_segs: + /* Restore %fs and fsbase */ + movw TF_FS(%rsp),%ax + .globl ld_fs +ld_fs: movw %ax,%fs + cmpw $KUF32SEL,%ax + jne 1f + movl $MSR_FSBASE,%ecx + movl PCB_FSBASE(%r8),%eax + movl PCB_FSBASE+4(%r8),%edx + wrmsr +1: + /* Restore %gs and gsbase */ + movw TF_GS(%rsp),%si + pushfq + cli + movl $MSR_GSBASE,%ecx + rdmsr + .globl ld_gs +ld_gs: movw %si,%gs + wrmsr + popfq + cmpw $KUG32SEL,%si + jne 1f + movl $MSR_KGSBASE,%ecx + movl PCB_GSBASE(%r8),%eax + movl PCB_GSBASE+4(%r8),%edx + wrmsr +1: .globl ld_es +ld_es: movw TF_ES(%rsp),%es + .globl ld_ds +ld_ds: movw TF_DS(%rsp),%ds +ld_regs:movq TF_RDI(%rsp),%rdi movq TF_RSI(%rsp),%rsi movq TF_RDX(%rsp),%rdx movq TF_RCX(%rsp),%rcx @@ -657,6 +704,14 @@ doreti_exit: doreti_iret: iretq +set_segs: + movw $KUDSEL,%ax + movw %ax,TF_DS(%rsp) + movw %ax,TF_ES(%rsp) + movw $KUF32SEL,TF_FS(%rsp) + movw $KUG32SEL,TF_GS(%rsp) + jmp do_segs + /* * doreti_iret_fault. Alternative return code for * the case where we get a fault in the doreti_exit code @@ -671,7 +726,12 @@ doreti_iret_fault: testl $PSL_I,TF_RFLAGS(%rsp) jz 1f sti -1: movq %rdi,TF_RDI(%rsp) +1: movw %fs,TF_FS(%rsp) + movw %gs,TF_GS(%rsp) + movw %es,TF_ES(%rsp) + movw %ds,TF_DS(%rsp) + movl $TF_HASSEGS,TF_FLAGS(%rsp) + movq %rdi,TF_RDI(%rsp) movq %rsi,TF_RSI(%rsp) movq %rdx,TF_RDX(%rsp) movq %rcx,TF_RCX(%rsp) @@ -686,11 +746,48 @@ doreti_iret_fault: movq %r13,TF_R13(%rsp) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) - movq $T_PROTFLT,TF_TRAPNO(%rsp) + movl $T_PROTFLT,TF_TRAPNO(%rsp) movq $0,TF_ERR(%rsp) /* XXX should be the error code */ movq $0,TF_ADDR(%rsp) FAKE_MCOUNT(TF_RIP(%rsp)) jmp calltrap + + ALIGN_TEXT + .globl ds_load_fault +ds_load_fault: + movl $T_PROTFLT,TF_TRAPNO(%rsp) + movzwl TF_DS(%rsp),%edx + movl %edx,TF_ERR(%rsp) + movw $KUDSEL,TF_DS(%rsp) + jmp calltrap + + ALIGN_TEXT + .globl es_load_fault +es_load_fault: + movl $T_PROTFLT,TF_TRAPNO(%rsp) + movzwl TF_ES(%rsp),%edx + movl %edx,TF_ERR(%rsp) + movw $KUDSEL,TF_ES(%rsp) + jmp calltrap + + ALIGN_TEXT + .globl fs_load_fault +fs_load_fault: + movl $T_PROTFLT,TF_TRAPNO(%rsp) + movzwl TF_FS(%rsp),%edx + movl %edx,TF_ERR(%rsp) + movw $KUF32SEL,TF_FS(%rsp) + jmp calltrap + + ALIGN_TEXT + .globl gs_load_fault +gs_load_fault: + popfq + movl $T_PROTFLT,TF_TRAPNO(%rsp) + movzwl TF_GS(%rsp),%edx + movl %edx,TF_ERR(%rsp) + movw $KUG32SEL,TF_GS(%rsp) + jmp calltrap #ifdef HWPMC_HOOKS ENTRY(end_exceptions) #endif Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/genassym.c Wed Apr 1 13:09:26 2009 (r190620) @@ -79,6 +79,10 @@ ASSYM(P_VMSPACE, offsetof(struct proc, p ASSYM(VM_PMAP, offsetof(struct vmspace, vm_pmap)); ASSYM(PM_ACTIVE, offsetof(struct pmap, pm_active)); +ASSYM(P_MD, offsetof(struct proc, p_md)); +ASSYM(MD_LDT, offsetof(struct mdproc, md_ldt)); +ASSYM(MD_LDT_SD, offsetof(struct mdproc, md_ldt_sd)); + ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); @@ -132,16 +136,13 @@ ASSYM(PCB_RBX, offsetof(struct pcb, pcb_ ASSYM(PCB_RIP, offsetof(struct pcb, pcb_rip)); ASSYM(PCB_FSBASE, offsetof(struct pcb, pcb_fsbase)); ASSYM(PCB_GSBASE, offsetof(struct pcb, pcb_gsbase)); -ASSYM(PCB_DS, offsetof(struct pcb, pcb_ds)); -ASSYM(PCB_ES, offsetof(struct pcb, pcb_es)); -ASSYM(PCB_FS, offsetof(struct pcb, pcb_fs)); -ASSYM(PCB_GS, offsetof(struct pcb, pcb_gs)); ASSYM(PCB_DR0, offsetof(struct pcb, pcb_dr0)); ASSYM(PCB_DR1, offsetof(struct pcb, pcb_dr1)); ASSYM(PCB_DR2, offsetof(struct pcb, pcb_dr2)); ASSYM(PCB_DR3, offsetof(struct pcb, pcb_dr3)); ASSYM(PCB_DR6, offsetof(struct pcb, pcb_dr6)); ASSYM(PCB_DR7, offsetof(struct pcb, pcb_dr7)); +ASSYM(PCB_TSSP, offsetof(struct pcb, pcb_tssp)); ASSYM(PCB_DBREGS, PCB_DBREGS); ASSYM(PCB_32BIT, PCB_32BIT); ASSYM(PCB_GS32BIT, PCB_GS32BIT); @@ -193,7 +194,13 @@ ASSYM(TF_CS, offsetof(struct trapframe, ASSYM(TF_RFLAGS, offsetof(struct trapframe, tf_rflags)); ASSYM(TF_RSP, offsetof(struct trapframe, tf_rsp)); ASSYM(TF_SS, offsetof(struct trapframe, tf_ss)); +ASSYM(TF_DS, offsetof(struct trapframe, tf_ds)); +ASSYM(TF_ES, offsetof(struct trapframe, tf_es)); +ASSYM(TF_FS, offsetof(struct trapframe, tf_fs)); +ASSYM(TF_GS, offsetof(struct trapframe, tf_gs)); +ASSYM(TF_FLAGS, offsetof(struct trapframe, tf_flags)); ASSYM(TF_SIZE, sizeof(struct trapframe)); +ASSYM(TF_HASSEGS, TF_HASSEGS); ASSYM(SIGF_HANDLER, offsetof(struct sigframe, sf_ahu.sf_handler)); ASSYM(SIGF_UC, offsetof(struct sigframe, sf_uc)); @@ -215,7 +222,11 @@ ASSYM(PC_SCRATCH_RSP, offsetof(struct pc ASSYM(PC_CURPMAP, offsetof(struct pcpu, pc_curpmap)); ASSYM(PC_TSSP, offsetof(struct pcpu, pc_tssp)); ASSYM(PC_RSP0, offsetof(struct pcpu, pc_rsp0)); +ASSYM(PC_FS32P, offsetof(struct pcpu, pc_fs32p)); ASSYM(PC_GS32P, offsetof(struct pcpu, pc_gs32p)); +ASSYM(PC_LDT, offsetof(struct pcpu, pc_ldt)); +ASSYM(PC_COMMONTSSP, offsetof(struct pcpu, pc_commontssp)); +ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); ASSYM(LA_VER, offsetof(struct LAPIC, version)); ASSYM(LA_TPR, offsetof(struct LAPIC, tpr)); @@ -230,6 +241,10 @@ ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL)); ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL)); ASSYM(KUDSEL, GSEL(GUDATA_SEL, SEL_UPL)); ASSYM(KUC32SEL, GSEL(GUCODE32_SEL, SEL_UPL)); +ASSYM(KUF32SEL, GSEL(GUFS32_SEL, SEL_UPL)); +ASSYM(KUG32SEL, GSEL(GUGS32_SEL, SEL_UPL)); +ASSYM(TSSSEL, GSEL(GPROC0_SEL, SEL_KPL)); +ASSYM(LDTSEL, GSEL(GUSERLDT_SEL, SEL_KPL)); ASSYM(SEL_RPL_MASK, SEL_RPL_MASK); ASSYM(MSR_GSBASE, MSR_GSBASE); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Apr 1 12:53:01 2009 (r190619) +++ head/sys/amd64/amd64/machdep.c Wed Apr 1 13:09:26 2009 (r190620) @@ -159,7 +159,7 @@ extern vm_offset_t ksym_start, ksym_end; #define ICH_PMBASE 0x400 #define ICH_SMI_EN ICH_PMBASE + 0x30 -int _udatasel, _ucodesel, _ucode32sel; +int _udatasel, _ucodesel, _ucode32sel, _ufssel, _ugssel; int cold = 1; @@ -192,6 +192,8 @@ struct mtx icu_lock; struct mem_range_softc mem_range_softc; +struct mtx dt_lock; /* lock for GDT and LDT */ + static void cpu_startup(dummy) void *dummy; @@ -278,7 +280,7 @@ cpu_startup(dummy) * Send an interrupt to process. * * Stack is set up to allow sigcode stored - * at top to call routine, followed by kcall + * at top to call routine, followed by call * to sigreturn routine below. After sigreturn * resets the signal mask, the stack, and the * frame pointer, it returns to the user @@ -316,6 +318,8 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sf.sf_uc.uc_mcontext.mc_len = sizeof(sf.sf_uc.uc_mcontext); /* magic */ get_fpcontext(td, &sf.sf_uc.uc_mcontext); fpstate_drop(td); + sf.sf_uc.uc_mcontext.mc_fsbase = td->td_pcb->pcb_fsbase; + sf.sf_uc.uc_mcontext.mc_gsbase = td->td_pcb->pcb_gsbase; /* Allocate space for the signal handler context. */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && @@ -370,6 +374,11 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, regs->tf_rip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _ufssel; + regs->tf_gs = _ugssel; + regs->tf_flags = TF_HASSEGS; PROC_LOCK(p); mtx_lock(&psp->ps_mtx); } @@ -401,9 +410,16 @@ sigreturn(td, uap) ksiginfo_t ksi; error = copyin(uap->sigcntxp, &uc, sizeof(uc)); - if (error != 0) + if (error != 0) { + printf("sigreturn (pid %d): copyin failed\n", p->p_pid); return (error); + } ucp = &uc; + if ((ucp->uc_mcontext.mc_flags & ~_MC_FLAG_MASK) != 0) { + printf("sigreturn (pid %d): mc_flags %x\n", p->p_pid, + ucp->uc_mcontext.mc_flags); + return (EINVAL); + } regs = td->td_frame; rflags = ucp->uc_mcontext.mc_rflags; /* @@ -420,7 +436,8 @@ sigreturn(td, uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(rflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { - printf("sigreturn: rflags = 0x%lx\n", rflags); + printf("sigreturn (pid %d): rflags = 0x%lx\n", p->p_pid, + rflags); return (EINVAL); } @@ -431,7 +448,7 @@ sigreturn(td, uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn: cs = 0x%x\n", cs); + printf("sigreturn (pid %d): cs = 0x%x\n", p->p_pid, cs); ksiginfo_init_trap(&ksi); ksi.ksi_signo = SIGBUS; ksi.ksi_code = BUS_OBJERR; @@ -442,9 +459,13 @@ sigreturn(td, uap) } ret = set_fpcontext(td, &ucp->uc_mcontext); - if (ret != 0) + if (ret != 0) { + printf("sigreturn (pid %d): set_fpcontext\n", p->p_pid); return (ret); + } bcopy(&ucp->uc_mcontext.mc_rdi, regs, sizeof(*regs)); + td->td_pcb->pcb_fsbase = ucp->uc_mcontext.mc_fsbase; + td->td_pcb->pcb_gsbase = ucp->uc_mcontext.mc_gsbase; PROC_LOCK(p); #if defined(COMPAT_43) @@ -738,22 +759,16 @@ exec_setregs(td, entry, stack, ps_string { struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; + + mtx_lock(&dt_lock); + if (td->td_proc->p_md.md_ldt != NULL) + user_ldt_free(td); + else + mtx_unlock(&dt_lock); - critical_enter(); - wrmsr(MSR_FSBASE, 0); - wrmsr(MSR_KGSBASE, 0); /* User value while we're in the kernel */ pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; - critical_exit(); pcb->pcb_flags &= ~(PCB_32BIT | PCB_GS32BIT); - load_ds(_udatasel); - load_es(_udatasel); - load_fs(_udatasel); - load_gs(_udatasel); - pcb->pcb_ds = _udatasel; - pcb->pcb_es = _udatasel; - pcb->pcb_fs = _udatasel; - pcb->pcb_gs = _udatasel; pcb->pcb_initial_fpucw = __INITIAL_FPUCW__; bzero((char *)regs, sizeof(struct trapframe)); @@ -763,6 +778,11 @@ exec_setregs(td, entry, stack, ps_string regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T); regs->tf_ss = _udatasel; regs->tf_cs = _ucodesel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _ufssel; + regs->tf_gs = _ugssel; + regs->tf_flags = TF_HASSEGS; /* * Reset the hardware debug registers if they were in use. @@ -1380,12 +1400,12 @@ hammer_time(u_int64_t modulep, u_int64_t /* * make gdt memory segments */ - gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&common_tss[0]; - for (x = 0; x < NGDT; x++) { - if (x != GPROC0_SEL && x != (GPROC0_SEL + 1)) + if (x != GPROC0_SEL && x != (GPROC0_SEL + 1) && + x != GUSERLDT_SEL && x != (GUSERLDT_SEL) + 1) ssdtosd(&gdt_segs[x], &gdt[x]); } + gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&common_tss[0]; ssdtosyssd(&gdt_segs[GPROC0_SEL], (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); @@ -1403,6 +1423,10 @@ hammer_time(u_int64_t modulep, u_int64_t PCPU_SET(curthread, &thread0); PCPU_SET(curpcb, thread0.td_pcb); PCPU_SET(tssp, &common_tss[0]); + PCPU_SET(commontssp, &common_tss[0]); + PCPU_SET(tss, (struct system_segment_descriptor *)&gdt[GPROC0_SEL]); + PCPU_SET(ldt, (struct system_segment_descriptor *)&gdt[GUSERLDT_SEL]); + PCPU_SET(fs32p, &gdt[GUFS32_SEL]); PCPU_SET(gs32p, &gdt[GUGS32_SEL]); /* @@ -1415,6 +1439,7 @@ hammer_time(u_int64_t modulep, u_int64_t */ mutex_init(); mtx_init(&icu_lock, "icu", NULL, MTX_SPIN | MTX_NOWITNESS); + mtx_init(&dt_lock, "descriptor tables", NULL, MTX_DEF); /* exceptions */ for (x = 0; x < NIDT; x++) @@ -1503,7 +1528,8 @@ hammer_time(u_int64_t modulep, u_int64_t common_tss[0].tss_ist2 = (long) np; /* Set the IO permission bitmap (empty due to tss seg limit) */ - common_tss[0].tss_iobase = sizeof(struct amd64tss); + common_tss[0].tss_iobase = sizeof(struct amd64tss) + + IOPAGES * PAGE_SIZE; gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); ltr(gsel_tss); @@ -1531,10 +1557,12 @@ hammer_time(u_int64_t modulep, u_int64_t _ucodesel = GSEL(GUCODE_SEL, SEL_UPL); _udatasel = GSEL(GUDATA_SEL, SEL_UPL); _ucode32sel = GSEL(GUCODE32_SEL, SEL_UPL); + _ufssel = GSEL(GUFS32_SEL, SEL_UPL); + _ugssel = GSEL(GUGS32_SEL, SEL_UPL); load_ds(_udatasel); load_es(_udatasel); - load_fs(_udatasel); + load_fs(_ufssel); /* setup proc 0's pcb */ thread0.td_pcb->pcb_flags = 0; @@ -1656,6 +1684,17 @@ fill_regs(struct thread *td, struct reg regs->r_rflags = tp->tf_rflags; regs->r_rsp = tp->tf_rsp; regs->r_ss = tp->tf_ss; + if (tp->tf_flags & TF_HASSEGS) { + regs->r_ds = tp->tf_ds; + regs->r_es = tp->tf_es; + regs->r_fs = tp->tf_fs; + regs->r_gs = tp->tf_gs; + } else { + regs->r_ds = 0; + regs->r_es = 0; + regs->r_fs = 0; + regs->r_gs = 0; + } return (0); } @@ -1689,6 +1728,13 @@ set_regs(struct thread *td, struct reg * tp->tf_rflags = rflags; tp->tf_rsp = regs->r_rsp; tp->tf_ss = regs->r_ss; + if (0) { /* XXXKIB */ + tp->tf_ds = regs->r_ds; + tp->tf_es = regs->r_es; + tp->tf_fs = regs->r_fs; + tp->tf_gs = regs->r_gs; + tp->tf_flags = TF_HASSEGS; + } td->td_pcb->pcb_flags |= PCB_FULLCTX; return (0); } @@ -1808,8 +1854,15 @@ get_mcontext(struct thread *td, mcontext mcp->mc_cs = tp->tf_cs; mcp->mc_rsp = tp->tf_rsp; mcp->mc_ss = tp->tf_ss; + mcp->mc_ds = tp->tf_ds; + mcp->mc_es = tp->tf_es; + mcp->mc_fs = tp->tf_fs; + mcp->mc_gs = tp->tf_gs; + mcp->mc_flags = tp->tf_flags; mcp->mc_len = sizeof(*mcp); get_fpcontext(td, mcp); + mcp->mc_fsbase = td->td_pcb->pcb_fsbase; + mcp->mc_gsbase = td->td_pcb->pcb_gsbase; return (0); } @@ -1827,7 +1880,8 @@ set_mcontext(struct thread *td, const mc int ret; tp = td->td_frame; - if (mcp->mc_len != sizeof(*mcp)) + if (mcp->mc_len != sizeof(*mcp) || + (mcp->mc_flags & ~_MC_FLAG_MASK) != 0) return (EINVAL); rflags = (mcp->mc_rflags & PSL_USERCHANGE) | (tp->tf_rflags & ~PSL_USERCHANGE); @@ -1853,6 +1907,17 @@ set_mcontext(struct thread *td, const mc tp->tf_rflags = rflags; tp->tf_rsp = mcp->mc_rsp; tp->tf_ss = mcp->mc_ss; + tp->tf_flags = mcp->mc_flags; + if (tp->tf_flags & TF_HASSEGS) { + tp->tf_ds = mcp->mc_ds; + tp->tf_es = mcp->mc_es; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 13:11:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55C671065672; Wed, 1 Apr 2009 13:11:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43FD78FC17; Wed, 1 Apr 2009 13:11:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31DBpve032765; Wed, 1 Apr 2009 13:11:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31DBpN9032763; Wed, 1 Apr 2009 13:11:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011311.n31DBpN9032763@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 13:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190621 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 13:11:52 -0000 Author: kib Date: Wed Apr 1 13:11:50 2009 New Revision: 190621 URL: http://svn.freebsd.org/changeset/base/190621 Log: Rename implementation function for freebsd32 sysarch(2) to allow for the arguments translations. Provide ABI-compatible definition of the struct i386_ldt_args for freebsd32 compat layer. In collaboration with: pho Reviewed by: jhb Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/syscalls.master Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Wed Apr 1 13:09:26 2009 (r190620) +++ head/sys/compat/freebsd32/freebsd32.h Wed Apr 1 13:11:50 2009 (r190621) @@ -191,4 +191,10 @@ struct thr_param32 { uint32_t spare[3]; }; +struct i386_ldt_args32 { + uint32_t start; + uint32_t descs; + uint32_t num; +}; + #endif /* !_COMPAT_FREEBSD32_FREEBSD32_H_ */ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Apr 1 13:09:26 2009 (r190620) +++ head/sys/compat/freebsd32/syscalls.master Wed Apr 1 13:11:50 2009 (r190621) @@ -298,7 +298,7 @@ 162 AUE_NULL OBSOL getdomainname 163 AUE_NULL OBSOL setdomainname 164 AUE_NULL OBSOL uname -165 AUE_SYSARCH NOPROTO { int sysarch(int op, char *parms); } +165 AUE_SYSARCH STD { int freebsd32_sysarch(int op, char *parms); } 166 AUE_RTPRIO NOPROTO { int rtprio(int function, pid_t pid, \ struct rtprio *rtp); } 167 AUE_NULL UNIMPL nosys From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 13:12:41 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65991106568F; Wed, 1 Apr 2009 13:12:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50B498FC18; Wed, 1 Apr 2009 13:12:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31DCfvS032824; Wed, 1 Apr 2009 13:12:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31DCfid032820; Wed, 1 Apr 2009 13:12:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011312.n31DCfid032820@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 13:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190622 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 13:12:44 -0000 Author: kib Date: Wed Apr 1 13:12:40 2009 New Revision: 190622 URL: http://svn.freebsd.org/changeset/base/190622 Log: Regen Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Apr 1 13:11:50 2009 (r190621) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Apr 1 13:12:40 2009 (r190622) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 190621 2009-04-01 13:11:50Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -119,6 +119,10 @@ struct freebsd32_adjtime_args { char delta_l_[PADL_(struct timeval32 *)]; struct timeval32 * delta; char delta_r_[PADR_(struct timeval32 *)]; char olddelta_l_[PADL_(struct timeval32 *)]; struct timeval32 * olddelta; char olddelta_r_[PADR_(struct timeval32 *)]; }; +struct freebsd32_sysarch_args { + char op_l_[PADL_(int)]; int op; char op_r_[PADR_(int)]; + char parms_l_[PADL_(char *)]; char * parms; char parms_r_[PADR_(char *)]; +}; struct freebsd32_semsys_args { char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; char a2_l_[PADL_(int)]; int a2; char a2_r_[PADR_(int)]; @@ -456,6 +460,7 @@ int freebsd32_writev(struct thread *, st int freebsd32_settimeofday(struct thread *, struct freebsd32_settimeofday_args *); int freebsd32_utimes(struct thread *, struct freebsd32_utimes_args *); int freebsd32_adjtime(struct thread *, struct freebsd32_adjtime_args *); +int freebsd32_sysarch(struct thread *, struct freebsd32_sysarch_args *); int freebsd32_semsys(struct thread *, struct freebsd32_semsys_args *); int freebsd32_msgsys(struct thread *, struct freebsd32_msgsys_args *); int freebsd32_shmsys(struct thread *, struct freebsd32_shmsys_args *); @@ -682,6 +687,7 @@ int freebsd6_freebsd32_ftruncate(struct #define FREEBSD32_SYS_AUE_freebsd32_settimeofday AUE_SETTIMEOFDAY #define FREEBSD32_SYS_AUE_freebsd32_utimes AUE_UTIMES #define FREEBSD32_SYS_AUE_freebsd32_adjtime AUE_ADJTIME +#define FREEBSD32_SYS_AUE_freebsd32_sysarch AUE_SYSARCH #define FREEBSD32_SYS_AUE_freebsd32_semsys AUE_SEMSYS #define FREEBSD32_SYS_AUE_freebsd32_msgsys AUE_MSGSYS #define FREEBSD32_SYS_AUE_freebsd32_shmsys AUE_SHMSYS Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Apr 1 13:11:50 2009 (r190621) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Apr 1 13:12:40 2009 (r190622) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 190621 2009-04-01 13:11:50Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -159,7 +159,7 @@ /* 162 is obsolete getdomainname */ /* 163 is obsolete setdomainname */ /* 164 is obsolete uname */ -#define FREEBSD32_SYS_sysarch 165 +#define FREEBSD32_SYS_freebsd32_sysarch 165 #define FREEBSD32_SYS_rtprio 166 #define FREEBSD32_SYS_freebsd32_semsys 169 #define FREEBSD32_SYS_freebsd32_msgsys 170 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Apr 1 13:11:50 2009 (r190621) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Apr 1 13:12:40 2009 (r190622) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 190621 2009-04-01 13:11:50Z kib */ const char *freebsd32_syscallnames[] = { @@ -172,7 +172,7 @@ const char *freebsd32_syscallnames[] = { "obs_getdomainname", /* 162 = obsolete getdomainname */ "obs_setdomainname", /* 163 = obsolete setdomainname */ "obs_uname", /* 164 = obsolete uname */ - "sysarch", /* 165 = sysarch */ + "freebsd32_sysarch", /* 165 = freebsd32_sysarch */ "rtprio", /* 166 = rtprio */ "#167", /* 167 = nosys */ "#168", /* 168 = nosys */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Apr 1 13:11:50 2009 (r190621) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Apr 1 13:12:40 2009 (r190622) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 185878 2008-12-10 20:56:19Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 190621 2009-04-01 13:11:50Z kib */ #include "opt_compat.h" @@ -203,7 +203,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 162 = obsolete getdomainname */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 163 = obsolete setdomainname */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 164 = obsolete uname */ - { AS(sysarch_args), (sy_call_t *)sysarch, AUE_SYSARCH, NULL, 0, 0 }, /* 165 = sysarch */ + { AS(freebsd32_sysarch_args), (sy_call_t *)freebsd32_sysarch, AUE_SYSARCH, NULL, 0, 0 }, /* 165 = freebsd32_sysarch */ { AS(rtprio_args), (sy_call_t *)rtprio, AUE_RTPRIO, NULL, 0, 0 }, /* 166 = rtprio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 167 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0 }, /* 168 = nosys */ From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 13:44:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D3A10656CD; Wed, 1 Apr 2009 13:44:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21B608FC1E; Wed, 1 Apr 2009 13:44:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31DiTZA033504; Wed, 1 Apr 2009 13:44:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31DiSiD033502; Wed, 1 Apr 2009 13:44:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011344.n31DiSiD033502@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 13:44:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190623 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 13:44:30 -0000 Author: kib Date: Wed Apr 1 13:44:28 2009 New Revision: 190623 URL: http://svn.freebsd.org/changeset/base/190623 Log: Sync definitions for struct sigcontext for i386 and amd64 architectures to struct mcontext. Modified: head/sys/amd64/include/signal.h head/sys/i386/include/signal.h Modified: head/sys/amd64/include/signal.h ============================================================================== --- head/sys/amd64/include/signal.h Wed Apr 1 13:12:40 2009 (r190622) +++ head/sys/amd64/include/signal.h Wed Apr 1 13:44:28 2009 (r190623) @@ -78,9 +78,13 @@ struct sigcontext { long sc_r13; long sc_r14; long sc_r15; - long sc_trapno; + int sc_trapno; + short sc_fs; + short sc_gs; long sc_addr; - long sc_flags; + int sc_flags; + short sc_es; + short sc_ds; long sc_err; long sc_rip; long sc_cs; @@ -95,7 +99,11 @@ struct sigcontext { long sc_fpformat; long sc_ownedfp; long sc_fpstate[64] __aligned(16); - long sc_spare[8]; + + long sc_fsbase; + long sc_gsbase; + + long sc_spare[6]; }; #endif /* __BSD_VISIBLE */ Modified: head/sys/i386/include/signal.h ============================================================================== --- head/sys/i386/include/signal.h Wed Apr 1 13:12:40 2009 (r190622) +++ head/sys/i386/include/signal.h Wed Apr 1 13:44:28 2009 (r190623) @@ -116,7 +116,11 @@ struct sigcontext { int sc_ownedfp; int sc_spare1[1]; int sc_fpstate[128] __aligned(16); - int sc_spare2[8]; + + int sc_fsbase; + int sc_gsbase; + + int sc_spare2[6]; }; #define sc_sp sc_esp From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 14:38:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDB8106564A; Wed, 1 Apr 2009 14:38:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112D78FC08; Wed, 1 Apr 2009 14:38:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31EcKVW034594; Wed, 1 Apr 2009 14:38:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31EcKIg034592; Wed, 1 Apr 2009 14:38:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011438.n31EcKIg034592@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 14:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190624 - in head: lib/libc/gen libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 14:38:21 -0000 Author: kib Date: Wed Apr 1 14:38:20 2009 New Revision: 190624 URL: http://svn.freebsd.org/changeset/base/190624 Log: Document RTLD_NODELETE, -z nodelete and -z origin support. Modified: head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/rtld.1 Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Wed Apr 1 13:44:28 2009 (r190623) +++ head/lib/libc/gen/dlopen.3 Wed Apr 1 14:38:20 2009 (r190624) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd April 1, 2009 .Os .Dt DLOPEN 3 .Sh NAME @@ -123,7 +123,7 @@ call to One of the following flags may be ORed into the .Fa mode argument: -.Bl -tag -width RTLD_GLOBALX +.Bl -tag -width RTLD_NODELETE .It Dv RTLD_GLOBAL Symbols from this shared object and its directed acyclic graph (DAG) of needed objects will be available for resolving undefined references @@ -141,6 +141,13 @@ the absolute pathnames of all objects, t With this flag .Fn dlopen will return to the caller only in the case of error. +.It Dv RTLD_NODELETE +Prevents unload of the loaded object on +.Fn dlclose . +The same behaviour may be requested by +.Fl "z nodelete" +option of the static linker +.Xr ld 1 . .El .Pp If Modified: head/libexec/rtld-elf/rtld.1 ============================================================================== --- head/libexec/rtld-elf/rtld.1 Wed Apr 1 13:44:28 2009 (r190623) +++ head/libexec/rtld-elf/rtld.1 Wed Apr 1 14:38:20 2009 (r190624) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2009 +.Dd April 1, 2009 .Dt RTLD 1 .Os .Sh NAME @@ -58,6 +58,25 @@ to be called on a per-object basis, givi to perform any extra set-up before execution of the program proper begins. This is useful for C++ libraries that contain static constructors. .Pp +When resolving dependencies for the loaded objects, +.Nm +may be allowed to translate dynamic token strings in rpath and soname +by setting +.Fl "z origin" +option of the static linker +.Xr ld 1 . +The following strings are recognized now: +.Bl -tag -width ".Pa $PLATFORM" +.It Pa $ORIGIN +Translated to the full path of the loaded object. +.It Pa $OSNAME +Translated to the name of the operating system implementation. +.It Pa $OSREL +Translated to the release level of the operating system. +.It Pa $PLATFORM +Translated to the machine hardware platform. +.El +.Pp The .Nm utility itself is loaded by the kernel together with any dynamically-linked From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 16:24:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0F731065670; Wed, 1 Apr 2009 16:24:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1178FC08; Wed, 1 Apr 2009 16:24:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31GOOtn036724; Wed, 1 Apr 2009 16:24:24 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31GOOXJ036722; Wed, 1 Apr 2009 16:24:24 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200904011624.n31GOOXJ036722@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 1 Apr 2009 16:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190626 - in head/sys/amd64: amd64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 16:24:25 -0000 Author: jkim Date: Wed Apr 1 16:24:24 2009 New Revision: 190626 URL: http://svn.freebsd.org/changeset/base/190626 Log: Garbage collect unused stack segment since r190620. Modified: head/sys/amd64/amd64/genassym.c head/sys/amd64/include/pcb.h Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Wed Apr 1 15:29:22 2009 (r190625) +++ head/sys/amd64/amd64/genassym.c Wed Apr 1 16:24:24 2009 (r190626) @@ -161,7 +161,6 @@ ASSYM(XPCB_CR0, offsetof(struct xpcb, xp ASSYM(XPCB_CR2, offsetof(struct xpcb, xpcb_cr2)); ASSYM(XPCB_CR4, offsetof(struct xpcb, xpcb_cr4)); ASSYM(XPCB_KGSBASE, offsetof(struct xpcb, xpcb_kgsbase)); -ASSYM(XPCB_SS, offsetof(struct xpcb, xpcb_ss)); ASSYM(XPCB_GDT, offsetof(struct xpcb, xpcb_gdt)); ASSYM(XPCB_IDT, offsetof(struct xpcb, xpcb_idt)); ASSYM(XPCB_LDT, offsetof(struct xpcb, xpcb_ldt)); Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Wed Apr 1 15:29:22 2009 (r190625) +++ head/sys/amd64/include/pcb.h Wed Apr 1 16:24:24 2009 (r190626) @@ -86,7 +86,6 @@ struct xpcb { register_t xpcb_cr2; register_t xpcb_cr4; register_t xpcb_kgsbase; - uint32_t xpcb_ss; struct region_descriptor xpcb_gdt; struct region_descriptor xpcb_idt; struct region_descriptor xpcb_ldt; From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 17:06:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52048106566C; Wed, 1 Apr 2009 17:06:29 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EBBA8FC13; Wed, 1 Apr 2009 17:06:29 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31H6Tbl037634; Wed, 1 Apr 2009 17:06:29 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31H6Sk1037626; Wed, 1 Apr 2009 17:06:28 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200904011706.n31H6Sk1037626@svn.freebsd.org> From: Doug Rabson Date: Wed, 1 Apr 2009 17:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190627 - in head/sys: dev/xen/balloon dev/xen/console i386/include/xen i386/xen xen xen/evtchn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 17:06:29 -0000 Author: dfr Date: Wed Apr 1 17:06:28 2009 New Revision: 190627 URL: http://svn.freebsd.org/changeset/base/190627 Log: Fix the Xen build for i386 PV mode. Modified: head/sys/dev/xen/balloon/balloon.c head/sys/dev/xen/console/console.c head/sys/i386/include/xen/xenpmap.h head/sys/i386/include/xen/xenvar.h head/sys/i386/xen/pmap.c head/sys/i386/xen/xen_machdep.c head/sys/xen/evtchn/evtchn.c head/sys/xen/reboot.c (contents, props changed) Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/dev/xen/balloon/balloon.c Wed Apr 1 17:06:28 2009 (r190627) @@ -167,6 +167,8 @@ minimum_target(void) { #ifdef XENHVM #define max_pfn physmem +#else +#define max_pfn HYPERVISOR_shared_info->arch.max_pfn #endif unsigned long min_pages, curr_pages = current_target(); @@ -256,6 +258,7 @@ increase_reservation(unsigned long nr_pa set_phys_to_machine(pfn, frame_list[i]); +#if 0 #ifndef XENHVM /* Link back into the page tables if not highmem. */ if (pfn < max_low_pfn) { @@ -268,6 +271,7 @@ increase_reservation(unsigned long nr_pa ("HYPERVISOR_update_va_mapping failed")); } #endif +#endif /* Relinquish the page back to the allocator. */ vm_page_unwire(page, 0); @@ -447,6 +451,9 @@ balloon_init(void *arg) { #ifndef XENHVM vm_page_t page; + unsigned long pfn; + +#define max_pfn HYPERVISOR_shared_info->arch.max_pfn #endif if (!is_running_on_xen()) @@ -477,6 +484,7 @@ balloon_init(void *arg) page = PHYS_TO_VM_PAGE(pfn << PAGE_SHIFT); balloon_append(page); } +#undef max_pfn #endif target_watch.callback = watch_target; Modified: head/sys/dev/xen/console/console.c ============================================================================== --- head/sys/dev/xen/console/console.c Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/dev/xen/console/console.c Wed Apr 1 17:06:28 2009 (r190627) @@ -225,7 +225,6 @@ static int xc_attach(device_t dev) { int error; - struct xc_softc *sc = (struct xc_softc *)device_get_softc(dev); if (xen_start_info->flags & SIF_INITDOMAIN) { xc_consdev.cn_putc = xccnputc_dom0; @@ -247,7 +246,7 @@ xc_attach(device_t dev) 0, "console", NULL, - xencons_priv_interrupt, + xencons_priv_interrupt, NULL, INTR_TYPE_TTY, NULL); KASSERT(error >= 0, ("can't register console interrupt")); Modified: head/sys/i386/include/xen/xenpmap.h ============================================================================== --- head/sys/i386/include/xen/xenpmap.h Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/i386/include/xen/xenpmap.h Wed Apr 1 17:06:28 2009 (r190627) @@ -45,6 +45,8 @@ void xen_pt_pin(vm_paddr_t); void xen_pt_unpin(vm_paddr_t); void xen_flush_queue(void); void pmap_ref(pt_entry_t *pte, vm_paddr_t ma); +void pmap_suspend(void); +void pmap_resume(void); void xen_check_queue(void); #ifdef INVARIANTS Modified: head/sys/i386/include/xen/xenvar.h ============================================================================== --- head/sys/i386/include/xen/xenvar.h Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/i386/include/xen/xenvar.h Wed Apr 1 17:06:28 2009 (r190627) @@ -40,6 +40,8 @@ extern int xendebug_flags; #include extern xen_pfn_t *xen_phys_machine; +extern xen_pfn_t *xen_pfn_to_mfn_frame_list[16]; +extern xen_pfn_t *xen_pfn_to_mfn_frame_list_list; #if 0 #define TRACE_ENTER XENPRINTF("(file=%s, line=%d) entered %s\n", __FILE__, __LINE__, __FUNCTION__) Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/i386/xen/pmap.c Wed Apr 1 17:06:28 2009 (r190627) @@ -4100,6 +4100,72 @@ pmap_align_superpage(vm_object_t object, *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } +#ifdef XEN + +void +pmap_suspend() +{ + pmap_t pmap; + int i, pdir, offset; + vm_paddr_t pdirma; + mmu_update_t mu[4]; + + /* + * We need to remove the recursive mapping structure from all + * our pmaps so that Xen doesn't get confused when it restores + * the page tables. The recursive map lives at page directory + * index PTDPTDI. We assume that the suspend code has stopped + * the other vcpus (if any). + */ + LIST_FOREACH(pmap, &allpmaps, pm_list) { + for (i = 0; i < 4; i++) { + /* + * Figure out which page directory (L2) page + * contains this bit of the recursive map and + * the offset within that page of the map + * entry + */ + pdir = (PTDPTDI + i) / NPDEPG; + offset = (PTDPTDI + i) % NPDEPG; + pdirma = pmap->pm_pdpt[pdir] & PG_FRAME; + mu[i].ptr = pdirma + offset * sizeof(pd_entry_t); + mu[i].val = 0; + } + HYPERVISOR_mmu_update(mu, 4, NULL, DOMID_SELF); + } +} + +void +pmap_resume() +{ + pmap_t pmap; + int i, pdir, offset; + vm_paddr_t pdirma; + mmu_update_t mu[4]; + + /* + * Restore the recursive map that we removed on suspend. + */ + LIST_FOREACH(pmap, &allpmaps, pm_list) { + for (i = 0; i < 4; i++) { + /* + * Figure out which page directory (L2) page + * contains this bit of the recursive map and + * the offset within that page of the map + * entry + */ + pdir = (PTDPTDI + i) / NPDEPG; + offset = (PTDPTDI + i) % NPDEPG; + pdirma = pmap->pm_pdpt[pdir] & PG_FRAME; + mu[i].ptr = pdirma + offset * sizeof(pd_entry_t); + mu[i].val = (pmap->pm_pdpt[i] & PG_FRAME) | PG_V; + } + HYPERVISOR_mmu_update(mu, 4, NULL, DOMID_SELF); + } +} + +#endif + #if defined(PMAP_DEBUG) pmap_pid_dump(int pid) { Modified: head/sys/i386/xen/xen_machdep.c ============================================================================== --- head/sys/i386/xen/xen_machdep.c Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/i386/xen/xen_machdep.c Wed Apr 1 17:06:28 2009 (r190627) @@ -89,6 +89,8 @@ start_info_t *xen_start_info; shared_info_t *HYPERVISOR_shared_info; xen_pfn_t *xen_machine_phys = machine_to_phys_mapping; xen_pfn_t *xen_phys_machine; +xen_pfn_t *xen_pfn_to_mfn_frame_list[16]; +xen_pfn_t *xen_pfn_to_mfn_frame_list_list; int preemptable, init_first; extern unsigned int avail_space; @@ -810,6 +812,39 @@ shift_phys_machine(unsigned long *phys_m } #endif /* ADD_ISA_HOLE */ +/* + * Build a directory of the pages that make up our Physical to Machine + * mapping table. The Xen suspend/restore code uses this to find our + * mapping table. + */ +static void +init_frame_list_list(void *arg) +{ + unsigned long nr_pages = xen_start_info->nr_pages; +#define FPP (PAGE_SIZE/sizeof(xen_pfn_t)) + int i, j, k; + + xen_pfn_to_mfn_frame_list_list = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK); + for (i = 0, j = 0, k = -1; i < nr_pages; + i += FPP, j++) { + if ((j & (FPP - 1)) == 0) { + k++; + xen_pfn_to_mfn_frame_list[k] = + malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK); + xen_pfn_to_mfn_frame_list_list[k] = + VTOMFN(xen_pfn_to_mfn_frame_list[k]); + j = 0; + } + xen_pfn_to_mfn_frame_list[k][j] = + VTOMFN(&xen_phys_machine[i]); + } + + HYPERVISOR_shared_info->arch.max_pfn = nr_pages; + HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list + = VTOMFN(xen_pfn_to_mfn_frame_list_list); +} +SYSINIT(init_fll, SI_SUB_DEVFS, SI_ORDER_ANY, init_frame_list_list, NULL); + extern unsigned long physfree; int pdir, curoffset; @@ -1081,7 +1116,6 @@ initvalues(start_info_t *startinfo) PT_SET_MA(console_page, console_page_ma | PG_KERNEL); printk("#5\n"); - HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = (unsigned long)xen_phys_machine; set_iopl.iopl = 1; PANIC_IF(HYPERVISOR_physdev_op(PHYSDEVOP_SET_IOPL, &set_iopl)); Modified: head/sys/xen/evtchn/evtchn.c ============================================================================== --- head/sys/xen/evtchn/evtchn.c Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/xen/evtchn/evtchn.c Wed Apr 1 17:06:28 2009 (r190627) @@ -512,7 +512,7 @@ bind_interdomain_evtchn_to_irqhandler(un int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu, const char *devname, driver_filter_t filter, driver_intr_t handler, - unsigned long irqflags, unsigned int *irqp) + void *arg, unsigned long irqflags, unsigned int *irqp) { unsigned int irq; int error; Modified: head/sys/xen/reboot.c ============================================================================== --- head/sys/xen/reboot.c Wed Apr 1 16:24:24 2009 (r190626) +++ head/sys/xen/reboot.c Wed Apr 1 17:06:28 2009 (r190627) @@ -176,9 +176,9 @@ xen_suspend() /* * Bind us to CPU 0 and stop any other VCPUs. */ - mtx_lock_spin(&sched_lock); + thread_lock(curthread); sched_bind(curthread, 0); - mtx_unlock_spin(&sched_lock); + thread_unlock(curthread); KASSERT(PCPU_GET(cpuid) == 0, ("xen_suspend: not running on cpu 0")); map = PCPU_GET(other_cpus) & ~stopped_cpus; @@ -188,8 +188,10 @@ xen_suspend() if (DEVICE_SUSPEND(root_bus) != 0) { printf("xen_suspend: device_suspend failed\n"); +#ifdef SMP if (map) restart_cpus(map); +#endif return; } @@ -253,7 +255,9 @@ xen_suspend() DEVICE_RESUME(root_bus); #ifdef SMP + thread_lock(curthread); sched_unbind(curthread); + thread_unlock(curthread); if (map) restart_cpus(map); #endif From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 17:11:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21EF110656BC; Wed, 1 Apr 2009 17:11:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9638FC28; Wed, 1 Apr 2009 17:11:50 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31HBoqa037783; Wed, 1 Apr 2009 17:11:50 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31HBocn037782; Wed, 1 Apr 2009 17:11:50 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200904011711.n31HBocn037782@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 1 Apr 2009 17:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190628 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 17:12:17 -0000 Author: bz Date: Wed Apr 1 17:11:50 2009 New Revision: 190628 URL: http://svn.freebsd.org/changeset/base/190628 Log: Add a new world named 'mips' to our universe. Discussed with: imp Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Apr 1 17:06:28 2009 (r190627) +++ head/Makefile Wed Apr 1 17:11:50 2009 (r190628) @@ -279,7 +279,7 @@ tinderbox: # existing system is. # .if make(universe) || make(tinderbox) -TARGETS?=amd64 arm i386 ia64 pc98 powerpc sparc64 sun4v +TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v .if defined(DOING_TINDERBOX) FAILFILE=tinderbox.failed From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 18:36:35 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 157661065673; Wed, 1 Apr 2009 18:36:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0440C8FC19; Wed, 1 Apr 2009 18:36:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31IaY6v039469; Wed, 1 Apr 2009 18:36:34 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31IaYSr039468; Wed, 1 Apr 2009 18:36:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200904011836.n31IaYSr039468@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 1 Apr 2009 18:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190629 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 18:36:35 -0000 Author: jkim Date: Wed Apr 1 18:36:34 2009 New Revision: 190629 URL: http://svn.freebsd.org/changeset/base/190629 Log: Garbage collect unused MSR_GSBASE since r190620. The only consumer was exception.S and specialreg.h is directly included now. Note no md5 changes were observed for all assym.s consumers with this. Modified: head/sys/amd64/amd64/genassym.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Wed Apr 1 17:11:50 2009 (r190628) +++ head/sys/amd64/amd64/genassym.c Wed Apr 1 18:36:34 2009 (r190629) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include ASSYM(P_VMSPACE, offsetof(struct proc, p_vmspace)); @@ -246,8 +245,6 @@ ASSYM(TSSSEL, GSEL(GPROC0_SEL, SEL_KPL)) ASSYM(LDTSEL, GSEL(GUSERLDT_SEL, SEL_KPL)); ASSYM(SEL_RPL_MASK, SEL_RPL_MASK); -ASSYM(MSR_GSBASE, MSR_GSBASE); - #ifdef HWPMC_HOOKS ASSYM(PMC_FN_USER_CALLCHAIN, PMC_FN_USER_CALLCHAIN); #endif From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 18:55:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61DF01065674; Wed, 1 Apr 2009 18:55:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 502598FC1D; Wed, 1 Apr 2009 18:55:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31It8TU039871; Wed, 1 Apr 2009 18:55:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31It8Dn039870; Wed, 1 Apr 2009 18:55:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200904011855.n31It8Dn039870@svn.freebsd.org> From: Alexander Motin Date: Wed, 1 Apr 2009 18:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190630 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 18:55:09 -0000 Author: mav Date: Wed Apr 1 18:55:08 2009 New Revision: 190630 URL: http://svn.freebsd.org/changeset/base/190630 Log: Add some more logic for AD1986A codec input tracing. Use mic preamplifier only for mic-type inputs. This gives better chances to use it. Change default configuration for some AD1986A codec based ASUS boards, use it also for ASUS P5PL2 board. This makes front mic preamplifier working. Tested by: Vadim Frolov Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed Apr 1 18:36:34 2009 (r190629) +++ head/sys/dev/sound/pci/hda/hdac.c Wed Apr 1 18:55:08 2009 (r190630) @@ -83,7 +83,7 @@ #include "mixer_if.h" -#define HDA_DRV_TEST_REV "20090329_0131" +#define HDA_DRV_TEST_REV "20090401_0132" SND_DECLARE_FILE("$FreeBSD$"); @@ -261,6 +261,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define ASUS_A7T_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x13c2) #define ASUS_W2J_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1971) #define ASUS_M5200_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x1993) +#define ASUS_P5PL2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x817f) #define ASUS_P1AH2_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) #define ASUS_M2NPVMX_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81cb) #define ASUS_M2V_SUBVENDOR HDA_MODEL_CONSTRUCT(ASUS, 0x81e7) @@ -2425,13 +2426,20 @@ hdac_widget_pin_getconfig(struct hdac_wi /* New patches */ if (id == HDA_CODEC_AD1986A && (sc->pci_subvendor == ASUS_M2NPVMX_SUBVENDOR || - sc->pci_subvendor == ASUS_A8NVMCSM_SUBVENDOR)) { + sc->pci_subvendor == ASUS_A8NVMCSM_SUBVENDOR || + sc->pci_subvendor == ASUS_P5PL2_SUBVENDOR)) { switch (nid) { - case 28: /* 5.1 out => 2.0 out + 2 inputs */ + case 26: /* Headphones with redirection */ + patch = "as=1 seq=15"; + break; + case 28: /* 5.1 out => 2.0 out + 1 input */ patch = "device=Line-in as=8 seq=1"; break; - case 29: - patch = "device=Mic as=8 seq=2"; + case 29: /* Can't use this as input, as the only available mic + * preamplifier is busy by front panel mic (nid 31). + * If you want to use this rear connector as mic input, + * you have to disable the front panel one. */ + patch = "as=0"; break; case 31: /* Lot of inputs configured with as=15 and unusable */ patch = "as=8 seq=3"; @@ -4731,6 +4739,35 @@ hdac_vendor_patch_parse(struct hdac_devi w = hdac_widget_get(devinfo, 15); if (w != NULL) w->connsenable[3] = 0; + /* There is only one mic preamplifier, use it effectively. */ + w = hdac_widget_get(devinfo, 31); + if (w != NULL) { + if ((w->wclass.pin.config & + HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) == + HDA_CONFIG_DEFAULTCONF_DEVICE_MIC_IN) { + w = hdac_widget_get(devinfo, 16); + if (w != NULL) + w->connsenable[2] = 0; + } else { + w = hdac_widget_get(devinfo, 15); + if (w != NULL) + w->connsenable[0] = 0; + } + } + w = hdac_widget_get(devinfo, 32); + if (w != NULL) { + if ((w->wclass.pin.config & + HDA_CONFIG_DEFAULTCONF_DEVICE_MASK) == + HDA_CONFIG_DEFAULTCONF_DEVICE_MIC_IN) { + w = hdac_widget_get(devinfo, 16); + if (w != NULL) + w->connsenable[0] = 0; + } else { + w = hdac_widget_get(devinfo, 15); + if (w != NULL) + w->connsenable[1] = 0; + } + } if (subvendor == ASUS_A8X_SUBVENDOR) { /* From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 19:23:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0BDA1065674; Wed, 1 Apr 2009 19:23:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE8EF8FC1B; Wed, 1 Apr 2009 19:23:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31JN7lQ040436; Wed, 1 Apr 2009 19:23:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31JN7Pa040434; Wed, 1 Apr 2009 19:23:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011923.n31JN7Pa040434@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 19:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190631 - in head/sys: conf ia64/ia32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 19:23:08 -0000 Author: kib Date: Wed Apr 1 19:23:07 2009 New Revision: 190631 URL: http://svn.freebsd.org/changeset/base/190631 Log: Add trivial implementation for the freebsd32_sysarch on ia64. Fix comapt32 and LINT build on ia64. Discussed with: jhb Added: head/sys/ia64/ia32/ia32_misc.c (contents, props changed) Modified: head/sys/conf/files.ia64 Modified: head/sys/conf/files.ia64 ============================================================================== --- head/sys/conf/files.ia64 Wed Apr 1 18:55:08 2009 (r190630) +++ head/sys/conf/files.ia64 Wed Apr 1 19:23:07 2009 (r190631) @@ -70,6 +70,7 @@ ia64/acpica/madt.c optional acpi ia64/disasm/disasm_decode.c standard ia64/disasm/disasm_extract.c standard ia64/disasm/disasm_format.c standard +ia64/ia32/ia32_misc.c optional compat_ia32 ia64/ia32/ia32_reg.c optional compat_ia32 ia64/ia32/ia32_signal.c optional compat_ia32 ia64/ia32/ia32_trap.c optional compat_ia32 Added: head/sys/ia64/ia32/ia32_misc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/ia64/ia32/ia32_misc.c Wed Apr 1 19:23:07 2009 (r190631) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 2009 Konstantin Belousov + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * 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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_compat.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +int +freebsd32_sysarch(struct thread *td, struct freebsd32_sysarch_args *uap) +{ + + return (EOPNOTSUPP); +} From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 19:23:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 339AA1065676; Wed, 1 Apr 2009 19:23:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21EEE8FC1F; Wed, 1 Apr 2009 19:23:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31JNlim040483; Wed, 1 Apr 2009 19:23:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31JNlhh040482; Wed, 1 Apr 2009 19:23:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904011923.n31JNlhh040482@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 1 Apr 2009 19:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190632 - head/lib/libc/i386/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 19:23:48 -0000 Author: kib Date: Wed Apr 1 19:23:46 2009 New Revision: 190632 URL: http://svn.freebsd.org/changeset/base/190632 Log: Unconditionally build wrappers for i386_get_ioperm(), i386_set_ioperm(), i386_get_ldt() and i386_set_ldt(). In collaboration with: pho Reviewed by: jhb Modified: head/lib/libc/i386/sys/Makefile.inc Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Wed Apr 1 19:23:07 2009 (r190631) +++ head/lib/libc/i386/sys/Makefile.inc Wed Apr 1 19:23:46 2009 (r190632) @@ -2,11 +2,10 @@ # $FreeBSD$ .if !defined(COMPAT_32BIT) -SRCS+= i386_clr_watch.c i386_get_ioperm.c \ - i386_set_ioperm.c i386_set_watch.c i386_vm86.c +SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c .endif -SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ldt.c \ - i386_set_fsbase.c i386_set_gsbase.c i386_set_ldt.c +SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ + i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ reboot.S sbrk.S setlogin.S sigreturn.S syscall.S From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 19:49:16 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2AD11065673; Wed, 1 Apr 2009 19:49:16 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout014.mac.com (asmtpout014.mac.com [17.148.16.89]) by mx1.freebsd.org (Postfix) with ESMTP id 888728FC3D; Wed, 1 Apr 2009 19:49:16 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=US-ASCII; format=flowed Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp014.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0KHF00H9RTPTDP10@asmtp014.mac.com>; Wed, 01 Apr 2009 12:49:05 -0700 (PDT) Message-id: From: Marcel Moolenaar To: Konstantin Belousov In-reply-to: <200904011923.n31JN7Pa040434@svn.freebsd.org> Date: Wed, 01 Apr 2009 12:49:04 -0700 References: <200904011923.n31JN7Pa040434@svn.freebsd.org> X-Mailer: Apple Mail (2.930.3) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190631 - in head/sys: conf ia64/ia32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 19:49:20 -0000 On Apr 1, 2009, at 12:23 PM, Konstantin Belousov wrote: > Author: kib > Date: Wed Apr 1 19:23:07 2009 > New Revision: 190631 > URL: http://svn.freebsd.org/changeset/base/190631 > > Log: > Add trivial implementation for the freebsd32_sysarch on ia64. > Fix comapt32 and LINT build on ia64. Thanks! Much appreciated. -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 20:23:48 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E7E4106566C; Wed, 1 Apr 2009 20:23:48 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088B78FC0C; Wed, 1 Apr 2009 20:23:48 +0000 (UTC) (envelope-from piso@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31KNmZM041885; Wed, 1 Apr 2009 20:23:48 GMT (envelope-from piso@svn.freebsd.org) Received: (from piso@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31KNl71041878; Wed, 1 Apr 2009 20:23:47 GMT (envelope-from piso@svn.freebsd.org) Message-Id: <200904012023.n31KNl71041878@svn.freebsd.org> From: Paolo Pisati Date: Wed, 1 Apr 2009 20:23:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190633 - in head: sbin/ipfw sys sys/amd64/include/xen sys/arm/arm sys/contrib/pf sys/dev/ata sys/dev/cxgb sys/dev/sound/usb sys/dev/usb sys/dev/usb/bluetooth sys/dev/usb/controller sys... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 20:23:48 -0000 Author: piso Date: Wed Apr 1 20:23:47 2009 New Revision: 190633 URL: http://svn.freebsd.org/changeset/base/190633 Log: Implement an ipfw action to reassemble ip packets: reass. Modified: head/sbin/ipfw/ (props changed) head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/main.c head/sys/ (props changed) head/sys/amd64/include/xen/ (props changed) head/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) head/sys/contrib/pf/ (props changed) head/sys/dev/ata/ata-usb.c (props changed) head/sys/dev/cxgb/ (props changed) head/sys/dev/sound/usb/uaudio.c (props changed) head/sys/dev/sound/usb/uaudio.h (props changed) head/sys/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/dev/sound/usb/uaudioreg.h (props changed) head/sys/dev/usb/README.TXT (props changed) head/sys/dev/usb/bluetooth/TODO.TXT (props changed) head/sys/dev/usb/bluetooth/ng_ubt.c (props changed) head/sys/dev/usb/bluetooth/ng_ubt_var.h (props changed) head/sys/dev/usb/bluetooth/ubtbcmfw.c (props changed) head/sys/dev/usb/controller/at91dci.c (props changed) head/sys/dev/usb/controller/at91dci.h (props changed) head/sys/dev/usb/controller/at91dci_atmelarm.c (props changed) head/sys/dev/usb/controller/atmegadci.c (props changed) head/sys/dev/usb/controller/atmegadci.h (props changed) head/sys/dev/usb/controller/atmegadci_atmelarm.c (props changed) head/sys/dev/usb/controller/ehci.c (props changed) head/sys/dev/usb/controller/ehci.h (props changed) head/sys/dev/usb/controller/ehci_ixp4xx.c (props changed) head/sys/dev/usb/controller/ehci_mbus.c (props changed) head/sys/dev/usb/controller/ehci_pci.c (props changed) head/sys/dev/usb/controller/musb_otg.c (props changed) head/sys/dev/usb/controller/musb_otg.h (props changed) head/sys/dev/usb/controller/musb_otg_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci.c (props changed) head/sys/dev/usb/controller/ohci.h (props changed) head/sys/dev/usb/controller/ohci_atmelarm.c (props changed) head/sys/dev/usb/controller/ohci_pci.c (props changed) head/sys/dev/usb/controller/uhci.c (props changed) head/sys/dev/usb/controller/uhci.h (props changed) head/sys/dev/usb/controller/uhci_pci.c (props changed) head/sys/dev/usb/controller/usb_controller.c (props changed) head/sys/dev/usb/controller/uss820dci.c (props changed) head/sys/dev/usb/controller/uss820dci.h (props changed) head/sys/dev/usb/controller/uss820dci_atmelarm.c (props changed) head/sys/dev/usb/input/uhid.c (props changed) head/sys/dev/usb/input/ukbd.c (props changed) head/sys/dev/usb/input/ums.c (props changed) head/sys/dev/usb/input/usb_rdesc.h (props changed) head/sys/dev/usb/misc/udbp.c (props changed) head/sys/dev/usb/misc/udbp.h (props changed) head/sys/dev/usb/misc/ufm.c (props changed) head/sys/dev/usb/net/if_aue.c (props changed) head/sys/dev/usb/net/if_auereg.h (props changed) head/sys/dev/usb/net/if_axe.c (props changed) head/sys/dev/usb/net/if_axereg.h (props changed) head/sys/dev/usb/net/if_cdce.c (props changed) head/sys/dev/usb/net/if_cdcereg.h (props changed) head/sys/dev/usb/net/if_cue.c (props changed) head/sys/dev/usb/net/if_cuereg.h (props changed) head/sys/dev/usb/net/if_kue.c (props changed) head/sys/dev/usb/net/if_kuefw.h (props changed) head/sys/dev/usb/net/if_kuereg.h (props changed) head/sys/dev/usb/net/if_rue.c (props changed) head/sys/dev/usb/net/if_ruereg.h (props changed) head/sys/dev/usb/net/if_udav.c (props changed) head/sys/dev/usb/net/if_udavreg.h (props changed) head/sys/dev/usb/net/usb_ethernet.c (props changed) head/sys/dev/usb/net/usb_ethernet.h (props changed) head/sys/dev/usb/quirk/usb_quirk.c (props changed) head/sys/dev/usb/quirk/usb_quirk.h (props changed) head/sys/dev/usb/serial/u3g.c (props changed) head/sys/dev/usb/serial/uark.c (props changed) head/sys/dev/usb/serial/ubsa.c (props changed) head/sys/dev/usb/serial/ubser.c (props changed) head/sys/dev/usb/serial/uchcom.c (props changed) head/sys/dev/usb/serial/ucycom.c (props changed) head/sys/dev/usb/serial/ufoma.c (props changed) head/sys/dev/usb/serial/uftdi.c (props changed) head/sys/dev/usb/serial/uftdi_reg.h (props changed) head/sys/dev/usb/serial/ugensa.c (props changed) head/sys/dev/usb/serial/uipaq.c (props changed) head/sys/dev/usb/serial/ulpt.c (props changed) head/sys/dev/usb/serial/umct.c (props changed) head/sys/dev/usb/serial/umodem.c (props changed) head/sys/dev/usb/serial/umoscom.c (props changed) head/sys/dev/usb/serial/uplcom.c (props changed) head/sys/dev/usb/serial/usb_serial.c (props changed) head/sys/dev/usb/serial/usb_serial.h (props changed) head/sys/dev/usb/serial/uslcom.c (props changed) head/sys/dev/usb/serial/uvisor.c (props changed) head/sys/dev/usb/serial/uvscom.c (props changed) head/sys/dev/usb/storage/rio500_usb.h (props changed) head/sys/dev/usb/storage/umass.c (props changed) head/sys/dev/usb/storage/urio.c (props changed) head/sys/dev/usb/storage/ustorage_fs.c (props changed) head/sys/dev/usb/template/usb_template.c (props changed) head/sys/dev/usb/template/usb_template.h (props changed) head/sys/dev/usb/template/usb_template_cdce.c (props changed) head/sys/dev/usb/template/usb_template_msc.c (props changed) head/sys/dev/usb/template/usb_template_mtp.c (props changed) head/sys/dev/usb/ufm_ioctl.h (props changed) head/sys/dev/usb/usb.h (props changed) head/sys/dev/usb/usb_bus.h (props changed) head/sys/dev/usb/usb_busdma.c (props changed) head/sys/dev/usb/usb_busdma.h (props changed) head/sys/dev/usb/usb_cdc.h (props changed) head/sys/dev/usb/usb_compat_linux.c (props changed) head/sys/dev/usb/usb_compat_linux.h (props changed) head/sys/dev/usb/usb_controller.h (props changed) head/sys/dev/usb/usb_core.c (props changed) head/sys/dev/usb/usb_core.h (props changed) head/sys/dev/usb/usb_debug.c (props changed) head/sys/dev/usb/usb_debug.h (props changed) head/sys/dev/usb/usb_defs.h (props changed) head/sys/dev/usb/usb_dev.c (props changed) head/sys/dev/usb/usb_dev.h (props changed) head/sys/dev/usb/usb_device.c (props changed) head/sys/dev/usb/usb_device.h (props changed) head/sys/dev/usb/usb_dynamic.c (props changed) head/sys/dev/usb/usb_dynamic.h (props changed) head/sys/dev/usb/usb_endian.h (props changed) head/sys/dev/usb/usb_error.c (props changed) head/sys/dev/usb/usb_error.h (props changed) head/sys/dev/usb/usb_generic.c (props changed) head/sys/dev/usb/usb_generic.h (props changed) head/sys/dev/usb/usb_handle_request.c (props changed) head/sys/dev/usb/usb_handle_request.h (props changed) head/sys/dev/usb/usb_hid.c (props changed) head/sys/dev/usb/usb_hid.h (props changed) head/sys/dev/usb/usb_hub.c (props changed) head/sys/dev/usb/usb_hub.h (props changed) head/sys/dev/usb/usb_if.m (props changed) head/sys/dev/usb/usb_ioctl.h (props changed) head/sys/dev/usb/usb_lookup.c (props changed) head/sys/dev/usb/usb_lookup.h (props changed) head/sys/dev/usb/usb_mbuf.c (props changed) head/sys/dev/usb/usb_mbuf.h (props changed) head/sys/dev/usb/usb_mfunc.h (props changed) head/sys/dev/usb/usb_msctest.c (props changed) head/sys/dev/usb/usb_msctest.h (props changed) head/sys/dev/usb/usb_parse.c (props changed) head/sys/dev/usb/usb_parse.h (props changed) head/sys/dev/usb/usb_pci.h (props changed) head/sys/dev/usb/usb_process.c (props changed) head/sys/dev/usb/usb_process.h (props changed) head/sys/dev/usb/usb_request.c (props changed) head/sys/dev/usb/usb_request.h (props changed) head/sys/dev/usb/usb_revision.h (props changed) head/sys/dev/usb/usb_sw_transfer.c (props changed) head/sys/dev/usb/usb_sw_transfer.h (props changed) head/sys/dev/usb/usb_transfer.c (props changed) head/sys/dev/usb/usb_transfer.h (props changed) head/sys/dev/usb/usb_util.c (props changed) head/sys/dev/usb/usb_util.h (props changed) head/sys/dev/usb/usbdevs (props changed) head/sys/dev/usb/usbhid.h (props changed) head/sys/dev/usb/wlan/if_rum.c (props changed) head/sys/dev/usb/wlan/if_rumfw.h (props changed) head/sys/dev/usb/wlan/if_rumreg.h (props changed) head/sys/dev/usb/wlan/if_rumvar.h (props changed) head/sys/dev/usb/wlan/if_ural.c (props changed) head/sys/dev/usb/wlan/if_uralreg.h (props changed) head/sys/dev/usb/wlan/if_uralvar.h (props changed) head/sys/dev/usb/wlan/if_zyd.c (props changed) head/sys/dev/usb/wlan/if_zydfw.h (props changed) head/sys/dev/usb/wlan/if_zydreg.h (props changed) head/sys/dev/usb/wlan/usb_wlan.h (props changed) head/sys/dev/xen/netfront/ (props changed) head/sys/dev/xen/xenpci/ (props changed) head/sys/legacy/dev/ata/ata-usb.c (props changed) head/sys/legacy/dev/sound/usb/uaudio.c (props changed) head/sys/legacy/dev/sound/usb/uaudio.h (props changed) head/sys/legacy/dev/sound/usb/uaudio_pcm.c (props changed) head/sys/legacy/dev/sound/usb/uaudioreg.h (props changed) head/sys/legacy/dev/usb/ (props changed) head/sys/legacy/dev/usb/ehci_ixp4xx.c (props changed) head/sys/mips/mips/elf64_machdep.c (props changed) head/sys/netinet/ip_fw.h head/sys/netinet/ip_fw2.c head/sys/netinet/ip_fw_pfil.c head/sys/xen/evtchn.h (props changed) head/sys/xen/hypervisor.h (props changed) head/sys/xen/xen_intr.h (props changed) Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Apr 1 19:23:46 2009 (r190632) +++ head/sbin/ipfw/ipfw.8 Wed Apr 1 20:23:47 2009 (r190633) @@ -866,6 +866,13 @@ in any subsequent forwarding decisions. Initially this is limited to the values 0 through 15, see .Xr setfib 8 . Processing continues at the next rule. +.It Cm reass +Queue and reassemble ip fragments. +If the packet is not fragmented, counters are updated and processing continues with the next rule. +If the packet is the last logical fragment, the packet is reassembled and, if +.Va net.inet.ip.fw.one_pass +is set to 0, processing continues with the next rule, else packet is allowed to pass and search terminates. +If the packet is a fragment in the middle, it is consumed and processing stops immediately. .El .Ss RULE BODY The body of a rule contains zero or more patterns (such as Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Wed Apr 1 19:23:46 2009 (r190632) +++ head/sbin/ipfw/ipfw2.c Wed Apr 1 20:23:47 2009 (r190633) @@ -211,6 +211,7 @@ static struct _s_x rule_actions[] = { { "check-state", TOK_CHECKSTATE }, { "//", TOK_COMMENT }, { "nat", TOK_NAT }, + { "reass", TOK_REASS }, { "setfib", TOK_SETFIB }, { NULL, 0 } /* terminator */ }; @@ -1089,6 +1090,10 @@ show_ipfw(struct ip_fw *rule, int pcwidt case O_SETFIB: PRINT_UINT_ARG("setfib ", cmd->arg1); break; + + case O_REASS: + printf("reass"); + break; default: printf("** unrecognized action %d len %d ", @@ -2781,6 +2786,10 @@ chkarg: ac--; av++; break; } + + case TOK_REASS: + action->opcode = O_REASS; + break; default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Wed Apr 1 19:23:46 2009 (r190632) +++ head/sbin/ipfw/ipfw2.h Wed Apr 1 20:23:47 2009 (r190633) @@ -95,6 +95,7 @@ enum tokens { TOK_UNREACH, TOK_CHECKSTATE, TOK_NAT, + TOK_REASS, TOK_ALTQ, TOK_LOG, Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Wed Apr 1 19:23:46 2009 (r190632) +++ head/sbin/ipfw/main.c Wed Apr 1 20:23:47 2009 (r190633) @@ -54,7 +54,7 @@ help(void) "RULE-BODY: check-state [PARAMS] | ACTION [PARAMS] ADDR [OPTION_LIST]\n" "ACTION: check-state | allow | count | deny | unreach{,6} CODE |\n" " skipto N | {divert|tee} PORT | forward ADDR |\n" -" pipe N | queue N | nat N | setfib FIB\n" +" pipe N | queue N | nat N | setfib FIB | reass\n" "PARAMS: [log [logamount LOGLIMIT]] [altq QUEUE_NAME]\n" "ADDR: [ MAC dst src ether_type ] \n" " [ ip from IPADDR [ PORT ] to IPADDR [ PORTLIST ] ]\n" Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Apr 1 19:23:46 2009 (r190632) +++ head/sys/netinet/ip_fw.h Wed Apr 1 20:23:47 2009 (r190633) @@ -139,7 +139,8 @@ enum ipfw_opcodes { /* arguments (4 byt O_FORWARD_IP, /* fwd sockaddr */ O_FORWARD_MAC, /* fwd mac */ O_NAT, /* nope */ - + O_REASS, /* none */ + /* * More opcodes. */ @@ -574,6 +575,7 @@ enum { IP_FW_NETGRAPH, IP_FW_NGTEE, IP_FW_NAT, + IP_FW_REASS, }; /* flags for divert mtag */ Modified: head/sys/netinet/ip_fw2.c ============================================================================== --- head/sys/netinet/ip_fw2.c Wed Apr 1 19:23:46 2009 (r190632) +++ head/sys/netinet/ip_fw2.c Wed Apr 1 20:23:47 2009 (r190633) @@ -898,6 +898,9 @@ ipfw_log(struct ip_fw *f, u_int hlen, st case O_NAT: action = "Nat"; break; + case O_REASS: + action = "Reass"; + break; default: action = "UNKNOWN"; break; @@ -3375,6 +3378,55 @@ check_body: goto done; } + case O_REASS: { + int ip_off; + + f->pcnt++; + f->bcnt += pktlen; + ip_off = (args->eh != NULL) ? ntohs(ip->ip_off) : ip->ip_off; + if (ip_off & (IP_MF | IP_OFFMASK)) { + /* + * ip_reass() expects len & off in host + * byte order: fix them in case we come + * from layer2. + */ + if (args->eh != NULL) { + ip->ip_len = ntohs(ip->ip_len); + ip->ip_off = ntohs(ip->ip_off); + } + + m = ip_reass(m); + args->m = m; + + /* + * IP header checksum fixup after + * reassembly and leave header + * in network byte order. + */ + if (m != NULL) { + int hlen; + + ip = mtod(m, struct ip *); + hlen = ip->ip_hl << 2; + /* revert len & off for layer2 pkts */ + if (args->eh != NULL) + ip->ip_len = htons(ip->ip_len); + ip->ip_sum = 0; + if (hlen == sizeof(struct ip)) + ip->ip_sum = in_cksum_hdr(ip); + else + ip->ip_sum = in_cksum(m, hlen); + retval = IP_FW_REASS; + args->rule = f; + goto done; + } else { + retval = IP_FW_DENY; + goto done; + } + } + goto next_rule; + } + default: panic("-- unknown opcode %d\n", cmd->opcode); } /* end of switch() on opcodes */ @@ -4024,6 +4076,7 @@ check_ipfw_struct(struct ip_fw *rule, in case O_UNREACH6: #endif case O_SKIPTO: + case O_REASS: check_size: if (cmdlen != F_INSN_SIZE(ipfw_insn)) goto bad_size; Modified: head/sys/netinet/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ip_fw_pfil.c Wed Apr 1 19:23:46 2009 (r190632) +++ head/sys/netinet/ip_fw_pfil.c Wed Apr 1 20:23:47 2009 (r190633) @@ -200,6 +200,9 @@ again: case IP_FW_NAT: goto again; /* continue with packet */ + case IP_FW_REASS: + goto again; + default: KASSERT(0, ("%s: unknown retval", __func__)); } @@ -329,6 +332,9 @@ again: case IP_FW_NAT: goto again; /* continue with packet */ + case IP_FW_REASS: + goto again; + default: KASSERT(0, ("%s: unknown retval", __func__)); } From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 21:14:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 491C3106566B; Wed, 1 Apr 2009 21:14:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D4CD8FC16; Wed, 1 Apr 2009 21:14:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n31LE2Gp042949; Wed, 1 Apr 2009 21:14:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n31LE24B042948; Wed, 1 Apr 2009 21:14:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200904012114.n31LE24B042948@svn.freebsd.org> From: John Baldwin Date: Wed, 1 Apr 2009 21:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190634 - in head/sys: arm/arm mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 21:14:02 -0000 Author: jhb Date: Wed Apr 1 21:14:01 2009 New Revision: 190634 URL: http://svn.freebsd.org/changeset/base/190634 Log: Remove some pointless mergeinfo that is the result of doing a local 'svn cp' and having svn create empty mergeinfo for the file. Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S (props changed) head/sys/mips/mips/elf64_machdep.c (props changed) From owner-svn-src-head@FreeBSD.ORG Wed Apr 1 21:47:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641D6106566B; Wed, 1 Apr 2009 21:47:00 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from mail-chaos.rambler.ru (mail-chaos.rambler.ru [81.19.68.130]) by mx1.freebsd.org (Postfix) with ESMTP id 199BD8FC15; Wed, 1 Apr 2009 21:47:00 +0000 (UTC) (envelope-from citrin@citrin.ru) Received: from [192.168.1.4] (ppp91-78-188-105.pppoe.mtu-net.ru [91.78.188.105]) (Authenticated sender: citrin@citrin.ru) by mail-chaos.rambler.ru (Postfix) with ESMTPSA id C98B21702A; Thu, 2 Apr 2009 01:25:52 +0400 (MSD) Message-ID: <49D3DBE0.5080709@citrin.ru> Date: Thu, 02 Apr 2009 01:25:52 +0400 From: Anton Yuzhaninov User-Agent: Thunderbird 2.0.0.21 (X11/20090321) MIME-Version: 1.0 To: Paolo Pisati References: <200904012023.n31KNl71041878@svn.freebsd.org> In-Reply-To: <200904012023.n31KNl71041878@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r190633 - in head: sbin/ipfw sys sys/amd64/include/xen sys/arm/arm sys/contrib/pf sys/dev/ata sys/dev/cxgb sys/dev/sound/usb sys/dev/usb sys/dev/usb/bluetooth sys/dev/usb/controller sys... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Apr 2009 21:47:00 -0000 Paolo Pisati wrote: > Author: piso > Date: Wed Apr 1 20:23:47 2009 > New Revision: 190633 > URL: http://svn.freebsd.org/changeset/base/190633 > > Log: > Implement an ipfw action to reassemble ip packets: reass. > Modified: head/sbin/ipfw/ipfw.8 > ============================================================================== > --- head/sbin/ipfw/ipfw.8 Wed Apr 1 19:23:46 2009 (r190632) > +++ head/sbin/ipfw/ipfw.8 Wed Apr 1 20:23:47 2009 (r190633) > @@ -866,6 +866,13 @@ in any subsequent forwarding decisions. > Initially this is limited to the values 0 through 15, see > .Xr setfib 8 . > Processing continues at the next rule. > +.It Cm reass > +Queue and reassemble ip fragments. > +If the packet is not fragmented, counters are updated and processing continues with the next rule. > +If the packet is the last logical fragment, the packet is reassembled and, if > +.Va net.inet.ip.fw.one_pass > +is set to 0, processing continues with the next rule, else packet is allowed to pass and search terminates. > +If the packet is a fragment in the middle, it is consumed and processing stops immediately. > .El > .Ss RULE BODY > The body of a rule contains zero or more patterns (such as > May be it will be useful to note in man, that total number of fragments in queue limited by sysctl net.inet.ip.maxfragpackets and maximum number of fragments per packed is 16. -- Anton Yuzhaninov From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 00:23:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07FD510656F9; Thu, 2 Apr 2009 00:23:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFD018FC16; Thu, 2 Apr 2009 00:23:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n320Nudt046565; Thu, 2 Apr 2009 00:23:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n320Nu0u046562; Thu, 2 Apr 2009 00:23:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200904020023.n320Nu0u046562@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 2 Apr 2009 00:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190635 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 00:23:57 -0000 Author: jkim Date: Thu Apr 2 00:23:56 2009 New Revision: 190635 URL: http://svn.freebsd.org/changeset/base/190635 Log: Chase GDT layout changes and unbreak suspend/resume on amd64. Modified: head/sys/amd64/acpica/acpi_switch.S head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/acpica/acpi_wakeup.c Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Wed Apr 1 21:14:01 2009 (r190634) +++ head/sys/amd64/acpica/acpi_switch.S Thu Apr 2 00:23:56 2009 (r190635) @@ -128,9 +128,19 @@ ENTRY(acpi_restorecpu) /* Restore descriptor tables. */ lidt WAKEUP_XPCB(IDT) lldt WAKEUP_XPCB(LDT) + +#define SDT_SYSTSS 9 +#define SDT_SYSBSY 11 + + /* Reset task busy bit and reload TR. */ + movq PCPU(TSS), %rax + andb $(~SDT_SYSBSY | SDT_SYSTSS), 5(%rax) movw WAKEUP_XPCB(TR), %ax ltr %ax +#undef SDT_SYSTSS +#undef SDT_SYSBSY + /* Restore other callee saved registers. */ movq WAKEUP_PCB(R15), %r15 movq WAKEUP_PCB(R14), %r14 Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Wed Apr 1 21:14:01 2009 (r190634) +++ head/sys/amd64/acpica/acpi_wakecode.S Thu Apr 2 00:23:56 2009 (r190635) @@ -223,6 +223,12 @@ reset_video: bootgdt: .long 0x00000000 .long 0x00000000 + .long 0x00000000 + .long 0x00000000 + .long 0x00000000 + .long 0x00000000 + .long 0x00000000 + .long 0x00000000 bootcode64: .long 0x0000ffff @@ -261,6 +267,8 @@ wakeup_xpcb: wakeup_gdt: .word 0 .quad 0 + + ALIGN_DATA wakeup_efer: .quad 0 wakeup_pat: Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Wed Apr 1 21:14:01 2009 (r190634) +++ head/sys/amd64/acpica/acpi_wakeup.c Thu Apr 2 00:23:56 2009 (r190635) @@ -78,7 +78,6 @@ static struct xpcb *stopxpcbs; int acpi_restorecpu(struct xpcb *, vm_offset_t); int acpi_savecpu(struct xpcb *); -static void acpi_reset_tss(int cpu); static void acpi_alloc_wakeup_handler(void); static void acpi_stop_beep(void *); @@ -116,8 +115,6 @@ acpi_wakeup_ap(struct acpi_softc *sc, in stopxpcbs[cpu].xpcb_gdt.rd_base); WAKECODE_FIXUP(wakeup_cpu, int, cpu); - acpi_reset_tss(cpu); - /* do an INIT IPI: assert RESET */ lapic_ipi_raw(APIC_DEST_DESTFLD | APIC_TRIGMOD_EDGE | APIC_LEVEL_ASSERT | APIC_DESTMODE_PHY | APIC_DELMODE_INIT, apic_id); @@ -220,19 +217,6 @@ acpi_wakeup_cpus(struct acpi_softc *sc, } #endif -static void -acpi_reset_tss(int cpu) -{ - uint32_t *tss; - - /* - * We have to clear "task busy" bit in TSS to restore - * task register later. Otherwise, ltr causes GPF. - */ - tss = (uint32_t *)&gdt[NGDT * cpu + GPROC0_SEL] + 1; - *tss &= ~((SDT_SYSBSY ^ SDT_SYSTSS) << 8); -} - int acpi_sleep_machdep(struct acpi_softc *sc, int state) { @@ -289,8 +273,6 @@ acpi_sleep_machdep(struct acpi_softc *sc stopxpcbs[0].xpcb_gdt.rd_base); WAKECODE_FIXUP(wakeup_cpu, int, 0); - acpi_reset_tss(0); - /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) status = AcpiEnterSleepStateS4bios(); From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 01:46:57 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3C4D1065673; Thu, 2 Apr 2009 01:46:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C11DB8FC0C; Thu, 2 Apr 2009 01:46:57 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n321kvsh048418; Thu, 2 Apr 2009 01:46:57 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n321kvVA048417; Thu, 2 Apr 2009 01:46:57 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <200904020146.n321kvVA048417@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 2 Apr 2009 01:46:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190636 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 01:46:59 -0000 Author: jkim Date: Thu Apr 2 01:46:57 2009 New Revision: 190636 URL: http://svn.freebsd.org/changeset/base/190636 Log: Reduce code duplcations from r190620. While I am here, tweak a comment. Modified: head/sys/amd64/acpica/acpi_switch.S Modified: head/sys/amd64/acpica/acpi_switch.S ============================================================================== --- head/sys/amd64/acpica/acpi_switch.S Thu Apr 2 00:23:56 2009 (r190635) +++ head/sys/amd64/acpica/acpi_switch.S Thu Apr 2 01:46:57 2009 (r190636) @@ -67,9 +67,7 @@ ENTRY(acpi_restorecpu) /* Force kernel segment registers. */ movl $KDSEL, %eax movw %ax, %ds - movl $KDSEL, %eax movw %ax, %es - movl $KDSEL, %eax movw %ax, %ss movl $KUF32SEL, %eax movw %ax, %fs @@ -132,7 +130,7 @@ ENTRY(acpi_restorecpu) #define SDT_SYSTSS 9 #define SDT_SYSBSY 11 - /* Reset task busy bit and reload TR. */ + /* Clear "task busy" bit and reload TR. */ movq PCPU(TSS), %rax andb $(~SDT_SYSBSY | SDT_SYSTSS), 5(%rax) movw WAKEUP_XPCB(TR), %ax From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 08:50:11 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3457910656D4; Thu, 2 Apr 2009 08:50:11 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id C87448FC35; Thu, 2 Apr 2009 08:50:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1LpIcj-000PyE-5V; Thu, 02 Apr 2009 11:50:09 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n328o6Sa011292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Apr 2009 11:50:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n328o5BX090867; Thu, 2 Apr 2009 11:50:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n328o5fa090866; Thu, 2 Apr 2009 11:50:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 2 Apr 2009 11:50:05 +0300 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20090402085005.GA31897@deviant.kiev.zoral.com.ua> References: <200904020023.n320Nu0u046562@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="54Got1pG2ocoWGyS" Content-Disposition: inline In-Reply-To: <200904020023.n320Nu0u046562@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1LpIcj-000PyE-5V 530fc490b2044221de9017fdc5c5f7da X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190635 - head/sys/amd64/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 08:50:12 -0000 --54Got1pG2ocoWGyS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 02, 2009 at 12:23:56AM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Thu Apr 2 00:23:56 2009 > New Revision: 190635 > URL: http://svn.freebsd.org/changeset/base/190635 >=20 > Log: > Chase GDT layout changes and unbreak suspend/resume on amd64. >=20 > Modified: > head/sys/amd64/acpica/acpi_switch.S > head/sys/amd64/acpica/acpi_wakecode.S > head/sys/amd64/acpica/acpi_wakeup.c Uff, thanks ! --54Got1pG2ocoWGyS Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAknUfD0ACgkQC3+MBN1Mb4gx3ACeNyMNYLdzfoBfH6GDIl4IN6sy ZZIAoJyG6Qc0ElHeCzgHRqDXOTqfiF0e =xIju -----END PGP SIGNATURE----- --54Got1pG2ocoWGyS-- From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 10:15:45 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80D5106570D; Thu, 2 Apr 2009 10:15:45 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from sippysoft.com (gk1.360sip.com [72.236.70.240]) by mx1.freebsd.org (Postfix) with ESMTP id 5A1D08FC14; Thu, 2 Apr 2009 10:15:45 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from [192.168.1.38] (S0106001372fd1e07.vs.shawcable.net [70.71.171.106]) (authenticated bits=0) by sippysoft.com (8.14.3/8.14.3) with ESMTP id n32AFgC7074720 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Apr 2009 03:15:44 -0700 (PDT) (envelope-from sobomax@FreeBSD.org) Message-ID: <49D4903C.7090904@FreeBSD.org> Date: Thu, 02 Apr 2009 03:15:24 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Paolo Pisati References: <200904012023.n31KNl71041878@svn.freebsd.org> In-Reply-To: <200904012023.n31KNl71041878@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn: head: sbin/ipfw sys sys/amd64/include/xen sys/arm/arm sys/contrib/pf sys/dev/ata sys/dev/cxgb sys/dev/sound/usb sys/dev/usb sys/dev/usb/bluetooth sys/dev/usb/controller sys... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 10:15:51 -0000 Paolo Pisati wrote: > Author: piso > Date: Wed Apr 1 20:23:47 2009 > New Revision: 190633 > URL: http://svn.freebsd.org/changeset/base/190633 > > Log: > Implement an ipfw action to reassemble ip packets: reass. Heh, nice name, isn't it? At first I thought it was an april fools joke as well. ;-) -Maxim From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 13:02:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E951065670; Thu, 2 Apr 2009 13:02:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AC378FC1F; Thu, 2 Apr 2009 13:02:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32D2CRB065489; Thu, 2 Apr 2009 13:02:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32D2CXw065488; Thu, 2 Apr 2009 13:02:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904021302.n32D2CXw065488@svn.freebsd.org> From: Rui Paulo Date: Thu, 2 Apr 2009 13:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190639 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 13:02:12 -0000 Author: rpaulo Date: Thu Apr 2 13:02:12 2009 New Revision: 190639 URL: http://svn.freebsd.org/changeset/base/190639 Log: Sync DLTs with latest libpcap version. Modified: head/sys/net/bpf.h Modified: head/sys/net/bpf.h ============================================================================== --- head/sys/net/bpf.h Thu Apr 2 07:11:54 2009 (r190638) +++ head/sys/net/bpf.h Thu Apr 2 13:02:12 2009 (r190639) @@ -726,6 +726,94 @@ struct bpf_zbuf_header { #define DLT_BLUETOOTH_HCI_H4_WITH_PHDR 201 /* + * AX.25 packet with a 1-byte KISS header; see + * + * http://www.ax25.net/kiss.htm + * + * as per Richard Stearn . + */ +#define DLT_AX25_KISS 202 + +/* + * LAPD packets from an ISDN channel, starting with the address field, + * with no pseudo-header. + * Requested by Varuna De Silva . + */ +#define DLT_LAPD 203 + +/* + * Variants of various link-layer headers, with a one-byte direction + * pseudo-header prepended - zero means "received by this host", + * non-zero (any non-zero value) means "sent by this host" - as per + * Will Barker . + */ +#define DLT_PPP_WITH_DIR 204 /* PPP - don't confuse with DLT_PPP_WITH_DIRECTION */ +#define DLT_C_HDLC_WITH_DIR 205 /* Cisco HDLC */ +#define DLT_FRELAY_WITH_DIR 206 /* Frame Relay */ +#define DLT_LAPB_WITH_DIR 207 /* LAPB */ + +/* + * 208 is reserved for an as-yet-unspecified proprietary link-layer + * type, as requested by Will Barker. + */ + +/* + * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman + * . + */ +#define DLT_IPMB_LINUX 209 + +/* + * FlexRay automotive bus - http://www.flexray.com/ - as requested + * by Hannes Kaelber . + */ +#define DLT_FLEXRAY 210 + +/* + * Media Oriented Systems Transport (MOST) bus for multimedia + * transport - http://www.mostcooperation.com/ - as requested + * by Hannes Kaelber . + */ +#define DLT_MOST 211 + +/* + * Local Interconnect Network (LIN) bus for vehicle networks - + * http://www.lin-subbus.org/ - as requested by Hannes Kaelber + * . + */ +#define DLT_LIN 212 + +/* + * X2E-private data link type used for serial line capture, + * as requested by Hannes Kaelber . + */ +#define DLT_X2E_SERIAL 213 + +/* + * X2E-private data link type used for the Xoraya data logger + * family, as requested by Hannes Kaelber . + */ +#define DLT_X2E_XORAYA 214 + +/* + * IEEE 802.15.4, exactly as it appears in the spec (no padding, no + * nothing), but with the PHY-level data for non-ASK PHYs (4 octets + * of 0 as preamble, one octet of SFD, one octet of frame length+ + * reserved bit, and then the MAC-layer data, starting with the + * frame control field). + * + * Requested by Max Filippov . + */ +#define DLT_IEEE802_15_4_NONASK_PHY 215 + +/* + * DLT and savefile link type values are split into a class and + * a member of that class. A class value of 0 indicates a regular + * DLT_/LINKTYPE_ value. + */ +#define DLT_CLASS(x) ((x) & 0x03ff0000) + +/* * The instruction encodings. */ /* instruction classes */ From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 13:04:17 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C84C5106564A; Thu, 2 Apr 2009 13:04:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B65818FC1C; Thu, 2 Apr 2009 13:04:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32D4HtM065564; Thu, 2 Apr 2009 13:04:17 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32D4H8v065562; Thu, 2 Apr 2009 13:04:17 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200904021304.n32D4H8v065562@svn.freebsd.org> From: Rui Paulo Date: Thu, 2 Apr 2009 13:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190640 - in head/contrib/libpcap: . pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 13:04:18 -0000 Author: rpaulo Date: Thu Apr 2 13:04:17 2009 New Revision: 190640 URL: http://svn.freebsd.org/changeset/base/190640 Log: Restore local change to include inside pcap.h. This fixes remaining ports build problems. Modified: head/contrib/libpcap/pcap.h head/contrib/libpcap/pcap/pcap.h Modified: head/contrib/libpcap/pcap.h ============================================================================== --- head/contrib/libpcap/pcap.h Thu Apr 2 13:02:12 2009 (r190639) +++ head/contrib/libpcap/pcap.h Thu Apr 2 13:04:17 2009 (r190640) @@ -47,9 +47,7 @@ #include #endif /* WIN32/MSDOS/UN*X */ -#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H -#include -#endif +#include #include Modified: head/contrib/libpcap/pcap/pcap.h ============================================================================== --- head/contrib/libpcap/pcap/pcap.h Thu Apr 2 13:02:12 2009 (r190639) +++ head/contrib/libpcap/pcap/pcap.h Thu Apr 2 13:04:17 2009 (r190640) @@ -47,9 +47,7 @@ #include #endif /* WIN32/MSDOS/UN*X */ -#ifndef PCAP_DONT_INCLUDE_PCAP_BPF_H -#include -#endif +#include #include From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 15:48:53 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 614BA1065672; Thu, 2 Apr 2009 15:48:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Thu, 2 Apr 2009 11:48:38 -0400 User-Agent: KMail/1.6.2 References: <200904021304.n32D4H8v065562@svn.freebsd.org> In-Reply-To: <200904021304.n32D4H8v065562@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200904021148.44528.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Rui Paulo Subject: Re: svn commit: r190640 - in head/contrib/libpcap: . pcap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 15:48:54 -0000 On Thursday 02 April 2009 09:04 am, Rui Paulo wrote: > Author: rpaulo > Date: Thu Apr 2 13:04:17 2009 > New Revision: 190640 > URL: http://svn.freebsd.org/changeset/base/190640 > > Log: > Restore local change to include inside pcap.h. This > fixes remaining ports build problems. > > Modified: > head/contrib/libpcap/pcap.h > head/contrib/libpcap/pcap/pcap.h Thanks! Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 15:53:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FDDF106566C; Thu, 2 Apr 2009 15:53:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E82C8FC1A; Thu, 2 Apr 2009 15:53:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32FrUgg068920; Thu, 2 Apr 2009 15:53:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32FrUEC068918; Thu, 2 Apr 2009 15:53:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200904021553.n32FrUEC068918@svn.freebsd.org> From: John Baldwin Date: Thu, 2 Apr 2009 15:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190641 - in head/lib/libc: gen sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 15:53:30 -0000 Author: jhb Date: Thu Apr 2 15:53:29 2009 New Revision: 190641 URL: http://svn.freebsd.org/changeset/base/190641 Log: Properly update the shm_open/shm_unlink symbol versioning metadata after these functions were moved into the kernel: - Move the version entries from gen/ to sys/. Since the ABI of the actual routines did not change, I'm still exporting them as FBSD 1.0 on purpose. - Add FBSD-private versions for the _ and __sys_ variants. Modified: head/lib/libc/gen/Symbol.map head/lib/libc/sys/Symbol.map Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu Apr 2 13:04:17 2009 (r190640) +++ head/lib/libc/gen/Symbol.map Thu Apr 2 15:53:29 2009 (r190641) @@ -223,8 +223,6 @@ FBSD_1.0 { posix_madvise; popen; pclose; - shm_open; - shm_unlink; pselect; psignal; raise; Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Thu Apr 2 13:04:17 2009 (r190640) +++ head/lib/libc/sys/Symbol.map Thu Apr 2 15:53:29 2009 (r190641) @@ -265,6 +265,8 @@ FBSD_1.0 { setsockopt; settimeofday; setuid; + shm_open; + shm_unlink; shmat; shmctl; shmdt; @@ -876,6 +878,10 @@ FBSDprivate_1.0 { __sys_settimeofday; _setuid; __sys_setuid; + _shm_open; + __sys_shm_open; + _shm_unlink; + __sys_shm_unlink; _shmat; __sys_shmat; _shmctl; From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 16:58:45 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFE751065672; Thu, 2 Apr 2009 16:58:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE3A28FC0A; Thu, 2 Apr 2009 16:58:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32GwjXF070352; Thu, 2 Apr 2009 16:58:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32GwjQc070351; Thu, 2 Apr 2009 16:58:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904021658.n32GwjQc070351@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Apr 2009 16:58:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190643 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 16:58:46 -0000 Author: imp Date: Thu Apr 2 16:58:45 2009 New Revision: 190643 URL: http://svn.freebsd.org/changeset/base/190643 Log: Force an autonegotiation at attach time for all the attached PHYs for ed cards. There's a number of minor nits in a lot of the PHYs on the PC Cards that use the Axis AX88190 or DLink DL10019 and DL10022 chips. Forcing the autonegotiation doesn't seem to cause problems on the cards that have sane PHYs, but makes several cards I have work without further workarounds. I'm not 100% sure that kicking the PHY and resetting them is the right thing to do on the media change callback. Other NICs seem to need this and do similar things. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 16:51:41 2009 (r190642) +++ head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 16:58:45 2009 (r190643) @@ -382,6 +382,26 @@ ed_pccard_add_modem(device_t dev) } static int +ed_pccard_kick_phy(struct ed_softc *sc) +{ + struct mii_softc *miisc; + struct mii_data *mii; + + /* + * Many of the PHYs that wind up on PC Cards are weird in + * this way. Generally, we don't need to worry so much about + * the Isolation protocol since there's only one PHY in + * these designs, so this workaround is reasonable. + */ + mii = device_get_softc(sc->miibus); + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + miisc->mii_flags |= MIIF_FORCEANEG; + mii_phy_reset(miisc); + } + return (mii_mediachg(mii)); +} + +static int ed_pccard_media_ioctl(struct ed_softc *sc, struct ifreq *ifr, u_long command) { struct mii_data *mii; @@ -584,6 +604,7 @@ ed_pccard_attach(device_t dev) sc->sc_tick = ed_pccard_tick; sc->sc_mediachg = ed_pccard_mediachg; sc->sc_media_ioctl = ed_pccard_media_ioctl; + ed_pccard_kick_phy(sc); } if (sc->modem_rid != -1) ed_pccard_add_modem(dev); @@ -963,6 +984,7 @@ ed_pccard_ax88x90_mii_readbits(struct ed val++; ed_asic_outb(sc, ED_AX88X90_MIIBUS, mdio | ED_AX88X90_MII_CLK); } + printf("AX88x90 %#x+%#x Reading %d bits: %x\n", (unsigned int)sc->port_bsh, sc->asic_offset, nbits, val); return val; } @@ -1062,6 +1084,7 @@ ed_pccard_tc5299j_mii_readbits(struct ed u_int val = 0; uint8_t cr; + printf("Reading %d bits\n", nbits); cr = ed_nic_inb(sc, ED_P0_CR); ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); @@ -1124,6 +1147,7 @@ ed_miibus_readreg(device_t dev, int phy, failed = (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); val = (*sc->mii_readbits)(sc, ED_MII_DATA_BITS); (*sc->mii_writebits)(sc, ED_MII_IDLE, ED_MII_IDLE_BITS); + printf("Reading phy %d reg %#x returning %#x (valid %d)\n", phy, reg, val, !failed); return (failed ? 0 : val); } @@ -1132,6 +1156,7 @@ ed_miibus_writereg(device_t dev, int phy { struct ed_softc *sc; + printf("Writing phy %d reg %#x data %#x\n", phy, reg, data); sc = device_get_softc(dev); /* See ed_miibus_readreg for details */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { @@ -1158,14 +1183,15 @@ static int ed_ifmedia_upd(struct ifnet *ifp) { struct ed_softc *sc; - struct mii_data *mii; + int error; sc = ifp->if_softc; if (sc->miibus == NULL) return (ENXIO); - - mii = device_get_softc(sc->miibus); - return mii_mediachg(mii); + ED_LOCK(sc); + error = ed_pccard_kick_phy(sc); + ED_UNLOCK(sc); + return (error); } static void From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 17:08:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458A310656BC; Thu, 2 Apr 2009 17:08:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32E788FC1D; Thu, 2 Apr 2009 17:08:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32H8tJd070596; Thu, 2 Apr 2009 17:08:55 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32H8tO8070595; Thu, 2 Apr 2009 17:08:55 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904021708.n32H8tO8070595@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Apr 2009 17:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190644 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:08:55 -0000 Author: imp Date: Thu Apr 2 17:08:54 2009 New Revision: 190644 URL: http://svn.freebsd.org/changeset/base/190644 Log: The AX88190 has 64k of external SRAM, of which 62k can be used for packet data. However, the AX88190A moves this on-chip and reduces it to the more traditional 16k from 16k-32k. The AX88790 follows the '190A. Probe memory above 32k to see which flavor of the '190 we have and use the extra memory if we have it. Eliminate the kludgy read eeprom for the ID code. It really is just a memory read at location 0x400, so just use that instead. Makes the code easier to understand as well as eliminates some magic numbers. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 16:58:45 2009 (r190643) +++ head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 17:08:54 2009 (r190644) @@ -788,11 +788,9 @@ ed_probe_ax88x90_generic(device_t dev, i * bytes in word mode and verify we can read them back. If we can't * then we don't have an AX88x90 chip here. */ - ed_nic_outb(sc, ED_P0_RCR, ED_RCR_MON); sc->isa16bit = 1; + ed_nic_outb(sc, ED_P0_RCR, ED_RCR_MON); ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); - ed_nic_outb(sc, ED_P0_PSTART, 16384 / ED_PAGE_SIZE); - ed_nic_outb(sc, ED_P0_PSTOP, 32768 / ED_PAGE_SIZE); ed_pio_writemem(sc, test_pattern, 16384, sizeof(test_pattern)); ed_pio_readmem(sc, 16384, test_buffer, sizeof(test_pattern)); if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) != 0) @@ -800,25 +798,45 @@ ed_probe_ax88x90_generic(device_t dev, i /* * Hard code values based on the datasheet. We're NE-2000 compatible - * NIC with 16kb of packet memory starting at 16k offset. We assume - * that the writes to ED_P0_START and ED_P0_STOP reflect the values - * below. + * NIC with 16kb of packet memory starting at 16k offset. */ sc->type = ED_TYPE_NE2000; + memsize = sc->mem_size = 16*1024; + sc->mem_start = 16 * 1024; if (ed_asic_inb(sc, ED_AX88X90_TEST) != 0) sc->chip_type = ED_CHIP_TYPE_AX88790; - else + else { sc->chip_type = ED_CHIP_TYPE_AX88190; - memsize = 16 * 1024; - sc->mem_size = memsize; - sc->mem_start = 16 * 1024; + /* + * The AX88190 (not A) has external 64k SRAM. Probe for this + * here. Most of the cards I have either use the AX88190A + * part, or have only 32k SRAM for some reason, so I don't + * know if this works or not. + */ + ed_pio_writemem(sc, test_pattern, 32768, sizeof(test_pattern)); + ed_pio_readmem(sc, 32768, test_buffer, sizeof(test_pattern)); + if (bcmp(test_pattern, test_buffer, sizeof(test_pattern)) == 0) { + sc->mem_start = 2*1024; + memsize = sc->mem_size = 62 * 1024; + } + } sc->mem_end = sc->mem_start + memsize; sc->tx_page_start = memsize / ED_PAGE_SIZE; - sc->txb_cnt = 2; + if (sc->mem_size > 16 * 1024) + sc->txb_cnt = 3; + else + sc->txb_cnt = 2; sc->rec_page_start = sc->tx_page_start + sc->txb_cnt * ED_TXBUF_SIZE; sc->rec_page_stop = sc->tx_page_start + memsize / ED_PAGE_SIZE; sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE; + + ed_nic_outb(sc, ED_P0_PSTART, sc->mem_start / ED_PAGE_SIZE); + ed_nic_outb(sc, ED_P0_PSTOP, sc->mem_end / ED_PAGE_SIZE); + + /* Get the mac before we go -- It's just at 0x400 in "SRAM" */ + ed_pio_readmem(sc, 0x400, sc->enaddr, ETHER_ADDR_LEN); + /* clear any pending interrupts that might have occurred above */ ed_nic_outb(sc, ED_P0_ISR, 0xff); sc->sc_write_mbufs = ed_pio_write_mbufs; @@ -826,42 +844,6 @@ ed_probe_ax88x90_generic(device_t dev, i } static int -ed_pccard_ax88x90_enaddr(struct ed_softc *sc) -{ - int i, j; - struct { - unsigned char offset, value; - } pg_seq[] = { - /* Select Page0 */ - {ED_P0_CR, ED_CR_RD2 | ED_CR_STP | ED_CR_PAGE_0}, - {ED_P0_DCR, ED_DCR_WTS}, /* Word access to SRAM */ - {ED_P0_RBCR0, 0x00}, /* Clear the count regs. */ - {ED_P0_RBCR1, 0x00}, - {ED_P0_IMR, 0x00}, /* Mask completion irq. */ - {ED_P0_ISR, 0xff}, /* ACK them all */ - {ED_P0_RCR, ED_RCR_MON | ED_RCR_INTT}, /* Set To Monitor */ - {ED_P0_TCR, ED_TCR_LB0}, /* loopback mode. */ - {ED_P0_RBCR0, 0x20}, /* 32byte DMA */ - {ED_P0_RBCR1, 0x00}, - {ED_P0_RSAR0, 0x00}, /* Read address is 0x0400 */ - {ED_P0_RSAR1, 0x04}, /* for MAC ADDR */ - {ED_P0_CR, ED_CR_RD0 | ED_CR_STA | ED_CR_PAGE_0}, - }; - - /* Card Settings */ - for (i = 0; i < sizeof(pg_seq) / sizeof(pg_seq[0]); i++) - ed_nic_outb(sc, pg_seq[i].offset, pg_seq[i].value); - - /* Get MAC address */ - for (i = 0; i < ETHER_ADDR_LEN; i += 2) { - j = ed_asic_inw(sc, 0); - sc->enaddr[i] = j & 0xff; - sc->enaddr[i + 1] = (j >> 8) & 0xff; - } - return (0); -} - -static int ed_pccard_ax88x90_check_mii(device_t dev, struct ed_softc *sc) { int i, id; @@ -938,9 +920,6 @@ ed_pccard_ax88x90(device_t dev, const st error); goto fail; } - error = ed_pccard_ax88x90_enaddr(sc); - if (error) - goto fail; error = ed_pccard_ax88x90_check_mii(dev, sc); if (error) goto fail; From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 17:15:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5509A106567A; Thu, 2 Apr 2009 17:15:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28A938FC1A; Thu, 2 Apr 2009 17:15:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32HFoTi070814; Thu, 2 Apr 2009 17:15:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32HFoqw070812; Thu, 2 Apr 2009 17:15:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904021715.n32HFoqw070812@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Apr 2009 17:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190645 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:15:51 -0000 Author: imp Date: Thu Apr 2 17:15:49 2009 New Revision: 190645 URL: http://svn.freebsd.org/changeset/base/190645 Log: Minor DLINK DL100xx support tweaks: The DIROUT bit difference between the 19 and 22 is annoying. We can set both bits on both parts without ill effect. Use this trick to simplify the code. The DELAYS in the MII bus bit-bang code for the DL100xx parts aren't needed. Eliminate them. Modified: head/sys/dev/ed/dl100xxreg.h head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/dl100xxreg.h ============================================================================== --- head/sys/dev/ed/dl100xxreg.h Thu Apr 2 17:08:54 2009 (r190644) +++ head/sys/dev/ed/dl100xxreg.h Thu Apr 2 17:15:49 2009 (r190645) @@ -38,5 +38,6 @@ #define ED_DL100XX_MII_DATAIN 0x10 #define ED_DL100XX_MII_DIROUT_22 0x20 #define ED_DL100XX_MII_DIROUT_19 0x10 +#define ED_DL100XX_MII_DIROUT 0x30 #define ED_DL100XX_MII_DATAOUT 0x40 #define ED_DL100XX_MII_CLK 0x80 Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 17:08:54 2009 (r190644) +++ head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 17:15:49 2009 (r190645) @@ -701,21 +701,14 @@ ed_pccard_dl100xx_mii_writebits(struct e { int i; - if (sc->chip_type == ED_CHIP_TYPE_DL10022) - DL100XX_MIISET(sc, ED_DL100XX_MII_DIROUT_22); - else - DL100XX_MIISET(sc, ED_DL100XX_MII_DIROUT_19); - + DL100XX_MIISET(sc, ED_DL100XX_MII_DIROUT); for (i = nbits - 1; i >= 0; i--) { if ((val >> i) & 1) DL100XX_MIISET(sc, ED_DL100XX_MII_DATAOUT); else DL100XX_MIICLR(sc, ED_DL100XX_MII_DATAOUT); - DELAY(10); DL100XX_MIISET(sc, ED_DL100XX_MII_CLK); - DELAY(10); DL100XX_MIICLR(sc, ED_DL100XX_MII_CLK); - DELAY(10); } } @@ -725,19 +718,13 @@ ed_pccard_dl100xx_mii_readbits(struct ed int i; u_int val = 0; - if (sc->chip_type == ED_CHIP_TYPE_DL10022) - DL100XX_MIICLR(sc, ED_DL100XX_MII_DIROUT_22); - else - DL100XX_MIICLR(sc, ED_DL100XX_MII_DIROUT_19); - + DL100XX_MIICLR(sc, ED_DL100XX_MII_DIROUT); for (i = nbits - 1; i >= 0; i--) { DL100XX_MIISET(sc, ED_DL100XX_MII_CLK); - DELAY(10); val <<= 1; if (ed_asic_inb(sc, ED_DL100XX_MIIBUS) & ED_DL100XX_MII_DATAIN) val++; DL100XX_MIICLR(sc, ED_DL100XX_MII_CLK); - DELAY(10); } return val; } From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 17:16:39 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6229810656F6; Thu, 2 Apr 2009 17:16:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE9A8FC18; Thu, 2 Apr 2009 17:16:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32HGdU1070870; Thu, 2 Apr 2009 17:16:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32HGdE0070869; Thu, 2 Apr 2009 17:16:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904021716.n32HGdE0070869@svn.freebsd.org> From: Xin LI Date: Thu, 2 Apr 2009 17:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190646 - head/lib/libufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 17:16:40 -0000 Author: delphij Date: Thu Apr 2 17:16:39 2009 New Revision: 190646 URL: http://svn.freebsd.org/changeset/base/190646 Log: Bail out when memory allocation is failed, rather than referencing a NULL pointer. PR: kern/94480 Submitted by: Michiel Pelt Modified: head/lib/libufs/block.c Modified: head/lib/libufs/block.c ============================================================================== --- head/lib/libufs/block.c Thu Apr 2 17:15:49 2009 (r190645) +++ head/lib/libufs/block.c Thu Apr 2 17:16:39 2009 (r190646) @@ -64,8 +64,10 @@ bread(struct uufsd *disk, ufs2_daddr_t b */ if (((intptr_t)data) & 0x3f) { p2 = malloc(size); - if (p2 == NULL) + if (p2 == NULL) { ERROR(disk, "allocate bounce buffer"); + goto fail; + } } cnt = pread(disk->d_fd, p2, size, (off_t)(blockno * disk->d_bsize)); if (cnt == -1) { @@ -115,8 +117,10 @@ bwrite(struct uufsd *disk, ufs2_daddr_t */ if (((intptr_t)data) & 0x3f) { p2 = malloc(size); - if (p2 == NULL) + if (p2 == NULL) { ERROR(disk, "allocate bounce buffer"); + return (-1); + } memcpy(p2, data, size); data = p2; } From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 18:02:00 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA0F1065686; Thu, 2 Apr 2009 18:02:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A40D8FC0C; Thu, 2 Apr 2009 18:02:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32I20e8072207; Thu, 2 Apr 2009 18:02:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32I20vo072205; Thu, 2 Apr 2009 18:02:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904021802.n32I20vo072205@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Apr 2009 18:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190650 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 18:02:03 -0000 Author: imp Date: Thu Apr 2 18:02:00 2009 New Revision: 190650 URL: http://svn.freebsd.org/changeset/base/190650 Log: Minor tweaks in the names to match the chips more closely. Modified: head/sys/dev/ed/dl100xxreg.h head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/dl100xxreg.h ============================================================================== --- head/sys/dev/ed/dl100xxreg.h Thu Apr 2 17:58:20 2009 (r190649) +++ head/sys/dev/ed/dl100xxreg.h Thu Apr 2 18:02:00 2009 (r190650) @@ -29,15 +29,15 @@ /* Dlink chipset used on some Netgear and Dlink PCMCIA cards */ #define ED_DL100XX_MIIBUS 0x0c /* MII bus register on ASIC */ -#define ED_DL100XX_DIAG 0x0d -#define ED_DL100XX_COLLISON_DIS 4 /* Disable collision detection */ +#define ED_DL10022_DIAG 0x0d +#define ED_DL10022_COLLISON_DIS 4 /* Disable collision detection */ -#define ED_DL100XX_MII_RESET1 0x04 -#define ED_DL100XX_MII_RESET2 0x08 +#define ED_DL10022_MII_RESET1 0x04 +#define ED_DL10022_MII_RESET2 0x08 #define ED_DL100XX_MII_DATAIN 0x10 -#define ED_DL100XX_MII_DIROUT_22 0x20 -#define ED_DL100XX_MII_DIROUT_19 0x10 -#define ED_DL100XX_MII_DIROUT 0x30 +#define ED_DL10022_MII_DIROUT 0x20 +#define ED_DL10019_MII_DIROUT 0x10 +#define ED_DL100XX_MII_DIROUT (ED_DL10022_MII_DIROUT | ED_DL10019_MII_DIROUT) #define ED_DL100XX_MII_DATAOUT 0x40 #define ED_DL100XX_MII_CLK 0x80 Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 17:58:20 2009 (r190649) +++ head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 18:02:00 2009 (r190650) @@ -439,9 +439,9 @@ ed_pccard_tick(void *arg) if (mii->mii_media_status & IFM_ACTIVE && media != mii->mii_media_status && 0 && sc->chip_type == ED_CHIP_TYPE_DL10022) { - ed_asic_outb(sc, ED_DL100XX_DIAG, + ed_asic_outb(sc, ED_DL10022_DIAG, (mii->mii_media_active & IFM_FDX) ? - ED_DL100XX_COLLISON_DIS : 0); + ED_DL10022_COLLISON_DIS : 0); } } @@ -683,15 +683,15 @@ ed_pccard_dl100xx_mii_reset(struct ed_so if (sc->chip_type != ED_CHIP_TYPE_DL10022) return; - ed_asic_outb(sc, ED_DL100XX_MIIBUS, ED_DL100XX_MII_RESET2); + ed_asic_outb(sc, ED_DL100XX_MIIBUS, ED_DL10022_MII_RESET2); DELAY(10); ed_asic_outb(sc, ED_DL100XX_MIIBUS, - ED_DL100XX_MII_RESET2 | ED_DL100XX_MII_RESET1); + ED_DL10022_MII_RESET2 | ED_DL10022_MII_RESET1); DELAY(10); - ed_asic_outb(sc, ED_DL100XX_MIIBUS, ED_DL100XX_MII_RESET2); + ed_asic_outb(sc, ED_DL100XX_MIIBUS, ED_DL10022_MII_RESET2); DELAY(10); ed_asic_outb(sc, ED_DL100XX_MIIBUS, - ED_DL100XX_MII_RESET2 | ED_DL100XX_MII_RESET1); + ED_DL10022_MII_RESET2 | ED_DL10022_MII_RESET1); DELAY(10); ed_asic_outb(sc, ED_DL100XX_MIIBUS, 0); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 18:11:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EDB9106570A; Thu, 2 Apr 2009 18:11:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0BA08FC1F; Thu, 2 Apr 2009 18:11:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32IBLd2072451; Thu, 2 Apr 2009 18:11:21 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32IBLZ6072450; Thu, 2 Apr 2009 18:11:21 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904021811.n32IBLZ6072450@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Apr 2009 18:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190651 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 18:11:23 -0000 Author: imp Date: Thu Apr 2 18:11:21 2009 New Revision: 190651 URL: http://svn.freebsd.org/changeset/base/190651 Log: Kill debug that crept in. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 18:02:00 2009 (r190650) +++ head/sys/dev/ed/if_ed_pccard.c Thu Apr 2 18:11:21 2009 (r190651) @@ -1113,7 +1113,7 @@ ed_miibus_readreg(device_t dev, int phy, failed = (*sc->mii_readbits)(sc, ED_MII_ACK_BITS); val = (*sc->mii_readbits)(sc, ED_MII_DATA_BITS); (*sc->mii_writebits)(sc, ED_MII_IDLE, ED_MII_IDLE_BITS); - printf("Reading phy %d reg %#x returning %#x (valid %d)\n", phy, reg, val, !failed); +/* printf("Reading phy %d reg %#x returning %#x (valid %d)\n", phy, reg, val, !failed); */ return (failed ? 0 : val); } @@ -1122,7 +1122,7 @@ ed_miibus_writereg(device_t dev, int phy { struct ed_softc *sc; - printf("Writing phy %d reg %#x data %#x\n", phy, reg, data); +/* printf("Writing phy %d reg %#x data %#x\n", phy, reg, data); */ sc = device_get_softc(dev); /* See ed_miibus_readreg for details */ if (sc->chip_type == ED_CHIP_TYPE_AX88790) { From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 19:27:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FA411065670; Thu, 2 Apr 2009 19:27:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D56C8FC0A; Thu, 2 Apr 2009 19:27:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32JRuYp073997; Thu, 2 Apr 2009 19:27:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32JRuR5073996; Thu, 2 Apr 2009 19:27:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904021927.n32JRuR5073996@svn.freebsd.org> From: Warner Losh Date: Thu, 2 Apr 2009 19:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190654 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 19:27:57 -0000 Author: imp Date: Thu Apr 2 19:27:56 2009 New Revision: 190654 URL: http://svn.freebsd.org/changeset/base/190654 Log: Retire two flags that haven't been used since OLDCARD was retired (well, since before OLDCARD was retired, since I removed their use somewhat before that). Modified: head/sys/dev/ed/if_edvar.h Modified: head/sys/dev/ed/if_edvar.h ============================================================================== --- head/sys/dev/ed/if_edvar.h Thu Apr 2 18:21:41 2009 (r190653) +++ head/sys/dev/ed/if_edvar.h Thu Apr 2 19:27:56 2009 (r190654) @@ -276,8 +276,6 @@ extern devclass_t ed_devclass; */ #define ED_FLAGS_TOSH_ETHER 0x10000 #define ED_FLAGS_GWETHER 0x20000 -#define ED_FLAGS_AX88190 0x30000 -#define ED_FLAGS_LINKSYS 0x80000 #define ED_FLAGS_GETTYPE(flg) ((flg) & 0xff0000) From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 21:16:21 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 268791065705; Thu, 2 Apr 2009 21:16:21 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14E018FC0A; Thu, 2 Apr 2009 21:16:21 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32LGK8j076211; Thu, 2 Apr 2009 21:16:20 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32LGK81076210; Thu, 2 Apr 2009 21:16:20 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <200904022116.n32LGK81076210@svn.freebsd.org> From: Peter Wemm Date: Thu, 2 Apr 2009 21:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190655 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 21:16:21 -0000 Author: peter Date: Thu Apr 2 21:16:20 2009 New Revision: 190655 URL: http://svn.freebsd.org/changeset/base/190655 Log: vn_vptocnp() unlocks the name cache and forgets to re-lock it before returning in one error case, and mistakenly unlocks it for the umount -f case. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Apr 2 19:27:56 2009 (r190654) +++ head/sys/kern/vfs_cache.c Thu Apr 2 21:16:20 2009 (r190655) @@ -971,6 +971,7 @@ vn_vptocnp(struct vnode **vp, char **bp, vdrop(*vp); VFS_UNLOCK_GIANT(vfslocked); if (error) { + CACHE_RLOCK(); numfullpathfail2++; return (error); } @@ -979,7 +980,6 @@ vn_vptocnp(struct vnode **vp, char **bp, CACHE_RLOCK(); if ((*vp)->v_iflag & VI_DOOMED) { /* forced unmount */ - CACHE_RUNLOCK(); vdrop(*vp); return (ENOENT); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 21:23:05 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 184441065670; Thu, 2 Apr 2009 21:23:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06FBB8FC15; Thu, 2 Apr 2009 21:23:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32LN40U076381; Thu, 2 Apr 2009 21:23:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32LN4hp076380; Thu, 2 Apr 2009 21:23:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904022123.n32LN4hp076380@svn.freebsd.org> From: Xin LI Date: Thu, 2 Apr 2009 21:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190656 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 21:23:05 -0000 Author: delphij Date: Thu Apr 2 21:23:04 2009 New Revision: 190656 URL: http://svn.freebsd.org/changeset/base/190656 Log: Don't crash when we have an invalid count number. PR: bin/32686 Submitted by: Jaakko Heinonen MFC after: 1 week Modified: head/usr.bin/locate/locate/fastfind.c Modified: head/usr.bin/locate/locate/fastfind.c ============================================================================== --- head/usr.bin/locate/locate/fastfind.c Thu Apr 2 21:16:20 2009 (r190655) +++ head/usr.bin/locate/locate/fastfind.c Thu Apr 2 21:23:04 2009 (r190656) @@ -216,6 +216,8 @@ fastfind count += c - OFFSET; } + if (count < 0 || count > MAXPATHLEN) + errx(1, "corrupted database: %s", database); /* overlay old path */ p = path + count; foundchar = p - 1; From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 21:44:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98A9D1065672; Thu, 2 Apr 2009 21:44:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8740C8FC16; Thu, 2 Apr 2009 21:44:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32Litfn076841; Thu, 2 Apr 2009 21:44:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32LitaM076840; Thu, 2 Apr 2009 21:44:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904022144.n32LitaM076840@svn.freebsd.org> From: Xin LI Date: Thu, 2 Apr 2009 21:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190657 - head/usr.bin/locate/locate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 21:44:56 -0000 Author: delphij Date: Thu Apr 2 21:44:55 2009 New Revision: 190657 URL: http://svn.freebsd.org/changeset/base/190657 Log: Signed/unsigned fixes, should be WARNS=2 clean now. Modified: head/usr.bin/locate/locate/util.c Modified: head/usr.bin/locate/locate/util.c ============================================================================== --- head/usr.bin/locate/locate/util.c Thu Apr 2 21:23:04 2009 (r190656) +++ head/usr.bin/locate/locate/util.c Thu Apr 2 21:44:55 2009 (r190657) @@ -237,7 +237,7 @@ getwm(p) } u; register int i; - for (i = 0; i < INTSIZE; i++) + for (i = 0; i < (int)INTSIZE; i++) u.buf[i] = *p++; i = u.i; @@ -245,7 +245,7 @@ getwm(p) if (i > MAXPATHLEN || i < -(MAXPATHLEN)) { i = ntohl(i); if (i > MAXPATHLEN || i < -(MAXPATHLEN)) - errx(1, "integer out of +-MAXPATHLEN (%d): %d", + errx(1, "integer out of +-MAXPATHLEN (%d): %u", MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i)); } return(i); @@ -270,7 +270,7 @@ getwf(fp) if (word > MAXPATHLEN || word < -(MAXPATHLEN)) { word = ntohl(word); if (word > MAXPATHLEN || word < -(MAXPATHLEN)) - errx(1, "integer out of +-MAXPATHLEN (%d): %d", + errx(1, "integer out of +-MAXPATHLEN (%d): %u", MAXPATHLEN, abs(word) < abs(htonl(word)) ? word : htonl(word)); } From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 21:51:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 219F0106564A; Thu, 2 Apr 2009 21:51:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 106CC8FC0A; Thu, 2 Apr 2009 21:51:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32LpsO7077035; Thu, 2 Apr 2009 21:51:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32LpsIC077034; Thu, 2 Apr 2009 21:51:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904022151.n32LpsIC077034@svn.freebsd.org> From: Xin LI Date: Thu, 2 Apr 2009 21:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190658 - head/lib/libc/rpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 21:51:55 -0000 Author: delphij Date: Thu Apr 2 21:51:54 2009 New Revision: 190658 URL: http://svn.freebsd.org/changeset/base/190658 Log: Remove a warning which is supposed to have been removed on 20030301. Modified: head/lib/libc/rpc/getnetconfig.c Modified: head/lib/libc/rpc/getnetconfig.c ============================================================================== --- head/lib/libc/rpc/getnetconfig.c Thu Apr 2 21:44:55 2009 (r190657) +++ head/lib/libc/rpc/getnetconfig.c Thu Apr 2 21:51:54 2009 (r190658) @@ -418,18 +418,6 @@ getnetconfigent(netid) return (NULL); } - if (strcmp(netid, "unix") == 0) { - fprintf(stderr, "The local transport is called \"unix\" "); - fprintf(stderr, "in /etc/netconfig.\n"); - fprintf(stderr, "Please change this to \"local\" manually "); - fprintf(stderr, "or run mergemaster(8).\n"); - fprintf(stderr, "See UPDATING entry 20021216 for details.\n"); - fprintf(stderr, "Continuing in 10 seconds\n\n"); - fprintf(stderr, "This warning will be removed 20030301\n"); - sleep(10); - - } - /* * Look up table if the entries have already been read and parsed in * getnetconfig(), then copy this entry into a buffer and return it. From owner-svn-src-head@FreeBSD.ORG Thu Apr 2 22:17:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6519110656DF; Thu, 2 Apr 2009 22:17:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 502068FC2B; Thu, 2 Apr 2009 22:17:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n32MH2xU078618; Thu, 2 Apr 2009 22:17:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n32MH2ji078617; Thu, 2 Apr 2009 22:17:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200904022217.n32MH2ji078617@svn.freebsd.org> From: Xin LI Date: Thu, 2 Apr 2009 22:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190661 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Apr 2009 22:17:05 -0000 Author: delphij Date: Thu Apr 2 22:17:02 2009 New Revision: 190661 URL: http://svn.freebsd.org/changeset/base/190661 Log: Properly handle malloc() failures. PR: bin/83338 Modified: head/lib/libc/gen/getcap.c Modified: head/lib/libc/gen/getcap.c ============================================================================== --- head/lib/libc/gen/getcap.c Thu Apr 2 22:04:44 2009 (r190660) +++ head/lib/libc/gen/getcap.c Thu Apr 2 22:17:02 2009 (r190661) @@ -189,7 +189,7 @@ getent(char **cap, u_int *len, char **db { DB *capdbp; char *r_end, *rp, **db_p; - int myfd, eof, foundit, retval, clen; + int myfd, eof, foundit, retval; char *record, *cbuf; int tc_not_resolved; char pbuf[_POSIX_PATH_MAX]; @@ -251,14 +251,16 @@ getent(char **cap, u_int *len, char **db return (retval); } /* save the data; close frees it */ - clen = strlen(record); - cbuf = malloc(clen + 1); - memcpy(cbuf, record, clen + 1); + cbuf = strdup(record); if (capdbp->close(capdbp) < 0) { free(cbuf); return (-2); } - *len = clen; + if (cbuf == NULL) { + errno = ENOMEM; + return (-2); + } + *len = strlen(record); *cap = cbuf; return (retval); } else { From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 02:28:12 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51DEB106566C; Fri, 3 Apr 2009 02:28:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 021398FC19; Fri, 3 Apr 2009 02:28:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n332SBsD093672; Fri, 3 Apr 2009 02:28:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n332SB1X093671; Fri, 3 Apr 2009 02:28:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904030228.n332SB1X093671@svn.freebsd.org> From: Warner Losh Date: Fri, 3 Apr 2009 02:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190664 - head/sys/dev/ed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 02:28:12 -0000 Author: imp Date: Fri Apr 3 02:28:11 2009 New Revision: 190664 URL: http://svn.freebsd.org/changeset/base/190664 Log: Remove more debug... Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Apr 3 00:12:14 2009 (r190663) +++ head/sys/dev/ed/if_ed_pccard.c Fri Apr 3 02:28:11 2009 (r190664) @@ -950,7 +950,6 @@ ed_pccard_ax88x90_mii_readbits(struct ed val++; ed_asic_outb(sc, ED_AX88X90_MIIBUS, mdio | ED_AX88X90_MII_CLK); } - printf("AX88x90 %#x+%#x Reading %d bits: %x\n", (unsigned int)sc->port_bsh, sc->asic_offset, nbits, val); return val; } @@ -1050,7 +1049,6 @@ ed_pccard_tc5299j_mii_readbits(struct ed u_int val = 0; uint8_t cr; - printf("Reading %d bits\n", nbits); cr = ed_nic_inb(sc, ED_P0_CR); ed_nic_outb(sc, ED_P0_CR, cr | ED_CR_PAGE_3); From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 05:54:50 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62AAD106566B; Fri, 3 Apr 2009 05:54:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 519748FC12; Fri, 3 Apr 2009 05:54:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n335soqZ007600; Fri, 3 Apr 2009 05:54:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n335so8a007599; Fri, 3 Apr 2009 05:54:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904030554.n335so8a007599@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 3 Apr 2009 05:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190667 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 05:54:50 -0000 Author: marcel Date: Fri Apr 3 05:54:49 2009 New Revision: 190667 URL: http://svn.freebsd.org/changeset/base/190667 Log: The 9 bytes immediately prior to the partition table can contain signatures or disk serial numbers. Don't assume those to be zero in all cases. This fixes a false negative. Tested by: avatar@mmlab.cse.yzu.edu.tw Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Fri Apr 3 03:25:00 2009 (r190666) +++ head/sys/geom/part/g_part_ebr.c Fri Apr 3 05:54:49 2009 (r190667) @@ -403,9 +403,14 @@ g_part_ebr_probe(struct g_part_table *ta if (magic != DOSMAGIC) goto out; - /* The sector is all zeroes, except for the partition entries. */ + /* + * The sector is all zeroes, except for the partition entries + * and some signatures or disk serial number. Those can be + * found in the 9 bytes immediately in front of the partition + * table. + */ sum = 0; - for (index = 0; index < DOSPARTOFF; index++) + for (index = 0; index < DOSPARTOFF - 9; index++) sum += buf[index]; if (sum != 0) goto out; From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 06:06:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40A99106564A; Fri, 3 Apr 2009 06:06:01 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id E25E58FC08; Fri, 3 Apr 2009 06:06:00 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 62DEA7F381; Fri, 3 Apr 2009 10:05:59 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1717780514; Fri, 03 Apr 2009 10:05:59 +0400 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n3365x2E024852; Fri, 3 Apr 2009 10:05:59 +0400 (MSD) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n3365rUo024851; Fri, 3 Apr 2009 10:05:54 +0400 (MSD) (envelope-from dchagin) Date: Fri, 3 Apr 2009 10:05:53 +0400 From: Chagin Dmitry To: Peter Wemm Message-ID: <20090403060553.GA20624@dchagin.static.corbina.ru> References: <200904022116.n32LGK81076210@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: <200904022116.n32LGK81076210@svn.freebsd.org> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190655 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 06:06:01 -0000 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 02, 2009 at 09:16:20PM +0000, Peter Wemm wrote: > Author: peter > Date: Thu Apr 2 21:16:20 2009 > New Revision: 190655 > URL: http://svn.freebsd.org/changeset/base/190655 >=20 > Log: > vn_vptocnp() unlocks the name cache and forgets to re-lock it before > returning in one error case, and mistakenly unlocks it for the > umount -f case. >=20 vn_vptocnp() consumers expects what in case of error returns w/o CACHE_RLOCK held. so you need something like: diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index ea19e13..b06a6c6 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -971,18 +971,17 @@ vn_vptocnp(struct vnode **vp, char **bp, char *buf, u= _int *buflen) vdrop(*vp); VFS_UNLOCK_GIANT(vfslocked); if (error) { - CACHE_RLOCK(); numfullpathfail2++; return (error); } *bp =3D buf + *buflen; *vp =3D dvp; - CACHE_RLOCK(); if ((*vp)->v_iflag & VI_DOOMED) { /* forced unmount */ vdrop(*vp); return (ENOENT); } + CACHE_RLOCK(); vdrop(*vp); =20 return (0); --=20 Have fun! chd --dDRMvlgZJXvWKvBx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAknVp0EACgkQ0t2Tb3OO/O1I3ACfZNKJ+Ofv3xiiHZYggkO0zsbz QmsAnjdOvbJ7eaMKK3b9vkrngmdU5y3e =BWKj -----END PGP SIGNATURE----- --dDRMvlgZJXvWKvBx-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 09:44:49 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78E11106568F; Fri, 3 Apr 2009 09:44:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.terabit.net.ua (mail.terabit.net.ua [195.137.202.147]) by mx1.freebsd.org (Postfix) with ESMTP id B10B18FC0C; Fri, 3 Apr 2009 09:44:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from skuns.zoral.com.ua ([91.193.166.194] helo=mail.zoral.com.ua) by mail.terabit.net.ua with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1Lpfx6-0007VM-A8; Fri, 03 Apr 2009 12:44:44 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id n339iWO5001033 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 3 Apr 2009 12:44:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3) with ESMTP id n339iWmu026646; Fri, 3 Apr 2009 12:44:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.3/8.14.3/Submit) id n339iWkv026645; Fri, 3 Apr 2009 12:44:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 3 Apr 2009 12:44:32 +0300 From: Kostik Belousov To: Chagin Dmitry Message-ID: <20090403094432.GQ31897@deviant.kiev.zoral.com.ua> References: <200904022116.n32LGK81076210@svn.freebsd.org> <20090403060553.GA20624@dchagin.static.corbina.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Sre54N+byDQwqJQI" Content-Disposition: inline In-Reply-To: <20090403060553.GA20624@dchagin.static.corbina.ru> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua X-Virus-Scanned: mail.terabit.net.ua 1Lpfx6-0007VM-A8 fbd6b7cbaa79e23861be7b12d3475b70 X-Terabit: YES Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm Subject: Re: svn commit: r190655 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 09:44:50 -0000 --Sre54N+byDQwqJQI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 03, 2009 at 10:05:53AM +0400, Chagin Dmitry wrote: > On Thu, Apr 02, 2009 at 09:16:20PM +0000, Peter Wemm wrote: > > Author: peter > > Date: Thu Apr 2 21:16:20 2009 > > New Revision: 190655 > > URL: http://svn.freebsd.org/changeset/base/190655 > >=20 > > Log: > > vn_vptocnp() unlocks the name cache and forgets to re-lock it before > > returning in one error case, and mistakenly unlocks it for the > > umount -f case. > >=20 >=20 > vn_vptocnp() consumers expects what in case of error returns > w/o CACHE_RLOCK held. so you need something like: Yeah, I do not quite understand this commit. >=20 > diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c > index ea19e13..b06a6c6 100644 > --- a/sys/kern/vfs_cache.c > +++ b/sys/kern/vfs_cache.c > @@ -971,18 +971,17 @@ vn_vptocnp(struct vnode **vp, char **bp, char *buf,= u_int *buflen) > vdrop(*vp); > VFS_UNLOCK_GIANT(vfslocked); > if (error) { > - CACHE_RLOCK(); > numfullpathfail2++; > return (error); > } Yes, this is reversal of the part of the r190655. > *bp =3D buf + *buflen; > *vp =3D dvp; > - CACHE_RLOCK(); > if ((*vp)->v_iflag & VI_DOOMED) { > /* forced unmount */ > vdrop(*vp); > return (ENOENT); > } > + CACHE_RLOCK(); > vdrop(*vp); > =20 > return (0); There, r190655 should be reversed too, instead of doing what you do. VI_DOOMED should be checked while cache is locked. >=20 >=20 > --=20 > Have fun! > chd --Sre54N+byDQwqJQI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAknV2n8ACgkQC3+MBN1Mb4j/uwCeJPnFltpXjO5nwD1Ns2pWohH8 6ecAn2TOIAjWpX3nxGbyBgG3VURjYsJa =g/aR -----END PGP SIGNATURE----- --Sre54N+byDQwqJQI-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 10:15:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F20BA106566C; Fri, 3 Apr 2009 10:15:00 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFAC98FC14; Fri, 3 Apr 2009 10:15:00 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33AF0dg015941; Fri, 3 Apr 2009 10:15:00 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33AF0Ws015940; Fri, 3 Apr 2009 10:15:00 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200904031015.n33AF0Ws015940@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 3 Apr 2009 10:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190668 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 10:15:01 -0000 Author: stas Date: Fri Apr 3 10:15:00 2009 New Revision: 190668 URL: http://svn.freebsd.org/changeset/base/190668 Log: - Correct the comment. MFC after: 3 days Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Apr 3 05:54:49 2009 (r190667) +++ head/sys/dev/pci/pci.c Fri Apr 3 10:15:00 2009 (r190668) @@ -1030,9 +1030,10 @@ pci_get_vpd_readonly_method(device_t dev } /* - * Return the offset in configuration space of the requested extended - * capability entry or 0 if the specified capability was not found. - */ + * Find the requested extended capability and return the offset in + * configuration space via the pointer provided. The function returns + * 0 on success and error code otherwise. +*/ int pci_find_extcap_method(device_t dev, device_t child, int capability, int *capreg) From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 12:35:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FDA71065686; Fri, 3 Apr 2009 12:35:29 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id DECC08FC17; Fri, 3 Apr 2009 12:35:28 +0000 (UTC) (envelope-from dchagin@dchagin.static.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id ECCE87D119; Fri, 3 Apr 2009 16:35:26 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from [10.208.17.3] (HELO dchagin.static.corbina.ru) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1718529313; Fri, 03 Apr 2009 16:35:26 +0400 Received: from dchagin.static.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.static.corbina.ru (8.14.3/8.14.3) with ESMTP id n33CZQSr058415; Fri, 3 Apr 2009 16:35:26 +0400 (MSD) (envelope-from dchagin@dchagin.static.corbina.ru) Received: (from dchagin@localhost) by dchagin.static.corbina.ru (8.14.3/8.14.3/Submit) id n33CZLOc058414; Fri, 3 Apr 2009 16:35:21 +0400 (MSD) (envelope-from dchagin) Date: Fri, 3 Apr 2009 16:35:21 +0400 From: Chagin Dmitry To: Kostik Belousov Message-ID: <20090403123521.GA58369@dchagin.static.corbina.ru> References: <200904022116.n32LGK81076210@svn.freebsd.org> <20090403060553.GA20624@dchagin.static.corbina.ru> <20090403094432.GQ31897@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mYCpIKhGyMATD0i+" Content-Disposition: inline In-Reply-To: <20090403094432.GQ31897@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.5.19 (2009-01-05) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm Subject: Re: svn commit: r190655 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 12:35:29 -0000 --mYCpIKhGyMATD0i+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 03, 2009 at 12:44:32PM +0300, Kostik Belousov wrote: > On Fri, Apr 03, 2009 at 10:05:53AM +0400, Chagin Dmitry wrote: > > On Thu, Apr 02, 2009 at 09:16:20PM +0000, Peter Wemm wrote: > > > Author: peter > > > Date: Thu Apr 2 21:16:20 2009 > > > New Revision: 190655 > > > URL: http://svn.freebsd.org/changeset/base/190655 > > >=20 > > > Log: > > > vn_vptocnp() unlocks the name cache and forgets to re-lock it before > > > returning in one error case, and mistakenly unlocks it for the > > > umount -f case. > > >=20 > >=20 > > vn_vptocnp() consumers expects what in case of error returns > > w/o CACHE_RLOCK held. so you need something like: > Yeah, I do not quite understand this commit. >=20 > >=20 > > diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c > > index ea19e13..b06a6c6 100644 > > --- a/sys/kern/vfs_cache.c > > +++ b/sys/kern/vfs_cache.c > > @@ -971,18 +971,17 @@ vn_vptocnp(struct vnode **vp, char **bp, char *bu= f, u_int *buflen) > > vdrop(*vp); > > VFS_UNLOCK_GIANT(vfslocked); > > if (error) { > > - CACHE_RLOCK(); > > numfullpathfail2++; > > return (error); > > } > Yes, this is reversal of the part of the r190655. >=20 > > *bp =3D buf + *buflen; > > *vp =3D dvp; > > - CACHE_RLOCK(); > > if ((*vp)->v_iflag & VI_DOOMED) { > > /* forced unmount */ > > vdrop(*vp); > > return (ENOENT); > > } > > + CACHE_RLOCK(); > > vdrop(*vp); > > =20 > > return (0); > There, r190655 should be reversed too, instead of doing what you do. > VI_DOOMED should be checked while cache is locked. >=20 whoops, it was fast hacking, therefore make universe panicked after rebase to r190655 thnx :) --=20 Have fun! chd --mYCpIKhGyMATD0i+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (FreeBSD) iEYEARECAAYFAknWAogACgkQ0t2Tb3OO/O05IgCgnUd8Cnvi9gqx7RsdwRfovr23 Tm8AnRCSAZ66N0EMHac5VXt9VH02LTzC =uySt -----END PGP SIGNATURE----- --mYCpIKhGyMATD0i+-- From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 13:35:54 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9D59106566C; Fri, 3 Apr 2009 13:35:54 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B84EE8FC19; Fri, 3 Apr 2009 13:35:54 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33DZsjI023866; Fri, 3 Apr 2009 13:35:54 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33DZsrl023865; Fri, 3 Apr 2009 13:35:54 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <200904031335.n33DZsrl023865@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 3 Apr 2009 13:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190670 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 13:35:55 -0000 Author: stas Date: Fri Apr 3 13:35:54 2009 New Revision: 190670 URL: http://svn.freebsd.org/changeset/base/190670 Log: - Fix spacing in the comment. Reported by: jhb Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Apr 3 10:38:24 2009 (r190669) +++ head/sys/dev/pci/pci.c Fri Apr 3 13:35:54 2009 (r190670) @@ -1033,7 +1033,7 @@ pci_get_vpd_readonly_method(device_t dev * Find the requested extended capability and return the offset in * configuration space via the pointer provided. The function returns * 0 on success and error code otherwise. -*/ + */ int pci_find_extcap_method(device_t dev, device_t child, int capability, int *capreg) From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 18:00:19 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7859A1065675; Fri, 3 Apr 2009 18:00:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8CD8FC38; Fri, 3 Apr 2009 18:00:19 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33I0Jen029066; Fri, 3 Apr 2009 18:00:19 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33I0JlC029063; Fri, 3 Apr 2009 18:00:19 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904031800.n33I0JlC029063@svn.freebsd.org> From: Sam Leffler Date: Fri, 3 Apr 2009 18:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190672 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 18:00:20 -0000 Author: sam Date: Fri Apr 3 18:00:19 2009 New Revision: 190672 URL: http://svn.freebsd.org/changeset/base/190672 Log: o update dwds mcast handling after hoisting ieee80211_encap: frames need to be encapsulated before dispatching to the driver o eliminate M_WDS now that we call ieee80211_encap directly and can supply the wds vap to indicate a 4-address frame should be created Modified: head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Fri Apr 3 16:02:13 2009 (r190671) +++ head/sys/net80211/ieee80211_freebsd.h Fri Apr 3 18:00:19 2009 (r190672) @@ -211,7 +211,6 @@ struct mbuf *ieee80211_getmgtframe(uint8 /* tx path usage */ #define M_ENCAP M_PROTO1 /* 802.11 encap done */ -#define M_WDS M_PROTO2 /* WDS frame */ #define M_EAPOL M_PROTO3 /* PAE/EAPOL frame */ #define M_PWR_SAV M_PROTO4 /* bypass PS handling */ #define M_MORE_DATA M_PROTO5 /* more data frames to follow */ @@ -219,7 +218,7 @@ struct mbuf *ieee80211_getmgtframe(uint8 #define M_TXCB M_PROTO7 /* do tx complete callback */ #define M_AMPDU_MPDU M_PROTO8 /* ok for A-MPDU aggregation */ #define M_80211_TX \ - (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_WDS|M_EAPOL|M_PWR_SAV|\ + (M_FRAG|M_FIRSTFRAG|M_LASTFRAG|M_ENCAP|M_EAPOL|M_PWR_SAV|\ M_MORE_DATA|M_FF|M_TXCB|M_AMPDU_MPDU) /* rx path usage */ Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Apr 3 16:02:13 2009 (r190671) +++ head/sys/net80211/ieee80211_output.c Fri Apr 3 18:00:19 2009 (r190672) @@ -919,12 +919,11 @@ ieee80211_encap(struct ieee80211vap *vap hdrsize = sizeof(struct ieee80211_frame); /* * 4-address frames need to be generated for: - * o packets sent through a WDS vap (M_WDS || IEEE80211_M_WDS) + * o packets sent through a WDS vap (IEEE80211_M_WDS) * o packets relayed by a station operating with dynamic WDS * (IEEE80211_M_STA+IEEE80211_F_DWDS and src address) */ - is4addr = (m->m_flags & M_WDS) || - vap->iv_opmode == IEEE80211_M_WDS || /* XXX redundant? */ + is4addr = vap->iv_opmode == IEEE80211_M_WDS || (vap->iv_opmode == IEEE80211_M_STA && (vap->iv_flags & IEEE80211_F_DWDS) && !IEEE80211_ADDR_EQ(eh.ether_shost, vap->iv_myaddr)); Modified: head/sys/net80211/ieee80211_wds.c ============================================================================== --- head/sys/net80211/ieee80211_wds.c Fri Apr 3 16:02:13 2009 (r190671) +++ head/sys/net80211/ieee80211_wds.c Fri Apr 3 18:00:19 2009 (r190672) @@ -250,9 +250,7 @@ ieee80211_dwds_mcast(struct ieee80211vap if (ifp == m->m_pkthdr.rcvif) continue; /* - * Duplicate the frame and send it. We don't need - * to classify or lookup the tx node; this was already - * done by the caller so we can just re-use the info. + * Duplicate the frame and send it. */ mcopy = m_copypacket(m, M_DONTWAIT); if (mcopy == NULL) { @@ -267,6 +265,7 @@ ieee80211_dwds_mcast(struct ieee80211vap m_freem(mcopy); continue; } + /* calculate priority so drivers can find the tx queue */ if (ieee80211_classify(ni, mcopy)) { IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_OUTPUT | IEEE80211_MSG_WDS, @@ -278,7 +277,16 @@ ieee80211_dwds_mcast(struct ieee80211vap ieee80211_free_node(ni); continue; } - mcopy->m_flags |= M_MCAST | M_WDS; + /* + * Encapsulate the packet in prep for transmission. + */ + mcopy = ieee80211_encap(vap, ni, mcopy); + if (m == NULL) { + /* NB: stat+msg handled in ieee80211_encap */ + ieee80211_free_node(ni); + continue; + } + mcopy->m_flags |= M_MCAST; mcopy->m_pkthdr.rcvif = (void *) ni; err = parent->if_transmit(parent, mcopy); From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 19:17:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E734106566B; Fri, 3 Apr 2009 19:17:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BC3C8FC1F; Fri, 3 Apr 2009 19:17:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33JHO0s030714; Fri, 3 Apr 2009 19:17:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33JHOMr030710; Fri, 3 Apr 2009 19:17:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904031917.n33JHOMr030710@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 3 Apr 2009 19:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190673 - in head: lib/libc/gen libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 19:17:25 -0000 Author: kib Date: Fri Apr 3 19:17:23 2009 New Revision: 190673 URL: http://svn.freebsd.org/changeset/base/190673 Log: Allow the NULL, RTLD_SELF and RTLD_NEXT handles to work with dlfunc(3). dlfunc() called dlsym() to do the work, and dlsym() determines the dso that originating the call by the return address. Due to this, dlfunc() operated as if the caller is always the libc. To fix this, move the dlfunc() to rtld, where it can call the internal implementation of dlsym, and still correctly fetch return address. Provide usual weak stub for the symbol from libc for static binaries. dlfunc is put to FBSD_1.0 symver namespace in the ld.so export to override dlfunc@FBSD_1.0 weak symbol, exported by libc. Reported, analyzed and tested by: Tijl Coosemans PR: standards/133339 Reviewed by: kan Deleted: head/lib/libc/gen/dlfunc.c Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/dlfcn.c head/libexec/rtld-elf/Symbol.map head/libexec/rtld-elf/rtld.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Apr 3 18:00:19 2009 (r190672) +++ head/lib/libc/gen/Makefile.inc Fri Apr 3 19:17:23 2009 (r190673) @@ -9,7 +9,7 @@ SRCS+= __getosreldate.c __xuname.c \ alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ - dlfcn.c dlfunc.c drand48.c erand48.c err.c errlst.c errno.c \ + dlfcn.c drand48.c erand48.c err.c errlst.c errno.c \ exec.c fdevname.c feature_present.c fmtcheck.c fmtmsg.c fnmatch.c \ fpclassify.c frexp.c fstab.c ftok.c fts.c fts-compat.c ftw.c \ getbootfile.c getbsize.c \ Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Fri Apr 3 18:00:19 2009 (r190672) +++ head/lib/libc/gen/dlfcn.c Fri Apr 3 19:17:23 2009 (r190673) @@ -105,6 +105,14 @@ dlsym(void * __restrict handle, const ch return NULL; } +#pragma weak dlfunc +dlfunc_t +dlfunc(void * __restrict handle, const char * __restrict name) +{ + _rtld_error(sorry); + return NULL; +} + #pragma weak dlvsym void * dlvsym(void * __restrict handle, const char * __restrict name, Modified: head/libexec/rtld-elf/Symbol.map ============================================================================== --- head/libexec/rtld-elf/Symbol.map Fri Apr 3 18:00:19 2009 (r190672) +++ head/libexec/rtld-elf/Symbol.map Fri Apr 3 19:17:23 2009 (r190673) @@ -8,6 +8,7 @@ FBSD_1.0 { dlerror; dlopen; dlsym; + dlfunc; dlvsym; dladdr; dllockinit; Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Apr 3 18:00:19 2009 (r190672) +++ head/libexec/rtld-elf/rtld.c Fri Apr 3 19:17:23 2009 (r190673) @@ -200,6 +200,7 @@ static func_ptr_type exports[] = { (func_ptr_type) &dlerror, (func_ptr_type) &dlopen, (func_ptr_type) &dlsym, + (func_ptr_type) &dlfunc, (func_ptr_type) &dlvsym, (func_ptr_type) &dladdr, (func_ptr_type) &dllockinit, @@ -2170,6 +2171,19 @@ dlsym(void *handle, const char *name) SYMLOOK_DLSYM); } +dlfunc_t +dlfunc(void *handle, const char *name) +{ + union { + void *d; + dlfunc_t f; + } rv; + + rv.d = do_dlsym(handle, name, __builtin_return_address(0), NULL, + SYMLOOK_DLSYM); + return (rv.f); +} + void * dlvsym(void *handle, const char *name, const char *version) { From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 19:21:40 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2352F106566B; Fri, 3 Apr 2009 19:21:40 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F8908FC1A; Fri, 3 Apr 2009 19:21:40 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33JLdCo030831; Fri, 3 Apr 2009 19:21:39 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33JLdtJ030829; Fri, 3 Apr 2009 19:21:39 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904031921.n33JLdtJ030829@svn.freebsd.org> From: Robert Noland Date: Fri, 3 Apr 2009 19:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190674 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 19:21:43 -0000 Author: rnoland Date: Fri Apr 3 19:21:39 2009 New Revision: 190674 URL: http://svn.freebsd.org/changeset/base/190674 Log: A little more cleanup from AMD, if we don't have the right microcode there is no reason to mess with the chip. MFC after: 3 days Modified: head/sys/dev/drm/r600_cp.c head/sys/dev/drm/radeon_cp.c Modified: head/sys/dev/drm/r600_cp.c ============================================================================== --- head/sys/dev/drm/r600_cp.c Fri Apr 3 19:17:23 2009 (r190673) +++ head/sys/dev/drm/r600_cp.c Fri Apr 3 19:21:39 2009 (r190674) @@ -286,20 +286,6 @@ static void r600_cp_load_microcode(drm_r const u32 *pfp; int i; - r600_do_cp_stop(dev_priv); - - RADEON_WRITE(R600_CP_RB_CNTL, - R600_RB_NO_UPDATE | - R600_RB_BLKSZ(15) | - R600_RB_BUFSZ(3)); - - RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); - RADEON_READ(R600_GRBM_SOFT_RESET); - DRM_UDELAY(15000); - RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); - - RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_R600: DRM_INFO("Loading R600 Microcode\n"); @@ -337,19 +323,32 @@ static void r600_cp_load_microcode(drm_r pfp = RS780_pfp_microcode; break; default: - goto no_microcode; + return; } - for (i = 0; i != PM4_UCODE_SIZE; i++) { + r600_do_cp_stop(dev_priv); + + RADEON_WRITE(R600_CP_RB_CNTL, + R600_RB_NO_UPDATE | + R600_RB_BLKSZ(15) | + R600_RB_BUFSZ(3)); + + RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); + RADEON_READ(R600_GRBM_SOFT_RESET); + DRM_UDELAY(15000); + RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); + + RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); + + for (i = 0; i < PM4_UCODE_SIZE; i++) { RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][0]); RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][1]); RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i][2]); } RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - for (i = 0; i != PFP_UCODE_SIZE; i++) + for (i = 0; i < PFP_UCODE_SIZE; i++) RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); -no_microcode:; RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); @@ -415,21 +414,9 @@ static void r700_cp_load_microcode(drm_r const u32 *cp; int i; - r600_do_cp_stop(dev_priv); - - RADEON_WRITE(R600_CP_RB_CNTL, - R600_RB_NO_UPDATE | - (15 << 8) | - (3 << 0)); - - RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); - RADEON_READ(R600_GRBM_SOFT_RESET); - DRM_UDELAY(15000); - RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); - switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_RV770: - DRM_INFO("Loading RV770 Microcode\n"); + DRM_INFO("Loading RV770/RV790 Microcode\n"); pfp = RV770_pfp_microcode; cp = RV770_cp_microcode; break; @@ -444,19 +431,30 @@ static void r700_cp_load_microcode(drm_r cp = RV710_cp_microcode; break; default: - goto no_microcode; + return; } + r600_do_cp_stop(dev_priv); + + RADEON_WRITE(R600_CP_RB_CNTL, + R600_RB_NO_UPDATE | + (15 << 8) | + (3 << 0)); + + RADEON_WRITE(R600_GRBM_SOFT_RESET, R600_SOFT_RESET_CP); + RADEON_READ(R600_GRBM_SOFT_RESET); + DRM_UDELAY(15000); + RADEON_WRITE(R600_GRBM_SOFT_RESET, 0); + RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); - for (i = 0; i != R700_PFP_UCODE_SIZE; i++) + for (i = 0; i < R700_PFP_UCODE_SIZE; i++) RADEON_WRITE(R600_CP_PFP_UCODE_DATA, pfp[i]); RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); - for (i = 0; i != R700_PM4_UCODE_SIZE; i++) + for (i = 0; i < R700_PM4_UCODE_SIZE; i++) RADEON_WRITE(R600_CP_ME_RAM_DATA, cp[i]); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); -no_microcode:; RADEON_WRITE(R600_CP_PFP_UCODE_ADDR, 0); RADEON_WRITE(R600_CP_ME_RAM_WADDR, 0); Modified: head/sys/dev/drm/radeon_cp.c ============================================================================== --- head/sys/dev/drm/radeon_cp.c Fri Apr 3 19:17:23 2009 (r190673) +++ head/sys/dev/drm/radeon_cp.c Fri Apr 3 19:21:39 2009 (r190674) @@ -460,9 +460,6 @@ static void radeon_cp_load_microcode(drm DRM_DEBUG("\n"); - radeon_do_wait_for_idle(dev_priv); - - RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); switch (dev_priv->flags & RADEON_FAMILY_MASK) { case CHIP_R100: case CHIP_RV100: @@ -516,6 +513,10 @@ static void radeon_cp_load_microcode(drm return; } + radeon_do_wait_for_idle(dev_priv); + + RADEON_WRITE(RADEON_CP_ME_RAM_ADDR, 0); + for (i = 0; i != 256; i++) { RADEON_WRITE(RADEON_CP_ME_RAM_DATAH, cp[i][1]); RADEON_WRITE(RADEON_CP_ME_RAM_DATAL, cp[i][0]); From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 19:23:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C0F5106566B; Fri, 3 Apr 2009 19:23:14 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A6298FC17; Fri, 3 Apr 2009 19:23:14 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33JNE9L030911; Fri, 3 Apr 2009 19:23:14 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33JNEq7030910; Fri, 3 Apr 2009 19:23:14 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200904031923.n33JNEq7030910@svn.freebsd.org> From: Robert Noland Date: Fri, 3 Apr 2009 19:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190675 - head/sys/dev/drm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 19:23:14 -0000 Author: rnoland Date: Fri Apr 3 19:23:14 2009 New Revision: 190675 URL: http://svn.freebsd.org/changeset/base/190675 Log: Add support for RV790 (HD 4890) asics MFC after: 3 days Modified: head/sys/dev/drm/drm_pciids.h Modified: head/sys/dev/drm/drm_pciids.h ============================================================================== --- head/sys/dev/drm/drm_pciids.h Fri Apr 3 19:21:39 2009 (r190674) +++ head/sys/dev/drm/drm_pciids.h Fri Apr 3 19:23:14 2009 (r190675) @@ -336,6 +336,8 @@ {0x1002, 0x944B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4850 X2"}, \ {0x1002, 0x945A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon HD 4870"}, \ {0x1002, 0x945B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI Mobility Radeon M98"}, \ + {0x1002, 0x9460, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ + {0x1002, 0x9462, CHIP_RV770|RADEON_NEW_MEMMAP, "ATI Radeon 4800 Series"}, \ {0x1002, 0x946A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI FirePro M7750"}, \ {0x1002, 0x946B, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI M98"}, \ {0x1002, 0x947A, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, "ATI M98"}, \ From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 19:46:13 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDAF106566C; Fri, 3 Apr 2009 19:46:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A829F8FC14; Fri, 3 Apr 2009 19:46:12 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33JkC4k031413; Fri, 3 Apr 2009 19:46:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33JkCU7031404; Fri, 3 Apr 2009 19:46:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904031946.n33JkCU7031404@svn.freebsd.org> From: Andrew Thompson Date: Fri, 3 Apr 2009 19:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190676 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs dev/pccbb dev/usb/controller geom/journal geom/mirror geom/part geom/raid3 kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 19:46:13 -0000 Author: thompsa Date: Fri Apr 3 19:46:12 2009 New Revision: 190676 URL: http://svn.freebsd.org/changeset/base/190676 Log: Add a how argument to root_mount_hold() so it can be passed NOWAIT and be called in situations where sleeping isnt allowed. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/usb/controller/usb_controller.c head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/part/g_part.c head/sys/geom/raid3/g_raid3.c head/sys/kern/vfs_mount.c head/sys/sys/systm.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Apr 3 19:46:12 2009 (r190676) @@ -3087,7 +3087,7 @@ zfs_modevent(module_t mod, int type, voi error = EOPNOTSUPP; switch (type) { case MOD_LOAD: - zfs_root_token = root_mount_hold("ZFS"); + zfs_root_token = root_mount_hold("ZFS", M_WAITOK); printf("WARNING: ZFS is considered to be an experimental " "feature in FreeBSD.\n"); TASK_INIT(&zfs_start_task, 0, zfs_start, NULL); Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/dev/pccbb/pccbb_pci.c Fri Apr 3 19:46:12 2009 (r190676) @@ -439,7 +439,7 @@ cbb_pci_attach(device_t brdev) device_printf(brdev, "unable to create event thread.\n"); panic("cbb_create_event_thread"); } - sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev)); + sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev), M_WAITOK); return (0); err: if (sc->irq_res) Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/dev/usb/controller/usb_controller.c Fri Apr 3 19:46:12 2009 (r190676) @@ -115,7 +115,7 @@ usb2_attach(device_t dev) } /* delay vfs_mountroot until the bus is explored */ - bus->bus_roothold = root_mount_hold(device_get_nameunit(dev)); + bus->bus_roothold = root_mount_hold(device_get_nameunit(dev), M_WAITOK); if (usb2_post_init_called) { mtx_lock(&Giant); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/geom/journal/g_journal.c Fri Apr 3 19:46:12 2009 (r190676) @@ -2310,7 +2310,7 @@ g_journal_create(struct g_class *mp, str sc->sc_inactive.jj_queue = NULL; sc->sc_active.jj_queue = NULL; - sc->sc_rootmount = root_mount_hold("GJOURNAL"); + sc->sc_rootmount = root_mount_hold("GJOURNAL", M_WAITOK); GJ_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); callout_init(&sc->sc_callout, CALLOUT_MPSAFE); Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 3 19:46:12 2009 (r190676) @@ -2907,7 +2907,7 @@ g_mirror_create(struct g_class *mp, cons G_MIRROR_DEBUG(1, "Device %s created (%u components, id=%u).", sc->sc_name, sc->sc_ndisks, sc->sc_id); - sc->sc_rootmount = root_mount_hold("GMIRROR"); + sc->sc_rootmount = root_mount_hold("GMIRROR", M_WAITOK); G_MIRROR_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); /* * Run timeout. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/geom/part/g_part.c Fri Apr 3 19:46:12 2009 (r190676) @@ -1474,7 +1474,7 @@ g_part_taste(struct g_class *mp, struct return (NULL); } - rht = root_mount_hold(mp->name); + rht = root_mount_hold(mp->name, M_WAITOK); g_topology_unlock(); /* Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/geom/raid3/g_raid3.c Fri Apr 3 19:46:12 2009 (r190676) @@ -3193,7 +3193,7 @@ g_raid3_create(struct g_class *mp, const G_RAID3_DEBUG(1, "Device %s created (%u components, id=%u).", sc->sc_name, sc->sc_ndisks, sc->sc_id); - sc->sc_rootmount = root_mount_hold("GRAID3"); + sc->sc_rootmount = root_mount_hold("GRAID3", M_WAITOK); G_RAID3_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount); /* Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/kern/vfs_mount.c Fri Apr 3 19:46:12 2009 (r190676) @@ -1353,14 +1353,18 @@ static int root_mount_complete; * Hold root mount. */ struct root_hold_token * -root_mount_hold(const char *identifier) +root_mount_hold(const char *identifier, int how) { struct root_hold_token *h; if (root_mounted()) return (NULL); - h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK); + h = malloc(sizeof *h, M_DEVBUF, M_ZERO | how); + if (h == NULL) { + printf("Unable to alloc root hold token for %s\n", identifier); + return (NULL); + } h->who = identifier; mtx_lock(&mountlist_mtx); LIST_INSERT_HEAD(&root_holds, h, list); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri Apr 3 19:23:14 2009 (r190675) +++ head/sys/sys/systm.h Fri Apr 3 19:46:12 2009 (r190676) @@ -325,7 +325,7 @@ void DELAY(int usec); /* Root mount holdback API */ struct root_hold_token; -struct root_hold_token *root_mount_hold(const char *identifier); +struct root_hold_token *root_mount_hold(const char *identifier, int how); void root_mount_rel(struct root_hold_token *h); void root_mount_wait(void); int root_mounted(void); From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 19:49:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21F89106564A; Fri, 3 Apr 2009 19:49:34 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3068FC08; Fri, 3 Apr 2009 19:49:34 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33JnXQO031505; Fri, 3 Apr 2009 19:49:33 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33JnXfP031500; Fri, 3 Apr 2009 19:49:33 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904031949.n33JnXfP031500@svn.freebsd.org> From: Andrew Thompson Date: Fri, 3 Apr 2009 19:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190677 - in head/sys: cam geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 19:49:34 -0000 Author: thompsa Date: Fri Apr 3 19:49:33 2009 New Revision: 190677 URL: http://svn.freebsd.org/changeset/base/190677 Log: Add interleaving root hold tokens from the CAM probe to disk_create and geom provider tasting. This is needed for disk attachments that happen after threads are running in the boot process. Tested by: rnoland Modified: head/sys/cam/cam_xpt.c head/sys/geom/geom.h head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/geom/geom_subr.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Apr 3 19:46:12 2009 (r190676) +++ head/sys/cam/cam_xpt.c Fri Apr 3 19:49:33 2009 (r190677) @@ -5139,6 +5139,7 @@ xpt_find_device(struct cam_et *target, l typedef struct { union ccb *request_ccb; struct ccb_pathinq *cpi; + struct root_hold_token *roothold; int counter; } xpt_scan_bus_info; @@ -5201,6 +5202,7 @@ xpt_scan_bus(struct cam_periph *periph, } scan_info->request_ccb = request_ccb; scan_info->cpi = &work_ccb->cpi; + scan_info->roothold = root_mount_hold("CAM", M_NOWAIT); /* Cache on our stack so we can work asynchronously */ max_target = scan_info->cpi->max_target; @@ -5232,6 +5234,7 @@ xpt_scan_bus(struct cam_periph *periph, printf("xpt_scan_bus: xpt_create_path failed" " with status %#x, bus scan halted\n", status); + root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = status; xpt_free_ccb(work_ccb); @@ -5240,6 +5243,7 @@ xpt_scan_bus(struct cam_periph *periph, } work_ccb = xpt_alloc_ccb_nowait(); if (work_ccb == NULL) { + root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); xpt_free_path(path); request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -5353,6 +5357,7 @@ xpt_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; + root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(request_ccb); @@ -5372,6 +5377,7 @@ xpt_scan_bus(struct cam_periph *periph, xpt_free_ccb(request_ccb); xpt_free_ccb((union ccb *)scan_info->cpi); request_ccb = scan_info->request_ccb; + root_mount_rel(scan_info->roothold); free(scan_info, M_CAMXPT); request_ccb->ccb_h.status = status; xpt_done(request_ccb); Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Fri Apr 3 19:46:12 2009 (r190676) +++ head/sys/geom/geom.h Fri Apr 3 19:49:33 2009 (r190677) @@ -193,6 +193,8 @@ struct g_provider { /* Two fields for the implementing class to use */ void *private; u_int index; + + struct root_hold_token *roothold; }; /* geom_dev.c */ Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Fri Apr 3 19:46:12 2009 (r190676) +++ head/sys/geom/geom_disk.c Fri Apr 3 19:49:33 2009 (r190677) @@ -381,6 +381,7 @@ g_disk_create(void *arg, int flag) printf("GEOM: new disk %s\n", gp->name); dp->d_geom = gp; g_error_provider(pp, 0); + root_mount_rel(dp->d_roothold); } static void @@ -467,6 +468,7 @@ disk_create(struct disk *dp, int version dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; + dp->d_roothold = root_mount_hold(dp->d_name, M_WAITOK); g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); } Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Fri Apr 3 19:46:12 2009 (r190676) +++ head/sys/geom/geom_disk.h Fri Apr 3 19:49:33 2009 (r190677) @@ -88,6 +88,8 @@ struct disk { /* Fields private to the driver */ void *d_drv1; + + struct root_hold_token *d_roothold; }; #define DISKFLAG_NEEDSGIANT 0x1 Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Fri Apr 3 19:46:12 2009 (r190676) +++ head/sys/geom/geom_subr.c Fri Apr 3 19:49:33 2009 (r190677) @@ -545,6 +545,10 @@ g_new_provider_event(void *arg, int flag mp->taste(mp, pp, 0); g_topology_assert(); } + if (pp->roothold != NULL) { + root_mount_rel(pp->roothold); + pp->roothold = NULL; + } } @@ -581,6 +585,7 @@ g_new_providerf(struct g_geom *gp, const pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); LIST_INSERT_HEAD(&gp->provider, pp, provider); + pp->roothold = root_mount_hold(pp->name, M_WAITOK); g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL); return (pp); } From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 20:46:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C53106564A; Fri, 3 Apr 2009 20:46:32 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 881E58FC1B; Fri, 3 Apr 2009 20:46:32 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33KkWnU032675; Fri, 3 Apr 2009 20:46:32 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33KkWgl032674; Fri, 3 Apr 2009 20:46:32 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200904032046.n33KkWgl032674@svn.freebsd.org> From: Sam Leffler Date: Fri, 3 Apr 2009 20:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190678 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 20:46:33 -0000 Author: sam Date: Fri Apr 3 20:46:32 2009 New Revision: 190678 URL: http://svn.freebsd.org/changeset/base/190678 Log: fix whitespace Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Apr 3 19:49:33 2009 (r190677) +++ head/sys/net80211/ieee80211_output.c Fri Apr 3 20:46:32 2009 (r190678) @@ -1009,7 +1009,7 @@ ieee80211_encap(struct ieee80211vap *vap case IEEE80211_M_WDS: /* NB: is4addr should always be true */ goto bad; } - if (m->m_flags & M_MORE_DATA) + if (m->m_flags & M_MORE_DATA) wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA; if (addqos) { uint8_t *qos; From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 21:13:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ABA71065672; Fri, 3 Apr 2009 21:13:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 887878FC26; Fri, 3 Apr 2009 21:13:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33LDIhn033196; Fri, 3 Apr 2009 21:13:18 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33LDITC033195; Fri, 3 Apr 2009 21:13:18 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <200904032113.n33LDITC033195@svn.freebsd.org> From: Colin Percival Date: Fri, 3 Apr 2009 21:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190679 - head/usr.sbin/portsnap/phttpget X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 21:13:19 -0000 Author: cperciva Date: Fri Apr 3 21:13:18 2009 New Revision: 190679 URL: http://svn.freebsd.org/changeset/base/190679 Log: Set SO_NOSIGPIPE on sockets used by phttpget. Without this, if (1) phttpget is attempting to download enough files that it can't send all the requests at once, and (2) the remote server forcibly closes the connection, resulting in RST packets being sent, phttpget will receive a SIGPIPE and terminate without downloading all of the files. This is probably responsible for a number of hard-to-reproduce errors with portsnap and freebsd-update. MFC after: 3 days Modified: head/usr.sbin/portsnap/phttpget/phttpget.c Modified: head/usr.sbin/portsnap/phttpget/phttpget.c ============================================================================== --- head/usr.sbin/portsnap/phttpget/phttpget.c Fri Apr 3 20:46:32 2009 (r190678) +++ head/usr.sbin/portsnap/phttpget/phttpget.c Fri Apr 3 21:13:18 2009 (r190679) @@ -317,6 +317,7 @@ main(int argc, char *argv[]) int chunked; /* != if transfer-encoding is chunked */ off_t clen; /* Chunk length */ int firstreq = 0; /* # of first request for this connection */ + int val; /* Value used for setsockopt call */ /* Check that the arguments are sensible */ if (argc < 2) @@ -370,6 +371,11 @@ main(int argc, char *argv[]) setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO, (void *)&timo, (socklen_t)sizeof(timo)); + /* ... disable SIGPIPE generation ... */ + val = 1; + setsockopt(sd, SOL_SOCKET, SO_NOSIGPIPE, + (void *)&val, sizeof(int)); + /* ... and connect to the server. */ if(connect(sd, res->ai_addr, res->ai_addrlen)) { close(sd); From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 22:26:18 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D05831065672; Fri, 3 Apr 2009 22:26:18 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from poseidon.ceid.upatras.gr (poseidon.ceid.upatras.gr [150.140.141.169]) by mx1.freebsd.org (Postfix) with ESMTP id 481128FC23; Fri, 3 Apr 2009 22:26:18 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from mail.ceid.upatras.gr (unknown [10.1.0.143]) by poseidon.ceid.upatras.gr (Postfix) with ESMTP id 69379EB504E; Sat, 4 Apr 2009 01:26:16 +0300 (EEST) Received: from localhost (europa.ceid.upatras.gr [127.0.0.1]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 4FB8D4509B; Sat, 4 Apr 2009 01:26:16 +0300 (EEST) X-Virus-Scanned: amavisd-new at ceid.upatras.gr Received: from mail.ceid.upatras.gr ([127.0.0.1]) by localhost (europa.ceid.upatras.gr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R0LCRpJe9H44; Sat, 4 Apr 2009 01:26:16 +0300 (EEST) Received: from kobe.laptop (unknown [188.4.10.162]) by mail.ceid.upatras.gr (Postfix) with ESMTP id 1407F4503F; Sat, 4 Apr 2009 01:26:16 +0300 (EEST) Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n33MQFHC002409; Sat, 4 Apr 2009 01:26:15 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n33MQEYs002408; Sat, 4 Apr 2009 01:26:14 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Peter Wemm References: <200904022116.n32LGK81076210@svn.freebsd.org> Date: Sat, 04 Apr 2009 01:26:14 +0300 In-Reply-To: <200904022116.n32LGK81076210@svn.freebsd.org> (Peter Wemm's message of "Thu, 2 Apr 2009 21:16:20 +0000 (UTC)") Message-ID: <87y6uhqsqh.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190655 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 22:26:19 -0000 On Thu, 2 Apr 2009 21:16:20 +0000 (UTC), Peter Wemm wrote: > Author: peter > Date: Thu Apr 2 21:16:20 2009 > New Revision: 190655 > URL: http://svn.freebsd.org/changeset/base/190655 > > Log: > vn_vptocnp() unlocks the name cache and forgets to re-lock it before > returning in one error case, and mistakenly unlocks it for the > umount -f case. > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Thu Apr 2 19:27:56 2009 (r190654) > +++ head/sys/kern/vfs_cache.c Thu Apr 2 21:16:20 2009 (r190655) > @@ -971,6 +971,7 @@ vn_vptocnp(struct vnode **vp, char **bp, > vdrop(*vp); > VFS_UNLOCK_GIANT(vfslocked); > if (error) { > + CACHE_RLOCK(); > numfullpathfail2++; > return (error); > } > @@ -979,7 +980,6 @@ vn_vptocnp(struct vnode **vp, char **bp, > CACHE_RLOCK(); > if ((*vp)->v_iflag & VI_DOOMED) { > /* forced unmount */ > - CACHE_RUNLOCK(); > vdrop(*vp); > return (ENOENT); > } This seems to trigger panics for nullfs mounts: System call __getcwd returning with the following locks held: shared rw Name Cache (Name Cache) r = 0 (0xc0ba245c) locked @ /usr/src/sys/kern/vfs_cache.c:980 panic: witness_warn From owner-svn-src-head@FreeBSD.ORG Fri Apr 3 23:52:47 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0478106564A; Fri, 3 Apr 2009 23:52:47 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEE4F8FC12; Fri, 3 Apr 2009 23:52:47 +0000 (UTC) (envelope-from trhodes@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n33NqlhE037301; Fri, 3 Apr 2009 23:52:47 GMT (envelope-from trhodes@svn.freebsd.org) Received: (from trhodes@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n33NqlCd037300; Fri, 3 Apr 2009 23:52:47 GMT (envelope-from trhodes@svn.freebsd.org) Message-Id: <200904032352.n33NqlCd037300@svn.freebsd.org> From: Tom Rhodes Date: Fri, 3 Apr 2009 23:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190680 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2009 23:52:48 -0000 Author: trhodes Date: Fri Apr 3 23:52:47 2009 New Revision: 190680 URL: http://svn.freebsd.org/changeset/base/190680 Log: Catch up with recent locking changes. PR: 132546 Submitted by: pluknet Reviewed by: alc Modified: head/share/man/man9/vm_map_lock.9 Modified: head/share/man/man9/vm_map_lock.9 ============================================================================== --- head/share/man/man9/vm_map_lock.9 Fri Apr 3 21:13:18 2009 (r190679) +++ head/share/man/man9/vm_map_lock.9 Fri Apr 3 23:52:47 2009 (r190680) @@ -73,7 +73,6 @@ The .Fn vm_map_lock_read macro obtains a read-lock on .Fa map . -Currently this is implemented as an exclusive lock. .Pp The .Fn vm_map_unlock_read @@ -93,23 +92,18 @@ macro attempts to obtain a read-lock on .Fa map . It returns FALSE if the lock cannot be immediately acquired; otherwise return TRUE with the lock acquired. -Currently this is implemented as an exclusive lock. .Pp The .Fn vm_map_lock_upgrade macro attempts to atomically upgrade a read-lock on .Fa map to an exclusive lock. -As read-locks are currently implemented as exclusive locks, -this macro is a no-op. .Pp The .Fn vm_map_lock_downgrade macro attempts to downgrade an exclusive lock on .Fa map to a read-lock. -As read-locks are currently implemented as exclusive locks, -this macro is a no-op. .Sh IMPLEMENTATION NOTES Currently, all of the locking macros implement their locks as sleep locks. .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 00:22:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE304106566C; Sat, 4 Apr 2009 00:22:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D80008FC17; Sat, 4 Apr 2009 00:22:44 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n340MihG039255; Sat, 4 Apr 2009 00:22:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n340Mifi039247; Sat, 4 Apr 2009 00:22:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904040022.n340Mifi039247@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Apr 2009 00:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190681 - in head: share/mk sys/conf sys/dev/powermac_nvram sys/dev/uart sys/powerpc/aim sys/powerpc/booke sys/powerpc/include sys/powerpc/ofw sys/powerpc/powermac sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 00:22:45 -0000 Author: nwhitehorn Date: Sat Apr 4 00:22:44 2009 New Revision: 190681 URL: http://svn.freebsd.org/changeset/base/190681 Log: Add support for 64-bit PowerPC CPUs operating in the 64-bit bridge mode provided, for example, on the PowerPC 970 (G5), as well as on related CPUs like the POWER3 and POWER4. This also adds support for various built-in hardware found on Apple G5 hardware (e.g. the IBM CPC925 northbridge). Reviewed by: grehan Added: head/sys/powerpc/aim/mmu_oea64.c (contents, props changed) head/sys/powerpc/powermac/cpcht.c (contents, props changed) head/sys/powerpc/powermac/cpchtvar.h (contents, props changed) head/sys/powerpc/powerpc/uio_machdep.c - copied unchanged from r190402, head/sys/powerpc/booke/uio_machdep.c Deleted: head/sys/powerpc/aim/uio_machdep.c head/sys/powerpc/booke/uio_machdep.c Modified: head/share/mk/bsd.cpu.mk head/sys/conf/files.powerpc head/sys/dev/powermac_nvram/powermac_nvram.c head/sys/dev/uart/uart_cpu_powerpc.c head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/aim/ofw_machdep.c head/sys/powerpc/aim/trap_subr.S head/sys/powerpc/aim/uma_machdep.c head/sys/powerpc/aim/vm_machdep.c head/sys/powerpc/booke/machdep.c head/sys/powerpc/include/hid.h head/sys/powerpc/include/md_var.h head/sys/powerpc/include/sf_buf.h head/sys/powerpc/include/spr.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/ofw/ofw_syscons.c head/sys/powerpc/powerpc/bus_machdep.c head/sys/powerpc/powerpc/cpu.c head/sys/powerpc/powerpc/mem.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Fri Apr 3 23:52:47 2009 (r190680) +++ head/share/mk/bsd.cpu.mk Sat Apr 4 00:22:44 2009 (r190681) @@ -119,7 +119,7 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float . else -_CPUCFLAGS = -mcpu=${CPUTYPE} +_CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64 . endif . elif ${MACHINE_ARCH} == "mips" . if ${CPUTYPE} == "mips32" Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Apr 3 23:52:47 2009 (r190680) +++ head/sys/conf/files.powerpc Sat Apr 4 00:22:44 2009 (r190681) @@ -76,13 +76,13 @@ powerpc/aim/interrupt.c optional aim powerpc/aim/locore.S optional aim no-obj powerpc/aim/machdep.c optional aim powerpc/aim/mmu_oea.c optional aim +powerpc/aim/mmu_oea64.c optional aim powerpc/aim/mp_cpudep.c optional aim smp powerpc/aim/nexus.c optional aim powerpc/aim/ofw_machdep.c optional aim powerpc/aim/ofwmagic.S optional aim powerpc/aim/swtch.S optional aim powerpc/aim/trap.c optional aim -powerpc/aim/uio_machdep.c optional aim powerpc/aim/uma_machdep.c optional aim powerpc/aim/vm_machdep.c optional aim powerpc/booke/clock.c optional e500 @@ -93,7 +93,6 @@ powerpc/booke/machdep.c optional e500 powerpc/booke/pmap.c optional e500 powerpc/booke/swtch.S optional e500 powerpc/booke/trap.c optional e500 -powerpc/booke/uio_machdep.c optional e500 powerpc/booke/vm_machdep.c optional e500 powerpc/fpu/fpu_add.c optional fpu_emu powerpc/fpu/fpu_compare.c optional fpu_emu @@ -127,6 +126,7 @@ powerpc/powermac/uninorth.c optional pow powerpc/powermac/cuda.c optional powermac cuda powerpc/powermac/pmu.c optional powermac pmu powerpc/powermac/macgpio.c optional powermac pci +powerpc/powermac/cpcht.c optional powermac pci powerpc/powerpc/altivec.c optional aim powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard @@ -158,6 +158,7 @@ powerpc/powerpc/stack_machdep.c optional powerpc/powerpc/suswintr.c standard powerpc/powerpc/syncicache.c standard powerpc/powerpc/sys_machdep.c standard +powerpc/powerpc/uio_machdep.c standard powerpc/psim/iobus.c optional psim powerpc/psim/ata_iobus.c optional ata psim powerpc/psim/openpic_iobus.c optional psim Modified: head/sys/dev/powermac_nvram/powermac_nvram.c ============================================================================== --- head/sys/dev/powermac_nvram/powermac_nvram.c Fri Apr 3 23:52:47 2009 (r190680) +++ head/sys/dev/powermac_nvram/powermac_nvram.c Sat Apr 4 00:22:44 2009 (r190681) @@ -131,19 +131,25 @@ powermac_nvram_attach(device_t dev) { struct powermac_nvram_softc *sc; phandle_t node; - u_int32_t reg[2]; - int gen0, gen1; + u_int32_t reg[3]; + int gen0, gen1, i; node = ofw_bus_get_node(dev); sc = device_get_softc(dev); - if (OF_getprop(node, "reg", reg, sizeof(reg)) < 8) + if ((i = OF_getprop(node, "reg", reg, sizeof(reg))) < 8) return ENXIO; sc->sc_dev = dev; sc->sc_node = node; - sc->sc_bank0 = (vm_offset_t)pmap_mapdev(reg[0], NVRAM_SIZE * 2); + /* + * Find which byte of reg corresponds to the 32-bit physical address. + * We should probably read #address-cells from /chosen instead. + */ + i = (i/4) - 2; + + sc->sc_bank0 = (vm_offset_t)pmap_mapdev(reg[i], NVRAM_SIZE * 2); sc->sc_bank1 = sc->sc_bank0 + NVRAM_SIZE; gen0 = powermac_nvram_check((void *)sc->sc_bank0); Modified: head/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- head/sys/dev/uart/uart_cpu_powerpc.c Fri Apr 3 23:52:47 2009 (r190680) +++ head/sys/dev/uart/uart_cpu_powerpc.c Sat Apr 4 00:22:44 2009 (r190681) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include @@ -53,8 +55,7 @@ bus_space_tag_t uart_bus_space_mem = &bs int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { - - return ((b1->bsh == b2->bsh) ? 1 : 0); + return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); } #ifdef MPC85XX @@ -116,7 +117,16 @@ uart_cpu_getdev(int devtype, struct uart return (ENXIO); if (OF_getprop(input, "name", buf, sizeof(buf)) == -1) return (ENXIO); - if (strcmp(buf, "ch-a")) + + if (strcmp(buf, "ch-a") == 0) { + class = &uart_z8530_class; + di->bas.regshft = 4; + di->bas.chan = 1; + } else if (strcmp(buf,"serial") == 0) { + class = &uart_ns8250_class; + di->bas.regshft = 0; + di->bas.chan = 0; + } else return (ENXIO); error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh); @@ -125,11 +135,13 @@ uart_cpu_getdev(int devtype, struct uart di->ops = uart_getops(class); - di->bas.rclk = 230400; - di->bas.chan = 1; - di->bas.regshft = 4; + if (OF_getprop(input, "clock-frequency", &di->bas.rclk, + sizeof(di->bas.rclk)) == -1) + di->bas.rclk = 230400; + if (OF_getprop(input, "current-speed", &di->baudrate, + sizeof(di->baudrate)) == -1) + di->baudrate = 0; - di->baudrate = 0; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Fri Apr 3 23:52:47 2009 (r190680) +++ head/sys/powerpc/aim/machdep.c Sat Apr 4 00:22:44 2009 (r190681) @@ -130,6 +130,8 @@ extern vm_offset_t ksym_start, ksym_end; int cold = 1; int cacheline_size = 32; +int ppc64 = 0; +int hw_direct_map = 1; struct pcpu __pcpu[MAXCPU]; @@ -230,10 +232,13 @@ cpu_startup(void *dummy) extern char kernel_text[], _end[]; +extern void *testppc64, *testppc64size; +extern void *restorebridge, *restorebridgesize; +extern void *rfid_patch, *rfi_patch1, *rfi_patch2; #ifdef SMP extern void *rstcode, *rstsize; #endif -extern void *trapcode, *trapsize; +extern void *trapcode, *trapcode64, *trapsize; extern void *alitrap, *alisize; extern void *dsitrap, *dsisize; extern void *decrint, *decrsize; @@ -245,11 +250,16 @@ powerpc_init(u_int startkernel, u_int en { struct pcpu *pc; vm_offset_t end; + void *generictrap; + size_t trap_offset; void *kmdp; char *env; + int vers; + uint32_t msr, scratch; end = 0; kmdp = NULL; + trap_offset = 0; /* * Parse metadata if present and fetch parameters. Must be done @@ -315,6 +325,26 @@ powerpc_init(u_int startkernel, u_int en printf("powerpc_init: no loader metadata.\n"); } + /* + * Set cacheline_size based on the CPU model. + */ + + vers = mfpvr() >> 16; + switch (vers) { + case IBM970: + case IBM970FX: + case IBM970MP: + case IBM970GX: + cacheline_size = 128; + break; + default: + cacheline_size = 32; + } + + /* + * Init KDB + */ + kdb_init(); /* @@ -322,47 +352,110 @@ powerpc_init(u_int startkernel, u_int en * Disable translation in case the vector area * hasn't been mapped (G5) */ - mtmsr(mfmsr() & ~(PSL_IR | PSL_DR)); + msr = mfmsr(); + mtmsr(msr & ~(PSL_IR | PSL_DR)); isync(); + + /* + * Figure out whether we need to use the 64 bit PMAP. This works by + * executing an instruction that is only legal on 64-bit PPC (mtmsrd), + * and setting ppc64 = 0 if that causes a trap. + */ + + ppc64 = 1; + + bcopy(&testppc64, (void *)EXC_PGM, (size_t)&testppc64size); + __syncicache((void *)EXC_PGM, (size_t)&testppc64size); + + __asm __volatile("\ + mfmsr %0; \ + mtsprg2 %1; \ + \ + mtmsrd %0; \ + mfsprg2 %1;" + : "=r"(scratch), "=r"(ppc64)); + + /* + * Now copy restorebridge into all the handlers, if necessary, + * and set up the trap tables. + */ + + if (ppc64) { + /* Patch the two instances of rfi -> rfid */ + bcopy(&rfid_patch,&rfi_patch1,4); + bcopy(&rfid_patch,&rfi_patch2,4); + + /* + * Copy a code snippet to restore 32-bit bridge mode + * to the top of every non-generic trap handler + */ + + trap_offset += (size_t)&restorebridgesize; + bcopy(&restorebridge, (void *)EXC_RST, trap_offset); + bcopy(&restorebridge, (void *)EXC_DSI, trap_offset); + bcopy(&restorebridge, (void *)EXC_ALI, trap_offset); + bcopy(&restorebridge, (void *)EXC_PGM, trap_offset); + bcopy(&restorebridge, (void *)EXC_MCHK, trap_offset); + bcopy(&restorebridge, (void *)EXC_TRC, trap_offset); + bcopy(&restorebridge, (void *)EXC_BPT, trap_offset); + + /* + * Set the common trap entry point to the one that + * knows to restore 32-bit operation on execution. + */ + + generictrap = &trapcode64; + } else { + generictrap = &trapcode; + } + #ifdef SMP - bcopy(&rstcode, (void *)EXC_RST, (size_t)&rstsize); + bcopy(&rstcode, (void *)(EXC_RST + trap_offset), (size_t)&rstsize); #else - bcopy(&trapcode, (void *)EXC_RST, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_RST, (size_t)&trapsize); #endif - bcopy(&trapcode, (void *)EXC_MCHK, (size_t)&trapsize); - bcopy(&dsitrap, (void *)EXC_DSI, (size_t)&dsisize); - bcopy(&trapcode, (void *)EXC_ISI, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_EXI, (size_t)&trapsize); - bcopy(&alitrap, (void *)EXC_ALI, (size_t)&alisize); - bcopy(&trapcode, (void *)EXC_PGM, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_FPU, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_DECR, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_SC, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_TRC, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_FPA, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_VEC, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_VECAST, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_THRM, (size_t)&trapsize); - bcopy(&trapcode, (void *)EXC_BPT, (size_t)&trapsize); + #ifdef KDB - bcopy(&dblow, (void *)EXC_MCHK, (size_t)&dbsize); - bcopy(&dblow, (void *)EXC_PGM, (size_t)&dbsize); - bcopy(&dblow, (void *)EXC_TRC, (size_t)&dbsize); - bcopy(&dblow, (void *)EXC_BPT, (size_t)&dbsize); + bcopy(&dblow, (void *)(EXC_MCHK + trap_offset), (size_t)&dbsize); + bcopy(&dblow, (void *)(EXC_PGM + trap_offset), (size_t)&dbsize); + bcopy(&dblow, (void *)(EXC_TRC + trap_offset), (size_t)&dbsize); + bcopy(&dblow, (void *)(EXC_BPT + trap_offset), (size_t)&dbsize); +#else + bcopy(generictrap, (void *)EXC_MCHK, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_PGM, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_TRC, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_BPT, (size_t)&trapsize); #endif + bcopy(&dsitrap, (void *)(EXC_DSI + trap_offset), (size_t)&dsisize); + bcopy(&alitrap, (void *)(EXC_ALI + trap_offset), (size_t)&alisize); + bcopy(generictrap, (void *)EXC_ISI, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_EXI, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_FPU, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_DECR, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_SC, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_FPA, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_VEC, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_VECAST, (size_t)&trapsize); + bcopy(generictrap, (void *)EXC_THRM, (size_t)&trapsize); __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); /* - * Make sure translation has been enabled + * Restore MSR */ - mtmsr(mfmsr() | PSL_IR|PSL_DR|PSL_ME|PSL_RI); + mtmsr(msr); isync(); /* * Initialise virtual memory. */ - pmap_mmu_install(MMU_TYPE_OEA, 0); /* XXX temporary */ + if (ppc64) + pmap_mmu_install(MMU_TYPE_G5, 0); + else + pmap_mmu_install(MMU_TYPE_OEA, 0); + pmap_bootstrap(startkernel, endkernel); + mtmsr(mfmsr() | PSL_IR|PSL_DR|PSL_ME|PSL_RI); + isync(); /* * Initialize params/tunables that are derived from memsize Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Fri Apr 3 23:52:47 2009 (r190680) +++ head/sys/powerpc/aim/mmu_oea.c Sat Apr 4 00:22:44 2009 (r190681) @@ -323,6 +323,7 @@ void moea_zero_page_area(mmu_t, vm_page_ void moea_zero_page_idle(mmu_t, vm_page_t); void moea_activate(mmu_t, struct thread *); void moea_deactivate(mmu_t, struct thread *); +void moea_cpu_bootstrap(mmu_t, int); void moea_bootstrap(mmu_t, vm_offset_t, vm_offset_t); void *moea_mapdev(mmu_t, vm_offset_t, vm_size_t); void moea_unmapdev(mmu_t, vm_offset_t, vm_size_t); @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { /* Internal interfaces */ MMUMETHOD(mmu_bootstrap, moea_bootstrap), + MMUMETHOD(mmu_cpu_bootstrap, moea_cpu_bootstrap), MMUMETHOD(mmu_mapdev, moea_mapdev), MMUMETHOD(mmu_unmapdev, moea_unmapdev), MMUMETHOD(mmu_kextract, moea_kextract), @@ -617,7 +619,7 @@ om_cmp(const void *a, const void *b) } void -pmap_cpu_bootstrap(int ap) +moea_cpu_bootstrap(mmu_t mmup, int ap) { u_int sdr; int i; @@ -709,6 +711,9 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k __asm __volatile("mtdbatl 1,%0" :: "r"(battable[8].batl)); isync(); + /* set global direct map flag */ + hw_direct_map = 1; + mem_regions(&pregions, &pregions_sz, ®ions, ®ions_sz); CTR0(KTR_PMAP, "moea_bootstrap: physical memory"); @@ -895,7 +900,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k kernel_pmap->pm_sr[KERNEL2_SR] = KERNEL2_SEGMENT; kernel_pmap->pm_active = ~0; - pmap_cpu_bootstrap(0); + moea_cpu_bootstrap(mmup,0); pmap_bootstrapped++; Added: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Apr 4 00:22:44 2009 (r190681) @@ -0,0 +1,2443 @@ +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas of Allegro Networks, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ +/*- + * Copyright (C) 1995, 1996 Wolfgang Solfrank. + * Copyright (C) 1995, 1996 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``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. + * + * $NetBSD: pmap.c,v 1.28 2000/03/26 20:42:36 kleink Exp $ + */ +/*- + * Copyright (C) 2001 Benno Rice. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Manages physical address maps. + * + * In addition to hardware address maps, this module is called upon to + * provide software-use-only maps which may or may not be stored in the + * same form as hardware maps. These pseudo-maps are used to store + * intermediate results from copy operations to and from address spaces. + * + * Since the information managed by this module is also stored by the + * logical address mapping module, this module may throw away valid virtual + * to physical mappings at almost any time. However, invalidations of + * mappings must be done as requested. + * + * In order to cope with hardware architectures which make virtual to + * physical map invalidates expensive, this module may delay invalidate + * reduced protection operations until such time as they are actually + * necessary. This module is given full information as to which processors + * are currently using which maps, and to when physical maps must be made + * correct. + */ + +#include "opt_kstack_pages.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mmu_if.h" + +#define MOEA_DEBUG + +#define TODO panic("%s: not implemented", __func__); + +static __inline u_int32_t +cntlzw(volatile u_int32_t a) { + u_int32_t b; + __asm ("cntlzw %0, %1" : "=r"(b) : "r"(a)); + return b; +} + +static __inline uint64_t +va_to_vsid(pmap_t pm, vm_offset_t va) +{ + return ((pm->pm_sr[(uintptr_t)va >> ADDR_SR_SHFT]) & SR_VSID_MASK); +} + +#define TLBSYNC() __asm __volatile("tlbsync; ptesync"); +#define SYNC() __asm __volatile("sync"); +#define EIEIO() __asm __volatile("eieio"); + +/* + * The tlbie instruction must be executed in 64-bit mode + * so we have to twiddle MSR[SF] around every invocation. + * Just to add to the fun, exceptions must be off as well + * so that we can't trap in 64-bit mode. What a pain. + */ + +static __inline void +TLBIE(pmap_t pmap, vm_offset_t va) { + register_t msr; + register_t scratch; + + uint64_t vpn; + register_t vpn_hi, vpn_lo; + +#if 1 + /* + * CPU documentation says that tlbie takes the VPN, not the + * VA. I think the code below does this correctly. We will see. + */ + + vpn = (uint64_t)(va & ADDR_PIDX); + if (pmap != NULL) + vpn |= (va_to_vsid(pmap,va) << 28); +#else + vpn = va; +#endif + + vpn_hi = (uint32_t)(vpn >> 32); + vpn_lo = (uint32_t)vpn; + + __asm __volatile("\ + mfmsr %0; \ + clrldi %1,%0,49; \ + insrdi %1,1,1,0; \ + mtmsrd %1; \ + ptesync; \ + \ + sld %1,%2,%4; \ + or %1,%1,%3; \ + tlbie %1; \ + \ + mtmsrd %0; \ + eieio; \ + tlbsync; \ + ptesync;" + : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32)); +} + +#define DISABLE_TRANS(msr) msr = mfmsr(); mtmsr(msr & ~PSL_DR); isync() +#define ENABLE_TRANS(msr) mtmsr(msr); isync() + +#define VSID_MAKE(sr, hash) ((sr) | (((hash) & 0xfffff) << 4)) +#define VSID_TO_SR(vsid) ((vsid) & 0xf) +#define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff) + +#define PVO_PTEGIDX_MASK 0x007 /* which PTEG slot */ +#define PVO_PTEGIDX_VALID 0x008 /* slot is valid */ +#define PVO_WIRED 0x010 /* PVO entry is wired */ +#define PVO_MANAGED 0x020 /* PVO entry is managed */ +#define PVO_BOOTSTRAP 0x080 /* PVO entry allocated during + bootstrap */ +#define PVO_FAKE 0x100 /* fictitious phys page */ +#define PVO_VADDR(pvo) ((pvo)->pvo_vaddr & ~ADDR_POFF) +#define PVO_ISFAKE(pvo) ((pvo)->pvo_vaddr & PVO_FAKE) +#define PVO_PTEGIDX_GET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_MASK) +#define PVO_PTEGIDX_ISSET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_VALID) +#define PVO_PTEGIDX_CLR(pvo) \ + ((void)((pvo)->pvo_vaddr &= ~(PVO_PTEGIDX_VALID|PVO_PTEGIDX_MASK))) +#define PVO_PTEGIDX_SET(pvo, i) \ + ((void)((pvo)->pvo_vaddr |= (i)|PVO_PTEGIDX_VALID)) + +#define MOEA_PVO_CHECK(pvo) + +#define LOCK_TABLE() mtx_lock(&moea64_table_mutex) +#define UNLOCK_TABLE() mtx_unlock(&moea64_table_mutex); +#define ASSERT_TABLE_LOCK() mtx_assert(&moea64_table_mutex, MA_OWNED) + +struct ofw_map { + vm_offset_t om_va; + vm_size_t om_len; + vm_offset_t om_pa_hi; + vm_offset_t om_pa_lo; + u_int om_mode; +}; + +/* + * Map of physical memory regions. + */ +static struct mem_region *regions; +static struct mem_region *pregions; +extern u_int phys_avail_count; +extern int regions_sz, pregions_sz; +extern int ofw_real_mode; +static struct ofw_map translations[64]; + +extern struct pmap ofw_pmap; + +extern void bs_remap_earlyboot(void); + + +/* + * Lock for the pteg and pvo tables. + */ +struct mtx moea64_table_mutex; + +/* + * PTEG data. + */ +static struct lpteg *moea64_pteg_table; +u_int moea64_pteg_count; +u_int moea64_pteg_mask; + +/* + * PVO data. + */ +struct pvo_head *moea64_pvo_table; /* pvo entries by pteg index */ +/* lists of unmanaged pages */ +struct pvo_head moea64_pvo_kunmanaged = + LIST_HEAD_INITIALIZER(moea64_pvo_kunmanaged); +struct pvo_head moea64_pvo_unmanaged = + LIST_HEAD_INITIALIZER(moea64_pvo_unmanaged); + +uma_zone_t moea64_upvo_zone; /* zone for pvo entries for unmanaged pages */ +uma_zone_t moea64_mpvo_zone; /* zone for pvo entries for managed pages */ + +vm_offset_t pvo_allocator_start; +vm_offset_t pvo_allocator_end; + +#define BPVO_POOL_SIZE 327680 +static struct pvo_entry *moea64_bpvo_pool; +static int moea64_bpvo_pool_index = 0; + +#define VSID_NBPW (sizeof(u_int32_t) * 8) +static u_int moea64_vsid_bitmap[NPMAPS / VSID_NBPW]; + +static boolean_t moea64_initialized = FALSE; + +/* + * Statistics. + */ +u_int moea64_pte_valid = 0; +u_int moea64_pte_overflow = 0; +u_int moea64_pvo_entries = 0; +u_int moea64_pvo_enter_calls = 0; +u_int moea64_pvo_remove_calls = 0; +SYSCTL_INT(_machdep, OID_AUTO, moea64_pte_valid, CTLFLAG_RD, + &moea64_pte_valid, 0, ""); +SYSCTL_INT(_machdep, OID_AUTO, moea64_pte_overflow, CTLFLAG_RD, + &moea64_pte_overflow, 0, ""); +SYSCTL_INT(_machdep, OID_AUTO, moea64_pvo_entries, CTLFLAG_RD, + &moea64_pvo_entries, 0, ""); +SYSCTL_INT(_machdep, OID_AUTO, moea64_pvo_enter_calls, CTLFLAG_RD, + &moea64_pvo_enter_calls, 0, ""); +SYSCTL_INT(_machdep, OID_AUTO, moea64_pvo_remove_calls, CTLFLAG_RD, + &moea64_pvo_remove_calls, 0, ""); + +vm_offset_t moea64_scratchpage_va[2]; +struct pvo_entry *moea64_scratchpage_pvo[2]; +struct lpte *moea64_scratchpage_pte[2]; +struct mtx moea64_scratchpage_mtx; + +/* + * Allocate physical memory for use in moea64_bootstrap. + */ +static vm_offset_t moea64_bootstrap_alloc(vm_size_t, u_int); + +/* + * PTE calls. + */ +static int moea64_pte_insert(u_int, struct lpte *); + +/* + * PVO calls. + */ +static int moea64_pvo_enter(pmap_t, uma_zone_t, struct pvo_head *, + vm_offset_t, vm_offset_t, uint64_t, int, int); +static void moea64_pvo_remove(struct pvo_entry *, int); +static struct pvo_entry *moea64_pvo_find_va(pmap_t, vm_offset_t, int *); +static struct lpte *moea64_pvo_to_pte(const struct pvo_entry *, int); + +/* + * Utility routines. + */ +static void moea64_bridge_bootstrap(mmu_t mmup, + vm_offset_t kernelstart, vm_offset_t kernelend); +static void moea64_bridge_cpu_bootstrap(mmu_t, int ap); +static void moea64_enter_locked(pmap_t, vm_offset_t, vm_page_t, + vm_prot_t, boolean_t); +static boolean_t moea64_query_bit(vm_page_t, u_int64_t); +static u_int moea64_clear_bit(vm_page_t, u_int64_t, u_int64_t *); +static void moea64_kremove(mmu_t, vm_offset_t); +static void moea64_syncicache(pmap_t pmap, vm_offset_t va, + vm_offset_t pa); +static void tlbia(void); + +/* + * Kernel MMU interface + */ +void moea64_change_wiring(mmu_t, pmap_t, vm_offset_t, boolean_t); +void moea64_clear_modify(mmu_t, vm_page_t); +void moea64_clear_reference(mmu_t, vm_page_t); +void moea64_copy_page(mmu_t, vm_page_t, vm_page_t); +void moea64_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, boolean_t); +void moea64_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, + vm_prot_t); +void moea64_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); +vm_paddr_t moea64_extract(mmu_t, pmap_t, vm_offset_t); +vm_page_t moea64_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); +void moea64_init(mmu_t); +boolean_t moea64_is_modified(mmu_t, vm_page_t); +boolean_t moea64_ts_referenced(mmu_t, vm_page_t); +vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int); +boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); +int moea64_page_wired_mappings(mmu_t, vm_page_t); +void moea64_pinit(mmu_t, pmap_t); +void moea64_pinit0(mmu_t, pmap_t); +void moea64_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); +void moea64_qenter(mmu_t, vm_offset_t, vm_page_t *, int); +void moea64_qremove(mmu_t, vm_offset_t, int); +void moea64_release(mmu_t, pmap_t); +void moea64_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); +void moea64_remove_all(mmu_t, vm_page_t); +void moea64_remove_write(mmu_t, vm_page_t); +void moea64_zero_page(mmu_t, vm_page_t); +void moea64_zero_page_area(mmu_t, vm_page_t, int, int); +void moea64_zero_page_idle(mmu_t, vm_page_t); +void moea64_activate(mmu_t, struct thread *); +void moea64_deactivate(mmu_t, struct thread *); +void *moea64_mapdev(mmu_t, vm_offset_t, vm_size_t); +void moea64_unmapdev(mmu_t, vm_offset_t, vm_size_t); +vm_offset_t moea64_kextract(mmu_t, vm_offset_t); +void moea64_kenter(mmu_t, vm_offset_t, vm_offset_t); +boolean_t moea64_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); +boolean_t moea64_page_executable(mmu_t, vm_page_t); + +static mmu_method_t moea64_bridge_methods[] = { + MMUMETHOD(mmu_change_wiring, moea64_change_wiring), + MMUMETHOD(mmu_clear_modify, moea64_clear_modify), + MMUMETHOD(mmu_clear_reference, moea64_clear_reference), + MMUMETHOD(mmu_copy_page, moea64_copy_page), + MMUMETHOD(mmu_enter, moea64_enter), + MMUMETHOD(mmu_enter_object, moea64_enter_object), + MMUMETHOD(mmu_enter_quick, moea64_enter_quick), + MMUMETHOD(mmu_extract, moea64_extract), + MMUMETHOD(mmu_extract_and_hold, moea64_extract_and_hold), + MMUMETHOD(mmu_init, moea64_init), + MMUMETHOD(mmu_is_modified, moea64_is_modified), + MMUMETHOD(mmu_ts_referenced, moea64_ts_referenced), + MMUMETHOD(mmu_map, moea64_map), + MMUMETHOD(mmu_page_exists_quick,moea64_page_exists_quick), + MMUMETHOD(mmu_page_wired_mappings,moea64_page_wired_mappings), + MMUMETHOD(mmu_pinit, moea64_pinit), + MMUMETHOD(mmu_pinit0, moea64_pinit0), + MMUMETHOD(mmu_protect, moea64_protect), + MMUMETHOD(mmu_qenter, moea64_qenter), + MMUMETHOD(mmu_qremove, moea64_qremove), + MMUMETHOD(mmu_release, moea64_release), + MMUMETHOD(mmu_remove, moea64_remove), + MMUMETHOD(mmu_remove_all, moea64_remove_all), + MMUMETHOD(mmu_remove_write, moea64_remove_write), + MMUMETHOD(mmu_zero_page, moea64_zero_page), + MMUMETHOD(mmu_zero_page_area, moea64_zero_page_area), + MMUMETHOD(mmu_zero_page_idle, moea64_zero_page_idle), + MMUMETHOD(mmu_activate, moea64_activate), + MMUMETHOD(mmu_deactivate, moea64_deactivate), + + /* Internal interfaces */ + MMUMETHOD(mmu_bootstrap, moea64_bridge_bootstrap), + MMUMETHOD(mmu_cpu_bootstrap, moea64_bridge_cpu_bootstrap), + MMUMETHOD(mmu_mapdev, moea64_mapdev), + MMUMETHOD(mmu_unmapdev, moea64_unmapdev), + MMUMETHOD(mmu_kextract, moea64_kextract), + MMUMETHOD(mmu_kenter, moea64_kenter), + MMUMETHOD(mmu_dev_direct_mapped,moea64_dev_direct_mapped), + MMUMETHOD(mmu_page_executable, moea64_page_executable), + + { 0, 0 } +}; + +static mmu_def_t oea64_bridge_mmu = { + MMU_TYPE_G5, + moea64_bridge_methods, + 0 +}; +MMU_DEF(oea64_bridge_mmu); + +static __inline u_int +va_to_pteg(uint64_t vsid, vm_offset_t addr) +{ + u_int hash; + + hash = vsid ^ (((uint64_t)addr & ADDR_PIDX) >> + ADDR_PIDX_SHFT); + return (hash & moea64_pteg_mask); +} + +static __inline struct pvo_head * +pa_to_pvoh(vm_offset_t pa, vm_page_t *pg_p) +{ + struct vm_page *pg; + + pg = PHYS_TO_VM_PAGE(pa); + + if (pg_p != NULL) + *pg_p = pg; + + if (pg == NULL) + return (&moea64_pvo_unmanaged); + + return (&pg->md.mdpg_pvoh); +} + +static __inline struct pvo_head * +vm_page_to_pvoh(vm_page_t m) +{ + + return (&m->md.mdpg_pvoh); +} + +static __inline void +moea64_attr_clear(vm_page_t m, u_int64_t ptebit) +{ + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + m->md.mdpg_attrs &= ~ptebit; +} + +static __inline u_int64_t +moea64_attr_fetch(vm_page_t m) +{ + + return (m->md.mdpg_attrs); +} + +static __inline void +moea64_attr_save(vm_page_t m, u_int64_t ptebit) +{ + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); + m->md.mdpg_attrs |= ptebit; +} + +static __inline int +moea64_pte_compare(const struct lpte *pt, const struct lpte *pvo_pt) +{ + if (pt->pte_hi == pvo_pt->pte_hi) + return (1); + + return (0); +} + +static __inline int +moea64_pte_match(struct lpte *pt, uint64_t vsid, vm_offset_t va, int which) +{ + return (pt->pte_hi & ~LPTE_VALID) == + ((vsid << LPTE_VSID_SHIFT) | + ((uint64_t)(va >> ADDR_API_SHFT64) & LPTE_API) | which); +} + +static __inline void +moea64_pte_create(struct lpte *pt, uint64_t vsid, vm_offset_t va, + uint64_t pte_lo) +{ + ASSERT_TABLE_LOCK(); + + /* + * Construct a PTE. Default to IMB initially. Valid bit only gets + * set when the real pte is set in memory. + * + * Note: Don't set the valid bit for correct operation of tlb update. + */ + pt->pte_hi = (vsid << LPTE_VSID_SHIFT) | + (((uint64_t)(va & ADDR_PIDX) >> ADDR_API_SHFT64) & LPTE_API); + + pt->pte_lo = pte_lo; +} + +static __inline void +moea64_pte_synch(struct lpte *pt, struct lpte *pvo_pt) +{ + + ASSERT_TABLE_LOCK(); + + pvo_pt->pte_lo |= pt->pte_lo & (LPTE_REF | LPTE_CHG); +} + +static __inline void +moea64_pte_clear(struct lpte *pt, pmap_t pmap, vm_offset_t va, u_int64_t ptebit) +{ + ASSERT_TABLE_LOCK(); + + /* + * As shown in Section 7.6.3.2.3 + */ + pt->pte_lo &= ~ptebit; + TLBIE(pmap,va); +} + +static __inline void +moea64_pte_set(struct lpte *pt, struct lpte *pvo_pt) +{ + + ASSERT_TABLE_LOCK(); + pvo_pt->pte_hi |= LPTE_VALID; + + /* + * Update the PTE as defined in section 7.6.3.1. + * Note that the REF/CHG bits are from pvo_pt and thus should have + * been saved so this routine can restore them (if desired). + */ + pt->pte_lo = pvo_pt->pte_lo; + EIEIO(); + pt->pte_hi = pvo_pt->pte_hi; + SYNC(); + moea64_pte_valid++; +} + +static __inline void +moea64_pte_unset(struct lpte *pt, struct lpte *pvo_pt, pmap_t pmap, vm_offset_t va) +{ + ASSERT_TABLE_LOCK(); + pvo_pt->pte_hi &= ~LPTE_VALID; + + /* + * Force the reg & chg bits back into the PTEs. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 00:26:01 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB0AC1065673; Sat, 4 Apr 2009 00:26:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7F18FC1F; Sat, 4 Apr 2009 00:26:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n340Q14W039518; Sat, 4 Apr 2009 00:26:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n340Q14E039517; Sat, 4 Apr 2009 00:26:01 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904040026.n340Q14E039517@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Apr 2009 00:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190682 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 00:26:02 -0000 Author: nwhitehorn Date: Sat Apr 4 00:26:01 2009 New Revision: 190682 URL: http://svn.freebsd.org/changeset/base/190682 Log: The Serverworks SATA chipsets used in Apple G5 systems require requiring the ATA status register with a 4-byte read request. This updates it, and subsequent 1-byte reads will return the correct result. This commit adds a hack to do this, which is currently ifdef'd powerpc, although Linux and Darwin do this unconditionally on all platforms. Modified: head/sys/dev/ata/chipsets/ata-serverworks.c Modified: head/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-serverworks.c Sat Apr 4 00:22:44 2009 (r190681) +++ head/sys/dev/ata/chipsets/ata-serverworks.c Sat Apr 4 00:26:01 2009 (r190682) @@ -58,6 +58,9 @@ static int ata_serverworks_ch_detach(dev static void ata_serverworks_tf_read(struct ata_request *request); static void ata_serverworks_tf_write(struct ata_request *request); static void ata_serverworks_setmode(device_t dev, int mode); +#ifdef __powerpc__ +static int ata_serverworks_status(device_t dev); +#endif /* misc defines */ #define SWKS_33 0 @@ -98,6 +101,23 @@ ata_serverworks_probe(device_t dev) return 0; } +#ifdef __powerpc__ +static int +ata_serverworks_status(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + + /* + * We need to do a 4-byte read on the status reg before the values + * will report correctly + */ + + ATA_IDX_INL(ch,ATA_STATUS); + + return ata_pci_status(dev); +} +#endif + static int ata_serverworks_chipinit(device_t dev) { @@ -186,6 +206,9 @@ ata_serverworks_ch_attach(device_t dev) ata_pci_hw(dev); ch->hw.tf_read = ata_serverworks_tf_read; ch->hw.tf_write = ata_serverworks_tf_write; +#ifdef __powerpc__ + ch->hw.status = ata_serverworks_status; +#endif /* chip does not reliably do 64K DMA transfers */ ch->dma.max_iosize = 64 * DEV_BSIZE; From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 02:12:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 125291065745; Sat, 4 Apr 2009 02:12:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F23F58FC20; Sat, 4 Apr 2009 02:12:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n342Cbhk043770; Sat, 4 Apr 2009 02:12:37 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n342CbYB043763; Sat, 4 Apr 2009 02:12:37 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904040212.n342CbYB043763@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 4 Apr 2009 02:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190684 - in head/sys: conf kern powerpc/include powerpc/powerpc sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 02:12:38 -0000 Author: marcel Date: Sat Apr 4 02:12:37 2009 New Revision: 190684 URL: http://svn.freebsd.org/changeset/base/190684 Log: PowerPC, meet kernel core dumps. The support is based on a generic dumper that creates an ELF core file and uses PMAP functions to scan and iterate over memory chunks, as well as handle memory mappings used during dumping. the PMAP layer can choose to return physical memory chunks or virtual memory chunks. For minidumps, the chunks should be virtual. The default MMU I/F implementation for the scan_md() method returns NULL. Thus, when a PMAP implementation does not implement the required methods, an empty core file is created. Here, empty means having an ELF header only. Obtained from: Juniper Networks Added: head/sys/powerpc/powerpc/dump_machdep.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/kern/kern_shutdown.c head/sys/powerpc/include/pmap.h head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/sys/kerneldump.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Apr 4 00:56:41 2009 (r190683) +++ head/sys/conf/files.powerpc Sat Apr 4 02:12:37 2009 (r190684) @@ -139,6 +139,7 @@ powerpc/powerpc/db_disasm.c optional ddb powerpc/powerpc/db_hwwatch.c optional ddb powerpc/powerpc/db_interface.c optional ddb powerpc/powerpc/db_trace.c optional ddb +powerpc/powerpc/dump_machdep.c standard powerpc/powerpc/elf_machdep.c standard powerpc/powerpc/fpu.c optional aim powerpc/powerpc/fuswintr.c standard Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Apr 4 00:56:41 2009 (r190683) +++ head/sys/kern/kern_shutdown.c Sat Apr 4 02:12:37 2009 (r190684) @@ -680,15 +680,6 @@ dump_write(struct dumperinfo *di, void * return (di->dumper(di->priv, virtual, physical, offset, length)); } -#if defined(__powerpc__) -void -dumpsys(struct dumperinfo *di __unused) -{ - - printf("Kernel dumps not implemented on this architecture\n"); -} -#endif - void mkdumpheader(struct kerneldumpheader *kdh, char *magic, uint32_t archver, uint64_t dumplen, uint32_t blksz) Modified: head/sys/powerpc/include/pmap.h ============================================================================== --- head/sys/powerpc/include/pmap.h Sat Apr 4 00:56:41 2009 (r190683) +++ head/sys/powerpc/include/pmap.h Sat Apr 4 02:12:37 2009 (r190684) @@ -71,6 +71,13 @@ #include #include +struct pmap_md { + u_int md_index; + vm_paddr_t md_paddr; + vm_offset_t md_vaddr; + vm_size_t md_size; +}; + #if defined(AIM) #if !defined(NPMAPS) @@ -179,6 +186,11 @@ extern vm_offset_t msgbuf_phys; extern int pmap_bootstrapped; +extern vm_offset_t pmap_dumpsys_map(struct pmap_md *, vm_size_t, vm_size_t *); +extern void pmap_dumpsys_unmap(struct pmap_md *, vm_size_t, vm_offset_t); + +extern struct pmap_md *pmap_scan_md(struct pmap_md *); + #endif #endif /* !_MACHINE_PMAP_H_ */ Added: head/sys/powerpc/powerpc/dump_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/dump_machdep.c Sat Apr 4 02:12:37 2009 (r190684) @@ -0,0 +1,303 @@ +/*- + * Copyright (c) 2002 Marcel Moolenaar + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * 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 THE AUTHOR ``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 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CTASSERT(sizeof(struct kerneldumpheader) == 512); + +/* + * Don't touch the first SIZEOF_METADATA bytes on the dump device. This + * is to protect us from metadata and to protect metadata from us. + */ +#define SIZEOF_METADATA (64*1024) + +#define MD_ALIGN(x) (((off_t)(x) + PAGE_MASK) & ~PAGE_MASK) +#define DEV_ALIGN(x) (((off_t)(x) + (DEV_BSIZE-1)) & ~(DEV_BSIZE-1)) + +typedef int callback_t(struct pmap_md *, int, void *); + +static struct kerneldumpheader kdh; +static off_t dumplo, fileofs; + +/* Handle buffered writes. */ +static char buffer[DEV_BSIZE]; +static size_t fragsz; + +int dumpsys_minidump = 1; +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RD, &dumpsys_minidump, 0, + "Kernel makes compressed crash dumps"); + +static int +buf_write(struct dumperinfo *di, char *ptr, size_t sz) +{ + size_t len; + int error; + + while (sz) { + len = DEV_BSIZE - fragsz; + if (len > sz) + len = sz; + bcopy(ptr, buffer + fragsz, len); + fragsz += len; + ptr += len; + sz -= len; + if (fragsz == DEV_BSIZE) { + error = di->dumper(di->priv, buffer, 0, dumplo, + DEV_BSIZE); + if (error) + return error; + dumplo += DEV_BSIZE; + fragsz = 0; + } + } + + return (0); +} + +static int +buf_flush(struct dumperinfo *di) +{ + int error; + + if (fragsz == 0) + return (0); + + error = di->dumper(di->priv, buffer, 0, dumplo, DEV_BSIZE); + dumplo += DEV_BSIZE; + fragsz = 0; + return (error); +} + +static int +cb_dumpdata(struct pmap_md *md, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + vm_offset_t va; + size_t counter, ofs, resid, sz; + int c, error, twiddle; + + error = 0; + counter = 0; /* Update twiddle every 16MB */ + twiddle = 0; + + ofs = 0; /* Logical offset within the chunk */ + resid = md->md_size; + + printf(" chunk %d: %lu bytes ", seqnr, (u_long)resid); + + while (resid) { + sz = (resid > DFLTPHYS) ? DFLTPHYS : resid; + va = pmap_dumpsys_map(md, ofs, &sz); + counter += sz; + if (counter >> 24) { + printf("%c\b", "|/-\\"[twiddle++ & 3]); + counter &= (1<<24) - 1; + } + error = di->dumper(di->priv, (void*)va, 0, dumplo, sz); + pmap_dumpsys_unmap(md, ofs, va); + if (error) + break; + dumplo += sz; + resid -= sz; + ofs += sz; + + /* Check for user abort. */ + c = cncheckc(); + if (c == 0x03) + return (ECANCELED); + if (c != -1) + printf("(CTRL-C to abort) "); + } + printf("... %s\n", (error) ? "fail" : "ok"); + return (error); +} + +static int +cb_dumphdr(struct pmap_md *md, int seqnr, void *arg) +{ + struct dumperinfo *di = (struct dumperinfo*)arg; + Elf32_Phdr phdr; + int error; + + bzero(&phdr, sizeof(phdr)); + phdr.p_type = PT_LOAD; + phdr.p_flags = PF_R; /* XXX */ + phdr.p_offset = fileofs; + phdr.p_vaddr = md->md_vaddr; + phdr.p_paddr = md->md_paddr; + phdr.p_filesz = md->md_size; + phdr.p_memsz = md->md_size; + phdr.p_align = PAGE_SIZE; + + error = buf_write(di, (char*)&phdr, sizeof(phdr)); + fileofs += phdr.p_filesz; + return (error); +} + +static int +cb_size(struct pmap_md *md, int seqnr, void *arg) +{ + uint32_t *sz = (uint32_t*)arg; + + *sz += md->md_size; + return (0); +} + +static int +foreach_chunk(callback_t cb, void *arg) +{ + struct pmap_md *md; + int error, seqnr; + + seqnr = 0; + md = pmap_scan_md(NULL); + while (md != NULL) { + error = (*cb)(md, seqnr++, arg); + if (error) + return (-error); + md = pmap_scan_md(md); + } + return (seqnr); +} + +void +dumpsys(struct dumperinfo *di) +{ + Elf32_Ehdr ehdr; + uint32_t dumpsize; + off_t hdrgap; + size_t hdrsz; + int error; + + bzero(&ehdr, sizeof(ehdr)); + ehdr.e_ident[EI_MAG0] = ELFMAG0; + ehdr.e_ident[EI_MAG1] = ELFMAG1; + ehdr.e_ident[EI_MAG2] = ELFMAG2; + ehdr.e_ident[EI_MAG3] = ELFMAG3; + ehdr.e_ident[EI_CLASS] = ELFCLASS32; +#if BYTE_ORDER == LITTLE_ENDIAN + ehdr.e_ident[EI_DATA] = ELFDATA2LSB; +#else + ehdr.e_ident[EI_DATA] = ELFDATA2MSB; +#endif + ehdr.e_ident[EI_VERSION] = EV_CURRENT; + ehdr.e_ident[EI_OSABI] = ELFOSABI_STANDALONE; /* XXX big picture? */ + ehdr.e_type = ET_CORE; + ehdr.e_machine = EM_PPC; + ehdr.e_phoff = sizeof(ehdr); + ehdr.e_ehsize = sizeof(ehdr); + ehdr.e_phentsize = sizeof(Elf32_Phdr); + ehdr.e_shentsize = sizeof(Elf32_Shdr); + + /* Calculate dump size. */ + dumpsize = 0L; + ehdr.e_phnum = foreach_chunk(cb_size, &dumpsize); + hdrsz = ehdr.e_phoff + ehdr.e_phnum * ehdr.e_phentsize; + fileofs = MD_ALIGN(hdrsz); + dumpsize += fileofs; + hdrgap = fileofs - DEV_ALIGN(hdrsz); + + /* For block devices, determine the dump offset on the device. */ + if (di->mediasize > 0) { + if (di->mediasize < + SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { + error = ENOSPC; + goto fail; + } + dumplo = di->mediaoffset + di->mediasize - dumpsize; + dumplo -= sizeof(kdh) * 2; + } else + dumplo = 0; + + mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_POWERPC_VERSION, dumpsize, + di->blocksize); + + printf("Dumping %u MB (%d chunks)\n", dumpsize >> 20, + ehdr.e_phnum); + + /* Dump leader */ + error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + dumplo += sizeof(kdh); + + /* Dump ELF header */ + error = buf_write(di, (char*)&ehdr, sizeof(ehdr)); + if (error) + goto fail; + + /* Dump program headers */ + error = foreach_chunk(cb_dumphdr, di); + if (error < 0) + goto fail; + buf_flush(di); + + /* + * All headers are written using blocked I/O, so we know the + * current offset is (still) block aligned. Skip the alignement + * in the file to have the segment contents aligned at page + * boundary. We cannot use MD_ALIGN on dumplo, because we don't + * care and may very well be unaligned within the dump device. + */ + dumplo += hdrgap; + + /* Dump memory chunks (updates dumplo) */ + error = foreach_chunk(cb_dumpdata, di); + if (error < 0) + goto fail; + + /* Dump trailer */ + error = di->dumper(di->priv, &kdh, 0, dumplo, sizeof(kdh)); + if (error) + goto fail; + + /* Signal completion, signoff and exit stage left. */ + di->dumper(di->priv, NULL, 0, 0, 0); + printf("\nDump complete\n"); + return; + + fail: + if (error < 0) + error = -error; + + if (error == ECANCELED) + printf("\nDump aborted\n"); + else + printf("\n** DUMP FAILED (ERROR %d) **\n", error); +} Modified: head/sys/powerpc/powerpc/mmu_if.m ============================================================================== --- head/sys/powerpc/powerpc/mmu_if.m Sat Apr 4 00:56:41 2009 (r190683) +++ head/sys/powerpc/powerpc/mmu_if.m Sat Apr 4 02:12:37 2009 (r190684) @@ -105,6 +105,11 @@ CODE { { return; } + + static struct pmap_md *mmu_null_scan_md(mmu_t mmu, struct pmap_md *p) + { + return (NULL); + } }; @@ -795,3 +800,50 @@ METHOD boolean_t page_executable { vm_page_t _pg; }; + +/** + * @brief Create temporary memory mapping for use by dumpsys(). + * + * @param _md The memory chunk in which the mapping lies. + * @param _ofs The offset within the chunk of the mapping. + * @param _sz The requested size of the mapping. + * + * @retval vm_offset_t The virtual address of the mapping. + * + * The sz argument is modified to reflect the actual size of the + * mapping. + */ +METHOD vm_offset_t dumpsys_map { + mmu_t _mmu; + struct pmap_md *_md; + vm_size_t _ofs; + vm_size_t *_sz; +}; + + +/** + * @brief Remove temporary dumpsys() mapping. + * + * @param _md The memory chunk in which the mapping lies. + * @param _ofs The offset within the chunk of the mapping. + * @param _va The virtual address of the mapping. + */ +METHOD void dumpsys_unmap { + mmu_t _mmu; + struct pmap_md *_md; + vm_size_t _ofs; + vm_offset_t _va; +}; + + +/** + * @brief Scan/iterate memory chunks. + * + * @param _prev The previously returned chunk or NULL. + * + * @retval The next (or first when _prev is NULL) chunk. + */ +METHOD struct pmap_md * scan_md { + mmu_t _mmu; + struct pmap_md *_prev; +} DEFAULT mmu_null_scan_md; Modified: head/sys/powerpc/powerpc/pmap_dispatch.c ============================================================================== --- head/sys/powerpc/powerpc/pmap_dispatch.c Sat Apr 4 00:56:41 2009 (r190683) +++ head/sys/powerpc/powerpc/pmap_dispatch.c Sat Apr 4 02:12:37 2009 (r190684) @@ -465,6 +465,30 @@ pmap_page_executable(vm_page_t pg) return (MMU_PAGE_EXECUTABLE(mmu_obj, pg)); } +vm_offset_t +pmap_dumpsys_map(struct pmap_md *md, vm_size_t ofs, vm_size_t *sz) +{ + + CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, md, ofs, *sz); + return (MMU_DUMPSYS_MAP(mmu_obj, md, ofs, sz)); +} + +void +pmap_dumpsys_unmap(struct pmap_md *md, vm_size_t ofs, vm_offset_t va) +{ + + CTR4(KTR_PMAP, "%s(%p, %#x, %#x)", __func__, md, ofs, va); + return (MMU_DUMPSYS_UNMAP(mmu_obj, md, ofs, va)); +} + +struct pmap_md * +pmap_scan_md(struct pmap_md *prev) +{ + + CTR2(KTR_PMAP, "%s(%p)", __func__, prev); + return (MMU_SCAN_MD(mmu_obj, prev)); +} + /* * MMU install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. Modified: head/sys/sys/kerneldump.h ============================================================================== --- head/sys/sys/kerneldump.h Sat Apr 4 00:56:41 2009 (r190683) +++ head/sys/sys/kerneldump.h Sat Apr 4 02:12:37 2009 (r190684) @@ -67,12 +67,13 @@ struct kerneldumpheader { #define KERNELDUMPVERSION 1 uint32_t architectureversion; #define KERNELDUMP_ALPHA_VERSION 1 -#define KERNELDUMP_I386_VERSION 2 -#define KERNELDUMP_IA64_VERSION 1 -#define KERNELDUMP_SPARC64_VERSION 1 #define KERNELDUMP_AMD64_VERSION 2 -#define KERNELDUMP_ARM_VERSION 1 -#define KERNELDUMP_TEXT_VERSION 1 +#define KERNELDUMP_ARM_VERSION 1 +#define KERNELDUMP_I386_VERSION 2 +#define KERNELDUMP_IA64_VERSION 1 +#define KERNELDUMP_POWERPC_VERSION 1 +#define KERNELDUMP_SPARC64_VERSION 1 +#define KERNELDUMP_TEXT_VERSION 1 uint64_t dumplength; /* excl headers */ uint64_t dumptime; uint32_t blocksize; From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 11:23:02 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77417106564A; Sat, 4 Apr 2009 11:23:01 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 623168FC28; Sat, 4 Apr 2009 11:23:01 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34BN1fX069876; Sat, 4 Apr 2009 11:23:01 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34BN1wb069873; Sat, 4 Apr 2009 11:23:01 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <200904041123.n34BN1wb069873@svn.freebsd.org> From: Weongyo Jeong Date: Sat, 4 Apr 2009 11:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190688 - in head: share/man/man4 sys/contrib/dev/uath sys/dev/usb/wlan sys/modules/usb/uath usr.sbin/uathload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 11:23:03 -0000 Author: weongyo Date: Sat Apr 4 11:23:00 2009 New Revision: 190688 URL: http://svn.freebsd.org/changeset/base/190688 Log: Add uath(4) wireless USB driver for Atheros AR5005UG and AR5005UX chipsets. Reviewed by: sam Added: head/share/man/man4/uath.4 (contents, props changed) head/sys/contrib/dev/uath/ head/sys/contrib/dev/uath/ar5523.bin.uu head/sys/dev/usb/wlan/if_uath.c (contents, props changed) head/sys/dev/usb/wlan/if_uathreg.h (contents, props changed) head/sys/dev/usb/wlan/if_uathvar.h (contents, props changed) head/sys/modules/usb/uath/ head/sys/modules/usb/uath/Makefile (contents, props changed) head/usr.sbin/uathload/ head/usr.sbin/uathload/Makefile (contents, props changed) head/usr.sbin/uathload/uathload.c (contents, props changed) Added: head/share/man/man4/uath.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/uath.4 Sat Apr 4 11:23:00 2009 (r190688) @@ -0,0 +1,186 @@ +.\" +.\" Copyright (c) 2006 +.\" Damien Bergamini +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 31, 2009 +.Dt UATH 4 +.Os +.Sh NAME +.Nm uath +.Nd Atheros USB IEEE 802.11a/b/g wireless network device +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ehci" +.Cd "device uhci" +.Cd "device ohci" +.Cd "device usb" +.Cd "device uath" +.Cd "device wlan" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_uath_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver supports USB 2.0 wireless network devices based on Atheros +Communications fifth generation AR5005UG and AR5005UX chipsets. +.Pp +The AR5005UG chipset is made of an AR5523 multiprotocol MAC/baseband processor +and an AR2112 Radio-on-a-Chip that can operate between 2300 and 2500 MHz +(802.11b/g). +.Pp +The AR5005UX chipset is made of an AR5523 multiprotocol MAC/baseband processor +and an AR5112 dual band Radio-on-a-Chip that can operate between 2300 and +2500 MHz (802.11b/g) or 4900 and 5850 MHz (802.11a). +.Pp +The AR5005UG and AR5005UX chipsets both have an integrated 32-bit MIPS +R4000-class processor that runs a firmware and manages, among other things, +the automatic control of the transmit rate and the calibration of the radio. +.Pp +.Nm +supports +.Cm station , +and +.Cm monitor +mode operation. +Only one virtual interface may be configured at any time. +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh FIRMWARE +.Nm +requires firmware that is downloaded to the device. +This is normally done by the +.Xr uathload 8 +utility that is launched by +.Xr devd 8 +when the device is inserted. +.Xr uathload +includes the firmware in the binary program. +This firmware is licensed for general use and is included in the base system. +.Sh HARDWARE +The following adapters should work: +.Pp +.Bl -column -compact "TRENDware International TEW-444UB" "AR5005UX" -offset 6n +.It Em "Adapter Chipset" +.\".It Belkin F6D3050 AR5005UX +.It Li "Compex WLU108AG" Ta AR5005UX +.It Li "Compex WLU108G" Ta AR5005UG +.\".It Li "D-Link DWL-AG132" Ta AR5005UX +.It Li "D-Link DWL-G132" Ta AR5005UG +.\".It Li "Edimax EW-7315Ug" Ta AR5005UG (AR2414???) +.\".It Li "Lancom USB-54ag" Ta AR5005UX +.\".It Li "NEC WL54TU" Ta AR5005UX +.It Li "IODATA WN-G54/US" Ta AR5005UG +.It Li "MELCO WLI-U2-KAMG54" Ta AR5005UX +.It Li "Netgear WG111T" Ta AR5005UG +.It Li "Netgear WG111U" Ta AR5005UX +.It Li "Netgear WPN111" Ta AR5005UG +.It Li "Olitec 000544" Ta AR5005UG +.It Li "PLANET WDL-U357" Ta AR5005UX +.\".It Li "Senao WUB-8004" Ta AR5005UX +.It Li "Siemens Gigaset 108" Ta AR5005UG +.It Li "SMC SMCWUSBT-G" Ta AR5005UG +.It Li "SMC SMCWUSBT-G2" Ta AR5005UG +.\".It Li "SparkLAN WL-685GS" Ta AR5005UG +.It Li "SparkLAN WL-785A" Ta AR5005UX +.It Li "TP-Link TL-WN620G" Ta AR5005UG +.It Li "TRENDware International TEW-444UB" Ta AR5005UG +.It Li "TRENDware International TEW-504UB" Ta AR5005UX +.It Li "Unex Technology UR054ag" Ta AR5005UX +.\".It Li "Wistron NeWeb DCUA-81" Ta AR5005UX +.\".It Li "Wistron NeWeb DRUA-81" Ta AR5005UG +.\".It Li "Wistron NeWeb DRUA-82" Ta AR5005UX +.\".It Li "ZyXEL G-200 v2" Ta AR5005UG +.It Li "ZyXEL XtremeMIMO M-202" Ta AR5005UX +.El +.Pp +An up to date list can be found at +.Pa http://customerproducts.atheros.com/customerproducts/default.asp . +.Sh EXAMPLES +Join an existing BSS network (i.e., connect to an access point): +.Pp +.Bd -literal -offset indent +ifconfig wlan create wlandev uath0 inet 192.168.0.20 \e + netmask 0xffffff00 +.Ed +.Pp +Join a specific BSS network with network name +.Dq Li my_net : +.Pp +.Dl "ifconfig wlan create wlandev uath0 ssid my_net up" +.Pp +Join a specific BSS network with 64-bit WEP encryption: +.Bd -literal -offset indent +ifconfig wlan create wlandev uath0 ssid my_net \e + wepmode on wepkey 0x1234567890 weptxkey 1 up +.Ed +.Pp +Join a specific BSS network with 128-bit WEP encryption: +.Bd -literal -offset indent +ifconfig wlan create wlandev uath0 wlanmode adhoc ssid my_net \e + wepmode on wepkey 0x01020304050607080910111213 weptxkey 1 +.Ed +.Sh DIAGNOSTICS +.Bl -diag +.It "uath%d: could not send command (error=%s)" +An attempt to send a command to the firmware failed. +.It "uath%d: timeout waiting for command reply" +A read command was sent to the firmware but the firmware failed to reply in +time. +.It "uath%d: device timeout" +A frame dispatched to the hardware for transmission did not complete in time. +The driver will reset the hardware. +This should not happen. +.El +.Sh SEE ALSO +.Xr netintro 4 , +.Xr usb 4 , +.Xr wlan 4 , +.Xr wlan_ccmp 4 , +.Xr wlan_tkip 4 , +.Xr wlan_wep 4 , +.Xr devd 8 , +.Xr uathload 8 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 . +.Sh HISTORY +The +.Nm +driver first appeared in +.Ox 4.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Weongyo Jeong Aq weongyo@freebsd.org +and +.An Sam Leffler Aq sam@freebsd.org . +It is distantly related to a driver written by +.An Damien Bergamini Aq damien@openbsd.org . +.Sh CAVEATS +Atheros proprietary 108 Mbps mode (aka Super AG mode) is not supported. +.Pp +Dual-band adapters are presently not working; +to workaround, restriction operation to 2.4GHz channels. Added: head/sys/contrib/dev/uath/ar5523.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/uath/ar5523.bin.uu Sat Apr 4 11:23:00 2009 (r190688) @@ -0,0 +1,3359 @@ +/*- + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the following conditions are met: + * 1. The materials contained herein are unmodified and are used + * unmodified. + * 2. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following NO + * ''WARRANTY'' disclaimer below (''Disclaimer''), without + * modification. + * 3. Redistributions in binary form must reproduce at minimum a + * disclaimer similar to the Disclaimer below and any redistribution + * must be conditioned upon including a substantially similar + * Disclaimer requirement for further binary redistribution. + * 4. Neither the names of the above-listed copyright holders nor the + * names of any contributors may be used to endorse or promote + * product derived from this software without specific prior written + * permission. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, + * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE + * FOR 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 DAMAGES. + */ +begin 755 ar5523.bin +M0!I@`#P;``@#>M@D$V``#0`````#X`@A/!N``"=[!@@\'X``)_\`-`-_V"($ +M$0`!``````-_V"``(/@A`V``"``````\&P`0`WK8)!-@``T``````^`((3P; +M@``G>P8`/!^``"?_`'0#?]@B!!$``0`````#?]@@`"#X(0-@``@`````)!H` +M`D":@``#X`@A/`*``"1"!!`\'X``)_\`K`!?$"($$0`!``````!?$"``(/@A +M`$``"``````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````0!IH```````S6@!_/!N``"=[`@`# +M>M@@CWL```-@``@``````````````````````````````````````````$`: +M:```````,UH`?SP;@``G>P(``WK8((][```#8``(```````````````````` +M```````````````````````D&@"`/!N``"=[`@"/>P"``V``"``````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````!`@&@``````#P"$``T0O\`0()@`````````````````"0"``)`@H`` +M`````````````````^`((3P:@``G6@MT/!^``"?_!&0#7]`B!!$``0`````# +M7]`@`"#X(0-`^`D``````^`((3P:@`(G6D:X/!^``"?_!)0#7]`B!!$``0`` +M```#7]`@`"#X(0-`^`D`````0`)@```````\`___-&,`_P!#$"1`@F`````` +M````````````/`2``B2$5_``@.@A/`$?_S0A__\#H>@D/`&@``.AZ"5`!(`` +M`````````````````^`((3P:@`(G6J6$/!^``"?_!1@#7]`B!!$``0`````# +M7]`@`"#X(3P!'_\T(?__`T'0)#P!H``#0=`E`T#X"0`````\'(`#)YS&L#P$ +M@`(DA%?P`(#H(3P(@``\"8``)2D!P#P+@``E:P'DC2(``"$I``2M`@``(0@` +M!!4K__L`````-`0`$#P%@``DI09T/`:``"3&`@"LQ0``(,8`!""$__\4@/_\ +M`````#P$@``DA`(`/`6``"2E!X"LA0``/`6``"2E"RBLA0`D/`6``"2E!G2L +MA0"`K(4`A*R%`(@,``*L``````P`:5H`````#`!J>P`````,`&D:``````@` +M;<\\'P``$````0````!`&F``/!O__S=[__`#6]`D0)I@```````````````` +M`$`:\`````````````````!`FG``````````````````0!I@`#P;_[\W>___ +M`UO0)$":8``D&@"(/!N``"=[`@"/>P"(`V``"``````#H-@A([W^L*^Z`(BO +MH```KZ$`!*^B``BOHP`,KZ0`$*^E`!2OI@`8KZ<`'*^H`""OJ0`DKZH`**^K +M`"ROK``PKZT`-*^N`#BOKP`\K[``0*^Q`$2OL@!(K[,`3*^T`%"OM0!4K[8` +M6*^W`%RON`!@K[D`9*^\`'"OO@!XK[\`?```(!```"@2KZ0`@*^E`(2ONP!T +M0`AH`$`)8`!`"C@`0`M``$`,&`!`#7@`0`YP`*^H`)BOJ0",KZH`E*^K`)RO +MK`"DKZT`H*^N`)`\'(`#)YS&L`.@@"$CO?_@0!I@`#P;__\W>__P`UO0)$": +M8``````````````````,`&D.`@`@(0@``DT``````Z#8(2.]_K"ON@"(KZ`` +M`*^A``2OH@`(KZ,`#*^D`!"OI0`4KZ8`&*^G`!ROJ``@KZD`)*^J`"BOJP`L +MKZP`,*^M`#2OK@`XKZ\`/*^P`$"OL0!$K[(`2*^S`$ROM`!0K[4`5*^V`%BO +MMP!*^_`'P``"`0```H$J^D`("OI0"$K[L`=$`) +M8`!`"C@`0`MP`*^I`(ROJ@"4KZL`D#P<@`,GG,:P/`*``B1"1E2,1```((0` +M`:Q$```#H(`A)[W_X$`#8```````0`)H````````0Q`D``(2@C!"`'\\`X`` +M)&,*/`!#$""`4@```D"((20!``02(0`#`````!````P`````/!&@P#8Q`!". +M,0``,C$`?SP#@``D8PH\`'$8((!Q```F,0`&`B"0(0``````$8B`0!I@`#P; +M__\W>__P`UO0)$":8``````````````````\"H`")4HQ>`%14""-2@``/`6` +M`B2E,?``L2@@C*4```)`("$!0/@)``````!`D"$\!8`")*4R:`"Q*"",I0`` +M`@`P(0P`=7,`0"`A`D`0(2.]`"!``F``/`/__S1C__X`0Q`D0()@```````` +M`````````(^H`)2/J0"`CZH`A$"(.``!(``1`4``$X^A``2/H@`(CZ,`#(^D +M`!"/I0`4CZ8`&(^G`!R/J``@CZD`)(^J`"B/JP`LCZP`,(^M`#2/K@`XCZ\` +M/(^P`$"/L0!$C[(`2(^S`$R/M`!0C[4`5(^V`%B/MP!(^_`'R/NP",-!K_``-:T"<#>M@D0!I@````````````,UK_``-ZV"6/ +MN@"0C[T`=#=[``)`FV``````````````````0)IP```````````````````` +M``]"```8`````````0`"``$``P`!``(``0`$``$``@`!``,``0`"``$`!0`! +M``(``0`#``$``@`!``0``0`"``$``P`!``(``0`#X``(``````.@&"$`H.@A +M([W_X*^C``BOOP`0`(#X"0````"/OP`0C[T`"`/@``@`````/`2``B2$1Z@\ +M!8`#)*6B'#"&``,4P``2``````"D.",`!SE"``P(``WK8((][```#8``(`````#0:`"0( +M``&=`````#P)H,`U*0"0C24``"0$``0`I"@EK24``#P)H+,U*0`",!2U`C)!,``0`+9`(Q:/__`4P`&P`.+`)1@``! +M```!S0``(!(``!@0``,<``!E&"4``&@2``````````!PB$@"`&D0*U!```L` +M:1@C`&L8(0!K$"L40``&)(W__P!I$"M00``$`&D8(R6M__\`:Q@A`&D8(P!L +M`!LQQ/__48```0```H@!@`+9`(`C``;,6C__P'N&`8` +MZA`$`$-0)0`*+`)1@``!```!S0&`:"$`[G`$```P$@``(!``!"0``(48)0`` +M>!(``````````'#(2`(`:1`K$$``"@$`F"$`:Q@A`&L0*Q1```8DS___`&D0 +M*U!```0`:1@C)>___P!K&"$`:1@C`&T`&S%$__]1H``!```!S0``$!(``!@0 +M``,<``!D&"4``#`2``````````!P4T@"`&D0*Q!```L`#Q0``&L8(0!K$"L4 +M0``&),;__P!I$"L00``$``\4`"3&__\`:Q@A``\4``!&F"40`/^.`&E0(S1" +M__\D`P`0`$L0*R0$`!@`8"@A$`#_>0""*`L`AA`K$$``!S0"__\``#`A``"8 +M(1$`_U$`H,@A$`#_30%`P"$`1A`K%$``?#P"`/\D`@`(+,,!``!`*"$``R@+ +M/`.``@"I$`8D8Q9\`$,0(9!$```D`@`@`(4@(0!$.",4X``1`$=X(P$J$"L4 +M0``%`H@!@",`!LQ,___`>X0 +M!@#J&`0`8E`E``HL`E&```$```'-`.M8!```,!(``"`0``0D``"%&"4``$`2 +M``````````!PTV@"`&T0*Q!```H`[G`$`&D8(0!I$"L40``&),C__P!M$"M0 +M0``$`&T8(R4(__\`:1@A`&T8(P!L`!LQ1/__48```0```",!2U`C)!,``0`+9`(Q:/__`4P`&P`.+`)1 +M@``!```!S0``(!(``!@0``,<``!E&"4``&@2``````````!PB$@"`&D0*U!` +M``L`:1@C`&L8(0!K$"L40``&)(W__P!I$"M00``$`&D8(R6M__\`:Q@A`&D8 +M(P!L`!LQQ/__48```0```H@!@`+9`(`C``;,6C__P'N +M&`8`ZA`$`$-0)0`*+`)1@``!```!S0&`:"$`[G`$```P$@``(!``!"0``(48 +M)0``>!(``````````'#(2`(`:1`K$$``"@$`F"$`:Q@A`&L0*Q1```8DS___ +M`&D0*U!```0`:1@C)>___P!K&"$`:1@C`&T`&S%$__]1H``!```!S0``$!(` +M`!@0``,<``!D&"4``#`2``````````!P4T@"`&D0*Q!```L`#Q0``&L8(0!K +M$"L40``&),;__P!I$"L00``$``\4`"3&__\`:Q@A``\4``!&F"40`/^.`&E0 +M(S1"__\D`P`0`$L0*R0$`!@`8"@A$`#_>0""*`L`AA`K$$``!S0"__\``#`A +M``"8(1$`_U$`H,@A$`#_30%`P"$`1A`K%$``?#P"`/\D`@`(+,,!``!`*"$` +M`R@+/`.``@"I$`8D8Q9\`$,0(9!$```D`@`@`(4@(0!$.",4X``1`$=X(P$J +M$"L40``%`H@!@",`!LQ,___ +M`>X0!@#J&`0`8E`E``HL`E&```$```'-`.M8!```,!(``"`0``0D``"%&"4` +M`$`2``````````!PTV@"`&T0*Q!```H`[G`$`&D8(0!I$"L40``&),C__P!M +M$"M00``$`&T8(R4(__\`:1@A`&T8(P!L`!LQ1/__48```0```]`"`G +MO?_0K[``$`"`@"$D!`!]`#"/H@`` +M`$`@(0P`!L^N8@`$%$#_\0!`B"$,`!FN`F`@(11`_^T`0(@A#``2D`)@("$4 +M0/_I`$"((0P`&=D"8"`A`$"0(1!`_^0D$0`"C[````!`("$,`!G1)`4'(`!` +MB"$D`@<@K@(;[`)`*"$"8"`A#``<@JYR```\`X`"K'-'J!``_]6N8@`()[W_ +M\*^P``"OOP`$#``4GP"`@"$"`"`A#``4K```*"$00``&)`,`%H^_``2/L``` +M`&`0(0/@``@GO0`0#``?*P(`("$`0!@A)@4;<`(`("$40/_U)`8``0P`-X4` +M`````$`8(20%``$40/_O`@`@(0P`%*P`````)`,`%A``_^H``A@*K*0`!`/@ +M``BLX```)[W_H*^S`$P`H)@A```H(:^Q`$2OOP!0K[(`2*^P`$`,`!2L`("( +M(11``!6OH@`PCB(7W!1``"T#H"`A#`!Z=0````"/I@`@CZ4`'#P$@`(DT,0` +M`!`7P@("$"$``I!##`!P="2$"(@"("`A#``)M@)`*"&OH@`P$$``"P.@("$2 +M8``"CZ(`,*YB``"/OP!0C[,`3(^R`$B/L0!$C[``0`/@``@GO0!@#`!Z=0`` +M``"/H@`@`B`@(210Q``,``RQ`@`H(3P$@`(DA`BD`@`H(0)`,"$40/_JKZ(` +M,`P`<'0`````)`(``:XB%]P"("`A#``'5R>E`#"/H@`P4$#_X*X@%^@0`/_> +M`````">]_^"OL0`4K[``$*^_`!B,@Q?@)`(``0"@B"$`@(`A`Z`H(1!B``NO +MH```$B``!JX`%^B/OP`8C[$`%(^P`!`#X``()[T`((^B```0`/_YKB(```P` +M!Y4`````CZ(``!1`__("`"`A#`!1E``````"`"`A#``4K"0%``$0`/_K```` +M`">]_^"OL@`(`*"0(0``*"&OLP`,K[$`!*^P``"OOP`0#``4K`"`@"$D$P`! +M`$"((1!```L"`"`A$D```JX`%^BN40``C[\`$(^S``R/L@`(C[$`!(^P```# +MX``()[T`(*X`&QP,``A^KA,;)`P`"A@"`"`A#`!Q7``````D8P#(+&4`R(X$ +M&`@`11`A`$`P(20(```D"0#(#`!Q=`!@."$,`'%<`````"1C`,@L90#(C@08 +M0`!%$"$`0#`A)`@``"0)`,@,`'%T`&`X(8X"``0,`!T8C$0```(`("$,`"D\ +M/`6```P`!_8"`"`AKA,7X!``_]$`````)[W_\*^R``BOL0`$K[```*^_``R, +M@A?@)!(``0"@B"$`@(`A$%(`"@``*"$2(``"KA(7Z*X@``"/OP`,C[(`"(^Q +M``2/L````^``"">]`!`,`!2L`````#P%@``,`"EL`@`@(0P`<7N.!!@(#`!Q +M>XX$&$`,``LT`@`@(0P`$7<"`"`A#``(E0(`("$D!0`!#``*2`(`("$,``@' +M`@`@(8X"``0,`!T*C$0``*X`%^`0`/_>`````">]__"OL````*"`(:^Q``0` +MP"@A`("((0(`("&OOP`,K[(`"`P`!S8`P)`A#`!1E`(`("$"("`A)`4`"``` +M,"$,`!$9)`<``59```&N0```C[\`#(^R``B/L0`$C[````/@``@GO0`0)[W_ +M\*^Q``2OL````("((0"@@"&OOP`(#``4;20%``$"("`A$@``"SP%``0,`"D\ +M``````(@("$,`!1M```H(8^_``B/L0`$C[````/@``@GO0`0#``I;#P%``00 +M`/_V`B`@(2>]__`D`@`!K((]_]"OM0`4`*"H(20%``&OOP`@K[<` +M'*^V`!BOM``0K[,`#`$`H"$`X)@AK[(`"*^Q``0`P)`A`("((:^P```,`!1M +M/!:``CP0@`(FI``0/!>``@``*"&N$C.`KM,SA`P`:S2N]#.(`J`@(0P`:S0D +M!0`!CB4``(X$,X`\`O_QC*-`$#1"__\`!"1``&(8)#P"``X`@B`D`&08):RC +M0!".)0``CL0SA#P"_X^,HT`0-$+__P`$)0``8A@D/`(`<`""("0`9!@EK*-` +M$(XE``".Y#.(/`+_?XRC0!`T0O__``0EP`!B&"0\`@"``((@)`!D&"6LHT`0 +M`B`@(0P`%&T``"@AC[\`((^W`!R/M@`8C[4`%(^T`!"/LP`,C[(`"(^Q``2/ +ML````^``"">]`#`GO?_PK[```"0&``0`@(`AK[\`!`P`-@X``"@A#`!1O28$ +M'8P00``'`@`@(0P`-;2,10`D#``UN`(`("$,`#7H`@`@(0P`<=`F!!K(C[\` +M!(^P```#X``()[T`$">]__```"@A)`8``Z^P``"OOP`$#``V#@"`@"$,`''" +M)@0:R`P`<+4`````#``U_0(`("$,`#6_`@`@(0P`<+H`````#``(VP(`("$D +M`@`!K@(;)(^_``2/L````^``"">]`!",I0`H)`/_\#"B``\D0@`G`$,X)`"C +M&"0`9Q`A`$,0*Q1```<`8#`AO'$``"1C`!``QQ`A`$,0*Q!`__L`````D*(` +M`"0#`(`P0@#\4$,`!)2C`!0``"`A`^``"`"`$"&4@AQ>5&+__```("&4HP`2 +ME((<7%1B__@``"`AE((<6I2C`!`48O_S)`0``1``__(`````C((:_(Q#```# +MX``(K(,:_(R"&ORLH@```^``"*R%&OPGO?_@)`(``:^P``"OOP`, +M1```H@`:^!``_XBN`!KT#``(TP(`("$`0(@AD@(:^"8E``0D0@`!HB(``"0" +M``.B(@`!)`(`0!``_\2F(@`"D@,:^`)`*"$D8@`!H@(:^))"``&B0P``,$(` +M_J)"``&.`@`$#``:QXQ$```0`/]P)A8=C`P`"*X"`"`A$`#_F*X"&MR/OP`< +MC[8`&(^U`!2/M``0C[,`#(^R``B/L0`$C[````"`$"$#X``()[T`(">]__"O +ML0`$K[````#`B"$`H(`A)`4``:^_``ROL@`(#``4;0"`D"$"`"`A#``W=`(@ +M*"$"`#`A`@`H(0P`4=@F1!V,`D`@(0P`%&T``"@AC[\`#(^R``B/L0`$C[`` +M``/@``@GO0`0)[W_\*^_``"0H@`!,$(``A!```8DI_^D#``(UP````"/OP`` +M`^``"">]`!"@H```H*```8R&&^RDH``"`.`H(0P`"8@DQO_\$`#_]H^_```G +MO?_0K[\`(*^W`!ROM@`8K[,`#*^Q``2OL```K[4`%*^T`!"OL@`(C((;[`"` +MF"$DA!V,)%``H`"P`!JN8!M44@```0```]`#!RT!@")`(``:YB';0D<``0#`!Z5P(`("$0 +M0``R`$"((0!`("$``"@A`@`P(0!`D"$,`'"J)C4`8`+V$"JN<1JX`B"@(:YP +M&KP00``5`J"((0+`@"&.9AOLKE0`)*Y5`"BN40`$`D`H(0)@("$,``F(),;_ +M_(YB&^PF$/__`B(H(0)"&"$"HB`A`H(0(21R`%PDE0!<)%0`7!8`_^XDL0!< +M)I$`$!K```BN8!K\`L"`(0(@*"$"8"`A#``(UR80__\6`/_[)C$`1"9P&L@, +M`'&T`@`@(0P`<]__"OL````("`(:^_ +M``0,`''0)(0:F`P`<=`F!!J$)`(``:X"&K2/OP`$C[````/@``@GO0`0)[W_ +M\*^R``BOL0`$K[```*^_``P`@)`A`("`(201``..`@`($$``#R8%``@`H!@A +M)`0``R0"``$DA/__K&(`-*1@`#"D8``R!('_^R1C``@DI0!] +M__"OL0`$`("((:X@&K0DA!J$K[\`"*^P```,`''"`*"`(0P`<<(F)!J8$@`` +M"P(@("$,``U[`B`@(0P`"B8"("`AKB`;'(^_``B/L0`$C[````/@``@GO0`0 +M#``.V0`````0`/_S`````(RB`#P\`X?_-&/__SP$?_\`0Q`D-(3__SP#_O\T +M8___`$00)`!#$"2LH``$)[W_\*R@```DI`!LC@,`.*X@```"0A`JKA$`.*QQ```40/_N +MKB,`!"8$`"0,`'&'```H(0)@$"&/OP`0C[,`#(^R``B/L0`$C[````/@``@G +MO0`@$`#_]R03``(GO?_PK[$`!*^_``BOL```C)``!`P`<+4`H(@AC@0`-(R% +M```0H``3C((`!*RB``2.`@`PC(,`!*R1``BL@@`$C@(`,*QE``"N!``PK(`` +M``P`<+JL1```#`!QHR8$`"2/OP`(C[$`!(^P```#X``()[T`$!``_^ZN`@`X +M)[W_\*^Q``0`@(@A)(0`)*^_``@,`'&.K[````P`<+4`````CB0`+(R%```0 +MH``3C((`!*RB``2.(@`XC(,`!(R0``BL@@`$CB(`.*QE``"N)``XK(```*R` +M``@,`'"ZK$0```(`$"&/OP`(C[$`!(^P```#X``()[T`$!``_^ZN(@`P)[W_ +MX*^Q`!2OL``0K[\`'*^R`!B,D@`$`("`(0.@*"$F1``D#`!QJJ^@``"/H@`` +M'$``!P``B"&/OP`]`"`,``L3`D`@(1!`__<` +M0"@A,$(`#R1"`"LD`__P`$,P)`"C&"0`9A`A`$,0*Q1```<`8"`AO'$``"1C +M`!``AA`A`$,0*Q!`__L`````C*,`""0"`!`08@`*``````P`"H,"`"`ACZ(` +M`"8Q``$"(A`J%$#_XX^_`!P0`/_=C[(`&`P`"O0"`"`A$`#_]X^B```GO?_P +MK[(`"*^P``"OOP`,K[$`!(R1``0D`@`!``"`(0(@("&N(A?8#``*@R8R&JP" +M0"`A#`!QAP``*"$,``ZZ`B`@(2H#``440``.)A```5!@``TF,!J8#`!Q7``` +M```D8P!D+&0`9`!$$"$`0#`A`&`X(0P`<94"0"`A$`#_[P`````F,!J8#`!Q +MT`(`("$,`'&C)B07T`P`<8XF)!?(`@`@(:X@%]@,`''"`````(^_``R/L@`( +MC[$`!(^P```#X``()[T`$">]_]"OL0`DK[\`+*^R`"BOL``@`*"((8R2``0` +M`%`A``!P(1"@`'X``'@AC*T`#(RD`!`QH@`/``(8P`!B&",``QC``D,8(20" +M__\0@@`8)'D8>``$$,``1!`A``(0P`!$$",``A"``D(0(8Q$``@D`P`!KZ,` +M!!2```X`6!'``&DD`@`& +MC<,`!%!B`&<``'@A)BG__(XL`!@!((`A)CC_H!$@`#\D!@`<`29`(24J_Z0E +M"``$K4@`!(TK``"10P`.)`7P```+$"L``A$`,&,`[P!B&"6A0P`.CB(``)5# +M``HE9_^D)$+_Y#!"#_\`91@D`&(8):5#``J.0AOLE40`#@`+.`H`1A`C)$+_ +M_`&"&"L!@Q`+`(4@)#!"#_\`@B`EI40`#I5&``ZM)_^DC4(`/"0#_?\`#2E` +M`$,0)#"E`@``#1E"/`3^_S2$__\`11`E,&,``0!$$"0``QX``$,0):U"`#RM +M2``HCB,`$##&#_\D`O__)&0`!*U'`""M6``PK4\`4*U.`$P08@`C`89@(ZU$ +M`#@!8$@A%6#_PP``,"$"`$@A$2``#`%`@"$E*O^DC4,`/(TK```\`G__-$+_ +M_P!B&"0!8$@AK4,`/*U9`%@58/_VK5``+`)`("$#("@A`P`P(0P`#TL``#@A +MCB(`%%!```.N``!4CB(`!*X"`%2/OP`LC[(`*(^Q`"2/L``@`^``"">]`#`D +M`G__$`#_W:U"`#@``'@A$`#_F0``<"$,``JD`Z`P(:X@``0"0"`A#``*@P(@ +M*"$0`/_NC[\`+">]_]"OL0`4K[\`(*^S`!ROL@`8K[``$`"`B"$,`'#^C)(` +M!`!`("$,`'$!```H(0(@("$,``L3)E,:F`)@("$,`''"`$"`(0)`("$,`!1M +M)`4``8X#``@D`@`0`@`H(1!B`!X"("`ACD(7X`(`*"$40``6`D`@(0P`"H,` +M````)B0`)`P`<:H#H"@ACZ(`````@"$00``$`B`@(0P`"Q,``````$"`(58` +M_^N.`P`(#`!QT`)@("$"0"`A#``4;0``*"$0`/_;`B`@(0P`"YX"("`A$`#_ +MZR8D`"0,``ML`````!``_^]`"`,`'&T)@0:F#P%@``\!X`"/`B``CP+@`(D!``!)FID$"2E +M,.@"(#`A).<(Q"4(6!`E:V08#`!PRR0)#``,`'#DCF1D$!``_^<"0!`A)[W_ +M\*^P``"OOP`$C((;]`"`@"&,0@!$%$``!20$.@"/OP`$C[````/@``@GO0`0 +M)`(`!PP`>E>N`AL`)$("`"0#_@``0Q`DK@(=Q!``__2N`AL$)[W_X*^_`!RO +MM@`8K[4`%*^T`!"OL@`(K[$`!*^P``"OLP`,C((;[`"`B"$DD!AX)%4`7`"U +M`!H\`H`"4J```0```L)E(``0)"$"H40/_X`A6`(1``_]P`````$`#_WB03``(GO?_`K[``,*^_ +M`#BOL0`TC((;](S+```D#``!C$,`"`%L$`0`@(`A`&(8)!1@`"D`H$@A+*(` +M!A!``"8`!1#`C,H`&(S#`!2,QP`0C,0`!`!%$".,Q0`(C,8`#``"$,`"`A`A +M,4@`"*^C``"OJP`(KZ0`#*^E`!"OI@`4KZ<`("11&'BOJ@`$KZ``&*^@`!RO +MH``D$0``!J^@`"@5(``6`````(X"'<0D0AP`KZ(`*`(`("$,`$IH`Z`H(0!` +M&"&.`AOTC$(`:`!B$"M40``&KB,`)(^_`#B/L0`TC[``,`/@``@GO0!`#`!Q +MM`(@("$0`/_YC[\`.%$L_^R.`AW$)`+_]P%"$"00`/_IKZ(`!">]__"OL@`( +MK[$`!*^P``"OOP`,`("`(0``D"$DD1G(C@,:<"0"``$"0A`$`&(8)`)`*"$4 +M8``+`@`@(292``$N0@`&%$#_]B8Q`!R/OP`,C[(`"(^Q``2/L````^``"">] +M`!`,`$J'``````(`("$"0"@A#``-%@(@,"$0`/_P)E(``2>]__"OL@`(K[$` +M!*^P``"OOP`,`("`(0``D"$DD1AXC@(:<"0#``$"0Q@$`$,0)%!```DF4@`! +MC@(;]`)`*"$"`"`AC$(`"`!#$"040``+)`8`!"92``$N0@`&%$#_\"8Q`#B/ +MOP`,C[(`"(^Q``2/L````^``"">]`!`,`$JV)E(``0(`("$,`!#@`B`H(1`` +M__(N0@`&)[W_\*^_``2OL```C*8`.`P`2[4`H(`AC@(`+(^_``2/L```K$`` +M0`/@``@GO0`0)[W_L*^U`#2OM``PK[,`+*^_`$"OMP`\K[8`.*^R`"BOL0`D +MK[``((RR`!0`H*@A`("8(1)``&XDE`2`CD(`/`1!``0``+`ACD(`(!!``.8` +M0)`ACD(`4%!```6.40`LC$(``%!```&N0`!0CE$`+(XB`$`40``')C<`0`)@ +M("$,`$VK`B`H(20#``T00P!9C[\`0`)@("$,`!"&`B`H(11``,\D`@`!CB,` +M0*Y@&QP08@`&CE``4%(```6.H@`(ZB`#"50P`(EF(<7E!B``.50P`&$`#_VB5"`!"68AQ<%&+_UR5"`!"50P`$ +MEF(<6E1B_],E0@`0CH(!+"1"``$0`/_TKH(!+`*@*"$,`!`!`B`P(5!`_X6. +ML@`4$`#_/8ZB`!P0`/^#KB``0(YB%]A00/^!C[\`0`P`<:,F9!JL$`#_?8^_ +M`$",@P`4$&``""0$``&,8@`\!$,`!0``("&,8@`@$$```@```````"`A`^`` +M"`"`$"$GO?_PK[$`!*^_``@`@(@AK[```(XB&\P00``4)(08>`P`#JX````` +M)B08L`P`#JX``H`K)B08Z`P`#JX``H`*)B09(`P`#JX``H`*4$```0``@"$" +M`!`AC[\`"(^Q``2/L````^``"">]`!`,``ZN`````!``__<``H`K)[W_\*^P +M``"OOP`$#`!PM0"`@"&.`AO,)@48>!!```L"`"`A#``-K0`````F!1BP#``- +MK0(`("$F!1CH#``-K0(`("$F!1D@`@`@(0P`#:T`````#`!PN@````"/OP`$ +MC[````/@``@GO0`0C*<`*```2"&0X@`!,$(`!!1``!",J``LD.(`%C!#``]4 +M8``-C*(`/)4"`$8``"`A``(1`J#B`!>1`@!',$(`#P`"$0``8A`EH.(`%@/@ +M``@`@!`AC*(`/``"%H(P0@`!5$``#Y#B``&5"0!&D.,`%C$B``\``A$`,&,` +M#P!B&"4`"1$"H.,`%J#B`!>,H@`\/`,$``!#$"6LH@`\D.(``3!"``000/_I +M`2`@(8T&`"!0P/_F`2`@(8S(`"PD!/_PC,<`*"4#``@P8@`/)$(`)P!D&"0` +M1"@D`&40(0!#$"L40``'`&`@(;QQ```D8P`0`(40(0!#$"L00/_[`````(S" +M`#P``A:",$(``51```Z0X@`!D.,`%C$B``\``A$`,&,`#P!B&"4`"1$"H.,` +M%J#B`!>,P@`\/`,$``!#$"6LP@`\D.(``3!"``140/_8C08`(!``_[T!("`A +M)[W_X*^S``P`P)@AK[4`%*^T`!"OL0`$K[```*^_`!BOL@`(`("@(0"@B"$, +M`'"U``"H(1)@`$("8(`AC@(`/``"%D(P0@`!%$``58X2`%`20`!4`H`@(8Y" +M`%000`!1`````!*@`$R.`@`LC$,``(Q"`""NHP``KJ(`((X&`"PF1`!<`@`H +M(:S``""LP```#`!1V`````".0@!X)$(``:Y"`'@2H``"`F"`(8ZP`"!6`/_C +MC@(`/!)@`"$`````EB,`-%!@`!&.(@`8CF0`*)""`!8P10`/4*``"Z8@`#0` +M`Q$"H((`%Y(B`#60@P`!,$(`#P`"$0``HA`E-&,`"*"#``&@@@`6CB(`&%1` +M`!VL4P`@)`(``:XB`"RN,P`4KC4`&`````^.(@`L5$``$(YF`"2.)0`D#`!* +MG`*`("$,`'"Z`````(^_`!B/M0`4C[0`$(^S``R/L@`(C[$`!(^P`````!`A +M`^``"">]`"".)0`D#`!*E0*`("$0`/_MKB``+(XC`!B.8@`DK&(``!``_^2N +M-0`8$`#_N(Q3`"`"@"`A#``-H0(`*"&.@ALX4$``&(XB`!Q2```6CB(`'(X" +M`#P``A9",$(``11```D"@"`ACB8`&(XG`#".*``D#`!*_@(`*"%40``*CB(` +M'`*`("$,`"EL/`6``(X"`#`"@"`A/`6```P`*3RN(@`PCB(`'"1"``$20``* +MKB(`'(XB`"2.1`!0``(0P`!2$"&40P`P)(0``:Y$`%`D8P`!I$,`,!``_Y>. +M%0`L)[W_\*^R``BOOP`,K[$`!*^P``",H@!4%$``!P"`D"$DL0!]`!",P@`LC,4` +M6`)`("&,4``@K$```*Q``"`,``]+```X(8XB`!P"`#`A)$+__Q1`__2N(@`< +M$`#_ZZX@`!@GO?_@K[0`$*^S``ROL0`$K[\`%*^R``BOL```C-``,(RB`"2, +MPP!`CA(`4``"$,``H(@A`D(H(20"``(`@*`A$&(`.22S`#".(P`4C&(`/`1" +M`"V,8@`@C@(`/#P#`@".!P`L`$,0):X"`#R.(@`] +M`""L8````&`H(:XB`!0"@"`A#``*8ZQ@`"`0`/_.C@(`/)2C`#".0@!4)`8` +M`:YF``0`0Q`AKD(`5*9C``*.`P`\/`6'_S2E__\``Q;",$(`#R1"``$P0@`/ +M``(6P`!E&"0`8A@EK@,`/(R"&V@``Q[",&,`#P!#$"M40``%CD(`5(R"&K14 +M0``1C((%@(Y"`%268P`")`7__R1"__^N0@!4CH(%A"1C__^F8P`")$(``0P` +M5NZN@@6$`H`@(0P`#]X"0"@A$`#_QB0"__\D0@`!K((%@(X"`#P``A;",$(` +M#Q!&``8`````C@,`*)!B``$T0@`($`#_DJ!B``$,``[T`@`H(1``__BF(@`T +M)[W_\*^Q``2OL```K[\`"`"@@"&.`P!`C*4`,"0"``$`@(@A$&(`3HRD`%". +M(AMH$$``1@``$"%0@`!%C[\`"(RB`"B00@`!,$(`!!!``"6.`P`@$&``/0`` +M$"&,<``LC@(`,(Q"`"B00@`6,$(`#Q!``#LF!``(,((`#R0#__`D0@`G`(,@ +M)`!#*"0`A1`A`$00*Q1```<`@!@AO)$``"2$`!``91`A`$00*Q!`__L````` +M`B`@(0(`*"$,`$Z')`8``1!``"$D`O__C@(`,(Q"`"B00@`!,$(`!!1`_]V. +M`P`@$&``&0``$"&,<``L)`3_\"8#``@P8@`/)$(`)P!D&"0`1"@D`&40(0!# +M$"L40``'`&`@(;QQ```D8P`0`(40(0!#$"L00/_[``````(@("$"`"@A#`!. +MAR0&``$D`___``(8"P!@$"&/OP`(C[$`!(^P```#X``()[T`$!``__H``!`A +M)[W_T*^Q`"0`H(@AK[(`**^P`""OOP`L#`!PM0"`D"&.,``4$@``&0````". +M0@2PCD,$M(X$`%0D8P`!+&4``0!%$"&N0@2PKD,$M!2``!]`!`0`/_JK@(`4`P`<9P` +M````)`,``11#__,D!``"$`#_W``````GO?_PK[````"`@"$DA``\K[\`#*^Q +M``2OL@`(#`!QC@"@B"$,`'"U`````(X%`$2,HP``$&``'(RB``2L8@`$C*(` +M!"8$`%2,L@`($B```ZQ#``",H@`,KB(``(X"`%`D`___K*```*RB``2.`@!0 +MK*,`"*X%`%"L10``#`!QHZR@``P,`'"Z``````)`$"&/OP`,C[(`"(^Q``2/ +ML````^``"">]`!`0`/_EK@(`2">]_^"OOP`4K[``$(R0``2OH```)@0`/`P` +M<:H#H"@ACZ(```(`("$40``()Z4`!(^B``!40/_X)@0`/(^_`!2/L``0`^`` +M"">]`"`,`!%+`````!``__>/H@``)[W_\"2E__^OL0`$K[\`#*^R``BOL``` +M+*(`&0"`B"$00``4C)(`!#P#@`(`!1"`)&,(X`!#$"&,0@```$``"`````", +MA```#``;"B0%`!$`0(`A)D8$@`!`("$D!0$X#``;/@````".)```#``:O0(` +M*"&/OP`,C[(`"(^Q``2/L````^``"">]`!```#`A`D`@(0P`+H$D!0`"CB0` +M``P`&PHD!0`2`$"`(29&!(@`0"`A$`#_ZB0%``B,A```#``;"B0%`!..)``` +M`$"`(20"`@`0`/_EK@(```P`$ZB,A``$$`#_Y(^_``P,`!/`C(0`!!``_^"/ +MOP`,)[W_T*^S`!ROOP`@K[(`&*^Q`!2OL``0C)(`!`"`F"$#H"@A`F`@(0P` +M$4LF41?L`B`@(0P`<<(`0(`A`D`@(0P`%&TD!0`!CZ8```(`*"$,`!&.`F`@ +M(0)`("$,`!1M```H(0P`<=`"("`A$`#_[0.@*"$GO?_@K[0`$*^S``ROOP`< +MK[8`&*^U`!2OL@`(K[$`!*^P``",D0`$``"@(0``F"&.(A?@5$``"HXB%]PF +M,!K(#`!QP@(`("$,`''0`@`@(8XB%^!00/_Z)C`:R(XB%]P00``X`````"8V +M&N`,`''"`L`@(8XC'*0D`@`#$&(`-0`````D!0`!`B`@(0P`%&TF,AK()C4: +MA`P`<]__"OOP``C*(`!`"@("$``#`A +MC$(7Q"0%`!@40``$```X(8^_```#X``()[T`$`P`$1D`````$`#_^X^_```G +MO?_P`*`@(0``,"$D!0`9K[\```P`$1D``#@AC[\```/@``@GO0`0)[W_\*^_ +M``BOL0`$K[```(R0``0,`'%9`("((0!`("$,`'%7)@4;7(X$&UP\!8``)@<8 +M""8(&!`"(#`A#`!Q822E20P,`'%<`````"1C`,@L90#(C@08"`!%$"$D"``` +M)`D`R`!`,"$,`'%T`&`X(8X$&UP\!8``)@<80"8(&$@"(#`A#`!Q822E24P, +M`'%<`````"1C`,B.!!A`+&4`R`!%$"$`0#`A)`@``"0)`,@,`'%T`&`X(8^_ +M``B/L0`$C[````/@``@GO0`0)[W_X"2"`$0D@P!,K[$`!`"`B"&OOP`8K[4` +M%*^S``ROL@`(K[0`$*^P```DA``\KB(`2*XC`%```"@AKB``1*X@`$PF,P!4 +M#`!QAXXT``0"8"`A#`!QAP``*"$``*@A``"0(0P`>EH).<)1"4(9+@E:VS``B`P(20)"``,`'#+ +M)`0``8X$;+@,`'#D/!"``CP%@``\!X`"/`B``CP+@`(F"GE@)*5'-"3G"50E +M"&U@)6MY:"0$``$"(#`A#`!PRR0)#``,`'#DC@1Y8`P`$ET"("`A`J`0(8^_ +M`!B/M0`4C[0`$(^S``R/L@`(C[$`!(^P```#X``()[T`(!``__4D%0`")[W_ +MT*^P`!``H(`AK[\`(*^S`!ROL@`8`("8(:^Q`!0,`'%"KZ``!`P`*.@"`"`A +M%$``$B02``$,`'%0`F`@(20"``$20@`)``````)`$"&/OP`@C[,`'(^R`!B/ +ML0`4C[``$`/@``@GO0`P#`!Q20)@("$0`/_V`D`0(0(`("$#H"@A#``H[2>F +M``0`0(@A,$(``11``%`"`"`A,B(`(%1``$:.`@2$,B((`!1``#X"`"`A,B(` +M0!1``#<"`"`A/`(`!`(B$"040``O`@`@(3(B`(`00``2`````(X"&\Q00``B +MC@48G(^B``0P0@`(5$``&HX%&42/H@`$,$(`!%1``!*.!1D,CZ(`!#!"``)4 +M0``*C@48U"0"_W\"(H@D$B#_Q:^@``".`AV$)!(``P!1$"40`/_`K@(=A`P` +M2IP"`"`A$`#_]20"_W\,`$J<`@`@(1``_^V/H@`$#`!*G`(`("$0`/_ECZ(` +M!(^B``0`LA@$`$,0)!!`_^D`````$`#_[@`````,`"EL/`4`!!``_]`R(@"` +M#``I;"0%`$`0`/_(/`(`!`P`2@HD!0`!)`+W_Q``_[\"(H@D`@`@(20%`"`D +M0@`!#``I;*X"!(00`/^V,B((``P`*6PD!0`!$`#_KS(B`"`GO?_@K[0`$*^R +M``BOL```K[\`%*^S``ROL0`$C,,] +M`"`,`#>``````%1```..!``$$`#_Z0)3D"4``#`A```X(0P`$1DD!0`#4$#_ +MY`)`*"$0`/_A`E.0)2>]__"OL```K[\`!(R"%^`00``/`("`(8R"%]P00``, +M)`(``HR#'*008@`))`(``1!B``B/OP`$#`!PM0`````,`##@`@`@(0P`<+H` +M````C[\`!(^P```#X``()[T`$">]_]"OL0`DK[\`+*^R`"BOL``@C((7X!!` +M`"8`@(@AC((7W!!``",D`@`"C(,)`(``1``_]RN(AL<)[W_X"0#``&OLP`,K[(`"*^Q``2O +ML```K[\`$`"@D"$`P)@A`("`(1"C`$8``(@A4*``,(R"'*0D`@`"$*(`$R0" +M``,0H@`,`````%(@``&N$ARD5F```:YQ``"/OP`0C[,`#(^R``B/L0`$C[`` +M``/@``@GO0`@#``4K"0%``(D$0`6$`#_\0`"B`H,`"EL/`6```(`("$,`!2L +M```H(201`!8"`"`A#``(E0`"B`HD!0`!#``*2`(`("&.`@`$#``="HQ$```, +M`%&4`@`@(0(`("&N`!?@#``I/#P%@``"`"`A#``4K"0%``$0`/_7`````!!# +M``D``````@`@(0``*"$,`!2L`````%1`_\\D$0`6$`#_S0````",@A?@4$#_ +M]P(`("&,@@`$#``=&(Q$```,`''0)@0:X!``__`"`"`AC((7X%1```2,@@`$ +M`@`@(1``_^LD!0`!#``="HQ$```,`''")@0:X!``__D"`"`A)[W_\*^P```P +ML`#_K[\`#*^R``BOL0`$``"0(0P`<+4`@(@A#`!Q-``````2```:CB(]`!`,`#3E)`8``8X#%]PD +M$@`6$&``!``"D`J.`A?@$%$`&3P%@``60/_O)`(``8X#'*A08@`/C@(%)`8``1!```0`0)`A)!(`%A9` +M_[X"0!`A`@`@(1``_]]__`D@@`4 +M)(,`'*^R``BOL```K[\`#*^Q``0`@(`AK((`&*R#`""L@``4K(``'```D"$, +M`'I7)`0`#`!`B"$2(``1)`(``@(@("$``"@A#`!PJB0&``R.`@`@)E(``2I# +M``*N$0`@KB```*XB``048/_PK%$``"8$``P,`'&'```H(0``$"&/OP`,C[(` +M"(^Q``2/L````^``"">]`!`GO?_PK[\``(R&`!R,R```$0``$0"`."&,P@`$ +MK0(`!(SB`!B,PP`$).0`#*S"``2,X@`8K&@``*S%``BLP```K.8`&`P`<:.L +M1@``C[\```/@``@GO0`0C,(`!!``__"L@@`@)[W_\*^Q``0`@(@A)(0`#*^_ +M``@,`'&.K[````P`<+4`````CB0`%(R%```0H``3C((`!*RB``2.(@`@C(,` +M!(R0``BL@@`$CB(`(*QE``"N)``@K(```*R```@,`'"ZK$0```(`$"&/OP`( +MC[$`!(^P```#X``()[T`$!``_^ZN(@`8,*8`#R>]_?`D`O_P),,`3Z^T`@`` +M8A@D`*"@(0"B*"0`HQ`AK[$!]*^_`@ROM@((K[4"!*^S`?ROL@'XK[`!\`!% +M$"L`@(@AC),`!(R6``"OH`"TKZ``H!1```<`H"`AO+$``"2E`!``@Q`A`$40 +M*Q!`__L`````CH,``"QB`$%40``1CH(`#`!F$"$D0@`/)`/_\`!#*"0"@Q@D +M`&40(0!#$"L40``'`&`@(;QQ```D8P`0`(40(0!#$"L00/_[`````(Z"``P4 +M0`.[CI``!```J"$F!?__+*(`0Q!``!L\`X`"``40@"1C"80`0Q`AC$(```!` +M``@`````)Z4`H">F`*0,`!MH`H`@(0*`("$GI0"@#``;:">F`*@"@"`A)Z4` +MH`P`&V@GI@"L`H`@(2>F`+`,`!MH)Z4`H`(@("$"8"@A#``'PR>F`+02H``' +M`L`@(8Z"``@"H"@AKJ(`"(^B`+0,`!J]KJ(`#(^_`@R/M@((C[4"!(^T`@"/ +MLP'\C[(!^(^Q`?2/L`'P`^``"">]`A`"@"`A)Z4`H`P`&V@GI@"XCZ8`N`(@ +M("$"8"@A#``&\">G`+00`/_D``````)@("$,`%>0)Z4`M!``_]\``````H`@ +M(2>E`*`,`!MH)Z8`O(^E`+P"8"`A)Z8`P```."$,`%!<)Z@`Q(^E`,`,`!LW +M`J`@(8^B`,`00``1CZ4`O`*@("$GI0#(#``;5R>F`,R/I0"\CZ<`R`)@("$G +MI@#0#`!07">H`,2/I0#0`J`@(0P`&V$`````$`#_OP`````"8"`A)Z8`P">G +M`-0,`%!<)Z@`Q(^E`-0"H"`A#``;-P`````0`/^T`````">E`*`GI@#8#``; +M:`*`("$"@"`A)Z4`H`P`&V@GI@#F`.B/ +MI0#8CZ<`Z`)@("$0`/_U```P(0*`("$GI0"@#``;:">F`.R/I0#L`F`@(2>F +M`/```#@A#`!8(2>H`/2/I0#P#``;-P*@("&/H@#P4$``#H^E`.P"H"`A)Z4` +M^`P`&UF`/`GIP$`#`!8(2>H`/2/I0$`$`#_N@*@("$"("`A)`4``0``,"$, +M`!$9```X(1``_VH``````F`@(0P`!O,GI0"T/`2``@P`<'0DA`ET$J#_:X^_ +M`@P,`"YR`F`@(0*@("$0`/^F`$`H(0)@("$,``E`+00`/].`````">E`*`GI@$$ +M#``;:`*`("$"@"`A)Z4`H`P`&V@GI@$(`H`@(2>E`*`,`!MH)Z8!#`*`("$G +MI0"@#``;F`1"/I0$$CZ8!"(^G`1`,`%#?`F`@(1``_S<`````)Z4`H">F +M`10,`!MH`H`@(0*`("$GI0"@#``;:">F`1@"@"`A)Z4`H`P`&V@GI@$E`*`,`!MH)Z8!/(^E +M`3P"8"`A#``4$">F`+00`/\#``````*`("$GI0"@#``;:">F`42/I0%$#``' +MW0)@("$0`/[Z`````">E`*`GI@%(#``;:`*`("$"@"`A)Z4`H`P`&V@GI@%, +MCZ4!2(^F`4P,``@6`F`@(1``_NP`````)Z4`H">F`5`,`!MH`H`@(0*`("$G +MI0"@#``;:">F`50"@"`A)Z4`H`P`&V@GI@%8`H`@(2>E`*`,`!MH)Z8!7(^E +M`5"/I@%4CZF`6`,`!MH`H`@ +M(0*`("$GI0"@#``;:">F`60GL``0`H`@(2>E`*`,`!MR)Z8!:`(`("$``"@A +M#`!PJB0&`!R/HP%DCZ(!:)>E`6("8"`A`@`P(:^B`!2OHP`D#`!/@*^C`!P0 +M`/ZX``````*`("$GI0"@#``;:">F`6R/I@%L`F`@(0P`3\@``"@A$`#^K@`` +M```,`!VR`F`@(1``_JH``````H`@(2>E`*`,`!MH)Z8!<(^E`7`,`"F>`F`@ +M(1``_J$`````)Z0`,```*"$,`'"J)`8`!@*`("$GI0"@#``;:">F`70"@"`A +M)Z4`H`P`&V@GI@%X`H`@(2>E`*`,`!MH)Z8!?`*`("$GI0"@#``;F`8"/ +MI@&`EZ4`-```@"&4QP`4E,0`!"3#``@XX@`'$*0`,P!B@`L`P(@ACZ,!="QB +M``040``8``,0P`!#$"$``A#``$,0(P`"$(`"8A`A)$/[F"0"``<0X@`B)`(` +M!*1B`18D`@`#$.(`&B0"`!`0X@`8)`(`$5#B`!>48@$6).+__BQ"``(40``" +M)`0`""0$``2D9`$8#``(E0)@("&.8AM4`F`@(0(@,"$D0@`!KF(;5(^E`72/ +MJ`%X#``IO`(`."$,``A^`F`@(1``_ED`````E&(!%B1"``00`/_HI&(!%J1@ +M`1@0`/_KI&`!%I>C`#*4P@`"%&+_S`#`B"&7HP`PE,(``!1B_\<``(@A$`#_ +MQX^C`70GI0"@)Z8!A`P`&V@"@"`A`H`@(2>E`*`,`!MH)Z8!B`*`("$GI0"@ +M#``;:">F`8R/IP&,CZ4!A(^F`8@,`"P_`F`@(8^C`80``A0```(D`RQB``04 +M0/XQ``,0P`!#$"$``A#``$,0(P`"$(`"8A`A$`#^*J1$_*P"@"`A)Z4`H`P` +M&V@GI@%`CZ4!0`P`5W\"8"`A$`#^(0`````GI0"@)Z8!D`P`&V@"@"`A`H`@ +M(2>E`*`,`!MH)Z8!E`*`("$GI0"@#``;:">F`9@"@"`A)Z4`H`P`&V@GI@&< +M)Z4`H">F`9P"@"`A#``;:(^P`9P"@"`A)Z4`H`P`&W(GI@&@CZ8!E(^G`9B/ +MJ`&@CZD!D`)@("$"`%`A#`!0$@``*"$0`/W^`````">E`*`GI@&D#``;:`*` +M("$"@"`A)Z4`H`P`&W(GI@&HCZ4!J`P`+2("8"`A$`#]\0`````GL``X`F`@ +M(0P`+>T"`"@A`J`@(0(`,"$D!0`(#``;/@`````0`/WF``````P`+@0"8"`A +M$`#]X@`````D`@`"KF(;L`P`+A("8"`A$`#]W``````GI0"@)Z8!K`P`&V@" +M@"`A`H`@(2>E`*`,`!MH)Z8!L">E`*`GI@&P`H`@(0P`&VB/L`&P`H`@(2>E +M`*`,`!MR)Z8!M(^C`:PD`O__$&(`)0`#$,``0Q`A``(0P`!#$"./I0&T``(0 +M@`)B$"$D1@`0`*88)3!C``,D1``($&``'R2G`"``X!@AB*(``)BB``.(IP`$ +MF*<`!XBH``B8J``+B*D`#)BI``^HP@``N,(``ZC'``2XQP`'J,@`"+C(``NH +MR0`,N,D`#R2E`!`4H__N),8`$("B``"@P@``#`!2Q0(`*"$6`/VACZ4!M`P` +M+BX"8"`A$`#]G0````",H@``C*,`!(RH``B,J0`,K,(``*S#``2LR``(K,D` +M#"2E`!`4I__V),8`$!``_^H``````H`@(2>E`*`,`!MH)Z8!N(Z"``P00``? +MCZ,!N"0"``408@`()`(`!!1B_80"8"`A```P(0P`+H$D!0`$$`#^(0*@("$" +M8"`A)Z8`0`P`+H$D!0`%CZ(`0">F`%@"H"`AKZ(`6(^B`$0D!0`4KZ(`7(^B +M`$BOH@!@CZ(`3*^B`&27H@!2IZ(`:)>B`%80`/^"IZ(`:H^E`;@"8"`A#``N +M@0``,"$0`/UE``````P`+PX"8"`A$`#^`P*@("$GI0"@)Z8!O`P`&V@"@"`A +M`H`@(2>E`*`,`!MH)Z8!P(^E`;R/I@'`#``RH0)@("$0`/U3``````P`,XT" +M8"`A$`#]3P`````"@"`A)Z4`H`P`&V@GI@'DCZ4!Y`P`,\$"8"`A$`#]1@`` +M```"@"`A)Z4`H`P`&V@GI@'HCF8<_(^E`>@,`#,5`F`@(1``_3RN8AS\)Z4` +MH">F`30,`!MH`H`@(0*`("$GI0"@#``;:">F`3B/I0$TCZ8!.`P`-@4"8"`A +M$`#]+@`````GI0"@)Z8!+`P`&V@"@"`A`H`@(2>E`*`,`!MH)Z8!,(^E`2R/ +MI@$P#``V#@)@("$0`/T@``````P`2'\"8"`AKF(%L"9E&W`,`#KG`F`@(1`` +M_1@`````)[`!Q`*`("$GI0"@#``;:`(`,"$"@"`A)Z4`H`(`,"$,`!MHE[(! +MQB>E`*`GI@'(`H`@(0P`&VB7L0'&`H`@(2>E`*`,`!MH)Z8!S`*`("$GI0"@ +M#``;:">F`=`"@"`A)Z4`H`P`&V@"`#`A`@`P(0*`("$GI0"@#``;:(^P`<2/ +MIP'(CZ@!S(^I`="/JP'$)Z(`M`)@("$"0"@A`B`P(0(`4"&OH@``#`!7EZ^@ +M``00`/SJ``````P`.F<"8"`A$`#\Y@`````"@"`A)Z4`H`P`&V@GI@'4CZ4! +MU`P`0=<"8"`A$`#\W0`````"@"`A)Z4`H`P`&V@GI@'8CZ(!V`*`("$GI0"@ +M``*`P`("@",,`!MH)Z8!W``0B("/H@'<`G&((28Q&E`*"N +M(@`$#``;:">F`=R/H@'<`H`@(2>E`*"OH@"`)Z8!W`P`&VBN(@`(CZ(!W`*` +M("$GI0"@KZ(`A">F`=P,`!MHKB(`#(^B`=P`$(#``H`@(:^B`)`GI0"@KB(` +M$">F`=P,`!MH`G"`(280&'B/H@'F`20"@"`A#``;:(^P`20" +M@"`A)Z4`H`P`&W(GI@$HCZ8!*``0$,``4!`CC,,````"$(``4Q`AK$,9R(S# +M``0D0AG()`<``:Q#``2,PP`(`@F`>"/HP'@`F`@(0`#$,``0Q`C``(0P`!3$"$, +M`$J'C$48G!``_&T``````H`@(2>E`*`,`!MH)Z8![)>B`>X0`/QFIF(;\`+` +M("$,`!L*`@`H(11`_$,`0*@A)`(``A``_&:OH@"T)[W_\*^Q``2OOP`(`("( +M(0P`]__"OL@`(K[$`!*^P``"OOP`,`("`(0P`%4,\ +M$H`#/`6``#P'@`(\"(`"/`N``P!`B"$F2HH()*5F;`(`,"$DYPJ0)0AZ""5K +MBA`D!``!$$``""0)$``"(!`AC[\`#(^R``B/L0`$C[````/@``@GO0`0#`!P +MRP`````,`'#DCD2*"!``__4"(!`A)`(``:R"`#`\`H`"K$5$1#P"@`*L140\ +M`^``"```$"$GO?_0K[0`(*^R`!BOL0`4K[``$*^_`"0\$(`"K[,`'(X%,N`\ +M!H``/`>```"`B"$DQFI0```@(23G:K@GJ@`!)Z@`!`P`66L#H$@A/`*``HQ4 +M1$`\`H`"C$9$.(X#,N"3H@``CZ4`!*QQ``"@8@`(K&4`!).B``&.!#+@``"0 +M(:""``F.`C+@K$8`$*Q4``P\$X`"CG`RX`P`>E<"@"`ACF,RX``2B(`",(`A +MK@(`%`(CB"&.)``4#``;'B92``$J0@`"5$#_\SP3@`*.9#+@#``:VB02``\\ +M$(`"C@(RX"92__\,`'I7C$0`#(X$,N`,`!KW`$`H(09#__@\$(`"C@(RX(^_ +M`"2/M``@C[,`'(^R`!B/L0`4C[``$`/@``@GO0`P)[W_T#"B``\D0@!-)`/_ +M\*^R`!@`H)`A`$,H)`)#&"0`91`A`$,0*Z^Q`!2OOP`@`("((:^S`!ROL``0 +M%$``!P!@("&\<0``)&,`$`"%$"$`0Q`K$$#_^P````"20@`!DD0``)(C`$`0 +M@P`2,%,``8XC`#B.(@`\K&```(XD`#0D0@`!$(``!:XB`#P,`!LIC)```!8` +M__T"`"`AKB``1*X@`#2B(`!`DD(``!1``$(`````DD(``%1```6.(@!$KC(` +M-*XR`#BN(`!$CB(`1)9#``*.)``X`$,0(:R2``"N(@!$%F``"ZXR`#B2(@!` +M)$(``:(B`$"/OP`@C[,`'(^R`!B/L0`4C[``$`/@``@GO0`PKD```(XC``". +M(@`THB``0"1D`"0D4@`$KB``-`.@*"&,<``$#`!QJJ^@``".0P`()`(`$!!B +M``J/H@``5$``"8XB``".`A?8)`,``5!#``6.(@``C@(:M!!#`` +M`D`H(0P`<=`"`"`A$`#_TH^_`"`,`!LI`D`@(1``_\Z/OP`@)[W_\*^_```0 +MX``-,*(`_Q!```8`P"@A#``:(@````"/OP```^``"">]`!",A```#``5:P#` +M*"$0`/_ZC[\``!!```4`P"`A#``;*0`````0`/_TC[\```P`&QX`P"`A$`#_ +M\(^_```GO?_P,*(`_Z^_```40``&`,`H(0P`&Q8`````C[\```/@``@GO0`0 +MC((```P`":*,1``$$`#_^H^_```GO?_PK[\``(RG``",A``$`*`P(0P`6@0` +M`"@AC[\```/@``@GO0`0)[W_\*^_```\`H`"C$(RY`"@,"$00``+D(4`,Y3" +M``(D1P`$#`!:!(R$``2/OP``)`0``3P#@`*L9#+D`^``"">]`!`0`/_W)`<' +M("2"`!PGO?_PK(``)```*"&OOP``#`!QAP!`("&/OP```^``"">]`!`GO?_P +MK[````"`@"$DA``]__"OOP`$K[````P`&N0`H(`AK%``!(^_``2/L``` +M)`,`(*Q#```#X``()[T`$">]__"LH``$K[\```P`&O<`````C[\```/@``@G +MO0`0)[W_\*^_```\`H`"C$(RX`"`,"$``"@A#`!9[HQ$``2/OP```^``"">] +M`!`GO?_PK[\``#P"@`*,0S+@`(`P(3P"B(B090`SC&0`!#1"B(@,`%GNK,(` +M`(^_```#X``()[T`$(R"````@A`AK$4``(R"```D0@`$`^``"*R"```GO?_P +MK[\`"*^Q``2OL````("((8R$````H(`A)`+__`(D("$`P"@AK)````(`,"$D +MA``$)A```PP`<)T"`H`DCB(``(^_``@`4!`A)$(`!*XB``"/L```C[$`!`/@ +M``@GO0`0C(,``"0"`@``0Q`C$*```@"#("&LI```5,```:S"```#X``(```` +M`(R#```DI0`#)`+__`"B*"0`91@A`^``"*R#```0H``"```8(8RC````@Q`A +MC$(`(!"@``(D8P`$K*,```/@``BLP@``C*(```""("$0P``")(0`(*S$```# +MX``(`````">]__"OOP`$K[````P`:_(`@(`A)`,``:X#``RN`@``K@``"*X` +M``2/OP`$C[````/@``@GO0`0)[W_\*^P``"OOP`$C((`.`"`@"$40``F)`0` +M`0P`:LDD!``!#`!K\@````"N`@`L#`!K]20$``*.`@`````H(0P`%-^,1``$ +M%$``$P````".`@`P%$``#```("&.`@`X%$``!0``("&/OP`$C[````/@``@G +MO0`0#`!K#P`````0`/_ZC[\`!`P`:P$`````$`#_\XX"`#@,`&OUC@0`+`P` +M:LD``"`A$`#_[8X"`#@,`&L/`````!``_]@`````)[W_\*^P``"OOP`$C((` +M.`"`@"$40``=)`0``8X"```D!0`!#``4WXQ$``000``%`````(^_``2/L``` +M`^``"">]`!`,`&OUC@0`+`P`:LD``"`AC@(`,!1```@D!``!C@(`.!!`__,` +M`"`A#`!K#P`````0`/_PC[\`!`P`:P$`````$`#_]XX"`#@,`&L/`````!`` +M_^*.`@``)[W_\*^P``"OOP`(K[$`!(S#`"@D`@`!$&(`!@#`@"&/OP`(C[$` +M!(^P```#X``()[T`$*S``#P,`'$T``````P`&[<"`"`AC@(`*!1``"```"`A +M$(``$`````".`@`\/`,``C1C2?`D0@`!K@(`/(X"`#P`8A@K$&``!P````". +M`@``C$(`!(Q1%^@D`@`!$B(`"@`````,`!S\C@0`!"0$``4,`'%)``````P` +M<3L`````$`#_VX^_``@,`!N'`@`@(20$``L0`/_VKA$`*`P`'0..!``$#``= +M(XX$``0\`P`"`$`@(1!```XT8TGPC@(`/"1"``&N`@`\C@(`/`!B$"M00``( +MC@(`*(X"``",0@`$C$,7Z"0"``$08O_-`````(X"`"@40/_I`````!``_\@` +M````)[W_\*^Q``2OL````*"((:^_``@,`'%"`("`(0(`("$"(#`A#``;W@`` +M*"&/OP`(C[$`!(^P```D`@`!`^``"">]`!`GO?_PK[```#P'@```@(`A/`B` +M`"2)`"0DB@`().=PL"0$``LE"&]X```H(:^_``0,`'$(`@`P(8X"`"040``% +M`$`@(8^_``2/L````^``"">]`!`,`'$F`````!``__J/OP`$)[W_\"0#``&O +ML```K[\`"*^Q``00HP`1`("`(5"@`!*,@@`H)`(``A"B``PD`@`#4*(`!HR" +M`"B/OP`(C[$`!(^P```#X``()[T`$%1`__JL@``H$`#_^8^_``BN```\$`#_ +M]H^_``@40/_TC[\`"(R"``",0@`$C%$7Z%8C__"/L0`$#``<]8R$``0,`'%" +M)`0`!0P`&X<"`"`AKA$`*`P`<4DD!``+$`#_Y(^_``@GO?_PK[(`"`"`D"$D +M!`!`K[$`!*^P``"OOP`,#`!Z5P"@B"$`0(`A$@``%```$"$``"@A)`8`0`P` +M<*H"`"`A)@0`+*X2``"N$0`$#``;>:X``"@,`'%))`0`!`P`'#T"`"`AC@0` +M!#P%@``DI7%8#``]`!``0/@)C(0`+!``__N/ +MOP``)[W_\*^_``",@@`H%$``!"0%``&/OP```^``"">]`!``0/@)C(0`+!`` +M__N/OP``)[W_\*^_``",@@`H%$``!"0%``*/OP```^``"">]`!``0/@)C(0` +M+!``__N/OP``)[W_\*^_``",@@`H%$``!"0%``./OP```^``"">]`!``0/@) +MC(0`+!``__N/OP``)[W_\*^_``2OL````("`(8R$``2N!@`L/`:``*X%`"@D +MQG*<#`!9U```*"&.!``$/`:``"3&]__"OOP``#`!:SXR$``2/OP`` +M`^``"">]`!`GO?_PK[\```P`6N",A``$C[\```/@``@GO0`0)[W_\*^_``2O +ML````("`(0P`6M>,A``$#``<_`(`("$,`!T#`@`@(8^_``2/L````^``"">] +M`!`GO?_PK[```*^_``0,`!SU`("`(0P`6MN.!``$C[\`!(^P```#X``()[T` +M$">]__"OOP``#`!:](R$``2/OP```^``"">]`!",@@`````H(8Q"0"`P1@#_ +M/`.``@`%$(`D8S,P`$,@(92"```DI0`!$,(`!2RC``A48/_X/`.``@/@``@` +M`!`A`^``")2"``(D`A0`I((`"B0""9ZD@@`()`(`!:2"`!0D`@`$K((`8"0" +M`!ZD@@`<)`()*J2"`'0D`@`'K((`>"0"``\D`P`")`4``20&``,D!P`\H((` +M4R0"$`"LA0!(H(8`?*"#`'VL@@!4I(<`6JR```2@@P`6H(``%ZR%`'"LA@`` +MK(``:*R``&RL@`!,K(``9*R``#2D@`!]_^"O +ML````("`(20$'`!`&"$``(`A/`*``B12,N@`$!#``%(0(91"```00P`& +M)`(`"280``$J`@`)%$#_]SP"@`(D`@`)$@(`%20#``$,`'I7)`0`O*XB&_00 +M0``0)`/__P``*"$D!@"\#`!PJ@!`("$,`!T\)B0;:``0$,``4A`AC$(`!`!` +M^`D"("`A%$``"P!`@"&N<0```@`8(8^_`!"/LP`,C[(`"(^Q``2/L````&`0 +M(0/@``@GO0`@#`!Z:HXD&_00`/_SKB`;]!``__(D$``")[W_\"0%``X``#`A +MK[(`"*^Q``2OL```K[\`#`P`'B``(40`!K)!0$```4 +M$$`D4?Z`#`!Z5P(@("$`0)@A$$#_YB0$``("(#`A`$`@(0P`<*H``"@AC@(; +M]"01`,`"-!@KK%,`M!!@``P"8)`A`B`H(0(`("$"H#`A#``LKR8Q``$40``* +M`C08*Y>B``*F0@``%&#_]B92``("@"@A#``@YP)@("$00``*`````!)@``8D +M!0`6#`!Z:@)@("&.`AOTK$``M"0%`!80`/_#`*`@(0P`>EB``(0`/^,`H*@)2Q"``440/]U)`0`%A``_VX"`"`A+((``A1`_W`D +M!``6$`#_#S0"@``GO?_PK[$`!*^P``"OOP`,K[(`"(R"&_0`@(@A)`0`(`P` +M>E>,4@"T$$``%P!`@"$`0"`A```H(0P`<*HD!@`@CB(;]`(`*"$"("`A#`!( +M#JQ0``0``(`A`@`H(0(@("$,`"F>)A```2H"`(`40/_[`@`H(8XE&_0,`#\Y +M`B`@(11```\`````$D```P`````,`'IJ`D`@(0P`'WP"("`A)`0`%H^_``R/ +ML@`(C[$`!(^P````@!`A`^``"">]`!`,`#3``B`@(0P`+V0"("`ACB0;]#P# +M@`(D8RRT/!"``CP'@``\"(``/`J``ZR#`!BN(A?$)@E'L"3G2\`E"$VH)4JA +M8```*"$"(#`A#`!Q"```("$,`'$FC@1'L`P`<4D``"`A#`!Z:@)`("&.(QOT +M)`(`"@``("&L8@!H$`#_V:Q@`+0GO?_@K[0`$*^_`!2OLP`,K[(`"*^Q``2O +ML```C)(;](Y0```2```=`("@(8X$``04@`!!`````(X$``@4@``Z`````(X$ +M``P4@``S`````(X$`!`4@``L````````F"$"`(@ACB(`%"9S``$40``B`$`@ +M(8XB`!PF,0`,%$``&@!`("$N8@`#5$#_]XXB`!0,`'IJ`@`@(:Y```".1``$ +M%(``#0`````"@"`A#``_1@)`*"&/OP`4C[0`$(^S``R/L@`(C[$`!(^P```` +M`!`A`^``"">]`"`,`'IJ`````!``__&N0``$#`!Z:@`````0`/_E+F(``PP` +M>FH`````$`#_W8XB`!P,`'IJ``"8(1``_]0"`(@A#`!Z:@`````0`/_,C@0` +M$`P`>FH`````$`#_Q8X$``P,`'IJ`````!``_[Z.!``(C(,;]"0"``XD8P`T +M`^``"``#$`LGO?_0K[0`(*^R`!BOL``0K[\`)*^S`!ROL0`4C)$;]"0%`+\# +MH#`ACB(```"`D"&GH``$#``LKXQ3``0F,``T%$``I@!`H"&.0AOTEZ,``(Q" +M``"N(P`TE$(``"Q"4`,40`"_)Z8`!`)`("$,`"RO)`4`RA1``)D`0*`AEZ(` +M!#!"#\```A%"-$(``:X"`#R.0AOTC$(``)1"```L0E`!$$``IR>F``*GH``" +MEF(`$I9D`!"68P`4``(0@`""("4``QC`EF4```"#("4T@@`"`$4@"I9C``(` +M@"@A-*(`$)>D````0R@*,*(``11```.N!```)`+__0"B*"0PH@`(%$``!"0" +M"0@D`O_O`*(H)"0""0BF`@!$ED(<]C!"`/`L0@`P$$``A*X%``260QSP)`(` +M!Q!B``4D`@G$)`(`"A!B``(D`@G$)`(*K*8"`$:7J``")`(3.*8"`$`D`A?4 +MI@(`0C$#``(D`@`!K@(`8*X``%P48``(```P(99#'/`L8@`&4$``!"0&``$D +M`@`%4&(`8I9#'/*61!SP)`(``:X&`%@L@P`&K@(`4*X``$P08`!8```P(20" +M``50@@!2ED(<\C$$__\`!!!".$(``20'``$P0@`!,0,``:X&`%2N`@!(K@<` +M"*X'``P48``#```P(3"B``D``C`K``00PCA"``$P0@`!,0,`!*X&`!"N`@`4 +M%&```P``,"$PH@`)``(P*Y9B``:.9``8``49`C!C``&N!@`8K@,`(*X'`"2N +M`@`HK@<`'!"```0``"@ACF(`'%1```,D`@`!)`4``20"``$Q`P'PK@(`,*X% +M`"P48``"``,1`B0"``HQ`_``$&``'ZX"`#0``QL")`(``0!B$`2N`@`XCD(; +M](Q#``"7H@`$,$(/P``"(4*48@``+$)0`Q1```.N!``\-((``:X"`#R"8@`@ +M`D`@(:X"`&2"8@`A#``?SJX"`&@"@!`AC[\`)(^T`""/LP`]`#`0`/_D)`(`@"Q"``@40/^N,03__Q``_ZLD!@`!)`(``A!B +M``,L8@`$5$#_G)9$'/`0`/^9)`8``1``_X0D`@G$`D`@(0P`+*\D!0#)%$#_ +MXP!`H"&7H@`"$`#_5*9B`#@"0"`A#``LKR0%`,H40/_;`$"@(9>B``0P0@P` +M``(90JX#`#P0`/]"IZ(`!">]_]"OLP`B +M``"3HP`!``(2`J(#``"B`@`!%(#_\B80``*20P`+)`(`_Q!B``H``(@AHD`` +M#(^_`""/LP`] +M__"OL````("`(:^_``0,`'I7)`0!6*X"``000`!")`,``@!`("$``"@A#`!P +MJB0&`5@,`'I7)`0#9*X"``@00``Y)`,``@!`("$``"@A#`!PJB0&`V2."0`( +M)`(`"B0(``FE(@`4)`(``Z4B`AXE(P`<)`(`"R4(__^D8@``!0'__21C`#0` +M`$`A`2`X(3P#@`(\`H`"``@@0"1C%X0D0A=\`((0(0"#&"&41@``E&,``"4( +M``$`B2`A)`(`"RD%``.D@P(@I(8")J3B`C*DX@+.%*#_[B3G`#0,`'I7)`0` +MB*X"``P00``/)`,``@!`("$``"@A#`!PJB0&`(@,`'I7)`0(`*X"`!`00``& +M)`,``@!`("$``"@A#`!PJB0&"````!@AC[\`!(^P````8!`A`^``"">]`!`G +MO?_@K[\`$*^S``ROL@`(K[$`!*^P``",@AOT`*!((3##__^,4P``EF(``"Q" +M,`,40``ICG``")8&`!0``)`A`D80*U!``!"6`@`4`@`X(0`#$$``21`AE$@` +M`"92``(D8P`!,00`_P`($@("1B@KI.(``*3D``(P8___%*#_]"3G``26`@`4 +M$$``#```D"$"`(@AEB4``)9D`````#`A#``HGB92``&6`P`4IB(```)#&"L4 +M8/_W)C$``H^_`!"/LP`,C[(`"(^Q``2/L````^``"">]`"```Q!``$40(91( +M```D8P`!,&/__P!@*"$`"#%```@8@@`($D(PQ@!_,&,`?P`%($"F!@`$I@(` +M`*8#``(`B2`AE(@``"2E``$PH___`&`@(0`($L(`""C```@9`@#","4PI0!_ +M,&,`?P`$$$"F!0`(I@8`!*8#``8`21`AE$@``"2$``$P@___`&`@(0`($T(` +M"#A```@9@@"B*"4PYP!_,&,`?P`$$$"F!P`,I@4`"*8#``H`21`AE$@``"2$ +M``$PA/__``@I@``(,\(`"!("``@80C"E`'\P0@!_`.8X)3!C`'\`!"!`I@4` +M$J8"``ZF!P`,I@,`$`")("&4B`````@2@@"B*"40`/^HI@4`$B>]_\"OMP`L +MK[4`)*^Q`!2OOP`TK[X`,*^V`"BOM``@K[,`'*^R`!BOL``0C((;]##&__^O +MI0``C%0``*^F``0``+@ACH(`!(Z2``@``(@AE%X`$@``J"$D`@`!```@(1*B +M`'>/HP`$4J``<997`!0D`@`"$J(`9P`````2X`!5``"P(0`#$$"/HP```("8 +M(0!#@"&68@``)B<`"*8B``"6"@``)A```@`*((``"BD"``HR@C"E`#\PA``_ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 11:43:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BC4D106566B; Sat, 4 Apr 2009 11:43:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 598B88FC16; Sat, 4 Apr 2009 11:43:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34BhXHx070331; Sat, 4 Apr 2009 11:43:33 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34BhWVA070325; Sat, 4 Apr 2009 11:43:32 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <200904041143.n34BhWVA070325@svn.freebsd.org> From: Randall Stewart Date: Sat, 4 Apr 2009 11:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190689 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 11:43:33 -0000 Author: rrs Date: Sat Apr 4 11:43:32 2009 New Revision: 190689 URL: http://svn.freebsd.org/changeset/base/190689 Log: Many bug fixes (from the IETF hack-fest): - PR-SCTP had major issues when skipping through a multi-part message. o Did not look at socket buffer. o Did not properly handle the reassmebly queue. o The MARKED segments could interfere and un-skip a chunk causing a problem with the proper FWD-TSN. o No FR of FWD-TSN's was being done. - NR-Sack code was basically disabled. It needed fixes that never got into the real code. - CMT code had issues when the two paths were NOT the same b/w. We found a few small bugs, but also the critcal one here was not dividing the rwnd amongst the paths. Obtained from: Michael Tuexen and myself at the IETF hack-fest ;-) Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Apr 4 11:23:00 2009 (r190688) +++ head/sys/netinet/sctp_indata.c Sat Apr 4 11:43:32 2009 (r190689) @@ -423,12 +423,13 @@ abandon: if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { nr_tsn = chk->rec.data.TSN_seq; - if (nr_tsn >= asoc->nr_mapping_array_base_tsn) { + if ((compare_with_wrap(nr_tsn, asoc->nr_mapping_array_base_tsn, MAX_TSN)) || + (nr_tsn == asoc->nr_mapping_array_base_tsn)) { nr_gap = nr_tsn - asoc->nr_mapping_array_base_tsn; } else { nr_gap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + nr_tsn + 1; } - if ((nr_gap >= (SCTP_NR_MAPPING_ARRAY << 3)) || + if ((nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3)) || (nr_gap >= (uint32_t) (asoc->nr_mapping_array_size << 3))) { /* * EY The 1st should never happen, as in @@ -440,10 +441,11 @@ abandon: * nr_mapping_array is always expanded when * mapping_array is expanded */ + printf("Impossible nr_gap ack range failed\n"); } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); - if (nr_tsn > asoc->highest_tsn_inside_nr_map) + if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } } @@ -550,7 +552,9 @@ abandon: } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); - if (nr_tsn > asoc->highest_tsn_inside_nr_map) + if (compare_with_wrap(nr_tsn, + asoc->highest_tsn_inside_nr_map, + MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } } @@ -699,7 +703,7 @@ protocol_error: } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); - if (nr_tsn > asoc->highest_tsn_inside_nr_map) + if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } } @@ -760,7 +764,8 @@ protocol_error: } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); - if (nr_tsn > asoc->highest_tsn_inside_nr_map) + if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, + MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } } @@ -2390,6 +2395,15 @@ finish_express_del: } SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->mapping_array, gap); + + if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && + asoc->peer_supports_nr_sack && + (SCTP_BASE_SYSCTL(sctp_do_drain) == 0)) { + SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, gap); + if (compare_with_wrap(tsn, asoc->highest_tsn_inside_nr_map, MAX_TSN)) { + asoc->highest_tsn_inside_nr_map = tsn; + } + } /* check the special flag for stream resets */ if (((liste = TAILQ_FIRST(&asoc->resetHead)) != NULL) && ((compare_with_wrap(asoc->cumulative_tsn, liste->tsn, MAX_TSN)) || @@ -2498,9 +2512,9 @@ sctp_sack_check(struct sctp_tcb *stcb, i int slide_from, slide_end, lgap, distance; /* EY nr_mapping array variables */ - int nr_at; - int nr_last_all_ones = 0; - int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; + /* int nr_at; */ + /* int nr_last_all_ones = 0; */ + /* int nr_slide_from, nr_slide_end, nr_lgap, nr_distance; */ uint32_t old_cumack, old_base, old_highest; unsigned char aux_array[64]; @@ -2683,102 +2697,19 @@ sctp_sack_check(struct sctp_tcb *stcb, i asoc->cumulative_tsn, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT); } - } - } - /* - * EY if doing nr_sacks then slide the nr_mapping_array accordingly - * please - */ - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { - - nr_at = 0; - for (nr_slide_from = 0; nr_slide_from < stcb->asoc.nr_mapping_array_size; nr_slide_from++) { - - if (asoc->nr_mapping_array[nr_slide_from] == 0xff) { - nr_at += 8; - nr_last_all_ones = 1; - } else { - /* there is a 0 bit */ - nr_at += sctp_map_lookup_tab[asoc->nr_mapping_array[nr_slide_from]]; - nr_last_all_ones = 0; - break; - } - } - - nr_at++; - - if (compare_with_wrap(asoc->cumulative_tsn, - asoc->highest_tsn_inside_nr_map, MAX_TSN) && (at >= 8)) { - /* The complete array was completed by a single FR */ - /* higest becomes the cum-ack */ - int clr; - - clr = (nr_at >> 3) + 1; - - if (clr > asoc->nr_mapping_array_size) - clr = asoc->nr_mapping_array_size; - - memset(asoc->nr_mapping_array, 0, clr); - /* base becomes one ahead of the cum-ack */ - asoc->nr_mapping_array_base_tsn = asoc->cumulative_tsn + 1; - asoc->highest_tsn_inside_nr_map = asoc->cumulative_tsn; - - } else if (nr_at >= 8) { - /* we can slide the mapping array down */ - /* Calculate the new byte postion we can move down */ - /* - * now calculate the ceiling of the move using our - * highest TSN value + * EY if doing nr_sacks then slide the + * nr_mapping_array accordingly please */ - if (asoc->highest_tsn_inside_nr_map >= asoc->nr_mapping_array_base_tsn) { - nr_lgap = asoc->highest_tsn_inside_nr_map - - asoc->nr_mapping_array_base_tsn; - } else { - nr_lgap = (MAX_TSN - asoc->nr_mapping_array_base_tsn) + - asoc->highest_tsn_inside_nr_map + 1; - } - nr_slide_end = nr_lgap >> 3; - if (nr_slide_end < nr_slide_from) { -#ifdef INVARIANTS - panic("impossible slide"); -#else - printf("impossible slide?\n"); - return; -#endif - } - if (nr_slide_end > asoc->nr_mapping_array_size) { -#ifdef INVARIANTS - panic("would overrun buffer"); -#else - printf("Gak, would have overrun map end:%d nr_slide_end:%d\n", - asoc->nr_mapping_array_size, nr_slide_end); - nr_slide_end = asoc->nr_mapping_array_size; -#endif - } - nr_distance = (nr_slide_end - nr_slide_from) + 1; - - if (nr_distance + nr_slide_from > asoc->nr_mapping_array_size || - nr_distance < 0) { - /* - * Here we do NOT slide forward the array so - * that hopefully when more data comes in to - * fill it up we will be able to slide it - * forward. Really I don't think this should - * happen :-0 - */ - ; - } else { - int ii; - - for (ii = 0; ii < nr_distance; ii++) { + if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) { + for (ii = 0; ii < distance; ii++) { asoc->nr_mapping_array[ii] = - asoc->nr_mapping_array[nr_slide_from + ii]; + asoc->nr_mapping_array[slide_from + ii]; } - for (ii = nr_distance; ii <= nr_slide_end; ii++) { + for (ii = distance; ii <= slide_end; ii++) { asoc->nr_mapping_array[ii] = 0; } - asoc->nr_mapping_array_base_tsn += (nr_slide_from << 3); + asoc->nr_mapping_array_base_tsn += (slide_from << 3); } } } @@ -2802,7 +2733,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i * EY if nr_sacks used then send an nr-sack , a sack * otherwise */ - if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack) + if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && stcb->asoc.peer_supports_nr_sack) sctp_send_nr_sack(stcb); else sctp_send_sack(stcb); @@ -3496,9 +3427,13 @@ sctp_handle_segments(struct mbuf *m, int /* * All chunks NOT UNSENT * fall through here and are - * marked + * marked (leave PR-SCTP + * ones that are to skip + * alone though) */ - tp1->sent = SCTP_DATAGRAM_MARKED; + if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + tp1->sent = SCTP_DATAGRAM_MARKED; + if (tp1->rec.data.chunk_was_revoked) { /* deflate the cwnd */ tp1->whoTo->cwnd -= tp1->book_size; @@ -5798,7 +5733,9 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); - if (nr_tsn > asoc->highest_tsn_inside_nr_map) + if (compare_with_wrap(nr_tsn, + asoc->highest_tsn_inside_nr_map, + MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } @@ -5901,7 +5838,8 @@ sctp_kick_prsctp_reorder_queue(struct sc } else { SCTP_TCB_LOCK_ASSERT(stcb); SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, nr_gap); - if (nr_tsn > asoc->highest_tsn_inside_nr_map) + if (compare_with_wrap(nr_tsn, asoc->highest_tsn_inside_nr_map, + MAX_TSN)) asoc->highest_tsn_inside_nr_map = nr_tsn; } @@ -5963,6 +5901,91 @@ sctp_kick_prsctp_reorder_queue(struct sc } } +static void +sctp_flush_reassm_for_str_seq(struct sctp_tcb *stcb, + struct sctp_association *asoc, + uint16_t stream, uint16_t seq) +{ + struct sctp_tmit_chunk *chk, *at; + + if (!TAILQ_EMPTY(&asoc->reasmqueue)) { + /* For each one on here see if we need to toss it */ + /* + * For now large messages held on the reasmqueue that are + * complete will be tossed too. We could in theory do more + * work to spin through and stop after dumping one msg aka + * seeing the start of a new msg at the head, and call the + * delivery function... to see if it can be delivered... But + * for now we just dump everything on the queue. + */ + chk = TAILQ_FIRST(&asoc->reasmqueue); + while (chk) { + at = TAILQ_NEXT(chk, sctp_next); + if (chk->rec.data.stream_number != stream) { + chk = at; + continue; + } + if (chk->rec.data.stream_seq == seq) { + /* It needs to be tossed */ + TAILQ_REMOVE(&asoc->reasmqueue, chk, sctp_next); + if (compare_with_wrap(chk->rec.data.TSN_seq, + asoc->tsn_last_delivered, MAX_TSN)) { + asoc->tsn_last_delivered = + chk->rec.data.TSN_seq; + asoc->str_of_pdapi = + chk->rec.data.stream_number; + asoc->ssn_of_pdapi = + chk->rec.data.stream_seq; + asoc->fragment_flags = + chk->rec.data.rcv_flags; + } + asoc->size_on_reasm_queue -= chk->send_size; + sctp_ucount_decr(asoc->cnt_on_reasm_queue); + + /* Clear up any stream problem */ + if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != + SCTP_DATA_UNORDERED && + (compare_with_wrap(chk->rec.data.stream_seq, + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered, + MAX_SEQ))) { + /* + * We must dump forward this streams + * sequence number if the chunk is + * not unordered that is being + * skipped. There is a chance that + * if the peer does not include the + * last fragment in its FWD-TSN we + * WILL have a problem here since + * you would have a partial chunk in + * queue that may not be + * deliverable. Also if a Partial + * delivery API as started the user + * may get a partial chunk. The next + * read returning a new chunk... + * really ugly but I see no way + * around it! Maybe a notify?? + */ + asoc->strmin[chk->rec.data.stream_number].last_sequence_delivered = + chk->rec.data.stream_seq; + } + if (chk->data) { + sctp_m_freem(chk->data); + chk->data = NULL; + } + sctp_free_a_chunk(stcb, chk); + } else if (compare_with_wrap(chk->rec.data.stream_seq, seq, MAX_SEQ)) { + /* + * If the stream_seq is > than the purging + * one, we are done + */ + break; + } + chk = at; + } + } +} + + void sctp_handle_forward_tsn(struct sctp_tcb *stcb, struct sctp_forward_tsn_chunk *fwd, int *abort_flag, struct mbuf *m, int offset) @@ -5992,13 +6015,14 @@ sctp_handle_forward_tsn(struct sctp_tcb */ struct sctp_association *asoc; uint32_t new_cum_tsn, gap; - unsigned int i, cnt_gone, fwd_sz, cumack_set_flag, m_size; + unsigned int i, fwd_sz, cumack_set_flag, m_size; + uint32_t str_seq; struct sctp_stream_in *strm; struct sctp_tmit_chunk *chk, *at; + struct sctp_queued_to_read *ctl, *sv; cumack_set_flag = 0; asoc = &stcb->asoc; - cnt_gone = 0; if ((fwd_sz = ntohs(fwd->ch.chunk_length)) < sizeof(struct sctp_forward_tsn_chunk)) { SCTPDBG(SCTP_DEBUG_INDATA1, "Bad size too small/big fwd-tsn\n"); @@ -6102,6 +6126,14 @@ sctp_handle_forward_tsn(struct sctp_tcb SCTP_TCB_LOCK_ASSERT(stcb); for (i = 0; i <= gap; i++) { SCTP_SET_TSN_PRESENT(asoc->mapping_array, i); + /* + * EY if drain is off then every gap-ack is an + * nr-gap-ack + */ + if (SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) && asoc->peer_supports_nr_sack + && SCTP_BASE_SYSCTL(sctp_do_drain) == 0) { + SCTP_SET_TSN_PRESENT(asoc->nr_mapping_array, i); + } } /* * Now after marking all, slide thing forward but no sack @@ -6152,7 +6184,6 @@ sctp_handle_forward_tsn(struct sctp_tcb } asoc->size_on_reasm_queue -= chk->send_size; sctp_ucount_decr(asoc->cnt_on_reasm_queue); - cnt_gone++; /* Clear up any stream problem */ if ((chk->rec.data.rcv_flags & SCTP_DATA_UNORDERED) != @@ -6188,45 +6219,17 @@ sctp_handle_forward_tsn(struct sctp_tcb } else { /* * Ok we have gone beyond the end of the - * fwd-tsn's mark. Some checks... + * fwd-tsn's mark. */ - if ((asoc->fragmented_delivery_inprogress) && - (chk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG)) { - uint32_t str_seq; - - /* - * Special case PD-API is up and - * what we fwd-tsn' over includes - * one that had the LAST_FRAG. We no - * longer need to do the PD-API. - */ - asoc->fragmented_delivery_inprogress = 0; - - str_seq = (asoc->str_of_pdapi << 16) | asoc->ssn_of_pdapi; - sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, - stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)&str_seq, SCTP_SO_NOT_LOCKED); - - } break; } chk = at; } } - if (asoc->fragmented_delivery_inprogress) { - /* - * Ok we removed cnt_gone chunks in the PD-API queue that - * were being delivered. So now we must turn off the flag. - */ - uint32_t str_seq; - - str_seq = (asoc->str_of_pdapi << 16) | asoc->ssn_of_pdapi; - sctp_ulp_notify(SCTP_NOTIFY_PARTIAL_DELVIERY_INDICATION, - stcb, SCTP_PARTIAL_DELIVERY_ABORTED, (void *)&str_seq, SCTP_SO_NOT_LOCKED); - asoc->fragmented_delivery_inprogress = 0; - } - /*************************************************************/ - /* 3. Update the PR-stream re-ordering queues */ - /*************************************************************/ + /*******************************************************/ + /* 3. Update the PR-stream re-ordering queues and fix */ + /* delivery issues as needed. */ + /*******************************************************/ fwd_sz -= sizeof(*fwd); if (m && fwd_sz) { /* New method. */ @@ -6235,6 +6238,7 @@ sctp_handle_forward_tsn(struct sctp_tcb offset += sizeof(*fwd); + SCTP_INP_READ_LOCK(stcb->sctp_ep); num_str = fwd_sz / sizeof(struct sctp_strseq); for (i = 0; i < num_str; i++) { uint16_t st; @@ -6251,11 +6255,49 @@ sctp_handle_forward_tsn(struct sctp_tcb stseq->stream = st; st = ntohs(stseq->sequence); stseq->sequence = st; + /* now process */ + + /* + * Ok we now look for the stream/seq on the read + * queue where its not all delivered. If we find it + * we transmute the read entry into a PDI_ABORTED. + */ if (stseq->stream >= asoc->streamincnt) { /* screwed up streams, stop! */ break; } + if ((asoc->str_of_pdapi == stseq->stream) && + (asoc->ssn_of_pdapi == stseq->sequence)) { + /* + * If this is the one we were partially + * delivering now then we no longer are. + * Note this will change with the reassembly + * re-write. + */ + asoc->fragmented_delivery_inprogress = 0; + } + sctp_flush_reassm_for_str_seq(stcb, asoc, stseq->stream, stseq->sequence); + TAILQ_FOREACH(ctl, &stcb->sctp_ep->read_queue, next) { + if ((ctl->sinfo_stream == stseq->stream) && + (ctl->sinfo_ssn == stseq->sequence)) { + str_seq = (stseq->stream << 16) | stseq->sequence; + ctl->end_added = 1; + ctl->pdapi_aborted = 1; + sv = stcb->asoc.control_pdapi; + stcb->asoc.control_pdapi = ctl; + sctp_notify_partial_delivery_indication(stcb, + SCTP_PARTIAL_DELIVERY_ABORTED, + SCTP_HOLDS_LOCK, + str_seq); + stcb->asoc.control_pdapi = sv; + break; + } else if ((ctl->sinfo_stream == stseq->stream) && + (compare_with_wrap(ctl->sinfo_ssn, stseq->sequence, MAX_SEQ))) { + /* We are past our victim SSN */ + break; + } + } strm = &asoc->strmin[stseq->stream]; if (compare_with_wrap(stseq->sequence, strm->last_sequence_delivered, MAX_SEQ)) { @@ -6267,6 +6309,7 @@ sctp_handle_forward_tsn(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_kick_prsctp_reorder_queue(stcb, strm); } + SCTP_INP_READ_UNLOCK(stcb->sctp_ep); } if (TAILQ_FIRST(&asoc->reasmqueue)) { /* now lets kick out and check for more fragmented delivery */ @@ -7067,7 +7110,8 @@ sctp_handle_nr_sack_segments(struct mbuf * fall through here and are * marked */ - tp1->sent = SCTP_DATAGRAM_MARKED; + if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + tp1->sent = SCTP_DATAGRAM_NR_MARKED; if (tp1->rec.data.chunk_was_revoked) { /* deflate the cwnd */ tp1->whoTo->cwnd -= tp1->book_size; @@ -7079,7 +7123,8 @@ sctp_handle_nr_sack_segments(struct mbuf * nr_marked */ if (all_bit) { - tp1->sent = SCTP_DATAGRAM_NR_MARKED; + if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + tp1->sent = SCTP_DATAGRAM_NR_MARKED; /* * TAILQ_REMOVE(&asoc * ->sent_queue, @@ -7198,7 +7243,8 @@ sctp_handle_nr_sack_segments(struct mbuf while (tp1) { if (tp1->rec.data.TSN_seq == j) { if (tp1->sent != SCTP_DATAGRAM_UNSENT) { - tp1->sent = SCTP_DATAGRAM_NR_MARKED; + if (tp1->sent != SCTP_FORWARD_TSN_SKIP) + tp1->sent = SCTP_DATAGRAM_NR_MARKED; /* * TAILQ_REMOVE(&asoc * ->sent_queue, Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Apr 4 11:23:00 2009 (r190688) +++ head/sys/netinet/sctp_input.c Sat Apr 4 11:43:32 2009 (r190689) @@ -3150,8 +3150,10 @@ process_chunk_drop(struct sctp_tcb *stcb (uintptr_t) stcb, tp1->rec.data.TSN_seq); } - sctp_flight_size_decrease(tp1); - sctp_total_flight_decrease(stcb, tp1); + if (tp1->sent < SCTP_DATAGRAM_RESEND) { + sctp_flight_size_decrease(tp1); + sctp_total_flight_decrease(stcb, tp1); + } } { /* audit code */ unsigned int audit; @@ -5606,11 +5608,14 @@ sctp_common_input_processing(struct mbuf /* there was a gap before this data was processed */ was_a_gap = 1; } + stcb->asoc.send_sack = 1; sctp_sack_check(stcb, 1, was_a_gap, &abort_flag); if (abort_flag) { /* Again, we aborted so NO UNLOCK needed */ goto out_now; } + } else if (fwd_tsn_seen) { + stcb->asoc.send_sack = 1; } /* trigger send of any chunks in queue... */ trigger_send: Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Apr 4 11:23:00 2009 (r190688) +++ head/sys/netinet/sctp_output.c Sat Apr 4 11:43:32 2009 (r190689) @@ -1859,1812 +1859,6 @@ struct sack_track sack_array[256] = { } }; -/* EY below are nr_sacks version of the preceeding two data structures, identical except their names */ -#define SCTP_MAX_NR_GAPS_INARRAY 4 -struct nr_sack_track { - uint8_t right_edge; /* mergable on the right edge */ - uint8_t left_edge; /* mergable on the left edge */ - uint8_t num_entries; - uint8_t spare; - struct sctp_nr_gap_ack_block nr_gaps[SCTP_MAX_NR_GAPS_INARRAY]; -}; - -struct nr_sack_track nr_sack_array[256] = { - {0, 0, 0, 0, /* 0x00 */ - {{0, 0}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 1, 0, /* 0x01 */ - {{0, 0}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x02 */ - {{1, 1}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 1, 0, /* 0x03 */ - {{0, 1}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x04 */ - {{2, 2}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x05 */ - {{0, 0}, - {2, 2}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x06 */ - {{1, 2}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 1, 0, /* 0x07 */ - {{0, 2}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x08 */ - {{3, 3}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x09 */ - {{0, 0}, - {3, 3}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x0a */ - {{1, 1}, - {3, 3}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x0b */ - {{0, 1}, - {3, 3}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x0c */ - {{2, 3}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x0d */ - {{0, 0}, - {2, 3}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x0e */ - {{1, 3}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 1, 0, /* 0x0f */ - {{0, 3}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x10 */ - {{4, 4}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x11 */ - {{0, 0}, - {4, 4}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x12 */ - {{1, 1}, - {4, 4}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x13 */ - {{0, 1}, - {4, 4}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x14 */ - {{2, 2}, - {4, 4}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 3, 0, /* 0x15 */ - {{0, 0}, - {2, 2}, - {4, 4}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x16 */ - {{1, 2}, - {4, 4}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x17 */ - {{0, 2}, - {4, 4}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x18 */ - {{3, 4}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x19 */ - {{0, 0}, - {3, 4}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x1a */ - {{1, 1}, - {3, 4}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x1b */ - {{0, 1}, - {3, 4}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x1c */ - {{2, 4}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x1d */ - {{0, 0}, - {2, 4}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x1e */ - {{1, 4}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 1, 0, /* 0x1f */ - {{0, 4}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x20 */ - {{5, 5}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x21 */ - {{0, 0}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x22 */ - {{1, 1}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x23 */ - {{0, 1}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x24 */ - {{2, 2}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 3, 0, /* 0x25 */ - {{0, 0}, - {2, 2}, - {5, 5}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x26 */ - {{1, 2}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x27 */ - {{0, 2}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x28 */ - {{3, 3}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 3, 0, /* 0x29 */ - {{0, 0}, - {3, 3}, - {5, 5}, - {0, 0} - } - }, - {0, 0, 3, 0, /* 0x2a */ - {{1, 1}, - {3, 3}, - {5, 5}, - {0, 0} - } - }, - {1, 0, 3, 0, /* 0x2b */ - {{0, 1}, - {3, 3}, - {5, 5}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x2c */ - {{2, 3}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 3, 0, /* 0x2d */ - {{0, 0}, - {2, 3}, - {5, 5}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x2e */ - {{1, 3}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x2f */ - {{0, 3}, - {5, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x30 */ - {{4, 5}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x31 */ - {{0, 0}, - {4, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x32 */ - {{1, 1}, - {4, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x33 */ - {{0, 1}, - {4, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x34 */ - {{2, 2}, - {4, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 3, 0, /* 0x35 */ - {{0, 0}, - {2, 2}, - {4, 5}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x36 */ - {{1, 2}, - {4, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x37 */ - {{0, 2}, - {4, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x38 */ - {{3, 5}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x39 */ - {{0, 0}, - {3, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 2, 0, /* 0x3a */ - {{1, 1}, - {3, 5}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x3b */ - {{0, 1}, - {3, 5}, - {0, 0}, - {0, 0} - } - }, - {0, 0, 1, 0, /* 0x3c */ - {{2, 5}, - {0, 0}, - {0, 0}, - {0, 0} - } - }, - {1, 0, 2, 0, /* 0x3d */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 12:19:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F59D1065674; Sat, 4 Apr 2009 12:19:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E3FE8FC16; Sat, 4 Apr 2009 12:19:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34CJqc8071064; Sat, 4 Apr 2009 12:19:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34CJq7P071063; Sat, 4 Apr 2009 12:19:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200904041219.n34CJq7P071063@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 4 Apr 2009 12:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190690 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 12:19:53 -0000 Author: kib Date: Sat Apr 4 12:19:52 2009 New Revision: 190690 URL: http://svn.freebsd.org/changeset/base/190690 Log: When removing or renaming snaphost, do not delve into request_cleanup(). The later may need blocks from the underlying device that belongs to normal files, that should not be locked while snap lock is held. Reported and tested by: pho MFC after: 1 month Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sat Apr 4 11:43:32 2009 (r190689) +++ head/sys/ufs/ffs/ffs_softdep.c Sat Apr 4 12:19:52 2009 (r190690) @@ -3309,7 +3309,7 @@ newdirrem(bp, dp, ip, isrmdir, prevdirre * the number of freefile and freeblks structures. */ ACQUIRE_LOCK(&lk); - if (num_dirrem > max_softdeps / 2) + if (!(ip->i_flags & SF_SNAPSHOT) && num_dirrem > max_softdeps / 2) (void) request_cleanup(ITOV(dp)->v_mount, FLUSH_REMOVE); num_dirrem += 1; FREE_LOCK(&lk); From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 15:26:32 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD8B1065675; Sat, 4 Apr 2009 15:26:32 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6D888FC0C; Sat, 4 Apr 2009 15:26:32 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34FQWs4074504; Sat, 4 Apr 2009 15:26:32 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34FQWJu074503; Sat, 4 Apr 2009 15:26:32 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200904041526.n34FQWJu074503@svn.freebsd.org> From: Bruce M Simpson Date: Sat, 4 Apr 2009 15:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190691 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 15:26:36 -0000 Author: bms Date: Sat Apr 4 15:26:32 2009 New Revision: 190691 URL: http://svn.freebsd.org/changeset/base/190691 Log: Do not obliterate QQI with MAXRESP. Found during MLDv2 port. Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sat Apr 4 12:19:52 2009 (r190690) +++ head/sys/netinet/igmp.c Sat Apr 4 15:26:32 2009 (r190691) @@ -1004,8 +1004,8 @@ igmp_input_v3_query(struct ifnet *ifp, c qqi = igmpv3->igmp_qqi; if (qqi >= 128) { - maxresp = IGMP_MANT(igmpv3->igmp_qqi) << - (IGMP_EXP(igmpv3->igmp_qqi) + 3); + qqi = IGMP_MANT(igmpv3->igmp_qqi) << + (IGMP_EXP(igmpv3->igmp_qqi) + 3); } timer = maxresp * PR_FASTHZ / IGMP_TIMER_SCALE; From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 15:32:24 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3933E106566B; Sat, 4 Apr 2009 15:32:24 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D9DD8FC0C; Sat, 4 Apr 2009 15:32:24 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34FWNkJ074652; Sat, 4 Apr 2009 15:32:23 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34FWNEl074651; Sat, 4 Apr 2009 15:32:23 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200904041532.n34FWNEl074651@svn.freebsd.org> From: Bruce M Simpson Date: Sat, 4 Apr 2009 15:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190692 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 15:32:24 -0000 Author: bms Date: Sat Apr 4 15:32:23 2009 New Revision: 190692 URL: http://svn.freebsd.org/changeset/base/190692 Log: Fix mbuf chain layout pessimization: in the case where a single mbuf is allocated due to m_getcl() returning NULL, we already call MH_ALIGN, so do not increment m->m_data in this case. Found during MLDv2 port. Modified: head/sys/netinet/igmp.c Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Sat Apr 4 15:26:32 2009 (r190691) +++ head/sys/netinet/igmp.c Sat Apr 4 15:32:23 2009 (r190692) @@ -2784,8 +2784,11 @@ igmp_v3_enqueue_group_record(struct ifqu m = NULL; m0srcs = (ifp->if_mtu - IGMP_LEADINGSPACE - sizeof(struct igmp_grouprec)) / sizeof(in_addr_t); - if (!is_state_change && !is_group_query) + if (!is_state_change && !is_group_query) { m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m) + m->m_data += IGMP_LEADINGSPACE; + } if (m == NULL) { m = m_gethdr(M_DONTWAIT, MT_DATA); if (m) @@ -2793,7 +2796,6 @@ igmp_v3_enqueue_group_record(struct ifqu } if (m == NULL) return (-ENOMEM); - m->m_data += IGMP_LEADINGSPACE; igmp_save_context(m, ifp); @@ -2909,6 +2911,8 @@ igmp_v3_enqueue_group_record(struct ifqu return (-ENOMEM); } m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m) + m->m_data += IGMP_LEADINGSPACE; if (m == NULL) { m = m_gethdr(M_DONTWAIT, MT_DATA); if (m) @@ -2917,7 +2921,6 @@ igmp_v3_enqueue_group_record(struct ifqu if (m == NULL) return (-ENOMEM); igmp_save_context(m, ifp); - m->m_data += IGMP_LEADINGSPACE; md = m_getptr(m, 0, &off); pig = (struct igmp_grouprec *)(mtod(md, uint8_t *) + off); CTR1(KTR_IGMPV3, "%s: allocated next packet", __func__); @@ -3063,6 +3066,8 @@ igmp_v3_enqueue_filter_change(struct ifq "%s: use previous packet", __func__); } else { m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m) + m->m_data += IGMP_LEADINGSPACE; if (m == NULL) { m = m_gethdr(M_DONTWAIT, MT_DATA); if (m) @@ -3075,7 +3080,6 @@ igmp_v3_enqueue_filter_change(struct ifq } m->m_pkthdr.PH_vt.vt_nrecs = 0; igmp_save_context(m, ifp); - m->m_data += IGMP_LEADINGSPACE; m0srcs = (ifp->if_mtu - IGMP_LEADINGSPACE - sizeof(struct igmp_grouprec)) / sizeof(in_addr_t); From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 15:48:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 747F6106564A; Sat, 4 Apr 2009 15:48:09 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62E2B8FC18; Sat, 4 Apr 2009 15:48:09 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34Fm9GZ074980; Sat, 4 Apr 2009 15:48:09 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34Fm9Hd074979; Sat, 4 Apr 2009 15:48:09 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200904041548.n34Fm9Hd074979@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 4 Apr 2009 15:48:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190693 - head/usr.sbin/fifolog/fifolog_create X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 15:48:10 -0000 Author: ru Date: Sat Apr 4 15:48:09 2009 New Revision: 190693 URL: http://svn.freebsd.org/changeset/base/190693 Log: Fixed NAME section. Modified: head/usr.sbin/fifolog/fifolog_create/fifolog.1 Modified: head/usr.sbin/fifolog/fifolog_create/fifolog.1 ============================================================================== --- head/usr.sbin/fifolog/fifolog_create/fifolog.1 Sat Apr 4 15:32:23 2009 (r190692) +++ head/usr.sbin/fifolog/fifolog_create/fifolog.1 Sat Apr 4 15:48:09 2009 (r190693) @@ -28,7 +28,7 @@ .Os .Dt FIFOLOG 1 .Sh NAME -.Nm fifolog_create , fifolog_write , fifolog_read +.Nm fifolog_create , fifolog_writer , fifolog_reader .Nd "initialize, write, seek and extract data from a fifolog" .Sh SYNOPSIS .Nm fifolog_create @@ -84,7 +84,7 @@ of hand-work all but the first record ca If the .Ar file does not already exist, -.Nm +.Nm fifolog_create will attempt to create and .Xr ftruncate 2 it to the specified size, defaulting to 86400 records of 512 bytes From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 16:03:29 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E0E106566B; Sat, 4 Apr 2009 16:03:29 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1595C8FC08; Sat, 4 Apr 2009 16:03:29 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34G3SXl075322; Sat, 4 Apr 2009 16:03:28 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34G3Sfp075321; Sat, 4 Apr 2009 16:03:28 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200904041603.n34G3Sfp075321@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 4 Apr 2009 16:03:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190694 - head/usr.sbin/jexec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 16:03:29 -0000 Author: ru Date: Sat Apr 4 16:03:28 2009 New Revision: 190694 URL: http://svn.freebsd.org/changeset/base/190694 Log: - Style: size_t can't be negative. - Don't exit with a zero status code when no jails are configured on a system. - Style: simplify some code constructs. - If a single jail cannot be found, let the caller print a nicer diagnostic message. Reviewed by: bz MFC after: 3 days Modified: head/usr.sbin/jexec/jexec.c Modified: head/usr.sbin/jexec/jexec.c ============================================================================== --- head/usr.sbin/jexec/jexec.c Sat Apr 4 15:48:09 2009 (r190693) +++ head/usr.sbin/jexec/jexec.c Sat Apr 4 16:03:28 2009 (r190694) @@ -119,8 +119,8 @@ lookup_jail(int jid, char *jailname) j = len; for (i = 0; i < 4; i++) { - if (len <= 0) - exit(0); + if (len == 0) + return (-1); p = q = malloc(len); if (p == NULL) err(1, "malloc()"); @@ -174,27 +174,21 @@ lookup_jail(int jid, char *jailname) /* NOTREACHED */ break; } - /* Possible match. */ - if (id > 0) { - /* Do we have a jail ID to match as well? */ - if (jid > 0) { - if (jid == id) { - xid = id; - count++; - } - } else { - xid = id; - count++; - } + /* Possible match; see if we have a jail ID to match as well. */ + if (id > 0 && (jid <= 0 || id == jid)) { + xid = id; + count++; } } free(p); - if (count != 1) + if (count == 1) + return (xid); + else if (count > 1) errx(1, "Could not uniquely identify the jail."); - - return (xid); + else + return (-1); } #define GET_USER_INFO do { \ From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 17:01:33 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1974F106564A; Sat, 4 Apr 2009 17:01:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E15C38FC13; Sat, 4 Apr 2009 17:01:32 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34H1Wts076417; Sat, 4 Apr 2009 17:01:32 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34H1WbF076416; Sat, 4 Apr 2009 17:01:32 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200904041701.n34H1WbF076416@svn.freebsd.org> From: Attilio Rao Date: Sat, 4 Apr 2009 17:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190695 - head/sys/dev/acpi_support X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 17:01:33 -0000 Author: attilio Date: Sat Apr 4 17:01:32 2009 New Revision: 190695 URL: http://svn.freebsd.org/changeset/base/190695 Log: - Add the support for the Asus A3F and A3E device - Fix style for A3N and for a comment Submitted by: Akira Funahashi Tested by: Marcin Nowak , Diego Sardina PR: kern/128634 Modified: head/sys/dev/acpi_support/acpi_asus.c Modified: head/sys/dev/acpi_support/acpi_asus.c ============================================================================== --- head/sys/dev/acpi_support/acpi_asus.c Sat Apr 4 16:03:28 2009 (r190694) +++ head/sys/dev/acpi_support/acpi_asus.c Sat Apr 4 17:01:32 2009 (r190695) @@ -176,16 +176,39 @@ static struct acpi_asus_model acpi_asus_ .disp_set = "SDSP" }, { + .name = "A3E", + .mled_set = "MLED", + .wled_set = "WLED", + .lcd_get = "\\_SB.PCI0.SBRG.EC0.RPIN(0x67)", + .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", + .brn_set = "SPLV", + .disp_get = "\\_SB.PCI0.P0P2.VGA.GETD", + .disp_set = "SDSP" + }, + { + .name = "A3F", + .mled_set = "MLED", + .wled_set = "WLED", + .bled_set = "BLED", + .lcd_get = "\\_SB.PCI0.SBRG.EC0.RPIN(0x11)", + .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", + .brn_set = "SPLV", + .disp_get = "\\SSTE", + .disp_set = "SDSP" + }, + { .name = "A3N", .mled_set = "MLED", .bled_set = "BLED", .wled_set = "WLED", - .lcd_get = NULL, + .lcd_get = "\\BKLT", .lcd_set = "\\_SB.PCI0.SBRG.EC0._Q10", + .brn_get = "GPLV", .brn_set = "SPLV", - .brn_get = "SDSP", - .disp_set = "SDSP", - .disp_get = "\\_SB.PCI0.P0P3.VGA.GETD" + .disp_get = "\\_SB.PCI0.P0P3.VGA.GETD", + .disp_set = "SDSP" }, { .name = "A4D", @@ -577,7 +600,7 @@ acpi_asus_probe(device_t dev) return (0); } - /* if EeePC */ + /* EeePC */ if (strncmp("ASUS010", rstr, 7) == 0) { sc->model = &acpi_eeepc_models[0]; device_set_desc(dev, "ASUS EeePC"); @@ -627,6 +650,9 @@ good: else if (strncmp(model->name, "A2x", 3) == 0 && strncmp(Obj->String.Pointer, "A2", 2) == 0) goto good; + else if (strncmp(model->name, "A3F", 3) == 0 && + strncmp(Obj->String.Pointer, "A6F", 3) == 0) + goto good; else if (strncmp(model->name, "D1x", 3) == 0 && strncmp(Obj->String.Pointer, "D1", 2) == 0) goto good; From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 17:03:06 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1654C1065672; Sat, 4 Apr 2009 17:03:06 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id C15DA8FC15; Sat, 4 Apr 2009 17:03:05 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from [10.100.124.124] (port=59186 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Lq8pg-000Dp7-56; Sat, 04 Apr 2009 20:35:00 +0400 Date: Sat, 4 Apr 2009 20:34:41 +0400 From: Ruslan Ermilov To: Warner Losh Message-ID: <20090404163441.GA78727@edoofus.dev.vega.ru> References: <200903190044.n2J0iMlD043003@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903190044.n2J0iMlD043003@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r190007 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 17:03:06 -0000 On Thu, Mar 19, 2009 at 12:44:22AM +0000, Warner Losh wrote: > Author: imp > Date: Thu Mar 19 00:44:22 2009 > New Revision: 190007 > URL: http://svn.freebsd.org/changeset/base/190007 > > Log: > Add usr.bin/ar to the list of cross tools. Before, when we had gnu > ar, it was built in the gnu/usr.bin/binutils tree. Now it isn't. > > Submitted by: John Hein > Please back this change out. 1) ar(1) was moved from cross-tools to bootstrap-tools when we switched to BSD ar. 2) ar(1) isn't a cross-tool as it doesn't test for TARGET{_ARCH,}; all cross-tools do. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 17:05:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 266891065691; Sat, 4 Apr 2009 17:05:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1481A8FC1C; Sat, 4 Apr 2009 17:05:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34H5Hbj076535; Sat, 4 Apr 2009 17:05:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34H5H2N076534; Sat, 4 Apr 2009 17:05:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <200904041705.n34H5H2N076534@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 4 Apr 2009 17:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190696 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 17:05:18 -0000 Author: nwhitehorn Date: Sat Apr 4 17:05:17 2009 New Revision: 190696 URL: http://svn.freebsd.org/changeset/base/190696 Log: Modularize the Macintosh built-in ATA along the lines of the rest of the ATA system as an optional atamacio device. PR: powerpc/133161 Submitted by: Bruce Cran Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Apr 4 17:01:32 2009 (r190695) +++ head/sys/conf/files.powerpc Sat Apr 4 17:05:17 2009 (r190696) @@ -112,9 +112,9 @@ powerpc/mpc85xx/pci_ocp.c optional pci m powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim powerpc/ofw/ofw_syscons.c optional sc aim -powerpc/powermac/ata_kauai.c optional powermac ata -powerpc/powermac/ata_macio.c optional powermac ata -powerpc/powermac/ata_dbdma.c optional powermac ata +powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio +powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio +powerpc/powermac/ata_dbdma.c optional powermac ata | powermac atamacio powerpc/powermac/dbdma.c optional powermac pci powerpc/powermac/grackle.c optional powermac pci powerpc/powermac/hrowpic.c optional powermac pci From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 17:48:38 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D41BB106566C; Sat, 4 Apr 2009 17:48:38 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C30188FC14; Sat, 4 Apr 2009 17:48:38 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34Hmc4v077358; Sat, 4 Apr 2009 17:48:38 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34Hmcie077357; Sat, 4 Apr 2009 17:48:38 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200904041748.n34Hmcie077357@svn.freebsd.org> From: Alexander Kabaev Date: Sat, 4 Apr 2009 17:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190697 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 17:48:39 -0000 Author: kan Date: Sat Apr 4 17:48:38 2009 New Revision: 190697 URL: http://svn.freebsd.org/changeset/base/190697 Log: Revert change 190655 temporarily. It breaks many setups where nullfs is used and needs to be revisited. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Apr 4 17:05:17 2009 (r190696) +++ head/sys/kern/vfs_cache.c Sat Apr 4 17:48:38 2009 (r190697) @@ -971,7 +971,6 @@ vn_vptocnp(struct vnode **vp, char **bp, vdrop(*vp); VFS_UNLOCK_GIANT(vfslocked); if (error) { - CACHE_RLOCK(); numfullpathfail2++; return (error); } @@ -980,6 +979,7 @@ vn_vptocnp(struct vnode **vp, char **bp, CACHE_RLOCK(); if ((*vp)->v_iflag & VI_DOOMED) { /* forced unmount */ + CACHE_RUNLOCK(); vdrop(*vp); return (ENOENT); } From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 18:14:15 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23CED106566C; Sat, 4 Apr 2009 18:14:15 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4008A8FC18; Sat, 4 Apr 2009 18:14:13 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n34IAkCl068644; Sat, 4 Apr 2009 12:10:46 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 04 Apr 2009 12:11:30 -0600 (MDT) Message-Id: <20090404.121130.163263885.imp@bsdimp.com> To: ru@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20090404163441.GA78727@edoofus.dev.vega.ru> References: <200903190044.n2J0iMlD043003@svn.freebsd.org> <20090404163441.GA78727@edoofus.dev.vega.ru> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r190007 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 18:14:16 -0000 In message: <20090404163441.GA78727@edoofus.dev.vega.ru> Ruslan Ermilov writes: : On Thu, Mar 19, 2009 at 12:44:22AM +0000, Warner Losh wrote: : > Author: imp : > Date: Thu Mar 19 00:44:22 2009 : > New Revision: 190007 : > URL: http://svn.freebsd.org/changeset/base/190007 : > : > Log: : > Add usr.bin/ar to the list of cross tools. Before, when we had gnu : > ar, it was built in the gnu/usr.bin/binutils tree. Now it isn't. : > : > Submitted by: John Hein : > : Please back this change out. : : 1) ar(1) was moved from cross-tools to bootstrap-tools when we switched : to BSD ar. : : 2) ar(1) isn't a cross-tool as it doesn't test for TARGET{_ARCH,}; all : cross-tools do. I'll 1/2 back this out. I'll back out this part of the change, but keep the other part which is needed. Warner From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 19:06:53 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D4AE10656BF; Sat, 4 Apr 2009 19:06:53 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4AC8FC25; Sat, 4 Apr 2009 19:06:53 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34J6rch078842; Sat, 4 Apr 2009 19:06:53 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34J6raw078841; Sat, 4 Apr 2009 19:06:53 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <200904041906.n34J6raw078841@svn.freebsd.org> From: Stefan Farfeleder Date: Sat, 4 Apr 2009 19:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190698 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 19:06:55 -0000 Author: stefanf Date: Sat Apr 4 19:06:52 2009 New Revision: 190698 URL: http://svn.freebsd.org/changeset/base/190698 Log: Don't let trailing empty lines overwrite the result of the last command with 0. This affects the built-ins eval, fc, and trap and also the string passed to sh with the -c option. Submitted by: Jilles Tjoelker Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sat Apr 4 17:48:38 2009 (r190697) +++ head/bin/sh/eval.c Sat Apr 4 19:06:52 2009 (r190698) @@ -166,7 +166,8 @@ evalstring(char *s) setstackmark(&smark); setinputstring(s, 1); while ((n = parsecmd(0)) != NEOF) { - evaltree(n, 0); + if (n != NULL) + evaltree(n, 0); popstackmark(&smark); } popfile(); From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 20:08:08 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAF28106564A; Sat, 4 Apr 2009 20:08:08 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7D758FC0A; Sat, 4 Apr 2009 20:08:08 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34K884Q079948; Sat, 4 Apr 2009 20:08:08 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34K88Bv079947; Sat, 4 Apr 2009 20:08:08 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <200904042008.n34K88Bv079947@svn.freebsd.org> From: Tim Kientzle Date: Sat, 4 Apr 2009 20:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190699 - head/lib/libarchive X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 20:08:09 -0000 Author: kientzle Date: Sat Apr 4 20:08:08 2009 New Revision: 190699 URL: http://svn.freebsd.org/changeset/base/190699 Log: Temporary hack to unbreak user/group lookups; use a larger buffer for getpwuid_r/getgrgid_r. This needs to be dynamically sized. Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_read_disk_set_standard_lookup.c Sat Apr 4 19:06:52 2009 (r190698) +++ head/lib/libarchive/archive_read_disk_set_standard_lookup.c Sat Apr 4 20:08:08 2009 (r190699) @@ -182,7 +182,7 @@ lookup_uname(void *data, uid_t uid) static const char * lookup_uname_helper(struct archive *a, id_t id) { - char buffer[64]; + char buffer[512]; struct passwd pwent, *result; int r; @@ -210,7 +210,7 @@ lookup_gname(void *data, gid_t gid) static const char * lookup_gname_helper(struct archive *a, id_t id) { - char buffer[64]; + char buffer[512]; struct group grent, *result; int r; From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 20:58:18 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B618106566C; Sat, 4 Apr 2009 20:58:18 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8098FC08; Sat, 4 Apr 2009 20:58:18 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34KwI5q080903; Sat, 4 Apr 2009 20:58:18 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34KwIjC080902; Sat, 4 Apr 2009 20:58:18 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <200904042058.n34KwIjC080902@svn.freebsd.org> From: "Christian S.J. Peron" Date: Sat, 4 Apr 2009 20:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190700 - head/usr.bin/su X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 20:58:19 -0000 Author: csjp Date: Sat Apr 4 20:58:18 2009 New Revision: 190700 URL: http://svn.freebsd.org/changeset/base/190700 Log: Fixup the parameters to audit_submit(3) the order is errno then return value. This bug went un-noticed for so long because EPERM == 1 MFC after: 1 week Spotted by: sson, rwatson Modified: head/usr.bin/su/su.c Modified: head/usr.bin/su/su.c ============================================================================== --- head/usr.bin/su/su.c Sat Apr 4 20:08:08 2009 (r190699) +++ head/usr.bin/su/su.c Sat Apr 4 20:58:18 2009 (r190700) @@ -231,7 +231,7 @@ main(int argc, char *argv[]) if (strlen(user) > MAXLOGNAME - 1) { #ifdef USE_BSM_AUDIT if (audit_submit(AUE_su, auid, - 1, EPERM, "username too long: '%s'", user)) + EPERM, 1, "username too long: '%s'", user)) errx(1, "Permission denied"); #endif errx(1, "username too long"); @@ -264,7 +264,7 @@ main(int argc, char *argv[]) pwd = getpwuid(ruid); if (pwd == NULL) { #ifdef USE_BSM_AUDIT - if (audit_submit(AUE_su, auid, 1, EPERM, + if (audit_submit(AUE_su, auid, EPERM, 1, "unable to determine invoking subject: '%s'", username)) errx(1, "Permission denied"); #endif @@ -305,7 +305,7 @@ main(int argc, char *argv[]) retcode = pam_authenticate(pamh, 0); if (retcode != PAM_SUCCESS) { #ifdef USE_BSM_AUDIT - if (audit_submit(AUE_su, auid, 1, EPERM, "bad su %s to %s on %s", + if (audit_submit(AUE_su, auid, EPERM, 1, "bad su %s to %s on %s", username, user, mytty)) errx(1, "Permission denied"); #endif @@ -326,7 +326,7 @@ main(int argc, char *argv[]) pwd = getpwnam(user); if (pwd == NULL) { #ifdef USE_BSM_AUDIT - if (audit_submit(AUE_su, auid, 1, EPERM, + if (audit_submit(AUE_su, auid, EPERM, 1, "unknown subject: %s", user)) errx(1, "Permission denied"); #endif @@ -342,7 +342,7 @@ main(int argc, char *argv[]) aerr = pam_strerror(pamh, retcode); if (aerr == NULL) aerr = "Unknown PAM error"; - if (audit_submit(AUE_su, auid, 1, EPERM, + if (audit_submit(AUE_su, auid, EPERM, 1, "pam_chauthtok: %s", aerr)) errx(1, "Permission denied"); #endif @@ -353,7 +353,7 @@ main(int argc, char *argv[]) } if (retcode != PAM_SUCCESS) { #ifdef USE_BSM_AUDIT - if (audit_submit(AUE_su, auid, 1, EPERM, "pam_acct_mgmt: %s", + if (audit_submit(AUE_su, auid, EPERM, 1, "pam_acct_mgmt: %s", pam_strerror(pamh, retcode))) errx(1, "Permission denied"); #endif @@ -368,7 +368,7 @@ main(int argc, char *argv[]) else { if (ruid != 0) { #ifdef USE_BSM_AUDIT - if (audit_submit(AUE_su, auid, 1, EPERM, + if (audit_submit(AUE_su, auid, EPERM, 1, "only root may use -c")) errx(1, "Permission denied"); #endif From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 22:01:44 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DE16106564A; Sat, 4 Apr 2009 22:01:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A59F8FC12; Sat, 4 Apr 2009 22:01:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34M1hpY082134; Sat, 4 Apr 2009 22:01:43 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34M1hHW082133; Sat, 4 Apr 2009 22:01:43 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904042201.n34M1hHW082133@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 4 Apr 2009 22:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190701 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 22:01:44 -0000 Author: marcel Date: Sat Apr 4 22:01:43 2009 New Revision: 190701 URL: http://svn.freebsd.org/changeset/base/190701 Log: Implement kernel core dump support for Book-E processors. Both raw physical memory dumps and virtual minidumps are supported. The default being minidumps. Obtained from: Juniper Networks Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Apr 4 20:58:18 2009 (r190700) +++ head/sys/powerpc/booke/pmap.c Sat Apr 4 22:01:43 2009 (r190701) @@ -39,7 +39,7 @@ * 0x0000_0000 - 0xafff_ffff : user process * 0xb000_0000 - 0xbfff_ffff : pmap_mapdev()-ed area (PCI/PCIE etc.) * 0xc000_0000 - 0xc0ff_ffff : kernel reserved - * 0xc000_0000 - kernelend : kernel code+data, env, metadata etc. + * 0xc000_0000 - data_end : kernel code+data, env, metadata etc. * 0xc100_0000 - 0xfeef_ffff : KVA * 0xc100_0000 - 0xc100_3fff : reserved for page zero/copy * 0xc100_4000 - 0xc200_3fff : reserved for ptbl bufs @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -107,8 +108,19 @@ __FBSDID("$FreeBSD$"); #endif extern struct mtx sched_lock; +extern int dumpsys_minidump; + +extern unsigned char _etext[]; +extern unsigned char _end[]; + /* Kernel physical load address. */ extern uint32_t kernload; +vm_offset_t kernstart; +vm_size_t kernsize; + +/* Message buffer and tables. */ +static vm_offset_t data_start; +static vm_size_t data_end; struct mem_region availmem_regions[MEM_REGIONS]; int availmem_regions_sz; @@ -304,6 +316,11 @@ static void mmu_booke_kenter(mmu_t, vm_ static void mmu_booke_kremove(mmu_t, vm_offset_t); static boolean_t mmu_booke_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t); static boolean_t mmu_booke_page_executable(mmu_t, vm_page_t); +static vm_offset_t mmu_booke_dumpsys_map(mmu_t, struct pmap_md *, + vm_size_t, vm_size_t *); +static void mmu_booke_dumpsys_unmap(mmu_t, struct pmap_md *, + vm_size_t, vm_offset_t); +static struct pmap_md *mmu_booke_scan_md(mmu_t, struct pmap_md *); static mmu_method_t mmu_booke_methods[] = { /* pmap dispatcher interface */ @@ -352,6 +369,11 @@ static mmu_method_t mmu_booke_methods[] MMUMETHOD(mmu_page_executable, mmu_booke_page_executable), MMUMETHOD(mmu_unmapdev, mmu_booke_unmapdev), + /* dumpsys() support */ + MMUMETHOD(mmu_dumpsys_map, mmu_booke_dumpsys_map), + MMUMETHOD(mmu_dumpsys_unmap, mmu_booke_dumpsys_unmap), + MMUMETHOD(mmu_scan_md, mmu_booke_scan_md), + { 0, 0 } }; @@ -884,7 +906,7 @@ pte_find(mmu_t mmu, pmap_t pmap, vm_offs * This is called during e500_init, before the system is really initialized. */ static void -mmu_booke_bootstrap(mmu_t mmu, vm_offset_t kernelstart, vm_offset_t kernelend) +mmu_booke_bootstrap(mmu_t mmu, vm_offset_t start, vm_offset_t kernelend) { vm_offset_t phys_kernelend; struct mem_region *mp, *mp1; @@ -904,47 +926,52 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset tlb0_get_tlbconf(); /* Align kernel start and end address (kernel image). */ - kernelstart = trunc_page(kernelstart); - kernelend = round_page(kernelend); + kernstart = trunc_page(start); + data_start = round_page(kernelend); + kernsize = data_start - kernstart; + + data_end = data_start; /* Allocate space for the message buffer. */ - msgbufp = (struct msgbuf *)kernelend; - kernelend += MSGBUF_SIZE; + msgbufp = (struct msgbuf *)data_end; + data_end += MSGBUF_SIZE; debugf(" msgbufp at 0x%08x end = 0x%08x\n", (uint32_t)msgbufp, - kernelend); + data_end); - kernelend = round_page(kernelend); + data_end = round_page(data_end); /* Allocate space for ptbl_bufs. */ - ptbl_bufs = (struct ptbl_buf *)kernelend; - kernelend += sizeof(struct ptbl_buf) * PTBL_BUFS; + ptbl_bufs = (struct ptbl_buf *)data_end; + data_end += sizeof(struct ptbl_buf) * PTBL_BUFS; debugf(" ptbl_bufs at 0x%08x end = 0x%08x\n", (uint32_t)ptbl_bufs, - kernelend); + data_end); - kernelend = round_page(kernelend); + data_end = round_page(data_end); /* Allocate PTE tables for kernel KVA. */ - kernel_pdir = kernelend; + kernel_pdir = data_end; kernel_ptbls = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS + PDIR_SIZE - 1) / PDIR_SIZE; - kernelend += kernel_ptbls * PTBL_PAGES * PAGE_SIZE; + data_end += kernel_ptbls * PTBL_PAGES * PAGE_SIZE; debugf(" kernel ptbls: %d\n", kernel_ptbls); - debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, kernelend); + debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, data_end); - debugf(" kernelend: 0x%08x\n", kernelend); - if (kernelend - kernelstart > 0x1000000) { - kernelend = (kernelend + 0x3fffff) & ~0x3fffff; - tlb1_mapin_region(kernelstart + 0x1000000, - kernload + 0x1000000, kernelend - kernelstart - 0x1000000); + debugf(" data_end: 0x%08x\n", data_end); + if (data_end - kernstart > 0x1000000) { + data_end = (data_end + 0x3fffff) & ~0x3fffff; + tlb1_mapin_region(kernstart + 0x1000000, + kernload + 0x1000000, data_end - kernstart - 0x1000000); } else - kernelend = (kernelend + 0xffffff) & ~0xffffff; + data_end = (data_end + 0xffffff) & ~0xffffff; - debugf(" updated kernelend: 0x%08x\n", kernelend); + debugf(" updated data_end: 0x%08x\n", data_end); + + kernsize += data_end - data_start; /* * Clear the structures - note we can only do it safely after the * possible additional TLB1 translations are in place (above) so that - * all range up to the currently calculated 'kernelend' is covered. + * all range up to the currently calculated 'data_end' is covered. */ memset((void *)ptbl_bufs, 0, sizeof(struct ptbl_buf) * PTBL_SIZE); memset((void *)kernel_pdir, 0, kernel_ptbls * PTBL_PAGES * PAGE_SIZE); @@ -952,7 +979,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /*******************************************************/ /* Set the start and end of kva. */ /*******************************************************/ - virtual_avail = kernelend; + virtual_avail = round_page(data_end); virtual_end = VM_MAX_KERNEL_ADDRESS; /* Allocate KVA space for page zero/copy operations. */ @@ -980,12 +1007,11 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset ptbl_buf_pool_vabase, virtual_avail); /* Calculate corresponding physical addresses for the kernel region. */ - phys_kernelend = kernload + (kernelend - kernelstart); + phys_kernelend = kernload + kernsize; debugf("kernel image and allocated data:\n"); debugf(" kernload = 0x%08x\n", kernload); - debugf(" kernelstart = 0x%08x\n", kernelstart); - debugf(" kernelend = 0x%08x\n", kernelend); - debugf(" kernel size = 0x%08x\n", kernelend - kernelstart); + debugf(" kernstart = 0x%08x\n", kernstart); + debugf(" kernsize = 0x%08x\n", kernsize); if (sizeof(phys_avail) / sizeof(phys_avail[0]) < availmem_regions_sz) panic("mmu_booke_bootstrap: phys_avail too small"); @@ -2287,6 +2313,140 @@ mmu_booke_dev_direct_mapped(mmu_t mmu, v return (EFAULT); } +vm_offset_t +mmu_booke_dumpsys_map(mmu_t mmu, struct pmap_md *md, vm_size_t ofs, + vm_size_t *sz) +{ + vm_paddr_t pa, ppa; + vm_offset_t va; + vm_size_t gran; + + /* Raw physical memory dumps don't have a virtual address. */ + if (md->md_vaddr == ~0UL) { + /* We always map a 256MB page at 256M. */ + gran = 256 * 1024 * 1024; + pa = md->md_paddr + ofs; + ppa = pa & ~(gran - 1); + ofs = pa - ppa; + va = gran; + tlb1_set_entry(va, ppa, gran, _TLB_ENTRY_IO); + if (*sz > (gran - ofs)) + *sz = gran - ofs; + return (va + ofs); + } + + /* Minidumps are based on virtual memory addresses. */ + va = md->md_vaddr + ofs; + if (va >= kernstart + kernsize) { + gran = PAGE_SIZE - (va & PAGE_MASK); + if (*sz > gran) + *sz = gran; + } + return (va); +} + +void +mmu_booke_dumpsys_unmap(mmu_t mmu, struct pmap_md *md, vm_size_t ofs, + vm_offset_t va) +{ + + /* Raw physical memory dumps don't have a virtual address. */ + if (md->md_vaddr == ~0UL) { + tlb1_idx--; + tlb1[tlb1_idx].mas1 = 0; + tlb1[tlb1_idx].mas2 = 0; + tlb1[tlb1_idx].mas3 = 0; + tlb1_write_entry(tlb1_idx); + return; + } + + /* Minidumps are based on virtual memory addresses. */ + /* Nothing to do... */ +} + +struct pmap_md * +mmu_booke_scan_md(mmu_t mmu, struct pmap_md *prev) +{ + static struct pmap_md md; + struct bi_mem_region *mr; + pte_t *pte; + vm_offset_t va; + + if (dumpsys_minidump) { + md.md_paddr = ~0UL; /* Minidumps use virtual addresses. */ + if (prev == NULL) { + /* 1st: kernel .data and .bss. */ + md.md_index = 1; + md.md_vaddr = trunc_page((uintptr_t)_etext); + md.md_size = round_page((uintptr_t)_end) - md.md_vaddr; + return (&md); + } + switch (prev->md_index) { + case 1: + /* 2nd: msgbuf and tables (see pmap_bootstrap()). */ + md.md_index = 2; + md.md_vaddr = data_start; + md.md_size = data_end - data_start; + break; + case 2: + /* 3rd: kernel VM. */ + va = prev->md_vaddr + prev->md_size; + /* Find start of next chunk (from va). */ + while (va < virtual_end) { + /* Don't dump the buffer cache. */ + if (va >= kmi.buffer_sva && + va < kmi.buffer_eva) { + va = kmi.buffer_eva; + continue; + } + pte = pte_find(mmu, kernel_pmap, va); + if (pte != NULL && PTE_ISVALID(pte)) + break; + va += PAGE_SIZE; + } + if (va < virtual_end) { + md.md_vaddr = va; + va += PAGE_SIZE; + /* Find last page in chunk. */ + while (va < virtual_end) { + /* Don't run into the buffer cache. */ + if (va == kmi.buffer_sva) + break; + pte = pte_find(mmu, kernel_pmap, va); + if (pte == NULL || !PTE_ISVALID(pte)) + break; + va += PAGE_SIZE; + } + md.md_size = va - md.md_vaddr; + break; + } + md.md_index = 3; + /* FALLTHROUGH */ + default: + return (NULL); + } + } else { /* minidumps */ + mr = bootinfo_mr(); + if (prev == NULL) { + /* first physical chunk. */ + md.md_paddr = mr->mem_base; + md.md_size = mr->mem_size; + md.md_vaddr = ~0UL; + md.md_index = 1; + } else if (md.md_index < bootinfo->bi_mem_reg_no) { + md.md_paddr = mr[md.md_index].mem_base; + md.md_size = mr[md.md_index].mem_size; + md.md_vaddr = ~0UL; + md.md_index++; + } else { + /* There's no next physical chunk. */ + return (NULL); + } + } + + return (&md); +} + /* * Map a set of physical memory pages into the kernel virtual address space. * Return a pointer to where it is mapped. This routine is intended to be used From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 22:03:20 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45C921065672; Sat, 4 Apr 2009 22:03:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 190B98FC13; Sat, 4 Apr 2009 22:03:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34M3JDl082221; Sat, 4 Apr 2009 22:03:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34M3JaH082220; Sat, 4 Apr 2009 22:03:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904042203.n34M3JaH082220@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 4 Apr 2009 22:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190702 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 22:03:20 -0000 Author: marcel Date: Sat Apr 4 22:03:19 2009 New Revision: 190702 URL: http://svn.freebsd.org/changeset/base/190702 Log: First round of cleanups. There's a lot of NetBSDism in this header. Modified: head/sys/powerpc/include/intr.h Modified: head/sys/powerpc/include/intr.h ============================================================================== --- head/sys/powerpc/include/intr.h Sat Apr 4 22:01:43 2009 (r190701) +++ head/sys/powerpc/include/intr.h Sat Apr 4 22:03:19 2009 (r190702) @@ -63,48 +63,11 @@ #ifndef LOCORE -#if 0 -/* - * Interrupt handler chains. intr_establish() inserts a handler into - * the list. The handler is called with its (single) argument. - */ -struct intrhand { - int (*ih_fun)(void *); - void *ih_arg; - u_long ih_count; - struct intrhand *ih_next; - int ih_level; - int ih_irq; -}; -#endif - -void setsoftclock(void); -void clearsoftclock(void); -void setsoftnet(void); -void clearsoftnet(void); - void do_pending_int(void); -static __inline void softintr(int); - extern u_int cpl, ipending, tickspending; extern int imask[]; -/* Following code should be implemented with lwarx/stwcx to avoid - * the disable/enable. i need to read the manual once more.... */ -static __inline void -softintr(int ipl) -{ - unsigned int msrsave; - - msrsave = mfmsr(); - mtmsr(msrsave & ~PSL_EE); - - ipending |= 1 << ipl; - - mtmsr(msrsave); -} - #define ICU_LEN 64 /* Soft interrupt masks. */ @@ -113,46 +76,6 @@ softintr(int ipl) #define SIR_SERIAL 30 #define SPL_CLOCK 31 -#if 0 - -/* - * Hardware interrupt masks - */ - -#define splbio() splraise(imask[IPL_BIO]) -#define splnet() splraise(imask[IPL_NET]) -#define spltty() splraise(imask[IPL_TTY]) -#define splaudio() splraise(imask[IPL_AUDIO]) -#define splclock() splraise(imask[IPL_CLOCK]) -#define splstatclock() splclock() -#define splserial() splraise(imask[IPL_SERIAL]) - -#define spllpt() spltty() - -/* - * Software interrupt masks - * - * NOTE: splsoftclock() is used by hardclock() to lower the priority from - * clock to softclock before it calls softclock(). - */ -#define spllowersoftclock() spllower(imask[IPL_SOFTCLOCK]) -#define splsoftclock() splraise(imask[IPL_SOFTCLOCK]) -#define splsoftnet() splraise(imask[IPL_SOFTNET]) -#define splsoftserial() splraise(imask[IPL_SOFTSERIAL]) - -/* - * Miscellaneous - */ -#define splimp() splraise(imask[IPL_IMP]) -#define splhigh() splraise(imask[IPL_HIGH]) -#define spl0() spllower(0) - -#endif /* 0 */ - -#define setsoftclock() softintr(SIR_CLOCK) -#define setsoftnet() softintr(SIR_NET) -#define setsoftserial() softintr(SIR_SERIAL) - #define CNT_IRQ0 0 #define CNT_CLOCK 64 #define CNT_SOFTCLOCK 65 From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 22:05:37 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AF38106566C; Sat, 4 Apr 2009 22:05:37 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D25668FC1C; Sat, 4 Apr 2009 22:05:36 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34M5aAc082303; Sat, 4 Apr 2009 22:05:36 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34M5aob082302; Sat, 4 Apr 2009 22:05:36 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904042205.n34M5aob082302@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 4 Apr 2009 22:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190703 - head/sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 22:05:37 -0000 Author: marcel Date: Sat Apr 4 22:05:36 2009 New Revision: 190703 URL: http://svn.freebsd.org/changeset/base/190703 Log: Add sysarch.h. It's included by drm(4). Added: head/sys/powerpc/include/sysarch.h (contents, props changed) Added: head/sys/powerpc/include/sysarch.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/include/sysarch.h Sat Apr 4 22:05:36 2009 (r190703) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 1993 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_SYSARCH_H_ +#define _MACHINE_SYSARCH_H_ + +#ifndef _KERNEL +#include + +__BEGIN_DECLS +int sysarch(int, void *); +__END_DECLS +#endif + +#endif /* !_MACHINE_SYSARCH_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 22:23:03 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5553106566C; Sat, 4 Apr 2009 22:23:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2F378FC14; Sat, 4 Apr 2009 22:23:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34MN33o082678; Sat, 4 Apr 2009 22:23:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34MN3RG082677; Sat, 4 Apr 2009 22:23:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200904042223.n34MN3RG082677@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 4 Apr 2009 22:23:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190704 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 22:23:04 -0000 Author: marcel Date: Sat Apr 4 22:23:03 2009 New Revision: 190704 URL: http://svn.freebsd.org/changeset/base/190704 Log: Perform a dummy stwcx. when we switch contexts. The context being switched out may hold a reservation. The stwcx. will clear the reservation. This is architecturally recommended. The scenario this addresses is as follows: 1. Thread 1 performs a lwarx and as such holds a reservation. 2. Thread 1 gets switched out (before doing the matching stwcx.) and thread 2 is switched in. 3. Thread 2 performs a stwcx. to the same reservation granule. This will succeed because the processor has the reservation even though thread 2 didn't do the lwarx. Note that on some processors the address given the stwcx. is not checked. On these processors the mere condition of having a reservation would cause the stwcx. to succeed, irrespective of whether the addresses are the same. The dummy stwcx. is especially important for those processors. Modified: head/sys/powerpc/aim/swtch.S Modified: head/sys/powerpc/aim/swtch.S ============================================================================== --- head/sys/powerpc/aim/swtch.S Sat Apr 4 22:05:36 2009 (r190703) +++ head/sys/powerpc/aim/swtch.S Sat Apr 4 22:23:03 2009 (r190704) @@ -155,6 +155,12 @@ cpu_switchin: mtsr USER_SR,%r5 isync lwz %r1,PCB_SP(%r3) /* Load the stack pointer */ + /* + * Perform a dummy stwcx. to clear any reservations we may have + * inherited from the previous thread. It doesn't matter if the + * stwcx succeeds or not. pcb_context[0] can be clobbered. + */ + stwcx. %r1, 0, %r3 blr /* From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 23:12:15 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14DD51065672; Sat, 4 Apr 2009 23:12:15 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBA3E8FC12; Sat, 4 Apr 2009 23:12:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n34NCEn9084038; Sat, 4 Apr 2009 23:12:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n34NCEQF084035; Sat, 4 Apr 2009 23:12:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200904042312.n34NCEQF084035@svn.freebsd.org> From: Alan Cox Date: Sat, 4 Apr 2009 23:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190705 - in head/sys: arm/include i386/include vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2009 23:12:15 -0000 Author: alc Date: Sat Apr 4 23:12:14 2009 New Revision: 190705 URL: http://svn.freebsd.org/changeset/base/190705 Log: Retire VM_PROT_READ_IS_EXEC. It was intended to be a micro-optimization, but I see no benefit from it today. VM_PROT_READ_IS_EXEC was only intended for use on processors that do not distinguish between read and execute permission. On an mmap(2) or mprotect(2), it automatically added execute permission if the caller specified permissions included read permission. The hope was that this would reduce the number of vm map entries needed to implement an address space because there would be fewer neighboring vm map entries that differed only in the presence or absence of VM_PROT_EXECUTE. (See vm/vm_mmap.c revision 1.56.) Today, I don't see any real applications that benefit from VM_PROT_READ_IS_EXEC. In any case, vm map entries are now organized as a self-adjusting binary search tree instead of an ordered list. So, the need for coalescing vm map entries is not as great as it once was. Modified: head/sys/arm/include/vmparam.h head/sys/i386/include/vmparam.h head/sys/vm/vm_mmap.c Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Sat Apr 4 22:23:03 2009 (r190704) +++ head/sys/arm/include/vmparam.h Sat Apr 4 23:12:14 2009 (r190705) @@ -141,8 +141,6 @@ #define SGROWSIZ (128*1024) #define MAXSLP 20 -#define VM_PROT_READ_IS_EXEC - #ifdef ARM_USE_SMALL_ALLOC #define UMA_MD_SMALL_ALLOC #endif /* ARM_USE_SMALL_ALLOC */ Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Sat Apr 4 22:23:03 2009 (r190704) +++ head/sys/i386/include/vmparam.h Sat Apr 4 23:12:14 2009 (r190705) @@ -43,10 +43,6 @@ * Machine dependent constants for 386. */ -#ifndef PAE -#define VM_PROT_READ_IS_EXEC /* if you can read -- then you can exec */ -#endif - /* * Virtual memory related constants, all in bytes */ Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Apr 4 22:23:03 2009 (r190704) +++ head/sys/vm/vm_mmap.c Sat Apr 4 23:12:14 2009 (r190705) @@ -620,10 +620,6 @@ mprotect(td, uap) addr = (vm_offset_t) uap->addr; size = uap->len; prot = uap->prot & VM_PROT_ALL; -#if defined(VM_PROT_READ_IS_EXEC) - if (prot & VM_PROT_READ) - prot |= VM_PROT_EXECUTE; -#endif pageoff = (addr & PAGE_MASK); addr -= pageoff; @@ -1441,14 +1437,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, if (flags & MAP_NOCORE) docow |= MAP_DISABLE_COREDUMP; -#if defined(VM_PROT_READ_IS_EXEC) - if (prot & VM_PROT_READ) - prot |= VM_PROT_EXECUTE; - - if (maxprot & VM_PROT_READ) - maxprot |= VM_PROT_EXECUTE; -#endif - if (flags & MAP_STACK) rv = vm_map_stack(map, *addr, size, prot, maxprot, docow | MAP_STACK_GROWS_DOWN);