From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 00:34:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11E4D106564A; Sun, 20 Jun 2010 00:34:07 +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 008CE8FC13; Sun, 20 Jun 2010 00:34:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K0Y6GB041026; Sun, 20 Jun 2010 00:34:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K0Y6xl041024; Sun, 20 Jun 2010 00:34:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006200034.o5K0Y6xl041024@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 20 Jun 2010 00:34: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: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 00:34:07 -0000 Author: marcel Date: Sun Jun 20 00:34:06 2010 New Revision: 209358 URL: http://svn.freebsd.org/changeset/base/209358 Log: Unbreak platforms with char unsigned by default. Oddly enough, GCC isn't satisfied with a simple cast to int in the check against EOF, so the fix is a bit involved by actually having to go through a temporary variable. Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sat Jun 19 22:13:40 2010 (r209357) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sun Jun 20 00:34:06 2010 (r209358) @@ -67,8 +67,12 @@ * for all subsequent invocations, which is the effect desired. */ #undef unput -#define unput(c) \ - if (c != EOF) yyunput( c, yytext_ptr ) +#define unput(c) \ + do { \ + int _c = c; \ + if (_c != EOF) \ + yyunput(_c, yytext_ptr); \ + } while(0) #endif static int id_or_type(const char *); From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 01:54:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A3E11065672; Sun, 20 Jun 2010 01:54:21 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id BCD4F8FC17; Sun, 20 Jun 2010 01:54:20 +0000 (UTC) Received: by gyh20 with SMTP id 20so2380203gyh.13 for ; Sat, 19 Jun 2010 18:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=5y0jVaXzDDhk/xK9X9e7JLRoYJyK9OIIxlB90/pA6HQ=; b=IWwFEkztBadlA84UI1oRGUBPWH8EQ1YVeYcj3gQSpM4dx2NgH1LWHfe22PTLr70vNw ppYymmgzxD2NaxEcmfRof6UpsWRqpuNPuI3J/HzNoL++aDiBkDGMGyC26DWg8/+fBZ+P kwiqKlOnaEN7hQ+EbeXRO8Ca9/Gt75PmOjDw8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=qCn2dmRQMffJQes46sb0lj0h3bRk0BBHrqu/tcWXUxdkIOWo60InQLUc5E0mV6HDAT 0ZZHuPoBE++PnSk8tJFCNx63OKcA0XN4Xq7isrdpuEosRwCUPrnVGAaSBda82dtV38D+ Oxx/GuX0zJARR8dVWt17q4ag2UaI8L6CYtlpE= Received: by 10.229.222.69 with SMTP id if5mr1674159qcb.201.1276998859548; Sat, 19 Jun 2010 18:54:19 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id bv23sm51186352qcb.13.2010.06.19.18.54.18 (version=SSLv3 cipher=RC4-MD5); Sat, 19 Jun 2010 18:54:18 -0700 (PDT) Date: Sat, 19 Jun 2010 21:54:12 -0400 From: Alexander Kabaev To: Marcel Moolenaar Message-ID: <20100619215412.47fc8ebf@kan.dnsalias.net> In-Reply-To: <201006200034.o5K0Y6xl041024@svn.freebsd.org> References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/LYWkrNXjs7LZSuwH4yMMiq_"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 01:54:21 -0000 --Sig_/LYWkrNXjs7LZSuwH4yMMiq_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 20 Jun 2010 00:34:06 +0000 (UTC) Marcel Moolenaar wrote: > Author: marcel > Date: Sun Jun 20 00:34:06 2010 > New Revision: 209358 > URL: http://svn.freebsd.org/changeset/base/209358 >=20 > Log: > Unbreak platforms with char unsigned by default. Oddly enough, GCC > isn't satisfied with a simple cast to int in the check against EOF, > so the fix is a bit involved by actually having to go through a > temporary variable. Thanks. Strangely enough I only got Garret's email alerting me of this breakage 5 min ago and your timely help is much appreciated. --=20 Alexander Kabaev --Sig_/LYWkrNXjs7LZSuwH4yMMiq_ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iD8DBQFMHXTJQ6z1jMm+XZYRAkrGAKCnUr2jcTuKAnBFeZ0xFgbGRDKtTACeP0Db MWXwSMAbZbvi2TFBiX9++OE= =Rgvv -----END PGP SIGNATURE----- --Sig_/LYWkrNXjs7LZSuwH4yMMiq_-- From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 02:21:53 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D5FD1065670; Sun, 20 Jun 2010 02:21:53 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 390098FC08; Sun, 20 Jun 2010 02:21:52 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 7B2007E84A; Sun, 20 Jun 2010 12:21:51 +1000 (EST) Message-ID: <4C1D7B3B.8080609@freebsd.org> Date: Sun, 20 Jun 2010 12:21:47 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.9) Gecko/20100405 Thunderbird/3.0.4 MIME-Version: 1.0 To: Rui Paulo References: <201006141537.o5EFbnTD093866@svn.freebsd.org> <4C1C3162.60300@freebsd.org> <4C1D000C.8090807@freebsd.org> In-Reply-To: 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: r209158 - in head/contrib/wpa: hostapd hostapd/doc src/common src/crypto src/drivers src/eap_common src/eap_peer src/eap_server src/eapol_supp src/hlr_auc_gw src/l2_packet src/radius sr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 02:21:53 -0000 On 06/20/10 05:22, Rui Paulo wrote: > Lawrence, > I don't see the point in enabling svn:keywords in vendor code. It's actually a good thing that radiotap.h doesn't get expanded. Rui, please accept my apologies. I *actually* understand the problem now as opposed to that lame 3am attempt earlier this morning. I was confused why vendor code would have $FreeBSD$ in it at all (thinking it was somehow a special case) which is why I thought you needed to set the keywords on the two radiotap.h files. I realise now that it's perfectly legit as it is and is that way because Sam pushed that code with the expanded keyword upstream and now we're importing it back in. The real problem is that Hg doesn't know about the svn autoprops during the conversion and my Hg keyword expansion config for $FreeBSD$ doesn't know to ignore $FreeBSD$ in contrib/*. Mea culpa and very sorry for lowering the SNR. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 04:14:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A6541065670; Sun, 20 Jun 2010 04:14:50 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EFFE8FC13; Sun, 20 Jun 2010 04:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K4EoS0089981; Sun, 20 Jun 2010 04:14:50 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K4Eoqn089976; Sun, 20 Jun 2010 04:14:50 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201006200414.o5K4Eoqn089976@svn.freebsd.org> From: Randi Harper Date: Sun, 20 Jun 2010 04:14: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: r209359 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 04:14:50 -0000 Author: randi Date: Sun Jun 20 04:14:49 2010 New Revision: 209359 URL: http://svn.freebsd.org/changeset/base/209359 Log: Clean up item_add and remove -fno-strict-aliasing from CFLAGS. Note that the "aux" value in libdialog is really an opaque pointer, but libdialog stores it as a long for historical reasons. Approved by: cperciva (mentor) Modified: head/usr.sbin/sysinstall/Makefile head/usr.sbin/sysinstall/index.c head/usr.sbin/sysinstall/misc.c head/usr.sbin/sysinstall/sysinstall.h Modified: head/usr.sbin/sysinstall/Makefile ============================================================================== --- head/usr.sbin/sysinstall/Makefile Sun Jun 20 00:34:06 2010 (r209358) +++ head/usr.sbin/sysinstall/Makefile Sun Jun 20 04:14:49 2010 (r209359) @@ -14,7 +14,7 @@ SRCS= anonFTP.c cdrom.c command.c config system.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \ variable.c ${_wizard} keymap.h countries.h -CFLAGS+= -DUSE_GZIP=1 -fno-strict-aliasing +CFLAGS+= -DUSE_GZIP=1 .if ${MACHINE} == "pc98" CFLAGS+= -DPC98 .endif Modified: head/usr.sbin/sysinstall/index.c ============================================================================== --- head/usr.sbin/sysinstall/index.c Sun Jun 20 00:34:06 2010 (r209358) +++ head/usr.sbin/sysinstall/index.c Sun Jun 20 04:14:49 2010 (r209359) @@ -650,8 +650,8 @@ index_menu(PkgNodePtr root, PkgNodePtr t SAFE_STRCPY(buf, kp->desc); if (strlen(buf) > (_MAX_DESC - maxname)) buf[_MAX_DESC - maxname] = '\0'; - nitems = item_add(nitems, kp->name, (char *)buf, pkg_checked, - pkg_fire, pkg_selected, kp, (int *)(&lists), + nitems = item_add(nitems, kp->name, buf, pkg_checked, + pkg_fire, pkg_selected, kp, &lists, &curr, &max); ++n; kp = kp->next; Modified: head/usr.sbin/sysinstall/misc.c ============================================================================== --- head/usr.sbin/sysinstall/misc.c Sun Jun 20 00:34:06 2010 (r209358) +++ head/usr.sbin/sysinstall/misc.c Sun Jun 20 04:14:49 2010 (r209359) @@ -238,7 +238,7 @@ item_add(dialogMenuItem *list, char *pro int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int *aux, int *curr, int *max) + void *data, void *aux, int *curr, int *max) { dialogMenuItem *d; Modified: head/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.h Sun Jun 20 00:34:06 2010 (r209358) +++ head/usr.sbin/sysinstall/sysinstall.h Sun Jun 20 04:14:49 2010 (r209359) @@ -755,7 +755,7 @@ extern dialogMenuItem *item_add(dialogMe int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), - void *data, int *aux, int *curr, int *max); + void *data, void *aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); extern int Mkdir_command(char *key, void *data); From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 06:52:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B4CB1065673; Sun, 20 Jun 2010 06:52:11 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A8EF8FC13; Sun, 20 Jun 2010 06:52:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K6qAvZ025009; Sun, 20 Jun 2010 06:52:10 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K6qAx8025007; Sun, 20 Jun 2010 06:52:10 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201006200652.o5K6qAx8025007@svn.freebsd.org> From: Maxim Konovalov Date: Sun, 20 Jun 2010 06:52:10 +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: r209360 - head/lib/libc/nls X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 06:52:11 -0000 Author: maxim Date: Sun Jun 20 06:52:10 2010 New Revision: 209360 URL: http://svn.freebsd.org/changeset/base/209360 Log: Merge from English r198040: add C message catalogue entries for newer errnos: EBADMSG, EMULTIHOP, ENOLINK, EPROTO, ENOTCAPABLE. PR: docs/147983 Submitted by: pluknet MFC after: 1 week Modified: head/lib/libc/nls/ru_RU.KOI8-R.msg (contents, props changed) Modified: head/lib/libc/nls/ru_RU.KOI8-R.msg ============================================================================== --- head/lib/libc/nls/ru_RU.KOI8-R.msg Sun Jun 20 04:14:49 2010 (r209359) +++ head/lib/libc/nls/ru_RU.KOI8-R.msg Sun Jun 20 06:52:10 2010 (r209360) @@ -183,6 +183,16 @@ $ ENOATTR 87 Атрибут не найден $ EDOOFUS 88 Ошибка программирования +$ EBADMSG +89 Плохой формат сообщения +$ EMULTIHOP +90 Попытка мультихопа +$ ENOLINK +91 Канал разорван +$ EPROTO +92 Ошибка протокола +$ ENOTCAPABLE +93 Недостаточно возможностей $ $ strsignal() support catalog $ From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 08:03:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6733106564A; Sun, 20 Jun 2010 08:03:06 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5CFF8FC17; Sun, 20 Jun 2010 08:03:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K836e2040636; Sun, 20 Jun 2010 08:03:06 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K836vE040634; Sun, 20 Jun 2010 08:03:06 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006200803.o5K836vE040634@svn.freebsd.org> From: Brian Somers Date: Sun, 20 Jun 2010 08:03: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: r209361 - head/sys/boot/ficl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 08:03:07 -0000 Author: brian Date: Sun Jun 20 08:03:06 2010 New Revision: 209361 URL: http://svn.freebsd.org/changeset/base/209361 Log: Add a missing prototype PR: 145232 Submitted by: gcooper MFC after: 1 week Modified: head/sys/boot/ficl/ficl.h Modified: head/sys/boot/ficl/ficl.h ============================================================================== --- head/sys/boot/ficl/ficl.h Sun Jun 20 06:52:10 2010 (r209360) +++ head/sys/boot/ficl/ficl.h Sun Jun 20 08:03:06 2010 (r209361) @@ -757,6 +757,7 @@ void dictAppendUNS (FICL_DICT *p int dictCellsAvail (FICL_DICT *pDict); int dictCellsUsed (FICL_DICT *pDict); void dictCheck (FICL_DICT *pDict, FICL_VM *pVM, int n); +void dictCheckThreshold(FICL_DICT* dp); FICL_DICT *dictCreate(unsigned nCELLS); FICL_DICT *dictCreateHashed(unsigned nCells, unsigned nHash); FICL_HASH *dictCreateWordlist(FICL_DICT *dp, int nBuckets); From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 08:27:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF5F8106566B; Sun, 20 Jun 2010 08:27:03 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A50FC8FC0A; Sun, 20 Jun 2010 08:27:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K8R3uL045892; Sun, 20 Jun 2010 08:27:03 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K8R3v4045889; Sun, 20 Jun 2010 08:27:03 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006200827.o5K8R3v4045889@svn.freebsd.org> From: Brian Somers Date: Sun, 20 Jun 2010 08:27: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: r209362 - head/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 08:27:03 -0000 Author: brian Date: Sun Jun 20 08:27:03 2010 New Revision: 209362 URL: http://svn.freebsd.org/changeset/base/209362 Log: Add a -t switch for masking output that's above or below certain thresholds. This switch makes it a lot easier to locate problem areas when a process is threatening to consume all of your disk space. PR: 144192 Submitted by: gk MFC after: 3 weeks Modified: head/usr.bin/du/du.1 head/usr.bin/du/du.c Modified: head/usr.bin/du/du.1 ============================================================================== --- head/usr.bin/du/du.1 Sun Jun 20 08:03:06 2010 (r209361) +++ head/usr.bin/du/du.1 Sun Jun 20 08:27:03 2010 (r209362) @@ -42,7 +42,7 @@ .Nm .Op Fl A .Op Fl H | L | P -.Op Fl a | s | d Ar depth +.Op Fl a | s | d Ar depth | Fl t Ar threshold .Op Fl c .Op Fl l .Op Fl h | k | m | B Ar blocksize @@ -107,6 +107,14 @@ This option exists solely for conformanc Display an entry for each specified file. (Equivalent to .Fl d Li 0 ) +.It Fl t Ar threshold +Display only entries for which size exceeds +.Ar threshold . +If +.Ar threshold +is negative, display only entries for which size is less than the absolute +value of +.Ar threshold . .It Fl d Ar depth Display an entry for all files and directories .Ar depth Modified: head/usr.bin/du/du.c ============================================================================== --- head/usr.bin/du/du.c Sun Jun 20 08:03:06 2010 (r209361) +++ head/usr.bin/du/du.c Sun Jun 20 08:27:03 2010 (r209362) @@ -90,6 +90,7 @@ main(int argc, char *argv[]) FTS *fts; FTSENT *p; off_t savednumber, curblocks; + off_t threshold, threshold_sign; int ftsoptions; int listall; int depth; @@ -106,12 +107,14 @@ main(int argc, char *argv[]) save = argv; ftsoptions = 0; savednumber = 0; + threshold = 0; + threshold_sign = 1; cblocksize = DEV_BSIZE; blocksize = 0; depth = INT_MAX; SLIST_INIT(&ignores); - while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1) + while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1) switch (ch) { case 'A': Aflag = 1; @@ -179,6 +182,14 @@ main(int argc, char *argv[]) break; case 'r': /* Compatibility. */ break; + case 't' : + if (expand_number(optarg, &threshold) != 0 || + threshold == 0) { + warnx("invalid threshold: %s", optarg); + usage(); + } else if (threshold < 0) + threshold_sign = -1; + break; case 'x': ftsoptions |= FTS_XDEV; break; @@ -248,6 +259,10 @@ main(int argc, char *argv[]) blocksize /= DEV_BSIZE; } + if (threshold != 0) + threshold = howmany(threshold / DEV_BSIZE * cblocksize, + blocksize); + rval = 0; (void)signal(SIGINFO, siginfo); @@ -271,7 +286,9 @@ main(int argc, char *argv[]) p->fts_parent->fts_bignum += p->fts_bignum += curblocks; - if (p->fts_level <= depth) { + if (p->fts_level <= depth && threshold <= + threshold_sign * howmany(p->fts_bignum * + cblocksize, blocksize)) { if (hflag) { prthumanval(p->fts_bignum); (void)printf("\t%s\n", p->fts_path); From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 08:48:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE741065673; Sun, 20 Jun 2010 08:48:30 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B40578FC13; Sun, 20 Jun 2010 08:48:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K8mUuP050683; Sun, 20 Jun 2010 08:48:30 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K8mUIj050680; Sun, 20 Jun 2010 08:48:30 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006200848.o5K8mUIj050680@svn.freebsd.org> From: Brian Somers Date: Sun, 20 Jun 2010 08:48: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: r209363 - head/bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 08:48:31 -0000 Author: brian Date: Sun Jun 20 08:48:30 2010 New Revision: 209363 URL: http://svn.freebsd.org/changeset/base/209363 Log: Recognise the -l switch with pkill - list kill command(s) used. PR: 143558 Submitted by: eitanadlerlist at gmail dot com MFC after: 3 weeks Modified: head/bin/pkill/pkill.1 head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.1 ============================================================================== --- head/bin/pkill/pkill.1 Sun Jun 20 08:27:03 2010 (r209362) +++ head/bin/pkill/pkill.1 Sun Jun 20 08:48:30 2010 (r209363) @@ -156,14 +156,16 @@ The value matches processes not in jail. .It Fl l Long output. -Print the process name in addition to the process ID for each matching +For +.Nm pgrep , +print the process name in addition to the process ID for each matching process. If used in conjunction with .Fl f , print the process ID and the full argument list for each matching process. -This option can only be used with the -.Nm pgrep -command. +For +.Nm pkill , +display the kill command used for each process killed. .It Fl n Select only the newest (most recently started) of the matching processes. .It Fl o Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Sun Jun 20 08:27:03 2010 (r209362) +++ head/bin/pkill/pkill.c Sun Jun 20 08:48:30 2010 (r209363) @@ -128,7 +128,7 @@ main(int argc, char **argv) { char buf[_POSIX2_LINE_MAX], *mstr, **pargv, *p, *q, *pidfile; const char *execf, *coref; - int ancestors, debug_opt; + int ancestors, debug_opt, did_action; int i, ch, bestidx, rv, criteria, pidfromfile, pidfilelock; size_t jsz; int (*action)(const struct kinfo_proc *); @@ -242,8 +242,6 @@ main(int argc, char **argv) criteria = 1; break; case 'l': - if (!pgrep) - usage(); longfmt = 1; break; case 'n': @@ -530,16 +528,24 @@ main(int argc, char **argv) /* * Take the appropriate action for each matched process, if any. */ + did_action = 0; for (i = 0, rv = 0, kp = plist; i < nproc; i++, kp++) { if (PSKIP(kp)) continue; if (selected[i]) { + if (longfmt && !pgrep) { + did_action = 1; + printf("kill -%d %d\n", signum, kp->ki_pid); + } if (inverse) continue; } else if (!inverse) continue; rv |= (*action)(kp); } + if (!did_action && !pgrep && longfmt) + fprintf(stderr, + "No matching processes belonging to you were found\n"); exit(rv ? STATUS_MATCH : STATUS_NOMATCH); } @@ -552,7 +558,7 @@ usage(void) if (pgrep) ustr = "[-LSfilnoqvx] [-d delim]"; else - ustr = "[-signal] [-ILfinovx]"; + ustr = "[-signal] [-ILfilnovx]"; fprintf(stderr, "usage: %s %s [-F pidfile] [-G gid] [-M core] [-N system]\n" From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 09:40:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B030B1065673; Sun, 20 Jun 2010 09:40:55 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3978FC1F; Sun, 20 Jun 2010 09:40:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5K9etXC063797; Sun, 20 Jun 2010 09:40:55 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5K9etNf063796; Sun, 20 Jun 2010 09:40:55 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201006200940.o5K9etNf063796@svn.freebsd.org> From: Brian Somers Date: Sun, 20 Jun 2010 09:40: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: r209364 - head/sbin/fsck_msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 09:40:55 -0000 Author: brian Date: Sun Jun 20 09:40:54 2010 New Revision: 209364 URL: http://svn.freebsd.org/changeset/base/209364 Log: Fix some style(9), although there's a lot more issues here. Fix some casting errors. PR: 142384 Submitted by: giffunip at tutopia dot com Obtained from: NetBSD MFC after: 3 weeks Modified: head/sbin/fsck_msdosfs/Makefile head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/check.c head/sbin/fsck_msdosfs/dir.c head/sbin/fsck_msdosfs/fat.c Modified: head/sbin/fsck_msdosfs/Makefile ============================================================================== --- head/sbin/fsck_msdosfs/Makefile Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/Makefile Sun Jun 20 09:40:54 2010 (r209364) @@ -9,6 +9,6 @@ MAN= fsck_msdosfs.8 SRCS= main.c check.c boot.c fat.c dir.c fsutil.c CFLAGS+= -I${FSCK} -WARNS?= 0 +WARNS?= 2 .include Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/boot.c Sun Jun 20 09:40:54 2010 (r209364) @@ -48,13 +48,14 @@ readboot(int dosfs, struct bootblock *bo int ret = FSOK; int i; - if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { + if (read(dosfs, block, sizeof block) != sizeof block) { perror("could not read boot block"); return FSFATAL; } if (block[510] != 0x55 || block[511] != 0xaa) { - pfatal("Invalid signature in boot block: %02x%02x", block[511], block[510]); + pfatal("Invalid signature in boot block: %02x%02x", + block[511], block[510]); return FSFATAL; } @@ -72,8 +73,10 @@ readboot(int dosfs, struct bootblock *bo boot->bpbFATsmall = block[22] + (block[23] << 8); boot->SecPerTrack = block[24] + (block[25] << 8); boot->bpbHeads = block[26] + (block[27] << 8); - boot->bpbHiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24); - boot->bpbHugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24); + boot->bpbHiddenSecs = block[28] + (block[29] << 8) + + (block[30] << 16) + (block[31] << 24); + boot->bpbHugeSectors = block[32] + (block[33] << 8) + + (block[34] << 16) + (block[35] << 24); boot->FATsecs = boot->bpbFATsmall; @@ -97,10 +100,9 @@ readboot(int dosfs, struct bootblock *bo boot->bpbFSInfo = block[48] + (block[49] << 8); boot->bpbBackup = block[50] + (block[51] << 8); - if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) - != boot->bpbFSInfo * boot->bpbBytesPerSec - || read(dosfs, fsinfo, sizeof fsinfo) - != sizeof fsinfo) { + if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, + SEEK_SET) != boot->bpbFSInfo * boot->bpbBytesPerSec + || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { perror("could not read fsinfo block"); return FSFATAL; } @@ -124,7 +126,8 @@ readboot(int dosfs, struct bootblock *bo fsinfo[0x3fc] = fsinfo[0x3fd] = 0; fsinfo[0x3fe] = 0x55; fsinfo[0x3ff] = 0xaa; - if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) + if (lseek(dosfs, boot->bpbFSInfo * + boot->bpbBytesPerSec, SEEK_SET) != boot->bpbFSInfo * boot->bpbBytesPerSec || write(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { @@ -144,7 +147,8 @@ readboot(int dosfs, struct bootblock *bo + (fsinfo[0x1ef] << 24); } - if (lseek(dosfs, boot->bpbBackup * boot->bpbBytesPerSec, SEEK_SET) + if (lseek(dosfs, boot->bpbBackup * boot->bpbBytesPerSec, + SEEK_SET) != boot->bpbBackup * boot->bpbBytesPerSec || read(dosfs, backup, sizeof backup) != sizeof backup) { perror("could not read backup bootblock"); @@ -172,11 +176,10 @@ readboot(int dosfs, struct bootblock *bo /* Check backup bpbFSInfo? XXX */ } - boot->ClusterOffset = (boot->bpbRootDirEnts * 32 + boot->bpbBytesPerSec - 1) - / boot->bpbBytesPerSec - + boot->bpbResSectors - + boot->bpbFATs * boot->FATsecs - - CLUST_FIRST * boot->bpbSecPerClust; + boot->ClusterOffset = (boot->bpbRootDirEnts * 32 + + boot->bpbBytesPerSec - 1) / boot->bpbBytesPerSec + + boot->bpbResSectors + boot->bpbFATs * boot->FATsecs - + CLUST_FIRST * boot->bpbSecPerClust; if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); @@ -191,7 +194,8 @@ readboot(int dosfs, struct bootblock *bo boot->NumSectors = boot->bpbSectors; } else boot->NumSectors = boot->bpbHugeSectors; - boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / boot->bpbSecPerClust; + boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / + boot->bpbSecPerClust; if (boot->flags&FAT32) boot->ClustMask = CLUST32_MASK; Modified: head/sbin/fsck_msdosfs/check.c ============================================================================== --- head/sbin/fsck_msdosfs/check.c Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/check.c Sun Jun 20 09:40:54 2010 (r209364) @@ -98,7 +98,7 @@ checkfilesys(const char *fname) } if (boot.ValidFat < 0) - for (i = 1; i < (int)boot.bpbFATs; i++) { + for (i = 1; i < boot.bpbFATs; i++) { struct fatEntry *currentFat; mod |= readfat(dosfs, &boot, i, ¤tFat); Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/dir.c Sun Jun 20 09:40:54 2010 (r209364) @@ -242,7 +242,8 @@ resetDosDirSection(struct bootblock *boo memset(rootDir, 0, sizeof *rootDir); if (boot->flags & FAT32) { - if (boot->bpbRootClust < CLUST_FIRST || boot->bpbRootClust >= boot->NumClusters) { + if (boot->bpbRootClust < CLUST_FIRST || + boot->bpbRootClust >= boot->NumClusters) { pfatal("Root directory starts with cluster out of range(%u)", boot->bpbRootClust); return FSFATAL; @@ -356,7 +357,8 @@ removede(int f, struct bootblock *boot, pwarn("Invalid long filename entry for %s\n", path); break; case 1: - pwarn("Invalid long filename entry at end of directory %s\n", path); + pwarn("Invalid long filename entry at end of directory %s\n", + path); break; case 2: pwarn("Invalid long filename entry for volume label\n"); @@ -418,7 +420,8 @@ checksize(struct bootblock *boot, struct cl_t cl; u_int32_t sz = 0; - for (cl = dir->head; (sz += boot->ClusterSize) < dir->size;) + for (cl = dir->head; (sz += boot->ClusterSize) < + dir->size;) cl = fat[cl].next; clearchain(boot, fat, fat[cl].next); fat[cl].next = CLUST_EOF; @@ -462,7 +465,8 @@ readDosDirSection(int f, struct bootbloc do { if (!(boot->flags & FAT32) && !dir->parent) { last = boot->bpbRootDirEnts * 32; - off = boot->bpbResSectors + boot->bpbFATs * boot->FATsecs; + off = boot->bpbResSectors + boot->bpbFATs * + boot->FATsecs; } else { last = boot->bpbSecPerClust * boot->bpbBytesPerSec; off = cl * boot->bpbSecPerClust + boot->ClusterOffset; @@ -547,7 +551,8 @@ readDosDirSection(int f, struct bootbloc } lidx = *p & LRNOMASK; t = longName + --lidx * 13; - for (k = 1; k < 11 && t < longName + sizeof(longName); k += 2) { + for (k = 1; k < 11 && t < longName + + sizeof(longName); k += 2) { if (!p[k] && !p[k + 1]) break; *t++ = p[k]; Modified: head/sbin/fsck_msdosfs/fat.c ============================================================================== --- head/sbin/fsck_msdosfs/fat.c Sun Jun 20 08:48:30 2010 (r209363) +++ head/sbin/fsck_msdosfs/fat.c Sun Jun 20 09:40:54 2010 (r209364) @@ -87,7 +87,8 @@ checkdirty(int fs, struct bootblock *boo goto err; } - if (read(fs, buffer, boot->bpbBytesPerSec) != boot->bpbBytesPerSec) { + if ((size_t)read(fs, buffer, boot->bpbBytesPerSec) != + boot->bpbBytesPerSec) { perror("Unable to read FAT"); goto err; } From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 10:23:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 717461065670; Sun, 20 Jun 2010 10:23:47 +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 462828FC0A; Sun, 20 Jun 2010 10:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5KANkSh073299; Sun, 20 Jun 2010 10:23:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5KANk5a073296; Sun, 20 Jun 2010 10:23:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006201023.o5KANk5a073296@svn.freebsd.org> From: Alexander Motin Date: Sun, 20 Jun 2010 10:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209365 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 10:23:47 -0000 Author: mav Date: Sun Jun 20 10:23:46 2010 New Revision: 209365 URL: http://svn.freebsd.org/changeset/base/209365 Log: MFC r209155: Fix bug introduced in SVN rev 194985. When calling pic_assign_cpu() for pre-bound IRQs during boot, submit there LAPIC ID, same as in other places, not CPU ID. Modified: stable/8/sys/amd64/amd64/intr_machdep.c stable/8/sys/i386/i386/intr_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/amd64/amd64/intr_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/intr_machdep.c Sun Jun 20 09:40:54 2010 (r209364) +++ stable/8/sys/amd64/amd64/intr_machdep.c Sun Jun 20 10:23:46 2010 (r209365) @@ -529,7 +529,7 @@ intr_shuffle_irqs(void *arg __unused) */ if (isrc->is_event->ie_cpu != NOCPU) (void)isrc->is_pic->pic_assign_cpu(isrc, - isrc->is_event->ie_cpu); + cpu_apic_ids[isrc->is_event->ie_cpu]); else if (isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[current_cpu]) == 0) (void)intr_next_cpu(); Modified: stable/8/sys/i386/i386/intr_machdep.c ============================================================================== --- stable/8/sys/i386/i386/intr_machdep.c Sun Jun 20 09:40:54 2010 (r209364) +++ stable/8/sys/i386/i386/intr_machdep.c Sun Jun 20 10:23:46 2010 (r209365) @@ -502,7 +502,7 @@ intr_shuffle_irqs(void *arg __unused) */ if (isrc->is_event->ie_cpu != NOCPU) (void)isrc->is_pic->pic_assign_cpu(isrc, - isrc->is_event->ie_cpu); + cpu_apic_ids[isrc->is_event->ie_cpu]); else if (isrc->is_pic->pic_assign_cpu(isrc, cpu_apic_ids[current_cpu]) == 0) (void)intr_next_cpu(); From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 12:52:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCB39106564A; Sun, 20 Jun 2010 12:52:33 +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 BC18F8FC18; Sun, 20 Jun 2010 12:52:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5KCqXBr007736; Sun, 20 Jun 2010 12:52:33 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5KCqXqY007734; Sun, 20 Jun 2010 12:52:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006201252.o5KCqXqY007734@svn.freebsd.org> From: Ed Schouten Date: Sun, 20 Jun 2010 12:52: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: r209366 - head/sbin/ping X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 12:52:33 -0000 Author: ed Date: Sun Jun 20 12:52:33 2010 New Revision: 209366 URL: http://svn.freebsd.org/changeset/base/209366 Log: Small style fixes: - ANSIfy prototypes. - Remove unneeded whitespace. - Add const keyword to function where it can be used. Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Sun Jun 20 10:23:46 2010 (r209365) +++ head/sbin/ping/ping.c Sun Jun 20 12:52:33 2010 (r209366) @@ -210,13 +210,11 @@ static void pr_pack(char *, int, struct static void pr_retip(struct ip *); static void status(int); static void stopit(int); -static void tvsub(struct timeval *, struct timeval *); +static void tvsub(struct timeval *, const struct timeval *); static void usage(void) __dead2; int -main(argc, argv) - int argc; - char *const *argv; +main(int argc, char *const *argv) { struct sockaddr_in from, sock_in; struct in_addr ifaddr; @@ -916,8 +914,7 @@ main(argc, argv) * to be called from a signal handler. */ void -stopit(sig) - int sig __unused; +stopit(int sig __unused) { /* @@ -1012,11 +1009,7 @@ pinger(void) * program to be run without having intermingled output (or statistics!). */ static void -pr_pack(buf, cc, from, tv) - char *buf; - int cc; - struct sockaddr_in *from; - struct timeval *tv; +pr_pack(char *buf, int cc, struct sockaddr_in *from, struct timeval *tv) { struct in_addr ina; u_char *cp, *dp; @@ -1280,9 +1273,7 @@ pr_pack(buf, cc, from, tv) * Checksum routine for Internet Protocol family headers (C Version) */ u_short -in_cksum(addr, len) - u_short *addr; - int len; +in_cksum(u_short *addr, int len) { int nleft, sum; u_short *w; @@ -1326,8 +1317,7 @@ in_cksum(addr, len) * be >= in. */ static void -tvsub(out, in) - struct timeval *out, *in; +tvsub(struct timeval *out, const struct timeval *in) { if ((out->tv_usec -= in->tv_usec) < 0) { @@ -1343,15 +1333,14 @@ tvsub(out, in) */ static void -status(sig) - int sig __unused; +status(int sig __unused) { siginfo_p = 1; } static void -check_status() +check_status(void) { if (siginfo_p) { @@ -1371,7 +1360,7 @@ check_status() * Print out statistics, and give up. */ static void -finish() +finish(void) { (void)signal(SIGINT, SIG_IGN); @@ -1430,8 +1419,7 @@ static char *ttab[] = { * Print a descriptive string about an ICMP header. */ static void -pr_icmph(icp) - struct icmp *icp; +pr_icmph(struct icmp *icp) { switch(icp->icmp_type) { @@ -1578,8 +1566,7 @@ pr_icmph(icp) * Print an IP header with options. */ static void -pr_iph(ip) - struct ip *ip; +pr_iph(struct ip *ip) { u_char *cp; int hlen; @@ -1611,8 +1598,7 @@ pr_iph(ip) * a hostname. */ static char * -pr_addr(ina) - struct in_addr ina; +pr_addr(struct in_addr ina) { struct hostent *hp; static char buf[16 + 3 + MAXHOSTNAMELEN]; @@ -1631,8 +1617,7 @@ pr_addr(ina) * Dump some info on a returned (via ICMP) IP packet. */ static void -pr_retip(ip) - struct ip *ip; +pr_retip(struct ip *ip) { u_char *cp; int hlen; @@ -1650,7 +1635,7 @@ pr_retip(ip) } static char * -pr_ntime (n_time timestamp) +pr_ntime(n_time timestamp) { static char buf[10]; int hour, min, sec; @@ -1666,8 +1651,7 @@ pr_ntime (n_time timestamp) } static void -fill(bp, patp) - char *bp, *patp; +fill(char *bp, char *patp) { char *cp; int pat[16]; @@ -1703,7 +1687,7 @@ fill(bp, patp) #define SECOPT "" #endif static void -usage() +usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 13:35:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 276FE1065672; Sun, 20 Jun 2010 13:35:17 +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 1680F8FC1A; Sun, 20 Jun 2010 13:35:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5KDZG5I017208; Sun, 20 Jun 2010 13:35:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5KDZG6O017206; Sun, 20 Jun 2010 13:35:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006201335.o5KDZG6O017206@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 20 Jun 2010 13:35:16 +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: r209367 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 13:35:17 -0000 Author: kib Date: Sun Jun 20 13:35:16 2010 New Revision: 209367 URL: http://svn.freebsd.org/changeset/base/209367 Log: Ensure that VOP_ACCESSX is called with exclusively locked vnode for the kernel compiled with QUOTA option. ufs_accessx() upgrades the vdp vnode lock from shared to exclusive to assign the dquot structure to the vnode, and ufs_delete_denied() is called when tvp is locked. Since upgrade drops shared lock when non-blocked upgrade failed, LOR is there. Reported and tested by: Dmitry Pryanishnikov Tested by: pho PR: kern/147890 MFC after: 1 week Modified: head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- head/sys/ufs/ufs/ufs_lookup.c Sun Jun 20 12:52:33 2010 (r209366) +++ head/sys/ufs/ufs/ufs_lookup.c Sun Jun 20 13:35:16 2010 (r209367) @@ -77,6 +77,32 @@ SYSCTL_INT(_debug, OID_AUTO, dircheck, C /* true if old FS format...*/ #define OFSFMT(vp) ((vp)->v_mount->mnt_maxsymlinklen <= 0) +#ifdef QUOTA +static int +ufs_lookup_upgrade_lock(struct vnode *vp) +{ + int error; + + ASSERT_VOP_LOCKED(vp, __FUNCTION__); + if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) + return (0); + + error = 0; + + /* + * Upgrade vnode lock, since getinoquota() + * requires exclusive lock to modify inode. + */ + vhold(vp); + vn_lock(vp, LK_UPGRADE | LK_RETRY); + VI_LOCK(vp); + if (vp->v_iflag & VI_DOOMED) + error = ENOENT; + vdropl(vp); + return (error); +} +#endif + static int ufs_delete_denied(struct vnode *vdp, struct vnode *tdp, struct ucred *cred, struct thread *td) @@ -232,6 +258,13 @@ ufs_lookup_ino(struct vnode *vdp, struct vnode_create_vobject(vdp, DIP(dp, i_size), cnp->cn_thread); bmask = VFSTOUFS(vdp->v_mount)->um_mountp->mnt_stat.f_iosize - 1; +#ifdef QUOTA + if ((nameiop == DELETE || nameiop == RENAME) && (flags & ISLASTCN)) { + error = ufs_lookup_upgrade_lock(vdp); + if (error != 0) + return (error); + } +#endif restart: bp = NULL; From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 16:56:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1AD2106564A; Sun, 20 Jun 2010 16:56:48 +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 CFE588FC21; Sun, 20 Jun 2010 16:56:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5KGumtI061984; Sun, 20 Jun 2010 16:56:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5KGuml3061982; Sun, 20 Jun 2010 16:56:48 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006201656.o5KGuml3061982@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Jun 2010 16:56: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: r209369 - head/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 16:56:49 -0000 Author: nwhitehorn Date: Sun Jun 20 16:56:48 2010 New Revision: 209369 URL: http://svn.freebsd.org/changeset/base/209369 Log: Temporarily disable instruction relocation while setting up the kernel's IBAT entry in early boot in order to prevent possible faults from races between the instruction cache and the MMU. PR: powerpc/148003 MFC after: 3 days Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sun Jun 20 16:24:22 2010 (r209368) +++ head/sys/powerpc/aim/mmu_oea.c Sun Jun 20 16:56:48 2010 (r209369) @@ -672,6 +672,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k vm_size_t size, physsz, hwphyssz; vm_offset_t pa, va, off; void *dpcpu; + register_t msr; /* * Set up BAT0 to map the lowest 256 MB area @@ -702,12 +703,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* * Use an IBAT and a DBAT to map the bottom segment of memory - * where we are. + * where we are. Turn off instruction relocation temporarily + * to prevent faults while reprogramming the IBAT. */ + msr = mfmsr(); + mtmsr(msr & ~PSL_IR); __asm (".balign 32; \n" "mtibatu 0,%0; mtibatl 0,%1; isync; \n" "mtdbatu 0,%0; mtdbatl 0,%1; isync" :: "r"(battable[0].batu), "r"(battable[0].batl)); + mtmsr(msr); /* map pci space */ __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); From owner-svn-src-all@FreeBSD.ORG Sun Jun 20 21:33:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B44A8106568A; Sun, 20 Jun 2010 21:33:29 +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 A0A488FC18; Sun, 20 Jun 2010 21:33:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5KLXTVP023081; Sun, 20 Jun 2010 21:33:29 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5KLXTG1023067; Sun, 20 Jun 2010 21:33:29 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006202133.o5KLXTG1023067@svn.freebsd.org> From: Alexander Motin Date: Sun, 20 Jun 2010 21:33: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: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jun 2010 21:33:29 -0000 Author: mav Date: Sun Jun 20 21:33:29 2010 New Revision: 209371 URL: http://svn.freebsd.org/changeset/base/209371 Log: Implement new event timers infrastructure. It provides unified APIs for writing event timer drivers, for choosing best possible drivers by machine independent code and for operating them to supply kernel with hardclock(), statclock() and profclock() events in unified fashion on various hardware. Infrastructure provides support for both per-CPU (independent for every CPU core) and global timers in periodic and one-shot modes. MI management code at this moment uses only periodic mode, but one-shot mode use planned for later, as part of tickless kernel project. For this moment infrastructure used on i386 and amd64 architectures. Other archs are welcome to follow, while their current operation should not be affected. This patch updates existing drivers (i8254, RTC and LAPIC) for the new order, and adds event timers support into the HPET driver. These drivers have different capabilities: LAPIC - per-CPU timer, supports periodic and one-shot operation, may freeze in C3 state, calibrated on first use, so may be not exactly precise. HPET - depending on hardware can work as per-CPU or global, supports periodic and one-shot operation, usually provides several event timers. i8254 - global, limited to periodic mode, because same hardware used also as time counter. RTC - global, supports only periodic mode, set of frequencies in Hz limited by powers of 2. Depending on hardware capabilities, drivers preferred in following orders, either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. User may explicitly specify wanted timers via loader tunables or sysctls: kern.eventtimer.timer1 and kern.eventtimer.timer2. If requested driver is unavailable or unoperational, system will try to replace it. If no more timers available or "NONE" specified for second, system will operate using only one timer, multiplying it's frequency by few times and uing respective dividers to honor hz, stathz and profhz values, set during initial setup. Added: head/sys/kern/kern_et.c (contents, props changed) head/sys/sys/timeet.h (contents, props changed) head/sys/x86/x86/timeevents.c (contents, props changed) Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/amd64/include/apicvar.h head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_hpet.h head/sys/i386/i386/mp_machdep.c head/sys/i386/include/apicvar.h head/sys/isa/rtc.h head/sys/kern/kern_clock.c head/sys/pc98/cbus/clock.c head/sys/sys/systm.h head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c head/sys/x86/x86/local_apic.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/amd64/amd64/mp_machdep.c Sun Jun 20 21:33:29 2010 (r209371) @@ -706,10 +706,11 @@ init_secondary(void) load_es(_udatasel); load_fs(_ufssel); mtx_unlock_spin(&ap_boot_mtx); - /* wait until all the AP's are up */ while (smp_started == 0) ia32_pause(); + /* Start per-CPU event timers. */ + cpu_initclocks_ap(); sched_throw(NULL); Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/amd64/include/apicvar.h Sun Jun 20 21:33:29 2010 (r209371) @@ -158,12 +158,6 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI -enum lapic_clock { - LAPIC_CLOCK_NONE, - LAPIC_CLOCK_HARDCLOCK, - LAPIC_CLOCK_ALL -}; - /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including * CPU's and I/O APIC's. @@ -234,7 +228,6 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -enum lapic_clock lapic_setup_clock(enum lapic_clock srcsdes); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/conf/files Sun Jun 20 21:33:29 2010 (r209371) @@ -2085,6 +2085,7 @@ kern/kern_context.c standard kern/kern_descrip.c standard kern/kern_dtrace.c optional kdtrace_hooks kern/kern_environment.c standard +kern/kern_et.c standard kern/kern_event.c standard kern/kern_exec.c standard kern/kern_exit.c standard Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/conf/files.amd64 Sun Jun 20 21:33:29 2010 (r209371) @@ -297,6 +297,7 @@ x86/cpufreq/p4tcc.c optional cpufreq x86/isa/atpic.c optional atpic isa x86/isa/atrtc.c standard x86/isa/clock.c standard +x86/x86/timeevents.c standard x86/isa/elcr.c standard x86/isa/isa.c standard x86/isa/isa_dma.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/conf/files.i386 Sun Jun 20 21:33:29 2010 (r209371) @@ -381,6 +381,7 @@ x86/cpufreq/smist.c optional cpufreq x86/isa/atpic.c optional atpic x86/isa/atrtc.c optional atpic x86/isa/clock.c optional native +x86/x86/timeevents.c standard x86/isa/elcr.c standard x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/dev/acpica/acpi_hpet.c Sun Jun 20 21:33:29 2010 (r209371) @@ -28,12 +28,21 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#ifdef __amd64__ +#define DEV_APIC +#else +#include "opt_apic.h" +#endif #include #include #include #include +#include #include #include +#include +#include +#include #include #include @@ -42,46 +51,69 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef DEV_APIC +#include "pcib_if.h" +#endif + #define HPET_VENDID_AMD 0x4353 #define HPET_VENDID_INTEL 0x8086 ACPI_SERIAL_DECL(hpet, "ACPI HPET support"); -static devclass_t acpi_hpet_devclass; +static devclass_t hpet_devclass; /* ACPI CA debugging */ #define _COMPONENT ACPI_TIMER ACPI_MODULE_NAME("HPET") -struct acpi_hpet_softc { +struct hpet_softc { device_t dev; + int mem_rid; + int intr_rid; + int irq; + int useirq; struct resource *mem_res; + struct resource *intr_res; + void *intr_handle; ACPI_HANDLE handle; + uint64_t freq; + struct timecounter tc; + struct hpet_timer { + struct eventtimer et; + struct hpet_softc *sc; + int num; + int mode; + int intr_rid; + int irq; + int pcpu_master; + int pcpu_slaves[MAXCPU]; + struct resource *intr_res; + void *intr_handle; + uint32_t caps; + uint32_t vectors; + uint32_t div; + uint32_t last; + char name[8]; + } t[32]; + int num_timers; }; static u_int hpet_get_timecount(struct timecounter *tc); -static void acpi_hpet_test(struct acpi_hpet_softc *sc); +static void hpet_test(struct hpet_softc *sc); static char *hpet_ids[] = { "PNP0103", NULL }; -struct timecounter hpet_timecounter = { - .tc_get_timecount = hpet_get_timecount, - .tc_counter_mask = ~0u, - .tc_name = "HPET", - .tc_quality = 900, -}; - static u_int hpet_get_timecount(struct timecounter *tc) { - struct acpi_hpet_softc *sc; + struct hpet_softc *sc; sc = tc->tc_priv; return (bus_read_4(sc->mem_res, HPET_MAIN_COUNTER)); } static void -hpet_enable(struct acpi_hpet_softc *sc) +hpet_enable(struct hpet_softc *sc) { uint32_t val; @@ -92,7 +124,7 @@ hpet_enable(struct acpi_hpet_softc *sc) } static void -hpet_disable(struct acpi_hpet_softc *sc) +hpet_disable(struct hpet_softc *sc) { uint32_t val; @@ -101,8 +133,113 @@ hpet_disable(struct acpi_hpet_softc *sc) bus_write_4(sc->mem_res, HPET_CONFIG, val); } +static int +hpet_start(struct eventtimer *et, + struct bintime *first, struct bintime *period) +{ + struct hpet_timer *mt = (struct hpet_timer *)et->et_priv; + struct hpet_timer *t; + struct hpet_softc *sc = mt->sc; + uint32_t fdiv; + + t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; + if (period != NULL) { + t->mode = 1; + t->div = (sc->freq * (period->frac >> 32)) >> 32; + if (period->sec != 0) + t->div += sc->freq * period->sec; + if (first == NULL) + first = period; + } else { + t->mode = 2; + t->div = 0; + } + fdiv = (sc->freq * (first->frac >> 32)) >> 32; + if (first->sec != 0) + fdiv += sc->freq * first->sec; + t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + t->caps |= HPET_TCNF_TYPE; + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), + t->caps | HPET_TCNF_VAL_SET); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->last + fdiv); + bus_read_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num)); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->div); + } else { + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->last + fdiv); + } + t->caps |= HPET_TCNF_INT_ENB; + bus_write_4(sc->mem_res, HPET_ISR, 1 << t->num); + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); + return (0); +} + +static int +hpet_stop(struct eventtimer *et) +{ + struct hpet_timer *mt = (struct hpet_timer *)et->et_priv; + struct hpet_timer *t; + struct hpet_softc *sc = mt->sc; + + t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; + t->mode = 0; + t->caps &= ~(HPET_TCNF_INT_ENB | HPET_TCNF_TYPE); + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); + return (0); +} + +static int +hpet_intr_single(void *arg) +{ + struct hpet_timer *t = (struct hpet_timer *)arg; + struct hpet_timer *mt; + struct hpet_softc *sc = t->sc; + uint32_t now; + + if (t->mode == 1 && + (t->caps & HPET_TCAP_PER_INT) == 0) { + t->last += t->div; + now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + if ((int32_t)(now - (t->last + t->div / 2)) > 0) + t->last = now - t->div / 2; + bus_write_4(sc->mem_res, + HPET_TIMER_COMPARATOR(t->num), t->last + t->div); + } else if (t->mode == 2) + t->mode = 0; + mt = (t->pcpu_master < 0) ? t : &sc->t[t->pcpu_master]; + if (mt->et.et_active) { + mt->et.et_event_cb(&mt->et, + mt->et.et_arg ? mt->et.et_arg : curthread->td_intr_frame); + } + return (FILTER_HANDLED); +} + +static int +hpet_intr(void *arg) +{ + struct hpet_softc *sc = (struct hpet_softc *)arg; + int i; + uint32_t val; + + val = bus_read_4(sc->mem_res, HPET_ISR); + if (val) { + bus_write_4(sc->mem_res, HPET_ISR, val); + val &= sc->useirq; + for (i = 0; i < sc->num_timers; i++) { + if ((val & (1 << i)) == 0) + continue; + hpet_intr_single(&sc->t[i]); + } + return (FILTER_HANDLED); + } + return (FILTER_STRAY); +} + static ACPI_STATUS -acpi_hpet_find(ACPI_HANDLE handle, UINT32 level, void *context, +hpet_find(ACPI_HANDLE handle, UINT32 level, void *context, void **status) { char **ids; @@ -115,16 +252,15 @@ acpi_hpet_find(ACPI_HANDLE handle, UINT3 } if (*ids == NULL) return (AE_OK); - if (ACPI_FAILURE(acpi_GetInteger(handle, "_UID", &uid))) - uid = 0; - if (id == uid) + if (ACPI_FAILURE(acpi_GetInteger(handle, "_UID", &uid)) || + id == uid) *((int *)status) = 1; return (AE_OK); } /* Discover the HPET via the ACPI table of the same name. */ static void -acpi_hpet_identify(driver_t *driver, device_t parent) +hpet_identify(driver_t *driver, device_t parent) { ACPI_TABLE_HPET *hpet; ACPI_STATUS status; @@ -132,7 +268,7 @@ acpi_hpet_identify(driver_t *driver, dev int i, found; /* Only one HPET device can be added. */ - if (devclass_get_device(acpi_hpet_devclass, 0)) + if (devclass_get_device(hpet_devclass, 0)) return; for (i = 1; ; i++) { /* Search for HPET table. */ @@ -142,12 +278,12 @@ acpi_hpet_identify(driver_t *driver, dev /* Search for HPET device with same ID. */ found = 0; AcpiWalkNamespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, - 100, acpi_hpet_find, NULL, (void *)(uintptr_t)hpet->Sequence, (void *)&found); + 100, hpet_find, NULL, (void *)(uintptr_t)hpet->Sequence, (void *)&found); /* If found - let it be probed in normal way. */ if (found) continue; /* If not - create it from table info. */ - child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "acpi_hpet", 0); + child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "hpet", 0); if (child == NULL) { printf("%s: can't add child\n", __func__); continue; @@ -158,7 +294,7 @@ acpi_hpet_identify(driver_t *driver, dev } static int -acpi_hpet_probe(device_t dev) +hpet_probe(device_t dev) { ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -173,13 +309,15 @@ acpi_hpet_probe(device_t dev) } static int -acpi_hpet_attach(device_t dev) +hpet_attach(device_t dev) { - struct acpi_hpet_softc *sc; - int rid, num_timers; - uint32_t val, val2; - uintmax_t freq; - uint16_t vendor; + struct hpet_softc *sc; + struct hpet_timer *t; + int i, j, num_msi, num_timers, num_percpu_et, num_percpu_t, cur_cpu; + int pcpu_master; + static int maxhpetet = 0; + uint32_t val, val2, cvectors; + uint16_t vendor, rev; ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -187,8 +325,8 @@ acpi_hpet_attach(device_t dev) sc->dev = dev; sc->handle = acpi_get_handle(dev); - rid = 0; - sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + sc->mem_rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE); if (sc->mem_res == NULL) return (ENOMEM); @@ -213,31 +351,53 @@ acpi_hpet_attach(device_t dev) return (ENXIO); } - freq = (1000000000000000LL + val / 2) / val; + sc->freq = (1000000000000000LL + val / 2) / val; + val = bus_read_4(sc->mem_res, HPET_CAPABILITIES); + vendor = (val & HPET_CAP_VENDOR_ID) >> 16; + rev = val & HPET_CAP_REV_ID; + num_timers = 1 + ((val & HPET_CAP_NUM_TIM) >> 8); + /* + * ATI/AMD violates IA-PC HPET (High Precision Event Timers) + * Specification and provides an off by one number + * of timers/comparators. + * Additionally, they use unregistered value in VENDOR_ID field. + */ + if (vendor == HPET_VENDID_AMD && rev < 0x10 && num_timers > 0) + num_timers--; + sc->num_timers = num_timers; if (bootverbose) { - val = bus_read_4(sc->mem_res, HPET_CAPABILITIES); - - /* - * ATI/AMD violates IA-PC HPET (High Precision Event Timers) - * Specification and provides an off by one number - * of timers/comparators. - * Additionally, they use unregistered value in VENDOR_ID field. - */ - num_timers = 1 + ((val & HPET_CAP_NUM_TIM) >> 8); - vendor = val >> 16; - if (vendor == HPET_VENDID_AMD && num_timers > 0) - num_timers--; device_printf(dev, - "vend: 0x%x rev: 0x%x num: %d hz: %jd opts:%s%s\n", - vendor, val & HPET_CAP_REV_ID, - num_timers, freq, - (val & HPET_CAP_LEG_RT) ? " legacy_route" : "", - (val & HPET_CAP_COUNT_SIZE) ? " 64-bit" : ""); + "vendor 0x%x, rev 0x%x, %jdHz%s, %d timers,%s\n", + vendor, rev, + sc->freq, (val & HPET_CAP_COUNT_SIZE) ? " 64bit" : "", + num_timers, (val & HPET_CAP_LEG_RT) ? " legacy route" : ""); + } + num_msi = 0; + for (i = 0; i < num_timers; i++) { + t = &sc->t[i]; + t->sc = sc; + t->num = i; + t->mode = 0; + t->intr_rid = -1; + t->irq = -1; + t->pcpu_master = -1; + t->caps = bus_read_4(sc->mem_res, HPET_TIMER_CAP_CNF(i)); + t->vectors = bus_read_4(sc->mem_res, HPET_TIMER_CAP_CNF(i) + 4); + if (bootverbose) { + device_printf(dev, + " t%d: irqs 0x%08x (%d)%s%s%s\n", i, + t->vectors, (t->caps & HPET_TCNF_INT_ROUTE) >> 9, + (t->caps & HPET_TCAP_FSB_INT_DEL) ? ", MSI" : "", + (t->caps & HPET_TCAP_SIZE) ? ", 64bit" : "", + (t->caps & HPET_TCAP_PER_INT) ? ", periodic" : ""); + } +#ifdef DEV_APIC + if (t->caps & HPET_TCAP_FSB_INT_DEL) + num_msi++; +#endif } - if (testenv("debug.acpi.hpet_test")) - acpi_hpet_test(sc); - + hpet_test(sc); /* * Don't attach if the timer never increments. Since the spec * requires it to be at least 10 MHz, it has to change in 1 us. @@ -253,15 +413,154 @@ acpi_hpet_attach(device_t dev) } /* Announce first HPET as timecounter. */ if (device_get_unit(dev) == 0) { - hpet_timecounter.tc_frequency = freq; - hpet_timecounter.tc_priv = sc; - tc_init(&hpet_timecounter); + sc->tc.tc_get_timecount = hpet_get_timecount, + sc->tc.tc_counter_mask = ~0u, + sc->tc.tc_name = "HPET", + sc->tc.tc_quality = 900, + sc->tc.tc_frequency = sc->freq; + sc->tc.tc_priv = sc; + tc_init(&sc->tc); + } + /* If not disabled - setup and announce event timers. */ + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "clock", &i) == 0 && i == 0) + return (0); + num_percpu_et = min(num_msi / mp_ncpus, 2); + num_percpu_t = num_percpu_et * mp_ncpus; + cur_cpu = CPU_FIRST(); + pcpu_master = 0; + /* Find common legacy IRQ vectors for all timers. */ + cvectors = 0xffff0000; + /* + * HPETs in AMD chipsets before SB800 have problems with IRQs >= 16 + * Lower are also not always working for different reasons. + * SB800 fixed it, but seems do not implements level triggering + * properly, that makes it very unreliable - it freezes after any + * interrupt loss. Avoid legacy IRQs for AMD. + */ + if (vendor == HPET_VENDID_AMD) + cvectors = 0x00000000; + sc->useirq = 0; + for (i = 0; i < num_timers; i++) { + t = &sc->t[i]; +#ifdef DEV_APIC + if (t->caps & HPET_TCAP_FSB_INT_DEL) { + if ((j = PCIB_ALLOC_MSIX( + device_get_parent(device_get_parent(dev)), dev, + &t->irq))) { + device_printf(dev, + "Can't allocate interrupt: %d.\n", j); + } else if (!(t->intr_res = + bus_alloc_resource(dev, SYS_RES_IRQ, &t->intr_rid, + t->irq, t->irq, 1, RF_SHAREABLE | RF_ACTIVE))) { + device_printf(dev, "Can't map interrupt.\n"); + } else if ((bus_setup_intr(dev, t->intr_res, + INTR_MPSAFE | INTR_TYPE_CLK, + (driver_filter_t *)hpet_intr_single, NULL, + t, &t->intr_handle))) { + device_printf(dev, "Can't setup interrupt.\n"); + } else { + bus_describe_intr(dev, t->intr_res, + t->intr_handle, "t%d", i); + num_msi++; + if (num_percpu_t > 0) { + if (cur_cpu == CPU_FIRST()) + pcpu_master = i; + t->pcpu_master = pcpu_master; + sc->t[pcpu_master]. + pcpu_slaves[cur_cpu] = i; + bus_bind_intr(dev, t->intr_res, cur_cpu); + cur_cpu = CPU_NEXT(cur_cpu); + num_percpu_t--; + } + } + } else +#endif + if ((cvectors & t->vectors) != 0) { + cvectors &= t->vectors; + sc->useirq |= (1 << i); + } + } + bus_write_4(sc->mem_res, HPET_ISR, 0xffffffff); + sc->irq = -1; + sc->intr_rid = -1; + /* If at least one timer needs legacy IRQ - setup it. */ + if (sc->useirq) { + j = i = fls(cvectors) - 1; + while (j > 0 && (cvectors & (1 << (j - 1))) != 0) + j--; + if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &sc->intr_rid, j, i, 1, RF_SHAREABLE | RF_ACTIVE))) + device_printf(dev,"Can't map interrupt.\n"); + else if ((bus_setup_intr(dev, sc->intr_res, + INTR_MPSAFE | INTR_TYPE_CLK, + (driver_filter_t *)hpet_intr, NULL, + sc, &sc->intr_handle))) { + device_printf(dev, "Can't setup interrupt.\n"); + } else { + sc->irq = rman_get_start(sc->intr_res); + /* Bind IRQ to BSP to avoid live migration. */ + bus_bind_intr(dev, sc->intr_res, CPU_FIRST()); + } + } + /* Program and announce event timers. */ + for (i = 0; i < num_timers; i++) { + t = &sc->t[i]; + t->caps &= ~(HPET_TCNF_FSB_EN | HPET_TCNF_INT_ROUTE); + t->caps &= ~(HPET_TCNF_VAL_SET | HPET_TCNF_INT_ENB); + t->caps |= HPET_TCNF_32MODE; +#ifdef DEV_APIC + if (t->irq >= 0) { + uint64_t addr; + uint32_t data; + + if (PCIB_MAP_MSI( + device_get_parent(device_get_parent(dev)), dev, + t->irq, &addr, &data) == 0) { + bus_write_4(sc->mem_res, + HPET_TIMER_FSB_ADDR(i), addr); + bus_write_4(sc->mem_res, + HPET_TIMER_FSB_VAL(i), data); + t->caps |= HPET_TCNF_FSB_EN; + } else + t->irq = -2; + } else +#endif + t->caps |= (sc->irq << 9) | HPET_TCNF_INT_TYPE; + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(i), t->caps); + /* Skip event timers without set up IRQ. */ + if (t->irq < 0 && + (sc->irq < 0 || (t->vectors & (1 << sc->irq)) == 0)) + continue; + /* Announce the reset. */ + if (maxhpetet == 0) + t->et.et_name = "HPET"; + else { + sprintf(t->name, "HPET%d", maxhpetet); + t->et.et_name = t->name; + } + t->et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT; + t->et.et_quality = 450; + if (t->pcpu_master >= 0) { + t->et.et_flags |= ET_FLAGS_PERCPU; + t->et.et_quality += 100; + } + if ((t->caps & HPET_TCAP_PER_INT) == 0) + t->et.et_quality -= 10; + t->et.et_frequency = sc->freq; + t->et.et_start = hpet_start; + t->et.et_stop = hpet_stop; + t->et.et_priv = &sc->t[i]; + if (t->pcpu_master < 0 || t->pcpu_master == i) { + et_register(&t->et); + maxhpetet++; + } } return (0); } static int -acpi_hpet_detach(device_t dev) +hpet_detach(device_t dev) { ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); @@ -270,9 +569,9 @@ acpi_hpet_detach(device_t dev) } static int -acpi_hpet_suspend(device_t dev) +hpet_suspend(device_t dev) { - struct acpi_hpet_softc *sc; + struct hpet_softc *sc; /* * Disable the timer during suspend. The timer will not lose @@ -286,20 +585,58 @@ acpi_hpet_suspend(device_t dev) } static int -acpi_hpet_resume(device_t dev) +hpet_resume(device_t dev) { - struct acpi_hpet_softc *sc; + struct hpet_softc *sc; + struct hpet_timer *t; + int i; /* Re-enable the timer after a resume to keep the clock advancing. */ sc = device_get_softc(dev); hpet_enable(sc); - + /* Restart event timers that were running on suspend. */ + for (i = 0; i < sc->num_timers; i++) { + t = &sc->t[i]; +#ifdef DEV_APIC + if (t->irq >= 0) { + uint64_t addr; + uint32_t data; + + if (PCIB_MAP_MSI( + device_get_parent(device_get_parent(dev)), dev, + t->irq, &addr, &data) == 0) { + bus_write_4(sc->mem_res, + HPET_TIMER_FSB_ADDR(i), addr); + bus_write_4(sc->mem_res, + HPET_TIMER_FSB_VAL(i), data); + } + } +#endif + if (t->mode == 0) + continue; + t->last = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); + if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + t->caps |= HPET_TCNF_TYPE; + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), + t->caps | HPET_TCNF_VAL_SET); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->last + t->div); + bus_read_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num)); + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->div); + } else { + bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), + t->last + sc->freq / 1024); + } + bus_write_4(sc->mem_res, HPET_ISR, 1 << t->num); + bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); + } return (0); } /* Print some basic latency/rate information to assist in debugging. */ static void -acpi_hpet_test(struct acpi_hpet_softc *sc) +hpet_test(struct hpet_softc *sc) { int i; uint32_t u1, u2; @@ -326,24 +663,56 @@ acpi_hpet_test(struct acpi_hpet_softc *s device_printf(sc->dev, "time per call: %ld ns\n", ts.tv_nsec / 1000); } -static device_method_t acpi_hpet_methods[] = { +#ifdef DEV_APIC +static int +hpet_remap_intr(device_t dev, device_t child, u_int irq) +{ + struct hpet_softc *sc = device_get_softc(dev); + struct hpet_timer *t; + uint64_t addr; + uint32_t data; + int error, i; + + for (i = 0; i < sc->num_timers; i++) { + t = &sc->t[i]; + if (t->irq != irq) + continue; + error = PCIB_MAP_MSI( + device_get_parent(device_get_parent(dev)), dev, + irq, &addr, &data); + if (error) + return (error); + hpet_disable(sc); /* Stop timer to avoid interrupt loss. */ + bus_write_4(sc->mem_res, HPET_TIMER_FSB_ADDR(i), addr); + bus_write_4(sc->mem_res, HPET_TIMER_FSB_VAL(i), data); + hpet_enable(sc); + return (0); + } + return (ENOENT); +} +#endif + +static device_method_t hpet_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, acpi_hpet_identify), - DEVMETHOD(device_probe, acpi_hpet_probe), - DEVMETHOD(device_attach, acpi_hpet_attach), - DEVMETHOD(device_detach, acpi_hpet_detach), - DEVMETHOD(device_suspend, acpi_hpet_suspend), - DEVMETHOD(device_resume, acpi_hpet_resume), + DEVMETHOD(device_identify, hpet_identify), + DEVMETHOD(device_probe, hpet_probe), + DEVMETHOD(device_attach, hpet_attach), + DEVMETHOD(device_detach, hpet_detach), + DEVMETHOD(device_suspend, hpet_suspend), + DEVMETHOD(device_resume, hpet_resume), + +#ifdef DEV_APIC + DEVMETHOD(bus_remap_intr, hpet_remap_intr), +#endif {0, 0} }; -static driver_t acpi_hpet_driver = { - "acpi_hpet", - acpi_hpet_methods, - sizeof(struct acpi_hpet_softc), +static driver_t hpet_driver = { + "hpet", + hpet_methods, + sizeof(struct hpet_softc), }; - -DRIVER_MODULE(acpi_hpet, acpi, acpi_hpet_driver, acpi_hpet_devclass, 0, 0); -MODULE_DEPEND(acpi_hpet, acpi, 1, 1, 1); +DRIVER_MODULE(hpet, acpi, hpet_driver, hpet_devclass, 0, 0); +MODULE_DEPEND(hpet, acpi, 1, 1, 1); Modified: head/sys/dev/acpica/acpi_hpet.h ============================================================================== --- head/sys/dev/acpica/acpi_hpet.h Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/dev/acpica/acpi_hpet.h Sun Jun 20 21:33:29 2010 (r209371) @@ -57,7 +57,7 @@ #define HPET_TCAP_PER_INT 0x00000010 /* Supports periodic interrupts */ #define HPET_TCNF_TYPE 0x00000008 /* 1 = periodic, 0 = one-shot */ #define HPET_TCNF_INT_ENB 0x00000004 -#define HPET_TCNT_INT_TYPE 0x00000002 /* 1 = level triggered, 0 = edge */ +#define HPET_TCNF_INT_TYPE 0x00000002 /* 1 = level triggered, 0 = edge */ #define HPET_TIMER_COMPARATOR(x) ((x) * 0x20 + 0x108) #define HPET_TIMER_FSB_VAL(x) ((x) * 0x20 + 0x110) #define HPET_TIMER_FSB_ADDR(x) ((x) * 0x20 + 0x114) Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/i386/i386/mp_machdep.c Sun Jun 20 21:33:29 2010 (r209371) @@ -728,10 +728,11 @@ init_secondary(void) } mtx_unlock_spin(&ap_boot_mtx); - /* wait until all the AP's are up */ while (smp_started == 0) ia32_pause(); + /* Start per-CPU event timers. */ + cpu_initclocks_ap(); /* enter the scheduler */ sched_throw(NULL); Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/i386/include/apicvar.h Sun Jun 20 21:33:29 2010 (r209371) @@ -187,12 +187,6 @@ #define APIC_BUS_PCI 2 #define APIC_BUS_MAX APIC_BUS_PCI -enum lapic_clock { - LAPIC_CLOCK_NONE, - LAPIC_CLOCK_HARDCLOCK, - LAPIC_CLOCK_ALL -}; - /* * An APIC enumerator is a psuedo bus driver that enumerates APIC's including * CPU's and I/O APIC's. @@ -263,7 +257,6 @@ int lapic_set_lvt_triggermode(u_int apic enum intr_trigger trigger); void lapic_set_tpr(u_int vector); void lapic_setup(int boot); -enum lapic_clock lapic_setup_clock(enum lapic_clock srcsdes); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: head/sys/isa/rtc.h ============================================================================== --- head/sys/isa/rtc.h Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/isa/rtc.h Sun Jun 20 21:33:29 2010 (r209371) @@ -114,11 +114,7 @@ #ifdef _KERNEL extern struct mtx clock_lock; extern int atrtcclock_disable; -int atrtc_setup_clock(void); int rtcin(int reg); -void atrtc_start(void); -void atrtc_rate(unsigned rate); -void atrtc_enable_intr(void); void atrtc_restore(void); void writertc(int reg, u_char val); #endif Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sun Jun 20 18:26:04 2010 (r209370) +++ head/sys/kern/kern_clock.c Sun Jun 20 21:33:29 2010 (r209371) @@ -392,7 +392,7 @@ initclocks(dummy) * Set divisors to 1 (normal case) and let the machine-specific * code do its bit. */ - mtx_init(&time_lock, "time lock", NULL, MTX_SPIN); + mtx_init(&time_lock, "time lock", NULL, MTX_DEF); cpu_initclocks(); /* @@ -449,7 +449,7 @@ timer2clock(int usermode, uintfptr_t pc) *cnt -= t2hz; if (*cnt >= t2hz) *cnt = 0; - profclock(usermode, pc); + profclock(usermode, pc); } } @@ -599,10 +599,10 @@ startprofclock(p) return; if ((p->p_flag & P_PROFIL) == 0) { p->p_flag |= P_PROFIL; - mtx_lock_spin(&time_lock); + mtx_lock(&time_lock); if (++profprocs == 1) cpu_startprofclock(); - mtx_unlock_spin(&time_lock); + mtx_unlock(&time_lock); } } @@ -626,10 +626,10 @@ stopprofclock(p) if ((p->p_flag & P_PROFIL) == 0) return; p->p_flag &= ~P_PROFIL; - mtx_lock_spin(&time_lock); + mtx_lock(&time_lock); if (--profprocs == 0) cpu_stopprofclock(); - mtx_unlock_spin(&time_lock); + mtx_unlock(&time_lock); } } Added: head/sys/kern/kern_et.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/kern_et.c Sun Jun 20 21:33:29 2010 (r209371) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2010 Alexander Motin + * 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, + * without modification, immediately at the beginning of the file. + * 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 + +SLIST_HEAD(et_eventtimers_list, eventtimer); +static struct et_eventtimers_list eventtimers = SLIST_HEAD_INITIALIZER(et_eventtimers); + +struct mtx et_eventtimers_mtx; +MTX_SYSINIT(et_eventtimers_init, &et_eventtimers_mtx, "et_mtx", MTX_SPIN); + +SYSCTL_NODE(_kern, OID_AUTO, eventtimer, CTLFLAG_RW, 0, "Event timers"); +SYSCTL_NODE(_kern_eventtimer, OID_AUTO, et, CTLFLAG_RW, 0, ""); + +/* + * Register a new event timer hardware. + */ +int +et_register(struct eventtimer *et) +{ + struct eventtimer *tmp, *next; + + if (et->et_quality >= 0 || bootverbose) { + printf("Event timer \"%s\" frequency %ju Hz quality %d\n", + et->et_name, (uintmax_t)et->et_frequency, + et->et_quality); + } + et->et_sysctl = SYSCTL_ADD_NODE(NULL, + SYSCTL_STATIC_CHILDREN(_kern_eventtimer_et), OID_AUTO, et->et_name, + CTLFLAG_RW, 0, "event timer description"); + SYSCTL_ADD_UINT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, + "flags", CTLFLAG_RD, &(et->et_flags), 0, + "Event timer capabilities"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, + "frequency", CTLFLAG_RD, &(et->et_frequency), 0, + "Event timer base frequency"); + SYSCTL_ADD_INT(NULL, SYSCTL_CHILDREN(et->et_sysctl), OID_AUTO, + "quality", CTLFLAG_RD, &(et->et_quality), 0, + "Goodness of event timer"); + ET_LOCK(); + if (SLIST_EMPTY(&eventtimers) || + SLIST_FIRST(&eventtimers)->et_quality < et->et_quality) { + SLIST_INSERT_HEAD(&eventtimers, et, et_all); + } else { + SLIST_FOREACH(tmp, &eventtimers, et_all) { + next = SLIST_NEXT(tmp, et_all); + if (next == NULL || next->et_quality < et->et_quality) { + SLIST_INSERT_AFTER(tmp, et, et_all); + break; + } + } + } + ET_UNLOCK(); + return (0); +} + +/* + * Deregister event timer hardware. + */ +int +et_deregister(struct eventtimer *et) +{ + int err = 0; + + if (et->et_deregister_cb != NULL) { + if ((err = et->et_deregister_cb(et, et->et_arg)) != 0) + return (err); + } + + ET_LOCK(); + SLIST_REMOVE(&eventtimers, et, eventtimer, et_all); + ET_UNLOCK(); + sysctl_remove_oid(et->et_sysctl, 1, 1); + return (0); +} + +/* + * Find free event timer hardware with specified parameters. + */ +struct eventtimer * +et_find(const char *name, int check, int want) +{ + struct eventtimer *et = NULL; + + SLIST_FOREACH(et, &eventtimers, et_all) { + if (et->et_active) + continue; + if (name != NULL && strcasecmp(et->et_name, name) != 0) + continue; + if (name == NULL && et->et_quality < 0) + continue; + if ((et->et_flags & check) != want) + continue; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 04:37:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A283A106564A; Mon, 21 Jun 2010 04:37:39 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90C778FC18; Mon, 21 Jun 2010 04:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5L4bdEk017064; Mon, 21 Jun 2010 04:37:39 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L4bdps017062; Mon, 21 Jun 2010 04:37:39 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006210437.o5L4bdps017062@svn.freebsd.org> From: Matt Jacob Date: Mon, 21 Jun 2010 04:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209383 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 04:37:39 -0000 Author: mjacob Date: Mon Jun 21 04:37:39 2010 New Revision: 209383 URL: http://svn.freebsd.org/changeset/base/209383 Log: This is an MFC of 208895. Fix XPT_GET_TRAN_SETTING for FC which has been broken for while so that it will figure out the correct target to handle index and be able to find things like WWPN, etc. Modified: stable/8/sys/dev/isp/isp_freebsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Mon Jun 21 04:06:01 2010 (r209382) +++ stable/8/sys/dev/isp/isp_freebsd.c Mon Jun 21 04:37:39 2010 (r209383) @@ -4499,6 +4499,7 @@ isp_action(struct cam_sim *sim, union cc fcparam *fcp = FCPARAM(isp, bus); struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi; struct ccb_trans_settings_fc *fc = &cts->xport_specific.fc; + unsigned int hdlidx; cts->protocol = PROTO_SCSI; cts->protocol_version = SCSI_REV_2; @@ -4510,8 +4511,9 @@ isp_action(struct cam_sim *sim, union cc fc->valid = CTS_FC_VALID_SPEED; fc->bitrate = 100000; fc->bitrate *= fcp->isp_gbspeed; - if (tgt > 0 && tgt < MAX_FC_TARG) { - fcportdb_t *lp = &fcp->portdb[tgt]; + hdlidx = fcp->isp_dev_map[tgt] - 1; + if (hdlidx < MAX_FC_TARG) { + fcportdb_t *lp = &fcp->portdb[hdlidx]; fc->wwnn = lp->node_wwn; fc->wwpn = lp->port_wwn; fc->port = lp->portid; From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 05:42:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D3D0106564A; Mon, 21 Jun 2010 05:42:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BB728FC08; Mon, 21 Jun 2010 05:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5L5gacd031444; Mon, 21 Jun 2010 05:42:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L5gabi031442; Mon, 21 Jun 2010 05:42:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006210542.o5L5gabi031442@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 21 Jun 2010 05:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209385 - stable/8/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 05:42:36 -0000 Author: ae Date: Mon Jun 21 05:42:36 2010 New Revision: 209385 URL: http://svn.freebsd.org/changeset/base/209385 Log: MFC r208886: libgeom(3) does strdup of param name. Don't leak memory when deleting param from gctl_req. Approved by: mav (mentor) Modified: stable/8/sbin/geom/misc/subr.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/misc/subr.c ============================================================================== --- stable/8/sbin/geom/misc/subr.c Mon Jun 21 05:42:21 2010 (r209384) +++ stable/8/sbin/geom/misc/subr.c Mon Jun 21 05:42:36 2010 (r209385) @@ -436,6 +436,7 @@ gctl_delete_param(struct gctl_req *req, if (i == req->narg) return (ENOENT); + free(ap->name); req->narg--; while (i < req->narg) { req->arg[i] = req->arg[i + 1]; From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 08:24:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F7491065672; Mon, 21 Jun 2010 08:24:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D7128FC14; Mon, 21 Jun 2010 08:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5L8OpM6067289; Mon, 21 Jun 2010 08:24:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L8OpFD067283; Mon, 21 Jun 2010 08:24:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006210824.o5L8OpFD067283@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 21 Jun 2010 08:24: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: r209388 - in head/sbin/geom: class/part core misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 08:24:52 -0000 Author: ae Date: Mon Jun 21 08:24:50 2010 New Revision: 209388 URL: http://svn.freebsd.org/changeset/base/209388 Log: Remove G_TYPE_ASCLBA type and replace it with G_TYPE_STRING in gpart. Move code that converts params from humanized numbers to sectors count to subr.c and adjust comment. Add post-processing for "size" and "start offset" params in gpart, now they are properly converted to sectors count with known sector size that can be greater that 512 bytes. Also replace "unsigned long long" type to "off_t" for unify code since it used for medium size in libgeom(3) and DIOCGMEDIASIZE ioctl. PR: bin/146277 Reviewed by: marcel (previous version) Approved by: kib (mentor) MFC after: 1 month Modified: head/sbin/geom/class/part/geom_part.c head/sbin/geom/core/geom.c head/sbin/geom/core/geom.h head/sbin/geom/misc/subr.c head/sbin/geom/misc/subr.h Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Mon Jun 21 07:17:48 2010 (r209387) +++ head/sbin/geom/class/part/geom_part.c Mon Jun 21 08:24:50 2010 (r209388) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -60,6 +62,9 @@ static char autofill[] = "*"; static char optional[] = ""; static char flags[] = "C"; +static char sstart[32]; +static char ssize[32]; + static const char const bootcode_param[] = "bootcode"; static const char const index_param[] = "index"; static const char const partcode_param[] = "partcode"; @@ -68,8 +73,7 @@ static struct gclass *find_class(struct static struct ggeom * find_geom(struct gclass *, const char *); static const char *find_geomcfg(struct ggeom *, const char *); static const char *find_provcfg(struct gprovider *, const char *); -static struct gprovider *find_provider(struct ggeom *, - unsigned long long); +static struct gprovider *find_provider(struct ggeom *, off_t); static const char *fmtsize(int64_t); static int gpart_autofill(struct gctl_req *); static int gpart_autofill_resize(struct gctl_req *); @@ -84,8 +88,8 @@ static void gpart_write_partcode_vtoc8(s struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { - { 'b', "start", autofill, G_TYPE_ASCLBA }, - { 's', "size", autofill, G_TYPE_ASCLBA }, + { 'b', "start", autofill, G_TYPE_STRING }, + { 's', "size", autofill, G_TYPE_STRING }, { 't', "type", NULL, G_TYPE_STRING }, { 'i', index_param, optional, G_TYPE_ASCNUM }, { 'l', "label", optional, G_TYPE_STRING }, @@ -149,7 +153,7 @@ struct g_command PUBSYM(class_commands)[ "geom", NULL }, { "resize", 0, gpart_issue, { - { 's', "size", autofill, G_TYPE_ASCLBA }, + { 's', "size", autofill, G_TYPE_STRING }, { 'i', index_param, NULL, G_TYPE_ASCNUM }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, @@ -207,11 +211,11 @@ find_provcfg(struct gprovider *pp, const } static struct gprovider * -find_provider(struct ggeom *gp, unsigned long long minsector) +find_provider(struct ggeom *gp, off_t minsector) { struct gprovider *pp, *bestpp; const char *s; - unsigned long long sector, bestsector; + off_t sector, bestsector; bestpp = NULL; bestsector = 0; @@ -219,9 +223,10 @@ find_provider(struct ggeom *gp, unsigned s = find_provcfg(pp, "start"); if (s == NULL) { s = find_provcfg(pp, "offset"); - sector = atoll(s) / pp->lg_sectorsize; + sector = + (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else - sector = atoll(s); + sector = (off_t)strtoimax(s, NULL, 0); if (sector < minsector) continue; @@ -271,18 +276,12 @@ gpart_autofill_resize(struct gctl_req *r struct gclass *cp; struct ggeom *gp; struct gprovider *pp; - unsigned long long last, size, start, new_size; - unsigned long long lba, new_lba; + off_t last, size, start, new_size; + off_t lba, new_lba; const char *s; char *val; int error, idx; - s = gctl_get_ascii(req, "size"); - if (*s == '*') - new_size = (unsigned long long)atoll(s); - else - return (0); - s = gctl_get_ascii(req, index_param); idx = strtol(s, &val, 10); if (idx < 1 || *s == '\0' || *val != '\0') @@ -303,8 +302,22 @@ gpart_autofill_resize(struct gctl_req *r gp = find_geom(cp, s); if (gp == NULL) errx(EXIT_FAILURE, "No such geom: %s.", s); - last = atoll(find_geomcfg(gp, "last")); + pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; + if (pp == NULL) + errx(EXIT_FAILURE, "Provider for geom %s not found.", s); + + s = gctl_get_ascii(req, "size"); + if (*s == '*') + new_size = 0; + else { + error = g_parse_lba(s, pp->lg_sectorsize, &new_size); + if (error) + errc(EXIT_FAILURE, error, "Invalid size param"); + /* no autofill necessary. */ + goto done; + } + last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); if (s == NULL) @@ -318,18 +331,21 @@ gpart_autofill_resize(struct gctl_req *r s = find_provcfg(pp, "start"); if (s == NULL) { s = find_provcfg(pp, "offset"); - start = atoll(s) / pp->lg_sectorsize; + start = (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else - start = atoll(s); + start = (off_t)strtoimax(s, NULL, 0); s = find_provcfg(pp, "end"); if (s == NULL) { s = find_provcfg(pp, "length"); - lba = start + atoll(s) / pp->lg_sectorsize; + lba = start + + (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else - lba = atoll(s) + 1; + lba = (off_t)strtoimax(s, NULL, 0) + 1; - if (lba > last) + if (lba > last) { + geom_deletetree(&mesh); return (ENOSPC); + } size = lba - start; pp = find_provider(gp, lba); if (pp == NULL) @@ -338,22 +354,25 @@ gpart_autofill_resize(struct gctl_req *r s = find_provcfg(pp, "start"); if (s == NULL) { s = find_provcfg(pp, "offset"); - new_lba = atoll(s) / pp->lg_sectorsize; + new_lba = + (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else - new_lba = atoll(s); - /* Is there any free space between current and + new_lba = (off_t)strtoimax(s, NULL, 0); + /* + * Is there any free space between current and * next providers? */ if (new_lba > lba) new_size = new_lba - start; - else + else { + geom_deletetree(&mesh); return (ENOSPC); + } } - asprintf(&val, "%llu", new_size); - if (val == NULL) - return (ENOMEM); - gctl_change_param(req, "size", -1, val); - +done: + snprintf(ssize, sizeof(ssize), "%jd", (intmax_t)new_size); + gctl_change_param(req, "size", -1, ssize); + geom_deletetree(&mesh); return (0); } @@ -364,11 +383,11 @@ gpart_autofill(struct gctl_req *req) struct gclass *cp; struct ggeom *gp; struct gprovider *pp; - unsigned long long first, last; - unsigned long long size, start; - unsigned long long lba, len, grade; + off_t first, last; + off_t size, start; + off_t lba, len; + uintmax_t grade; const char *s; - char *val; int error, has_size, has_start; s = gctl_get_ascii(req, "verb"); @@ -377,18 +396,6 @@ gpart_autofill(struct gctl_req *req) if (strcmp(s, "add") != 0) return (0); - s = gctl_get_ascii(req, "size"); - has_size = (*s == '*') ? 0 : 1; - size = (has_size) ? (unsigned long long)atoll(s) : 0ULL; - - s = gctl_get_ascii(req, "start"); - has_start = (*s == '*') ? 0 : 1; - start = (has_start) ? (unsigned long long)atoll(s) : ~0ULL; - - /* No autofill necessary. */ - if (has_size && has_start) - return (0); - error = geom_gettree(&mesh); if (error) return (error); @@ -404,22 +411,49 @@ gpart_autofill(struct gctl_req *req) gp = find_geom(cp, s); if (gp == NULL) errx(EXIT_FAILURE, "No such geom: %s.", s); - first = atoll(find_geomcfg(gp, "first")); - last = atoll(find_geomcfg(gp, "last")); + pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; + if (pp == NULL) + errx(EXIT_FAILURE, "Provider for geom %s not found.", s); + + s = gctl_get_ascii(req, "size"); + has_size = (*s == '*') ? 0 : 1; + size = 0; + if (has_size) { + error = g_parse_lba(s, pp->lg_sectorsize, &size); + if (error) + errc(EXIT_FAILURE, error, "Invalid size param"); + } + + s = gctl_get_ascii(req, "start"); + has_start = (*s == '*') ? 0 : 1; + start = 0ULL; + if (has_start) { + error = g_parse_lba(s, pp->lg_sectorsize, &start); + if (error) + errc(EXIT_FAILURE, error, "Invalid start param"); + } + + /* No autofill necessary. */ + if (has_size && has_start) + goto done; + + first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); + last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); grade = ~0ULL; while ((pp = find_provider(gp, first)) != NULL) { s = find_provcfg(pp, "start"); if (s == NULL) { s = find_provcfg(pp, "offset"); - lba = atoll(s) / pp->lg_sectorsize; + lba = (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else - lba = atoll(s); + lba = (off_t)strtoimax(s, NULL, 0); if (first < lba) { /* Free space [first, lba> */ len = lba - first; if (has_size) { - if (len >= size && len - size < grade) { + if (len >= size && + (uintmax_t)(len - size) < grade) { start = first; grade = len - size; } @@ -440,15 +474,17 @@ gpart_autofill(struct gctl_req *req) s = find_provcfg(pp, "end"); if (s == NULL) { s = find_provcfg(pp, "length"); - first = lba + atoll(s) / pp->lg_sectorsize; + first = lba + + (off_t)strtoimax(s, NULL, 0) / pp->lg_sectorsize; } else - first = atoll(s) + 1; + first = (off_t)strtoimax(s, NULL, 0) + 1; } if (first <= last) { /* Free space [first-last] */ len = last - first + 1; if (has_size) { - if (len >= size && len - size < grade) { + if (len >= size && + (uintmax_t)(len - size) < grade) { start = first; grade = len - size; } @@ -466,21 +502,17 @@ gpart_autofill(struct gctl_req *req) } } - if (grade == ~0ULL) + if (grade == ~0ULL) { + geom_deletetree(&mesh); return (ENOSPC); - - if (!has_size) { - asprintf(&val, "%llu", size); - if (val == NULL) - return (ENOMEM); - gctl_change_param(req, "size", -1, val); - } - if (!has_start) { - asprintf(&val, "%llu", start); - if (val == NULL) - return (ENOMEM); - gctl_change_param(req, "start", -1, val); } + +done: + snprintf(ssize, sizeof(ssize), "%jd", (intmax_t)size); + gctl_change_param(req, "size", -1, ssize); + snprintf(sstart, sizeof(sstart), "%jd", (intmax_t)start); + gctl_change_param(req, "start", -1, sstart); + geom_deletetree(&mesh); return (0); } @@ -489,21 +521,21 @@ gpart_show_geom(struct ggeom *gp, const { struct gprovider *pp; const char *s, *scheme; - unsigned long long first, last, sector, end; - unsigned long long length, secsz; + off_t first, last, sector, end; + off_t length, secsz; int idx, wblocks, wname; scheme = find_geomcfg(gp, "scheme"); s = find_geomcfg(gp, "first"); - first = atoll(s); + first = (off_t)strtoimax(s, NULL, 0); s = find_geomcfg(gp, "last"); - last = atoll(s); + last = (off_t)strtoimax(s, NULL, 0); wblocks = strlen(s); wname = strlen(gp->lg_name); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; secsz = pp->lg_sectorsize; - printf("=>%*llu %*llu %*s %s (%s)\n", - wblocks, first, wblocks, (last - first + 1), + printf("=>%*jd %*jd %*s %s (%s)\n", + wblocks, (intmax_t)first, wblocks, (intmax_t)(last - first + 1), wname, gp->lg_name, scheme, fmtsize(pp->lg_mediasize)); @@ -511,37 +543,37 @@ gpart_show_geom(struct ggeom *gp, const s = find_provcfg(pp, "start"); if (s == NULL) { s = find_provcfg(pp, "offset"); - sector = atoll(s) / secsz; + sector = (off_t)strtoimax(s, NULL, 0) / secsz; } else - sector = atoll(s); + sector = (off_t)strtoimax(s, NULL, 0); s = find_provcfg(pp, "end"); if (s == NULL) { s = find_provcfg(pp, "length"); - length = atoll(s) / secsz; + length = (off_t)strtoimax(s, NULL, 0) / secsz; end = sector + length - 1; } else { - end = atoll(s); + end = (off_t)strtoimax(s, NULL, 0); length = end - sector + 1; } s = find_provcfg(pp, "index"); idx = atoi(s); if (first < sector) { - printf(" %*llu %*llu %*s - free - (%s)\n", - wblocks, first, wblocks, sector - first, - wname, "", + printf(" %*jd %*jd %*s - free - (%s)\n", + wblocks, (intmax_t)first, wblocks, + (intmax_t)(sector - first), wname, "", fmtsize((sector - first) * secsz)); } - printf(" %*llu %*llu %*d %s %s (%s)\n", - wblocks, sector, wblocks, length, + printf(" %*jd %*jd %*d %s %s (%s)\n", + wblocks, (intmax_t)sector, wblocks, (intmax_t)length, wname, idx, find_provcfg(pp, element), fmtattrib(pp), fmtsize(pp->lg_mediasize)); first = end + 1; } if (first <= last) { length = last - first + 1; - printf(" %*llu %*llu %*s - free - (%s)\n", - wblocks, first, wblocks, length, + printf(" %*jd %*jd %*s - free - (%s)\n", + wblocks, (intmax_t)first, wblocks, (intmax_t)length, wname, "", fmtsize(length * secsz)); } Modified: head/sbin/geom/core/geom.c ============================================================================== --- head/sbin/geom/core/geom.c Mon Jun 21 07:17:48 2010 (r209387) +++ head/sbin/geom/core/geom.c Mon Jun 21 08:24:50 2010 (r209388) @@ -259,94 +259,6 @@ set_option(struct gctl_req *req, struct opt->go_val); } else gctl_ro_param(req, opt->go_name, -1, opt->go_val); - } else if (G_OPT_TYPE(opt) == G_TYPE_ASCLBA) { - /* - * LBAs are ugly. The argument is a sector. The size of a - * sector is context specific (i.e. determined by the media), - * which we don't know here. But when users enter a value - * with a SI unit, they really mean the byte-size or byte- - * offset and not the size or offset in sectors. - * So how can we map the byte-oriented value into a sector- - * oriented value if we don't know the sector size in bytes? - * The approach taken here is: - * o Sectors are 512 bytes in size. Mostly the case anyway. - * o When no SI unit is specified the value is in sectors. - * o With an SI unit the value is in bytes. - * o The 'b' suffix forces byte interpretation and the 's' - * suffix forces sector interpretation. - * - * Thus: - * o 2 and 2s mean 2 sectors, and 2b means 2 bytes. - * o 4k and 4kb mean 4096 bytes, and 4ks means 4096 sectors. - * - * "This seemed like a good idea at the time" - */ - intmax_t mult, unit; - - number = strtoimax(val, &s, 0); - if (s == val) - errc(EXIT_FAILURE, EINVAL, "argument '%c'", - opt->go_char); - mult = 1; - unit = 512; /* sector */ - if (*s == '\0') - goto done; - switch (*s) { - case 'e': case 'E': - mult *= 1024; - /*FALLTHROUGH*/ - case 'p': case 'P': - mult *= 1024; - /*FALLTHROUGH*/ - case 't': case 'T': - mult *= 1024; - /*FALLTHROUGH*/ - case 'g': case 'G': - mult *= 1024; - /*FALLTHROUGH*/ - case 'm': case 'M': - mult *= 1024; - /*FALLTHROUGH*/ - case 'k': case 'K': - mult *= 1024; - break; - default: - goto sfx; - } - unit = 1; /* bytes */ - s++; - if (*s == '\0') - goto done; -sfx: - switch (*s) { - case 's': case 'S': - unit = 512; /* sector */ - break; - case 'b': case 'B': - unit = 1; /* bytes */ - break; - default: - errc(EXIT_FAILURE, EINVAL, "argument '%c': suffix '%c'", - opt->go_char, *s); - } - s++; - if (*s != '\0') - errx(EXIT_FAILURE, "argument '%c': junk at end (%s)", - opt->go_char, s); -done: - if (mult * unit < mult || number * mult * unit < number) - errc(EXIT_FAILURE, ERANGE, "argument '%c'", - opt->go_char); - number *= mult * unit; - if (number % 512) - errx(EXIT_FAILURE, "argument '%c': " - "not a valid block address", opt->go_char); - number /= 512; - asprintf(&s, "%jd", number); - if (s == NULL) - err(EXIT_FAILURE, NULL); - opt->go_val = s; - gctl_ro_param(req, opt->go_name, -1, s); } else if (G_OPT_TYPE(opt) == G_TYPE_STRING) { gctl_ro_param(req, opt->go_name, -1, val); } else if (G_OPT_TYPE(opt) == G_TYPE_BOOL) { @@ -439,8 +351,7 @@ parse_arguments(struct g_command *cmd, s gctl_ro_param(req, opt->go_name, sizeof(intmax_t), opt->go_val); } else if (G_OPT_TYPE(opt) == G_TYPE_STRING || - G_OPT_TYPE(opt) == G_TYPE_ASCNUM || - G_OPT_TYPE(opt) == G_TYPE_ASCLBA) { + G_OPT_TYPE(opt) == G_TYPE_ASCNUM) { if (cmd->gc_argname == NULL || opt->go_val == NULL || *(char *)opt->go_val != '\0') Modified: head/sbin/geom/core/geom.h ============================================================================== --- head/sbin/geom/core/geom.h Mon Jun 21 07:17:48 2010 (r209387) +++ head/sbin/geom/core/geom.h Mon Jun 21 08:24:50 2010 (r209388) @@ -39,7 +39,6 @@ #define G_TYPE_STRING 0x02 #define G_TYPE_NUMBER 0x03 #define G_TYPE_ASCNUM 0x04 -#define G_TYPE_ASCLBA 0x05 #define G_TYPE_MASK 0x0f #define G_TYPE_DONE 0x10 Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Mon Jun 21 07:17:48 2010 (r209387) +++ head/sbin/geom/misc/subr.c Mon Jun 21 08:24:50 2010 (r209388) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -107,6 +109,94 @@ bitcount32(uint32_t x) return (x); } +/* + * The size of a sector is context specific (i.e. determined by the + * media). But when users enter a value with a SI unit, they really + * mean the byte-size or byte-offset and not the size or offset in + * sectors. We should map the byte-oriented value into a sector-oriented + * value when we already know the sector size in bytes. At this time + * we can use g_parse_lba() function. It converts user specified + * value into sectors with following conditions: + * o Sectors size taken as argument from caller. + * o When no SI unit is specified the value is in sectors. + * o With an SI unit the value is in bytes. + * o The 'b' suffix forces byte interpretation and the 's' + * suffix forces sector interpretation. + * + * Thus: + * o 2 and 2s mean 2 sectors, and 2b means 2 bytes. + * o 4k and 4kb mean 4096 bytes, and 4ks means 4096 sectors. + * + */ +int +g_parse_lba(const char *lbastr, unsigned sectorsize, off_t *sectors) +{ + off_t number, mult, unit; + char *s; + + assert(lbastr != NULL); + assert(sectorsize > 0); + assert(sectors != NULL); + + number = (off_t)strtoimax(lbastr, &s, 0); + if (s == lbastr) + return (EINVAL); + + mult = 1; + unit = sectorsize; + if (*s == '\0') + goto done; + switch (*s) { + case 'e': case 'E': + mult *= 1024; + /* FALLTHROUGH */ + case 'p': case 'P': + mult *= 1024; + /* FALLTHROUGH */ + case 't': case 'T': + mult *= 1024; + /* FALLTHROUGH */ + case 'g': case 'G': + mult *= 1024; + /* FALLTHROUGH */ + case 'm': case 'M': + mult *= 1024; + /* FALLTHROUGH */ + case 'k': case 'K': + mult *= 1024; + break; + default: + goto sfx; + } + unit = 1; /* bytes */ + s++; + if (*s == '\0') + goto done; +sfx: + switch (*s) { + case 's': case 'S': + unit = sectorsize; /* sector */ + break; + case 'b': case 'B': + unit = 1; /* bytes */ + break; + default: + return (EINVAL); + } + s++; + if (*s != '\0') + return (EINVAL); +done: + if (mult * unit < mult || number * mult * unit < number) + return (ERANGE); + number *= mult * unit; + if (number % sectorsize) + return (EINVAL); + number /= sectorsize; + *sectors = number; + return (0); +} + off_t g_get_mediasize(const char *name) { Modified: head/sbin/geom/misc/subr.h ============================================================================== --- head/sbin/geom/misc/subr.h Mon Jun 21 07:17:48 2010 (r209387) +++ head/sbin/geom/misc/subr.h Mon Jun 21 08:24:50 2010 (r209388) @@ -32,6 +32,7 @@ unsigned g_lcm(unsigned a, unsigned b); uint32_t bitcount32(uint32_t x); +int g_parse_lba(const char *lbastr, unsigned sectorsize, off_t *sectors); off_t g_get_mediasize(const char *name); unsigned g_get_sectorsize(const char *name); From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 09:51:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B856E106566B; Mon, 21 Jun 2010 09:51:25 +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 A809D8FC16; Mon, 21 Jun 2010 09:51:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5L9pPjN086442; Mon, 21 Jun 2010 09:51:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L9pP7g086440; Mon, 21 Jun 2010 09:51:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006210951.o5L9pP7g086440@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Jun 2010 09:51: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: r209389 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 09:51:25 -0000 Author: kib Date: Mon Jun 21 09:51:25 2010 New Revision: 209389 URL: http://svn.freebsd.org/changeset/base/209389 Log: Do not report a stack garbage as the old value for debug.ncores sysctl. Reported by: brucec Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon Jun 21 08:24:50 2010 (r209388) +++ head/sys/kern/kern_sig.c Mon Jun 21 09:51:25 2010 (r209389) @@ -2953,7 +2953,8 @@ sysctl_debug_num_cores_check (SYSCTL_HAN { int error; int new_val; - + + new_val = num_cores; error = sysctl_handle_int(oidp, &new_val, 0, req); if (error != 0 || req->newptr == NULL) return (error); From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 09:55:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3348A106564A; Mon, 21 Jun 2010 09:55:57 +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 21C1A8FC1A; Mon, 21 Jun 2010 09:55:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5L9tvF4087512; Mon, 21 Jun 2010 09:55:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5L9tuAc087486; Mon, 21 Jun 2010 09:55:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006210955.o5L9tuAc087486@svn.freebsd.org> From: Ed Schouten Date: Mon, 21 Jun 2010 09:55: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: r209390 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 09:55:57 -0000 Author: ed Date: Mon Jun 21 09:55:56 2010 New Revision: 209390 URL: http://svn.freebsd.org/changeset/base/209390 Log: Use ISO C99 integer types in sys/kern where possible. There are only about 100 occurences of the BSD-specific u_int*_t datatypes in sys/kern. The ISO C99 integer types are used here more often. Modified: head/sys/kern/kern_acct.c head/sys/kern/kern_clock.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_module.c head/sys/kern/kern_resource.c head/sys/kern/kern_sdt.c head/sys/kern/kern_tc.c head/sys/kern/kern_umtx.c head/sys/kern/makesyscalls.sh head/sys/kern/subr_bus.c head/sys/kern/subr_devstat.c head/sys/kern/subr_fattime.c head/sys/kern/subr_lock.c head/sys/kern/subr_mchain.c head/sys/kern/subr_module.c head/sys/kern/sys_process.c head/sys/kern/systrace_args.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_syscalls.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c Modified: head/sys/kern/kern_acct.c ============================================================================== --- head/sys/kern/kern_acct.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_acct.c Mon Jun 21 09:55:56 2010 (r209390) @@ -494,7 +494,7 @@ encode_timeval(struct timeval tv) val = 1000000 * tv.tv_sec + tv.tv_usec; } else { exp = log2_s + LOG2_1M - CALC_BITS; - val = (unsigned int)(((u_int64_t)1000000 * tv.tv_sec + + val = (unsigned int)(((uint64_t)1000000 * tv.tv_sec + tv.tv_usec) >> exp); } } Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_clock.c Mon Jun 21 09:55:56 2010 (r209390) @@ -790,7 +790,7 @@ static void watchdog_fire(void) { int nintr; - u_int64_t inttotal; + uint64_t inttotal; u_long *curintr; char *curname; Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_malloc.c Mon Jun 21 09:55:56 2010 (r209390) @@ -129,7 +129,7 @@ static int kmemcount; #define KMEM_ZMAX PAGE_SIZE #define KMEM_ZSIZE (KMEM_ZMAX >> KMEM_ZSHIFT) -static u_int8_t kmemsize[KMEM_ZSIZE + 1]; +static uint8_t kmemsize[KMEM_ZSIZE + 1]; /* * Small malloc(9) memory allocations are allocated from a set of UMA buckets @@ -558,7 +558,7 @@ reallocf(void *addr, unsigned long size, static void kmeminit(void *dummy) { - u_int8_t indx; + uint8_t indx; u_long mem_size; int i; @@ -879,8 +879,8 @@ DB_SHOW_COMMAND(malloc, db_show_malloc) { struct malloc_type_internal *mtip; struct malloc_type *mtp; - u_int64_t allocs, frees; - u_int64_t alloced, freed; + uint64_t allocs, frees; + uint64_t alloced, freed; int i; db_printf("%18s %12s %12s %12s\n", "Type", "InUse", "MemUse", Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_mbuf.c Mon Jun 21 09:55:56 2010 (r209390) @@ -233,7 +233,7 @@ static void mb_zfini_pack(void *, int); static void mb_reclaim(void *); static void mbuf_init(void *); -static void *mbuf_jumbo_alloc(uma_zone_t, int, u_int8_t *, int); +static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); /* Ensure that MSIZE doesn't break dtom() - it must be a power of 2 */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); @@ -350,7 +350,7 @@ mbuf_init(void *dummy) * pages. */ static void * -mbuf_jumbo_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) +mbuf_jumbo_alloc(uma_zone_t zone, int bytes, uint8_t *flags, int wait) { /* Inform UMA that this allocator uses kernel_map/object. */ Modified: head/sys/kern/kern_module.c ============================================================================== --- head/sys/kern/kern_module.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_module.c Mon Jun 21 09:55:56 2010 (r209390) @@ -455,9 +455,9 @@ MODULE_VERSION(kernel, __FreeBSD_version typedef union modspecific32 { int intval; - u_int32_t uintval; + uint32_t uintval; int longval; - u_int32_t ulongval; + uint32_t ulongval; } modspecific32_t; struct module_stat32 { Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_resource.c Mon Jun 21 09:55:56 2010 (r209390) @@ -851,7 +851,7 @@ calcru1(struct proc *p, struct rusage_ex struct timeval *sp) { /* {user, system, interrupt, total} {ticks, usec}: */ - u_int64_t ut, uu, st, su, it, tt, tu; + uint64_t ut, uu, st, su, it, tt, tu; ut = ruxp->rux_uticks; st = ruxp->rux_sticks; Modified: head/sys/kern/kern_sdt.c ============================================================================== --- head/sys/kern/kern_sdt.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_sdt.c Mon Jun 21 09:55:56 2010 (r209390) @@ -65,7 +65,7 @@ sdt_probe_func_t sdt_probe_func = sdt_pr * support to enable it. */ void -sdt_probe_stub(u_int32_t id, uintptr_t arg0, uintptr_t arg1, +sdt_probe_stub(uint32_t id, uintptr_t arg0, uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4) { printf("sdt_probe_stub: Why did this get called?\n"); Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_tc.c Mon Jun 21 09:55:56 2010 (r209390) @@ -51,7 +51,7 @@ struct timehands { /* These fields must be initialized by the driver. */ struct timecounter *th_counter; int64_t th_adjustment; - u_int64_t th_scale; + uint64_t th_scale; u_int th_offset_count; struct bintime th_offset; struct timeval th_microtime; @@ -134,7 +134,7 @@ sysctl_kern_timecounter_get(SYSCTL_HANDL static int sysctl_kern_timecounter_freq(SYSCTL_HANDLER_ARGS) { - u_int64_t freq; + uint64_t freq; struct timecounter *tc = arg1; freq = tc->tc_frequency; @@ -362,7 +362,7 @@ tc_init(struct timecounter *tc) } /* Report the frequency of the current timecounter. */ -u_int64_t +uint64_t tc_getfrequency(void) { @@ -412,7 +412,7 @@ tc_windup(void) { struct bintime bt; struct timehands *th, *tho; - u_int64_t scale; + uint64_t scale; u_int delta, ncount, ogen; int i; time_t t; @@ -507,7 +507,7 @@ tc_windup(void) * to the goddess of code clarity. * */ - scale = (u_int64_t)1 << 63; + scale = (uint64_t)1 << 63; scale += (th->th_adjustment / 1024) * 2199; scale /= th->th_counter->tc_frequency; th->th_scale = scale * 2; @@ -734,7 +734,7 @@ pps_event(struct pps_state *pps, int eve } #ifdef PPS_SYNC if (fhard) { - u_int64_t scale; + uint64_t scale; /* * Feed the NTP PLL/FLL. @@ -744,7 +744,7 @@ pps_event(struct pps_state *pps, int eve tcount = pps->capcount - pps->ppscount[2]; pps->ppscount[2] = pps->capcount; tcount &= pps->capth->th_counter->tc_counter_mask; - scale = (u_int64_t)1 << 63; + scale = (uint64_t)1 << 63; scale /= pps->capth->th_counter->tc_frequency; scale *= 2; bt.sec = 0; Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/kern_umtx.c Mon Jun 21 09:55:56 2010 (r209390) @@ -3285,8 +3285,8 @@ freebsd32_umtx_unlock(struct thread *td, } struct timespec32 { - u_int32_t tv_sec; - u_int32_t tv_nsec; + uint32_t tv_sec; + uint32_t tv_nsec; }; static inline int Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/makesyscalls.sh Mon Jun 21 09:55:56 2010 (r209390) @@ -165,7 +165,7 @@ s/\$//g printf "# created from%s\nMIASM = ", $0 > sysmk printf " * This file is part of the DTrace syscall provider.\n */\n\n" > systrace - printf "static void\nsystrace_args(int sysnum, void *params, u_int64_t *uarg, int *n_args)\n{\n" > systrace + printf "static void\nsystrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)\n{\n" > systrace printf "\tint64_t *iarg = (int64_t *) uarg;\n" > systrace printf "\tswitch (sysnum) {\n" > systrace Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/subr_bus.c Mon Jun 21 09:55:56 2010 (r209390) @@ -120,7 +120,7 @@ struct device { char* desc; /**< driver specific description */ int busy; /**< count of calls to device_busy() */ device_state_t state; /**< current device state */ - u_int32_t devflags; /**< api level flags for device_get_flags() */ + uint32_t devflags; /**< api level flags for device_get_flags() */ u_short flags; /**< internal device flags */ #define DF_ENABLED 1 /* device should be probed/attached */ #define DF_FIXEDCLASS 2 /* devclass specified at create time */ @@ -2207,7 +2207,7 @@ device_get_desc(device_t dev) /** * @brief Return the device's flags */ -u_int32_t +uint32_t device_get_flags(device_t dev) { return (dev->devflags); @@ -2315,7 +2315,7 @@ device_set_desc_copy(device_t dev, const * @brief Set the device's flags */ void -device_set_flags(device_t dev, u_int32_t flags) +device_set_flags(device_t dev, uint32_t flags) { dev->devflags = flags; } Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/subr_devstat.c Mon Jun 21 09:55:56 2010 (r209390) @@ -54,7 +54,7 @@ static struct devstatlist device_statq; static struct devstat *devstat_alloc(void); static void devstat_free(struct devstat *); static void devstat_add_entry(struct devstat *ds, const void *dev_name, - int unit_number, u_int32_t block_size, + int unit_number, uint32_t block_size, devstat_support_flags flags, devstat_type_flags device_type, devstat_priority priority); @@ -64,7 +64,7 @@ static void devstat_add_entry(struct dev */ struct devstat * devstat_new_entry(const void *dev_name, - int unit_number, u_int32_t block_size, + int unit_number, uint32_t block_size, devstat_support_flags flags, devstat_type_flags device_type, devstat_priority priority) @@ -99,7 +99,7 @@ devstat_new_entry(const void *dev_name, */ static void devstat_add_entry(struct devstat *ds, const void *dev_name, - int unit_number, u_int32_t block_size, + int unit_number, uint32_t block_size, devstat_support_flags flags, devstat_type_flags device_type, devstat_priority priority) @@ -275,7 +275,7 @@ devstat_start_transaction_bio(struct dev * atomic instructions using appropriate memory barriers. */ void -devstat_end_transaction(struct devstat *ds, u_int32_t bytes, +devstat_end_transaction(struct devstat *ds, uint32_t bytes, devstat_tag_type tag_type, devstat_trans_flags flags, struct bintime *now, struct bintime *then) { Modified: head/sys/kern/subr_fattime.c ============================================================================== --- head/sys/kern/subr_fattime.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/subr_fattime.c Mon Jun 21 09:55:56 2010 (r209390) @@ -135,7 +135,7 @@ static const struct { void -timespec2fattime(struct timespec *tsp, int utc, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp) +timespec2fattime(struct timespec *tsp, int utc, uint16_t *ddp, uint16_t *dtp, uint8_t *dhp) { time_t t1; unsigned t2, l, m; @@ -263,8 +263,8 @@ main(int argc __unused, char **argv __un struct timespec ts; struct tm tm; double a; - u_int16_t d, t; - u_int8_t p; + uint16_t d, t; + uint8_t p; char buf[100]; for (i = 0; i < 10000; i++) { Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/subr_lock.c Mon Jun 21 09:55:56 2010 (r209390) @@ -139,8 +139,8 @@ struct lock_profile_object { int lpo_line; uint16_t lpo_ref; uint16_t lpo_cnt; - u_int64_t lpo_acqtime; - u_int64_t lpo_waittime; + uint64_t lpo_acqtime; + uint64_t lpo_waittime; u_int lpo_contest_locking; }; @@ -199,15 +199,15 @@ static int lock_prof_skipspin; static int lock_prof_skipcount; #ifndef USE_CPU_NANOSECONDS -u_int64_t +uint64_t nanoseconds(void) { struct bintime bt; - u_int64_t ns; + uint64_t ns; binuptime(&bt); /* From bintime2timespec */ - ns = bt.sec * (u_int64_t)1000000000; + ns = bt.sec * (uint64_t)1000000000; ns += ((uint64_t)1000000000 * (uint32_t)(bt.frac >> 32)) >> 32; return (ns); } @@ -598,7 +598,7 @@ lock_profile_release_lock(struct lock_ob struct lock_profile_object *l; struct lock_prof_type *type; struct lock_prof *lp; - u_int64_t curtime, holdtime; + uint64_t curtime, holdtime; struct lpohead *head; int spin; Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/subr_mchain.c Mon Jun 21 09:55:56 2010 (r209390) @@ -125,34 +125,34 @@ mb_reserve(struct mbchain *mbp, int size } int -mb_put_uint8(struct mbchain *mbp, u_int8_t x) +mb_put_uint8(struct mbchain *mbp, uint8_t x) { return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); } int -mb_put_uint16be(struct mbchain *mbp, u_int16_t x) +mb_put_uint16be(struct mbchain *mbp, uint16_t x) { x = htobe16(x); return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); } int -mb_put_uint16le(struct mbchain *mbp, u_int16_t x) +mb_put_uint16le(struct mbchain *mbp, uint16_t x) { x = htole16(x); return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); } int -mb_put_uint32be(struct mbchain *mbp, u_int32_t x) +mb_put_uint32be(struct mbchain *mbp, uint32_t x) { x = htobe32(x); return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); } int -mb_put_uint32le(struct mbchain *mbp, u_int32_t x) +mb_put_uint32le(struct mbchain *mbp, uint32_t x) { x = htole32(x); return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); @@ -352,21 +352,21 @@ md_next_record(struct mdchain *mdp) } int -md_get_uint8(struct mdchain *mdp, u_int8_t *x) +md_get_uint8(struct mdchain *mdp, uint8_t *x) { return md_get_mem(mdp, x, 1, MB_MINLINE); } int -md_get_uint16(struct mdchain *mdp, u_int16_t *x) +md_get_uint16(struct mdchain *mdp, uint16_t *x) { return md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE); } int -md_get_uint16le(struct mdchain *mdp, u_int16_t *x) +md_get_uint16le(struct mdchain *mdp, uint16_t *x) { - u_int16_t v; + uint16_t v; int error = md_get_uint16(mdp, &v); if (x != NULL) @@ -375,8 +375,9 @@ md_get_uint16le(struct mdchain *mdp, u_i } int -md_get_uint16be(struct mdchain *mdp, u_int16_t *x) { - u_int16_t v; +md_get_uint16be(struct mdchain *mdp, uint16_t *x) +{ + uint16_t v; int error = md_get_uint16(mdp, &v); if (x != NULL) @@ -385,15 +386,15 @@ md_get_uint16be(struct mdchain *mdp, u_i } int -md_get_uint32(struct mdchain *mdp, u_int32_t *x) +md_get_uint32(struct mdchain *mdp, uint32_t *x) { return md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE); } int -md_get_uint32be(struct mdchain *mdp, u_int32_t *x) +md_get_uint32be(struct mdchain *mdp, uint32_t *x) { - u_int32_t v; + uint32_t v; int error; error = md_get_uint32(mdp, &v); @@ -403,9 +404,9 @@ md_get_uint32be(struct mdchain *mdp, u_i } int -md_get_uint32le(struct mdchain *mdp, u_int32_t *x) +md_get_uint32le(struct mdchain *mdp, uint32_t *x) { - u_int32_t v; + uint32_t v; int error; error = md_get_uint32(mdp, &v); Modified: head/sys/kern/subr_module.c ============================================================================== --- head/sys/kern/subr_module.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/subr_module.c Mon Jun 21 09:55:56 2010 (r209390) @@ -44,24 +44,24 @@ caddr_t preload_search_by_name(const char *name) { caddr_t curp; - u_int32_t *hdr; + uint32_t *hdr; int next; if (preload_metadata != NULL) { curp = preload_metadata; for (;;) { - hdr = (u_int32_t *)curp; + hdr = (uint32_t *)curp; if (hdr[0] == 0 && hdr[1] == 0) break; /* Search for a MODINFO_NAME field */ if ((hdr[0] == MODINFO_NAME) && - !strcmp(name, curp + sizeof(u_int32_t) * 2)) + !strcmp(name, curp + sizeof(uint32_t) * 2)) return(curp); /* skip to next field */ - next = sizeof(u_int32_t) * 2 + hdr[1]; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } @@ -76,7 +76,7 @@ caddr_t preload_search_by_type(const char *type) { caddr_t curp, lname; - u_int32_t *hdr; + uint32_t *hdr; int next; if (preload_metadata != NULL) { @@ -84,7 +84,7 @@ preload_search_by_type(const char *type) curp = preload_metadata; lname = NULL; for (;;) { - hdr = (u_int32_t *)curp; + hdr = (uint32_t *)curp; if (hdr[0] == 0 && hdr[1] == 0) break; @@ -94,11 +94,11 @@ preload_search_by_type(const char *type) /* Search for a MODINFO_TYPE field */ if ((hdr[0] == MODINFO_TYPE) && - !strcmp(type, curp + sizeof(u_int32_t) * 2)) + !strcmp(type, curp + sizeof(uint32_t) * 2)) return(lname); /* skip to next field */ - next = sizeof(u_int32_t) * 2 + hdr[1]; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } @@ -113,7 +113,7 @@ caddr_t preload_search_next_name(caddr_t base) { caddr_t curp; - u_int32_t *hdr; + uint32_t *hdr; int next; if (preload_metadata != NULL) { @@ -122,15 +122,15 @@ preload_search_next_name(caddr_t base) if (base) { /* skip to next field */ curp = base; - hdr = (u_int32_t *)curp; - next = sizeof(u_int32_t) * 2 + hdr[1]; + hdr = (uint32_t *)curp; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } else curp = preload_metadata; for (;;) { - hdr = (u_int32_t *)curp; + hdr = (uint32_t *)curp; if (hdr[0] == 0 && hdr[1] == 0) break; @@ -139,7 +139,7 @@ preload_search_next_name(caddr_t base) return curp; /* skip to next field */ - next = sizeof(u_int32_t) * 2 + hdr[1]; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } @@ -155,13 +155,13 @@ caddr_t preload_search_info(caddr_t mod, int inf) { caddr_t curp; - u_int32_t *hdr; - u_int32_t type = 0; + uint32_t *hdr; + uint32_t type = 0; int next; curp = mod; for (;;) { - hdr = (u_int32_t *)curp; + hdr = (uint32_t *)curp; /* end of module data? */ if (hdr[0] == 0 && hdr[1] == 0) break; @@ -182,10 +182,10 @@ preload_search_info(caddr_t mod, int inf * data. */ if (hdr[0] == inf) - return(curp + (sizeof(u_int32_t) * 2)); + return(curp + (sizeof(uint32_t) * 2)); /* skip to next field */ - next = sizeof(u_int32_t) * 2 + hdr[1]; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } @@ -199,7 +199,7 @@ void preload_delete_name(const char *name) { caddr_t curp; - u_int32_t *hdr; + uint32_t *hdr; int next; int clearing; @@ -208,13 +208,13 @@ preload_delete_name(const char *name) clearing = 0; curp = preload_metadata; for (;;) { - hdr = (u_int32_t *)curp; + hdr = (uint32_t *)curp; if (hdr[0] == 0 && hdr[1] == 0) break; /* Search for a MODINFO_NAME field */ if (hdr[0] == MODINFO_NAME) { - if (!strcmp(name, curp + sizeof(u_int32_t) * 2)) + if (!strcmp(name, curp + sizeof(uint32_t) * 2)) clearing = 1; /* got it, start clearing */ else if (clearing) clearing = 0; /* at next one now.. better stop */ @@ -223,7 +223,7 @@ preload_delete_name(const char *name) hdr[0] = MODINFO_EMPTY; /* skip to next field */ - next = sizeof(u_int32_t) * 2 + hdr[1]; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } @@ -235,7 +235,7 @@ void preload_bootstrap_relocate(vm_offset_t offset) { caddr_t curp; - u_int32_t *hdr; + uint32_t *hdr; vm_offset_t *ptr; int next; @@ -243,7 +243,7 @@ preload_bootstrap_relocate(vm_offset_t o curp = preload_metadata; for (;;) { - hdr = (u_int32_t *)curp; + hdr = (uint32_t *)curp; if (hdr[0] == 0 && hdr[1] == 0) break; @@ -252,14 +252,14 @@ preload_bootstrap_relocate(vm_offset_t o case MODINFO_ADDR: case MODINFO_METADATA|MODINFOMD_SSYM: case MODINFO_METADATA|MODINFOMD_ESYM: - ptr = (vm_offset_t *)(curp + (sizeof(u_int32_t) * 2)); + ptr = (vm_offset_t *)(curp + (sizeof(uint32_t) * 2)); *ptr += offset; break; } /* The rest is beyond us for now */ /* skip to next field */ - next = sizeof(u_int32_t) * 2 + hdr[1]; + next = sizeof(uint32_t) * 2 + hdr[1]; next = roundup(next, sizeof(u_long)); curp += next; } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/sys_process.c Mon Jun 21 09:55:56 2010 (r209390) @@ -67,9 +67,9 @@ __FBSDID("$FreeBSD$"); struct ptrace_io_desc32 { int piod_op; - u_int32_t piod_offs; - u_int32_t piod_addr; - u_int32_t piod_len; + uint32_t piod_offs; + uint32_t piod_addr; + uint32_t piod_len; }; struct ptrace_vm_entry32 { Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/systrace_args.c Mon Jun 21 09:55:56 2010 (r209390) @@ -7,7 +7,7 @@ */ static void -systrace_args(int sysnum, void *params, u_int64_t *uarg, int *n_args) +systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args) { int64_t *iarg = (int64_t *) uarg; switch (sysnum) { Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/uipc_mbuf.c Mon Jun 21 09:55:56 2010 (r209390) @@ -2027,7 +2027,7 @@ mbprof_textify(void) { int offset; char *c; - u_int64_t *p; + uint64_t *p; p = &mbprof.wasted[0]; Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/uipc_mbuf2.c Mon Jun 21 09:55:56 2010 (r209390) @@ -314,7 +314,7 @@ m_tag_free_default(struct m_tag *t) /* Get a packet tag structure along with specified data following. */ struct m_tag * -m_tag_alloc(u_int32_t cookie, int type, int len, int wait) +m_tag_alloc(uint32_t cookie, int type, int len, int wait) { struct m_tag *t; @@ -376,7 +376,7 @@ m_tag_delete_nonpersistent(struct mbuf * /* Find a tag, starting from a given position. */ struct m_tag * -m_tag_locate(struct mbuf *m, u_int32_t cookie, int type, struct m_tag *t) +m_tag_locate(struct mbuf *m, uint32_t cookie, int type, struct m_tag *t) { struct m_tag *p; Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/uipc_mqueue.c Mon Jun 21 09:55:56 2010 (r209390) @@ -130,7 +130,7 @@ struct mqfs_node { int mn_refcount; mqfs_type_t mn_type; int mn_deleted; - u_int32_t mn_fileno; + uint32_t mn_fileno; void *mn_data; struct timespec mn_birth; struct timespec mn_ctime; Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/uipc_syscalls.c Mon Jun 21 09:55:56 2010 (r209390) @@ -2602,7 +2602,7 @@ sctp_generic_recvmsg(td, uap) } */ *uap; { #if (defined(INET) || defined(INET6)) && defined(SCTP) - u_int8_t sockbufstore[256]; + uint8_t sockbufstore[256]; struct uio auio; struct iovec *iov, *tiov; struct sctp_sndrcvinfo sinfo; Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/vfs_cache.c Mon Jun 21 09:55:56 2010 (r209390) @@ -379,7 +379,7 @@ cache_lookup(dvp, vpp, cnp) struct componentname *cnp; { struct namecache *ncp; - u_int32_t hash; + uint32_t hash; int error, ltype, wlocked; if (!doingcache) { @@ -602,7 +602,7 @@ cache_enter(dvp, vp, cnp) { struct namecache *ncp, *n2; struct nchashhead *ncpp; - u_int32_t hash; + uint32_t hash; int flag; int hold; int zap; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Jun 21 09:51:25 2010 (r209389) +++ head/sys/kern/vfs_subr.c Mon Jun 21 09:55:56 2010 (r209390) @@ -498,7 +498,7 @@ vfs_suser(struct mount *mp, struct threa void vfs_getnewfsid(struct mount *mp) { - static u_int16_t mntid_base; + static uint16_t mntid_base; struct mount *nmp; fsid_t tfsid; int mtype; @@ -4018,7 +4018,7 @@ vfs_event_init(void *arg) SYSINIT(vfs_knlist, SI_SUB_VFS, SI_ORDER_ANY, vfs_event_init, NULL); void -vfs_event_signal(fsid_t *fsid, u_int32_t event, intptr_t data __unused) +vfs_event_signal(fsid_t *fsid, uint32_t event, intptr_t data __unused) { KNOTE_UNLOCKED(&fs_knlist, event); From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 11:12:56 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97746106567E; Mon, 21 Jun 2010 11:12:56 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 15A928FC13; Mon, 21 Jun 2010 11:12:55 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.4/8.14.4) with ESMTP id o5LBCsAr032215; Mon, 21 Jun 2010 15:12:54 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1277118774; bh=DtPuBhDy5dPwiEknoEAy4zXGkgqT9MSwmF/Fvtd4Hs8=; l=379; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=itRubeOCLPL8DaiNMSx1vvwQiSAIWMFEoaz9DuhInARF0fm+W1urSv47VDICDL6vx luSXcQ//PQBq5OrSOIrnRPTw8Qo8ULurVHEVd13eBiC5mZtfKBP7JRJpKUjuRLLaUC QkPvBCEzq+A5IaRtDgsdZb/GOCiGvYiUjal329X4= Received: (from ache@localhost) by nagual.pp.ru (8.14.4/8.14.4/Submit) id o5LBCsEH032214; Mon, 21 Jun 2010 15:12:54 +0400 (MSD) (envelope-from ache) Date: Mon, 21 Jun 2010 15:12:54 +0400 From: Andrey Chernov To: "Andrey V. Elsukov" Message-ID: <20100621111254.GA31917@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , "Andrey V. Elsukov" , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201006210824.o5L8OpFD067283@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201006210824.o5L8OpFD067283@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r209388 - in head/sbin/geom: class/part core misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 11:12:56 -0000 On Mon, Jun 21, 2010 at 08:24:51AM +0000, Andrey V. Elsukov wrote: > +done: > + if (mult * unit < mult || number * mult * unit < number) > + return (ERANGE); A general rule is: don't check for overflow when it already occurs, since result can be any, including valid ones. Redo it to before overflow stage (using things like OFF_MAX / unit). -- http://ache.pp.ru/ From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 12:50:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FD681065673; Mon, 21 Jun 2010 12:50:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6CF8FC25; Mon, 21 Jun 2010 12:50:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LCosTd027117; Mon, 21 Jun 2010 12:50:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LCosXr027115; Mon, 21 Jun 2010 12:50:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006211250.o5LCosXr027115@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 21 Jun 2010 12:50: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: r209392 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 12:50:54 -0000 Author: ae Date: Mon Jun 21 12:50:54 2010 New Revision: 209392 URL: http://svn.freebsd.org/changeset/base/209392 Log: Check for overflow before it occurs. Also add check for negative numbers. Suggested by: ache Approved by: kib (mentor) Modified: head/sbin/geom/misc/subr.c Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Mon Jun 21 10:43:13 2010 (r209391) +++ head/sbin/geom/misc/subr.c Mon Jun 21 12:50:54 2010 (r209392) @@ -139,7 +139,7 @@ g_parse_lba(const char *lbastr, unsigned assert(sectors != NULL); number = (off_t)strtoimax(lbastr, &s, 0); - if (s == lbastr) + if (s == lbastr || number < 0) return (EINVAL); mult = 1; @@ -187,7 +187,7 @@ sfx: if (*s != '\0') return (EINVAL); done: - if (mult * unit < mult || number * mult * unit < number) + if ((OFF_MAX / unit) < mult || (OFF_MAX / mult / unit) < number) return (ERANGE); number *= mult * unit; if (number % sectorsize) From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 13:47:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3081065674; Mon, 21 Jun 2010 13:47:29 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA92B8FC1A; Mon, 21 Jun 2010 13:47:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LDlTSV039637; Mon, 21 Jun 2010 13:47:29 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LDlTg2039634; Mon, 21 Jun 2010 13:47:29 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201006211347.o5LDlTg2039634@svn.freebsd.org> From: Kai Wang Date: Mon, 21 Jun 2010 13:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209393 - stable/8/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 13:47:29 -0000 Author: kaiw Date: Mon Jun 21 13:47:29 2010 New Revision: 209393 URL: http://svn.freebsd.org/changeset/base/209393 Log: MFC r209122: * Improve compatibility with existing application code by permitting the use of `elf_getbase()` on non-archive members. This change is needed for gcc LTO (-flto) to work properly. * Style fix: paranthesize returned values. * Document the current behaviour of `elf_getbase()`. Modified: stable/8/lib/libelf/elf_getbase.3 stable/8/lib/libelf/elf_getbase.c Directory Properties: stable/8/lib/libelf/ (props changed) Modified: stable/8/lib/libelf/elf_getbase.3 ============================================================================== --- stable/8/lib/libelf/elf_getbase.3 Mon Jun 21 12:50:54 2010 (r209392) +++ stable/8/lib/libelf/elf_getbase.3 Mon Jun 21 13:47:29 2010 (r209393) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008,2010 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2006 +.Dd June 6, 2010 .Os .Dt ELF_GETBASE 3 .Sh NAME @@ -38,17 +38,21 @@ .Sh DESCRIPTION Function .Fn elf_getbase -returns the file offset in the containing archive of the first byte of -the file referenced by ELF descriptor +returns the file offset to the first byte of the object referenced by ELF +descriptor .Ar elf . +.Pp +For descriptors referencing members of archives, the returned offset is +the file offset of the member in its containing archive. +For descriptors to regular objects, the returned offset is (vacuously) +zero. .Sh RETURN VALUES Function .Fn elf_getbase -returns a valid file offset into the containing archive if successful. -It returns -1 if argument -.Ar elf -is NULL or is not a member of an -archive. +returns a valid file offset if successful, or +.Pq Vt off_t +.Li -1 +in case of an error. .Sh ERRORS Function .Fn elf_getbase @@ -57,7 +61,7 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -is not an ELF descriptor for an archive member. +was NULL. .El .Sh SEE ALSO .Xr elf 3 , Modified: stable/8/lib/libelf/elf_getbase.c ============================================================================== --- stable/8/lib/libelf/elf_getbase.c Mon Jun 21 12:50:54 2010 (r209392) +++ stable/8/lib/libelf/elf_getbase.c Mon Jun 21 13:47:29 2010 (r209393) @@ -34,12 +34,14 @@ __FBSDID("$FreeBSD$"); off_t elf_getbase(Elf *e) { - if (e == NULL || - e->e_parent == NULL) { + if (e == NULL) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (off_t) -1; + return ((off_t) -1); } + if (e->e_parent == NULL) + return ((off_t) 0); + return ((off_t) ((uintptr_t) e->e_rawfile - (uintptr_t) e->e_parent->e_rawfile)); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 13:52:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F9321065673; Mon, 21 Jun 2010 13:52:32 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8F778FC14; Mon, 21 Jun 2010 13:52:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LDqVGK040796; Mon, 21 Jun 2010 13:52:31 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LDqVGQ040793; Mon, 21 Jun 2010 13:52:31 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201006211352.o5LDqVGQ040793@svn.freebsd.org> From: Kai Wang Date: Mon, 21 Jun 2010 13:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209394 - stable/7/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 13:52:32 -0000 Author: kaiw Date: Mon Jun 21 13:52:31 2010 New Revision: 209394 URL: http://svn.freebsd.org/changeset/base/209394 Log: MFC r209122: * Improve compatibility with existing application code by permitting the use of `elf_getbase()` on non-archive members. This change is needed for gcc LTO (-flto) to work properly. * Style fix: paranthesize returned values. * Document the current behaviour of `elf_getbase()`. Modified: stable/7/lib/libelf/elf_getbase.3 stable/7/lib/libelf/elf_getbase.c Directory Properties: stable/7/lib/libelf/ (props changed) Modified: stable/7/lib/libelf/elf_getbase.3 ============================================================================== --- stable/7/lib/libelf/elf_getbase.3 Mon Jun 21 13:47:29 2010 (r209393) +++ stable/7/lib/libelf/elf_getbase.3 Mon Jun 21 13:52:31 2010 (r209394) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006 Joseph Koshy. All rights reserved. +.\" Copyright (c) 2006,2008,2010 Joseph Koshy. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2006 +.Dd June 6, 2010 .Os .Dt ELF_GETBASE 3 .Sh NAME @@ -38,17 +38,21 @@ .Sh DESCRIPTION Function .Fn elf_getbase -returns the file offset in the containing archive of the first byte of -the file referenced by ELF descriptor +returns the file offset to the first byte of the object referenced by ELF +descriptor .Ar elf . +.Pp +For descriptors referencing members of archives, the returned offset is +the file offset of the member in its containing archive. +For descriptors to regular objects, the returned offset is (vacuously) +zero. .Sh RETURN VALUES Function .Fn elf_getbase -returns a valid file offset into the containing archive if successful. -It returns -1 if argument -.Ar elf -is NULL or is not a member of an -archive. +returns a valid file offset if successful, or +.Pq Vt off_t +.Li -1 +in case of an error. .Sh ERRORS Function .Fn elf_getbase @@ -57,7 +61,7 @@ may fail with the following errors: .It Bq Er ELF_E_ARGUMENT Argument .Ar elf -is not an ELF descriptor for an archive member. +was NULL. .El .Sh SEE ALSO .Xr elf 3 , Modified: stable/7/lib/libelf/elf_getbase.c ============================================================================== --- stable/7/lib/libelf/elf_getbase.c Mon Jun 21 13:47:29 2010 (r209393) +++ stable/7/lib/libelf/elf_getbase.c Mon Jun 21 13:52:31 2010 (r209394) @@ -34,12 +34,14 @@ __FBSDID("$FreeBSD$"); off_t elf_getbase(Elf *e) { - if (e == NULL || - e->e_parent == NULL) { + if (e == NULL) { LIBELF_SET_ERROR(ARGUMENT, 0); - return (off_t) -1; + return ((off_t) -1); } + if (e->e_parent == NULL) + return ((off_t) 0); + return ((off_t) ((uintptr_t) e->e_rawfile - (uintptr_t) e->e_parent->e_rawfile)); } From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 17:22:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316AA1065675; Mon, 21 Jun 2010 17:22:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 3044F8FC14; Mon, 21 Jun 2010 17:22:43 +0000 (UTC) Received: from c122-106-145-229.carlnfd1.nsw.optusnet.com.au (c122-106-145-229.carlnfd1.nsw.optusnet.com.au [122.106.145.229]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5LHMeGw009180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 03:22:41 +1000 Date: Tue, 22 Jun 2010 03:22:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Marcel Moolenaar In-Reply-To: <201006200034.o5K0Y6xl041024@svn.freebsd.org> Message-ID: <20100622024652.C43995@delplex.bde.org> References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 17:22:45 -0000 On Sun, 20 Jun 2010, Marcel Moolenaar wrote: > Log: > Unbreak platforms with char unsigned by default. Oddly enough, GCC isn't > satisfied with a simple cast to int in the check against EOF, so the fix > is a bit involved by actually having to go through a temporary variable. Perhaps that is because gcc can see that the cast has no effect, so the comparison can never be true if `c' is an unsigned char (unless unsigned char has the same number of bits as signed int), but it cannot see that the conversion to the temporary variable has the same null effect. > Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l > ============================================================================== > --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sat Jun 19 22:13:40 2010 (r209357) > +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l Sun Jun 20 00:34:06 2010 (r209358) > @@ -67,8 +67,12 @@ > * for all subsequent invocations, which is the effect desired. > */ > #undef unput > -#define unput(c) \ > - if (c != EOF) yyunput( c, yytext_ptr ) > +#define unput(c) \ > + do { \ > + int _c = c; \ > + if (_c != EOF) \ > + yyunput(_c, yytext_ptr); \ > + } while(0) > #endif > > static int id_or_type(const char *); > This remains broken, especially on platforms with chars unsigned. No one should try to unput EOF, so c should never equal EOF, but if c is a negative character it may equal EOF and thus On platforms with chars unsigned (except exotic ones where chars have the same size as ints), if c is a char then it is >= 0 and thus cannot equal EOF (which is < 0). Since the platform is non-exotic, (int)c and "int _c = c;" equal c and are this still >= 0 and thus cannot equal EOF. Thus the comparison with EOF has no effect, and c is always unput. On platforms with chars signed, some chars may equal EOF. It is an error to unput almost any value held in a variable of type char, since its value might equal EOF and thus be rejected by unput(), but unput() should be able to handle any character in the character set. This problem is handled by ungetc() by always converting the value to unsigned char. Thus the value can never equal EOF, and the character set is effectively represented by unsigned char's, not the plain chars that stdio returns in some other interfaces (but not getc()). There seems to be no reason to break the warning about this instead of using the same approach as stdio. This depends on yyunput() not having similar bugs (it must take an arg of type int and convert to an unsigned cgar like ungetc()): #define unput(c) yyunput((unsigned char)(c), yytext_ptr) This also fixes the missing parantheses for 'c' and some style bugs. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 17:33:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65900106566C; Mon, 21 Jun 2010 17:33:50 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB518FC15; Mon, 21 Jun 2010 17:33:49 +0000 (UTC) Received: by vws1 with SMTP id 1so1414271vws.13 for ; Mon, 21 Jun 2010 10:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=/gKx7q8exwy5ISKAIBKQHlPGJkCUPV6m/uRpOOc7Szw=; b=ZBQcvMnyyGvukQEhRU5iqRRQBEdlJ4CyldZ3c9nyDSqjjSZT8s+VP+VKaC8vWgWJ7C oheoHOt3vH3PoDAE5wsX/orYjcMhHeiehD0CGOAlTWGJxFCc6fuoXvcy8jszLFvlV2yk U6SrXZQbyoq32wR/coHXqbwMfFKbofl0ZzOhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=U9pRp1bSRxkZAt4cKNtVLBSQlrRwAo9oDOWBatouKGv23a+lY2cZcU+ACbBUqttKt9 IfEfXaLTTuchn7vqwv9zCBIpYsz9ppscOGqQppVEvafjLN95+ImXHkvAzBUpLrN+0/V3 +nyw9TcDAxYC0cWGNPu+OsHOkDtcHu/mdhgdU= Received: by 10.224.69.159 with SMTP id z31mr3378931qai.273.1277141628000; Mon, 21 Jun 2010 10:33:48 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id t34sm48627435qcp.6.2010.06.21.10.33.46 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 10:33:46 -0700 (PDT) Date: Mon, 21 Jun 2010 13:33:40 -0400 From: Alexander Kabaev To: Bruce Evans Message-ID: <20100621133340.7501713b@kan.dnsalias.net> In-Reply-To: <20100622024652.C43995@delplex.bde.org> References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> <20100622024652.C43995@delplex.bde.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/QdXti8V3Uvqn36DS029H5JY"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 17:33:50 -0000 --Sig_/QdXti8V3Uvqn36DS029H5JY Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 22 Jun 2010 03:22:40 +1000 (EST) Bruce Evans wrote: > On Sun, 20 Jun 2010, Marcel Moolenaar wrote: >=20 > > Log: > > Unbreak platforms with char unsigned by default. Oddly enough, GCC > > isn't satisfied with a simple cast to int in the check against EOF, > > so the fix is a bit involved by actually having to go through a > > temporary variable. >=20 > Perhaps that is because gcc can see that the cast has no effect, so > the comparison can never be true if `c' is an unsigned char (unless > unsigned char has the same number of bits as signed int), but it > cannot see that the conversion to the temporary variable has the same > null effect. >=20 > > Modified: > > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l > > =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/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l > > Sat Jun 19 22:13:40 2010 (r209357) +++ > > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l > > Sun Jun 20 00:34:06 2010 (r209358) @@ -67,8 +67,12 @@ > > * for all subsequent invocations, which is the effect desired. > > */ > > #undef unput > > -#define unput(c) \ > > - if (c !=3D EOF) yyunput( c, yytext_ptr ) > > +#define unput(c) \ > > + do { \ > > + int _c =3D c; \ > > + if (_c !=3D EOF) \ > > + yyunput(_c, yytext_ptr); \ > > + } while(0) > > #endif > > > > static int id_or_type(const char *); > > >=20 > This remains broken, especially on platforms with chars unsigned. No > one should try to unput EOF, so c should never equal EOF, but if c is > a negative character it may equal EOF and thus >=20 > On platforms with chars unsigned (except exotic ones where chars have > the same size as ints), if c is a char then it is >=3D 0 and thus cannot > equal EOF (which is < 0). Since the platform is non-exotic, (int)c > and "int _c =3D c;" equal c and are this still >=3D 0 and thus cannot > equal EOF. Thus the comparison with EOF has no effect, and c is > always unput. >=20 > On platforms with chars signed, some chars may equal EOF. It is an > error to unput almost any value held in a variable of type char, > since its value might equal EOF and thus be rejected by unput(), but > unput() should be able to handle any character in the character set. >=20 > This problem is handled by ungetc() by always converting the value to > unsigned char. Thus the value can never equal EOF, and the character > set is effectively represented by unsigned char's, not the plain chars > that stdio returns in some other interfaces (but not getc()). >=20 > There seems to be no reason to break the warning about this instead of > using the same approach as stdio. This depends on yyunput() not > having similar bugs (it must take an arg of type int and convert to > an unsigned cgar like ungetc()): >=20 > #define unput(c) yyunput((unsigned char)(c), yytext_ptr) >=20 > This also fixes the missing parantheses for 'c' and some style bugs. >=20 > Bruce DTrace _does_ try to unput EOF though and apparently gets away with it on Solaris, so while yor version is correct, it is also useless. --=20 Alexander Kabaev --Sig_/QdXti8V3Uvqn36DS029H5JY Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iD8DBQFMH6J4Q6z1jMm+XZYRAggMAJ4qyCWuH+8bQAXQl5sbEEXq09Q2zwCfa7Op NMCDlp149XmRXWob9zGeNts= =ibEu -----END PGP SIGNATURE----- --Sig_/QdXti8V3Uvqn36DS029H5JY-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 18:01:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E44D7106566C; Mon, 21 Jun 2010 18:01:57 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3CA18FC1D; Mon, 21 Jun 2010 18:01:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LI1vIj096208; Mon, 21 Jun 2010 18:01:57 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LI1vgJ096206; Mon, 21 Jun 2010 18:01:57 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201006211801.o5LI1vgJ096206@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 Jun 2010 18:01: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: r209399 - head/usr.sbin/mptutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:01:58 -0000 Author: sbruno Date: Mon Jun 21 18:01:57 2010 New Revision: 209399 URL: http://svn.freebsd.org/changeset/base/209399 Log: Syntax, commas and stuff. Comments from jhb. PR: bin/147572 MFC after: 2 weeks Modified: head/usr.sbin/mptutil/mptutil.8 Modified: head/usr.sbin/mptutil/mptutil.8 ============================================================================== --- head/usr.sbin/mptutil/mptutil.8 Mon Jun 21 15:07:10 2010 (r209398) +++ head/usr.sbin/mptutil/mptutil.8 Mon Jun 21 18:01:57 2010 (r209399) @@ -393,6 +393,6 @@ doesn't support volumes above two teraby This is a limitation of the API. If you are using this adapter with volumes larger than two terabytes, use the adapter in JBOD mode. Utilize -.Xr geom 8 -.Xr zfs 1M +.Xr geom 8 , +.Xr zfs 8 , or another software volume manager to work around this limitation. From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 18:19:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB4D9106566C; Mon, 21 Jun 2010 18:19:11 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout024.mac.com (asmtpout024.mac.com [17.148.16.99]) by mx1.freebsd.org (Postfix) with ESMTP id B99768FC08; Mon, 21 Jun 2010 18:19:11 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.24.241.142] (natint3.juniper.net [66.129.224.36]) by asmtp024.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4D004G7MVY7N40@asmtp024.mac.com>; Mon, 21 Jun 2010 11:19:11 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006210102 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-21_01:2010-02-06, 2010-06-21, 2010-06-20 signatures=0 From: Marcel Moolenaar In-reply-to: <20100622024652.C43995@delplex.bde.org> Date: Mon, 21 Jun 2010 11:19:10 -0700 Message-id: References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> <20100622024652.C43995@delplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:19:12 -0000 On Jun 21, 2010, at 10:22 AM, Bruce Evans wrote: > On Sun, 20 Jun 2010, Marcel Moolenaar wrote: > >> Log: >> Unbreak platforms with char unsigned by default. Oddly enough, GCC isn't >> satisfied with a simple cast to int in the check against EOF, so the fix >> is a bit involved by actually having to go through a temporary variable. > > Perhaps that is because gcc can see that the cast has no effect, so the > comparison can never be true if `c' is an unsigned char (unless unsigned > char has the same number of bits as signed int), but it cannot see that > the conversion to the temporary variable has the same null effect. Very likely. However, by casting from char to int we do tell the compiler that this not grounds for a warning and as such we expect the compiler to treat this as any other scenario in which the compiler can infer that a condition is always true or false and as such optimize correctly. In other words: the compiler is correct in warning that (u_char != -1) is possibly not what the programmer wants, but I do expect that if we change the condition to (int != -1) by using a cast that the compiler will simply shut up and eliminate the if statement if it knows that the int will never be -1. > This remains broken, especially on platforms with chars unsigned. I can't make that claim. The expansion of the macro in the failing case may actually not have a problem by virtue of it working on an array of unsigned char. For all I know, EOF is never encountered and the check is simply not applicable. FYI, -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 18:30:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C40FA1065670; Mon, 21 Jun 2010 18:30:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 573838FC0C; Mon, 21 Jun 2010 18:30:14 +0000 (UTC) Received: from c122-106-145-229.carlnfd1.nsw.optusnet.com.au (c122-106-145-229.carlnfd1.nsw.optusnet.com.au [122.106.145.229]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o5LIUCLP028476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 04:30:13 +1000 Date: Tue, 22 Jun 2010 04:30:12 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Alexander Kabaev In-Reply-To: <20100621133340.7501713b@kan.dnsalias.net> Message-ID: <20100622041935.J44301@delplex.bde.org> References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> <20100622024652.C43995@delplex.bde.org> <20100621133340.7501713b@kan.dnsalias.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:30:15 -0000 On Mon, 21 Jun 2010, Alexander Kabaev wrote: > On Tue, 22 Jun 2010 03:22:40 +1000 (EST) > Bruce Evans wrote: > >> On Sun, 20 Jun 2010, Marcel Moolenaar wrote: >>> ... >>> #undef unput >>> -#define unput(c) \ >>> - if (c != EOF) yyunput( c, yytext_ptr ) >>> +#define unput(c) \ >>> + do { \ >>> + int _c = c; \ >>> + if (_c != EOF) \ >>> + yyunput(_c, yytext_ptr); \ >>> + } while(0) >>> #endif >> ... >> This problem is handled by ungetc() by always converting the value to >> unsigned char. Thus the value can never equal EOF, and the character >> set is effectively represented by unsigned char's, not the plain chars >> that stdio returns in some other interfaces (but not getc()). >> >> There seems to be no reason to break the warning about this instead of >> using the same approach as stdio. This depends on yyunput() not >> having similar bugs (it must take an arg of type int and convert to >> an unsigned cgar like ungetc()): >> >> #define unput(c) yyunput((unsigned char)(c), yytext_ptr) >> >> This also fixes the missing parantheses for 'c' and some style bugs. >> >> Bruce > > DTrace _does_ try to unput EOF though and apparently gets away with it > on Solaris, so while yor version is correct, it is also useless. Do you mean that it tries to unput EOF as an int (not obtained from a char), and that that must fail and not unput ((unsigned char)EOF)? Then the current version is still broken on platforms with chars signed, since when it tries to unput a char with value EOF, that will fail and not unput ((unsigned char)). Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 18:47:50 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05EAB1065676; Mon, 21 Jun 2010 18:47:50 +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 9E70F8FC1D; Mon, 21 Jun 2010 18:47:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5LIlMC4035610; Mon, 21 Jun 2010 12:47:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 21 Jun 2010 12:47:28 -0600 (MDT) Message-Id: <20100621.124728.575506241299669566.imp@bsdimp.com> To: kabaev@gmail.com From: "M. Warner Losh" In-Reply-To: <20100621133340.7501713b@kan.dnsalias.net> References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> <20100622024652.C43995@delplex.bde.org> <20100621133340.7501713b@kan.dnsalias.net> X-Mailer: Mew version 6.3 on Emacs 22.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, marcel@FreeBSD.org, brde@optusnet.com.au, src-committers@FreeBSD.org Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 18:47:50 -0000 In message: <20100621133340.7501713b@kan.dnsalias.net> Alexander Kabaev writes: : DTrace _does_ try to unput EOF though and apparently gets away with it : on Solaris, so while yor version is correct, it is also useless. Then DTrace can't possibly work on ARM. Warner From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 19:05:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38BDF106564A; Mon, 21 Jun 2010 19:05:51 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA398FC18; Mon, 21 Jun 2010 19:05:50 +0000 (UTC) Received: by gyh20 with SMTP id 20so3273573gyh.13 for ; Mon, 21 Jun 2010 12:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=fK9cHjdVVM2loRiPyZjqwAZ79H75UNAC4zVgpSoHNgQ=; b=EjTtE35Vd+Mg21mclhMoyZtA9bqeed1eBWDHOQVYnApgOWD5+ym7bZvNhm8mozFSWw GPK5EfYwLiU6LrH8kfnGUmWDSrH0p2xLSD0yt0vj93Wde3PBv8RSOkQ9WViC8M0zTb0o TX3yJ0I44x4cRZBGMIqKMQ7mic9dr5PrIAYuU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=PHCdRHeDgKNlZKyZd6508qd3MfDd1ARlNyguhjq/Ss6mBcldjiYDD0S2OZGd83FAnx 98XyTB3g0vdhMZnocm9dAKcCVeJLlw/08D09Z3szMk40aqdFTM0cmh835NMtp5XGD3as 36cPQ48nRqpBMSnWp8jZxkm8pkJ9T2B9S4Kwc= Received: by 10.229.186.135 with SMTP id cs7mr2744029qcb.4.1277147149705; Mon, 21 Jun 2010 12:05:49 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id x34sm51262674qce.39.2010.06.21.12.05.48 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 12:05:48 -0700 (PDT) Date: Mon, 21 Jun 2010 15:05:44 -0400 From: Alexander Kabaev To: Bruce Evans Message-ID: <20100621150544.094de36a@kan.dnsalias.net> In-Reply-To: <20100622041935.J44301@delplex.bde.org> References: <201006200034.o5K0Y6xl041024@svn.freebsd.org> <20100622024652.C43995@delplex.bde.org> <20100621133340.7501713b@kan.dnsalias.net> <20100622041935.J44301@delplex.bde.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/DjS3c48Jj_20RNX43UHywwG"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org Subject: Re: svn commit: r209358 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:05:51 -0000 --Sig_/DjS3c48Jj_20RNX43UHywwG Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 22 Jun 2010 04:30:12 +1000 (EST) Bruce Evans wrote: > On Mon, 21 Jun 2010, Alexander Kabaev wrote: >=20 > > On Tue, 22 Jun 2010 03:22:40 +1000 (EST) > > Bruce Evans wrote: > > > > > > DTrace _does_ try to unput EOF though and apparently gets away with > > it on Solaris, so while yor version is correct, it is also useless. >=20 > Do you mean that it tries to unput EOF as an int (not obtained from a > char), and that that must fail and not unput ((unsigned char)EOF)? > Then the current version is still broken on platforms with chars > signed, since when it tries to unput a char with value EOF, that will > fail and not unput ((unsigned char)). Correct, but chances of valid DTrace script having 0xff character in them is pretty much nonexistent, so I let that slide rather than pushing more changes into externally maintained code. To be absolutely correct, I think, we need to declare unput() as inline/static taking int argument and make sure that we invoke it as unput((unsigned char)*q) every time q is declared as char *. --=20 Alexander Kabaev --Sig_/DjS3c48Jj_20RNX43UHywwG Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iD8DBQFMH7gLQ6z1jMm+XZYRAnInAJ428KTLRLk/JrBSu8yseo+VTYTKXACcC3a5 J2Xif5/rD3vIGKd6FLcVpYk= =uVbI -----END PGP SIGNATURE----- --Sig_/DjS3c48Jj_20RNX43UHywwG-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 19:44:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86238106564A; Mon, 21 Jun 2010 19:44:29 +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 757B38FC15; Mon, 21 Jun 2010 19:44:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LJiTeI019068; Mon, 21 Jun 2010 19:44:29 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LJiTZi019066; Mon, 21 Jun 2010 19:44:29 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201006211944.o5LJiTZi019066@svn.freebsd.org> From: Ed Schouten Date: Mon, 21 Jun 2010 19:44: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: r209400 - head/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:44:29 -0000 Author: ed Date: Mon Jun 21 19:44:29 2010 New Revision: 209400 URL: http://svn.freebsd.org/changeset/base/209400 Log: Don't build Clang libs during lib32 build. This should massively reduce the buildworld time on amd64. Pointy hat to: me Modified: head/lib/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Jun 21 18:01:57 2010 (r209399) +++ head/lib/Makefile Mon Jun 21 19:44:29 2010 (r209400) @@ -138,7 +138,7 @@ _libsdp= libsdp _libbsnmp= libbsnmp .endif -.if ${MK_CLANG} != "no" +.if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) _clang= clang .endif From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 19:53:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9D27106564A; Mon, 21 Jun 2010 19:53:47 +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 D8CF38FC12; Mon, 21 Jun 2010 19:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LJrlKt021150; Mon, 21 Jun 2010 19:53:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LJrl09021148; Mon, 21 Jun 2010 19:53:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006211953.o5LJrl09021148@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Jun 2010 19:53: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: r209401 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:53:48 -0000 Author: mav Date: Mon Jun 21 19:53:47 2010 New Revision: 209401 URL: http://svn.freebsd.org/changeset/base/209401 Log: Fix i386 LINT build broken by r209371. There appeared such legacy thing as APM, that somehow breaking RTC. Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Mon Jun 21 19:44:29 2010 (r209400) +++ head/sys/x86/isa/atrtc.c Mon Jun 21 19:53:47 2010 (r209401) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #define RTC_LOCK mtx_lock_spin(&clock_lock) #define RTC_UNLOCK mtx_unlock_spin(&clock_lock) +int atrtcclock_disable = 0; + static int rtc_reg = -1; static u_char rtc_statusa = RTCSA_DIVIDER | RTCSA_NOPROF; static u_char rtc_statusb = RTCSB_24HR; @@ -267,6 +269,7 @@ atrtc_attach(device_t dev) clock_register(dev, 1000000); bzero(&sc->et, sizeof(struct eventtimer)); if (haveirq && + !atrtcclock_disable && (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0)) { sc->et.et_name = "RTC"; From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 19:58:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D6DA106564A; Mon, 21 Jun 2010 19:58:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEEE8FC12; Mon, 21 Jun 2010 19:58:42 +0000 (UTC) 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 o5LJwcVU069031 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jun 2010 22:58:38 +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.4/8.14.4) with ESMTP id o5LJwcwE020223; Mon, 21 Jun 2010 22:58:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5LJwcUk020222; Mon, 21 Jun 2010 22:58:38 +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: Mon, 21 Jun 2010 22:58:38 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> References: <201006202133.o5KLXTG1023067@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="neJKo2vCRXM/Q6OJ" Content-Disposition: inline In-Reply-To: <201006202133.o5KLXTG1023067@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 19:58:43 -0000 --neJKo2vCRXM/Q6OJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: > Author: mav > Date: Sun Jun 20 21:33:29 2010 > New Revision: 209371 > URL: http://svn.freebsd.org/changeset/base/209371 >=20 > Log: > Implement new event timers infrastructure. It provides unified APIs for > writing event timer drivers, for choosing best possible drivers by mach= ine > independent code and for operating them to supply kernel with hardclock= (), > statclock() and profclock() events in unified fashion on various hardwa= re. > =20 > Infrastructure provides support for both per-CPU (independent for every= CPU > core) and global timers in periodic and one-shot modes. MI management c= ode > at this moment uses only periodic mode, but one-shot mode use planned f= or > later, as part of tickless kernel project. > =20 > For this moment infrastructure used on i386 and amd64 architectures. Ot= her > archs are welcome to follow, while their current operation should not be > affected. > =20 > This patch updates existing drivers (i8254, RTC and LAPIC) for the new > order, and adds event timers support into the HPET driver. These drivers > have different capabilities: > LAPIC - per-CPU timer, supports periodic and one-shot operation, may > freeze in C3 state, calibrated on first use, so may be not exactly prec= ise. > HPET - depending on hardware can work as per-CPU or global, supports > periodic and one-shot operation, usually provides several event timers. > i8254 - global, limited to periodic mode, because same hardware used a= lso > as time counter. > RTC - global, supports only periodic mode, set of frequencies in Hz > limited by powers of 2. > =20 > Depending on hardware capabilities, drivers preferred in following orde= rs, > either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. > User may explicitly specify wanted timers via loader tunables or sysctl= s: > kern.eventtimer.timer1 and kern.eventtimer.timer2. > If requested driver is unavailable or unoperational, system will try to > replace it. If no more timers available or "NONE" specified for second, > system will operate using only one timer, multiplying it's frequency by= few > times and uing respective dividers to honor hz, stathz and profhz value= s, > set during initial setup. This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. QEMU (not FreeBSD kernel) panics with qemu: level-triggered hpet not supported message. Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE does not help. --neJKo2vCRXM/Q6OJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwfxG0ACgkQC3+MBN1Mb4hHEQCfWHF4dTQkvOcSoS1enVTHk5cS VIUAoI5bq1jdivwiGQOrJ1UXMS/gv+rF =de4L -----END PGP SIGNATURE----- --neJKo2vCRXM/Q6OJ-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:08:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5296106564A; Mon, 21 Jun 2010 20:08:39 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 132A48FC0C; Mon, 21 Jun 2010 20:08:38 +0000 (UTC) Received: by fxm7 with SMTP id 7so2516335fxm.13 for ; Mon, 21 Jun 2010 13:08:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=ot4BQ7dLIXcC5uPYDbJQl9QNjbF2tSGMxNErk4nk0pA=; b=VADmTYwN3XexslSDEF91u0QZFkSp4JN9k5LAz1/KZD0AXin3QxtZfiab6jZUqoNbz2 /9veyOhxU0Q0fCDnP4qbWzwN3huxr385b+31BHrVZIgtfBtl/KUsyRoSd2H7/HOf4sV5 CjcFoJ6+15r3p5RfWSC1PUQy0dAppFHPOkkUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=uswr2ThylZ0rIq6IIVtbI6vc0YYj9vq0wyXO7/HuJzVPoUpQePcYka2IcV6/Qx/vp/ jfUkQOvl87b/V04PkbUCzVQtfWm/47M/S7OV7WKgfW6p22pK0gaeSRliuXzGrtK3cDKi RTL2Q8kGH4gklpyNqhJMbC9rnAyPWVZy48XqA= Received: by 10.223.144.84 with SMTP id y20mr5364066fau.78.1277150917212; Mon, 21 Jun 2010 13:08:37 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 15sm33766128fad.10.2010.06.21.13.08.35 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 13:08:36 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1FC6C1.5060800@FreeBSD.org> Date: Mon, 21 Jun 2010 23:08:33 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Kostik Belousov References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:08:40 -0000 Kostik Belousov wrote: > On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Sun Jun 20 21:33:29 2010 >> New Revision: 209371 >> URL: http://svn.freebsd.org/changeset/base/209371 >> >> Log: >> Implement new event timers infrastructure. It provides unified APIs for >> writing event timer drivers, for choosing best possible drivers by machine >> independent code and for operating them to supply kernel with hardclock(), >> statclock() and profclock() events in unified fashion on various hardware. > > This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. > QEMU (not FreeBSD kernel) panics with > qemu: level-triggered hpet not supported > message. According to specification, it is not optional. No more cookies! > Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE > does not help. Try `hint.apic.0.clock=0` and send me verbose dmesg, I'll try to make workaround if possible. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:09:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E742106567B; Mon, 21 Jun 2010 20:09:09 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id BAE088FC1E; Mon, 21 Jun 2010 20:09:08 +0000 (UTC) Received: by mail-fx0-f54.google.com with SMTP id 7so2516335fxm.13 for ; Mon, 21 Jun 2010 13:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=JPDMGxm8gXnfcIEgSq2GyUOIiPKvdPd2Dtky/RUVqrc=; b=iUFOP8Gt+YJCr3CQNgmjoj2wnRzEYIcqJ/SQvdxeUljQ+Iydft9ZEsoNKfK7X9Fde/ hUQkMPKhTPYdi5yT3mTZjFLqmwXBmZeD61OFJ7gsFy+TkTzxMGq6kTd63F9VTZiWz5Fv llQ4qS7sdElGCj3UJa3g7ynyomr7vjzhUhl/g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=WYcfVJ+wxPxaQG6uiRIJkSSPTkxWlV3lcv49ff2FEsebP0LT7QcESspqWYtWh/6/UB EyD35IPRo/xceTOMYRkyMdc0jXR0HB+RXuftUXBYGZmdD/bAgEuTan13M6HJMTJq9zNN ApymX9X6yLFGy2nxFqYgTTVUIKWybK4wdRyDM= Received: by 10.223.144.84 with SMTP id y20mr5364515fau.78.1277150948365; Mon, 21 Jun 2010 13:09:08 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id u12sm28154328fah.28.2010.06.21.13.09.07 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 13:09:07 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1FC6E1.4080001@FreeBSD.org> Date: Mon, 21 Jun 2010 23:09:05 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Kostik Belousov References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> In-Reply-To: <4C1FC6C1.5060800@FreeBSD.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:09:09 -0000 Alexander Motin wrote: > Kostik Belousov wrote: >> On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: >>> Author: mav >>> Date: Sun Jun 20 21:33:29 2010 >>> New Revision: 209371 >>> URL: http://svn.freebsd.org/changeset/base/209371 >>> >>> Log: >>> Implement new event timers infrastructure. It provides unified APIs for >>> writing event timer drivers, for choosing best possible drivers by machine >>> independent code and for operating them to supply kernel with hardclock(), >>> statclock() and profclock() events in unified fashion on various hardware. >> This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. >> QEMU (not FreeBSD kernel) panics with >> qemu: level-triggered hpet not supported >> message. > > According to specification, it is not optional. No more cookies! > >> Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE >> does not help. > > Try `hint.apic.0.clock=0` and send me verbose dmesg, I'll try to make > workaround if possible. Sorry, 'hint.hpet.0.clock=0'. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:15:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D732106564A; Mon, 21 Jun 2010 20:15:04 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 23D578FC16; Mon, 21 Jun 2010 20:15:02 +0000 (UTC) Received: by wyb33 with SMTP id 33so3561094wyb.13 for ; Mon, 21 Jun 2010 13:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=kTd0skNvpUKRMg9e3lynuPemyF57/wHfr+SfZ5kWpus=; b=fneVoLEMZSAP3KjvFlbA/8vlBb+nAhUXiwJOX640FCkeUu8WsTFNkBPTdt7EVY+OiS RMij/mx8PJ6iMtGv1IWakJPJKuevQoyxfR9EcmwpoZxaM6315K1jAF+I19c2l7XwoJw9 VISQ4E9PbEMbDSNXZQNYZhu0TOBek2kMu/ocw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=C88hwdx2UMtfDNwN95E9iWV+g4ZWUOoiue2RIDe8lddb0Gr5HNPvYIByDtte1umr+b K+rq00ny1UR502DE20Wh3oemtESBjl+PEAH2gqqdaBx9NpUZwcRLGWkkYwfLj4Ga9RCZ uzhaaH256oFXAno8nY1+HpArBKmoh0G/MrHI0= Received: by 10.227.144.146 with SMTP id z18mr5315071wbu.131.1277151301842; Mon, 21 Jun 2010 13:15:01 -0700 (PDT) Received: from [172.16.0.199] (c80-216-186-179.bredband.comhem.se [80.216.186.179]) by mx.google.com with ESMTPS id p17sm28461406wbe.2.2010.06.21.13.15.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 13:15:00 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Pawel Worach In-Reply-To: <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> Date: Mon, 21 Jun 2010 22:14:58 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <6067180F-87EB-4569-A4DE-7150A3CC074F@gmail.com> References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> To: Kostik Belousov X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:15:04 -0000 On Jun 21, 2010, at 21:58, Kostik Belousov wrote: > On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: >> Author: mav >> Date: Sun Jun 20 21:33:29 2010 >> New Revision: 209371 >> URL: http://svn.freebsd.org/changeset/base/209371 >>=20 >> Log: >> Implement new event timers infrastructure. It provides unified APIs = for >> writing event timer drivers, for choosing best possible drivers by = machine >> independent code and for operating them to supply kernel with = hardclock(), >> statclock() and profclock() events in unified fashion on various = hardware. >>=20 >> Infrastructure provides support for both per-CPU (independent for = every CPU >> core) and global timers in periodic and one-shot modes. MI = management code >> at this moment uses only periodic mode, but one-shot mode use = planned for >> later, as part of tickless kernel project. >>=20 >> For this moment infrastructure used on i386 and amd64 architectures. = Other >> archs are welcome to follow, while their current operation should = not be >> affected. >>=20 >> This patch updates existing drivers (i8254, RTC and LAPIC) for the = new >> order, and adds event timers support into the HPET driver. These = drivers >> have different capabilities: >> LAPIC - per-CPU timer, supports periodic and one-shot operation, = may >> freeze in C3 state, calibrated on first use, so may be not exactly = precise. >> HPET - depending on hardware can work as per-CPU or global, = supports >> periodic and one-shot operation, usually provides several event = timers. >> i8254 - global, limited to periodic mode, because same hardware = used also >> as time counter. >> RTC - global, supports only periodic mode, set of frequencies in Hz >> limited by powers of 2. >>=20 >> Depending on hardware capabilities, drivers preferred in following = orders, >> either LAPIC, HPETs, i8254, RTC or HPETs, LAPIC, i8254, RTC. >> User may explicitly specify wanted timers via loader tunables or = sysctls: >> kern.eventtimer.timer1 and kern.eventtimer.timer2. >> If requested driver is unavailable or unoperational, system will try = to >> replace it. If no more timers available or "NONE" specified for = second, >> system will operate using only one timer, multiplying it's frequency = by few >> times and uing respective dividers to honor hz, stathz and profhz = values, >> set during initial setup. >=20 > This broke QEMU for me. I cannot boot FreeBSD guest under QEMU = anymore. > QEMU (not FreeBSD kernel) panics with > qemu: level-triggered hpet not supported > message. >=20 > Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE > does not help. ps. level-triggered hpet is implemented in QEMU git. --=20 Pawel= From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:27:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B005A1065672; Mon, 21 Jun 2010 20:27:32 +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 691658FC16; Mon, 21 Jun 2010 20:27:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LKRWYb028632; Mon, 21 Jun 2010 20:27:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LKRWGu028630; Mon, 21 Jun 2010 20:27:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006212027.o5LKRWGu028630@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Jun 2010 20:27: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: r209402 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:27:32 -0000 Author: mav Date: Mon Jun 21 20:27:32 2010 New Revision: 209402 URL: http://svn.freebsd.org/changeset/base/209402 Log: Fix ia64 build broken by r209371. ia64, same as amd64 has ACPI and always has APIC. Submitted by: jhb@ Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Mon Jun 21 19:53:47 2010 (r209401) +++ head/sys/dev/acpica/acpi_hpet.c Mon Jun 21 20:27:32 2010 (r209402) @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" -#ifdef __amd64__ +#if defined(__amd64__) || defined(__ia64__) #define DEV_APIC #else #include "opt_apic.h" From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:28:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F78D1065673; Mon, 21 Jun 2010 20:28:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CF7BB8FC31; Mon, 21 Jun 2010 20:28:30 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8188346B32; Mon, 21 Jun 2010 16:28:30 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 92C318A03C; Mon, 21 Jun 2010 16:28:29 -0400 (EDT) From: John Baldwin To: Alexander Motin Date: Mon, 21 Jun 2010 16:28:22 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> In-Reply-To: <4C1FC6C1.5060800@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201006211628.22494.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 21 Jun 2010 16:28:29 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:28:31 -0000 On Monday 21 June 2010 4:08:33 pm Alexander Motin wrote: > Kostik Belousov wrote: > > On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: > >> Author: mav > >> Date: Sun Jun 20 21:33:29 2010 > >> New Revision: 209371 > >> URL: http://svn.freebsd.org/changeset/base/209371 > >> > >> Log: > >> Implement new event timers infrastructure. It provides unified APIs for > >> writing event timer drivers, for choosing best possible drivers by machine > >> independent code and for operating them to supply kernel with hardclock(), > >> statclock() and profclock() events in unified fashion on various hardware. > > > > This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. > > QEMU (not FreeBSD kernel) panics with > > qemu: level-triggered hpet not supported > > message. > > According to specification, it is not optional. No more cookies! Why do you even need a level triggered interrupt? The FSB interrupt is not shared with anything else, so it can be edge triggered just fine. We set all MSI interrupts to edge triggered on x86. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:33:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F355C1065672; Mon, 21 Jun 2010 20:33:45 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout029.mac.com (asmtpout029.mac.com [17.148.16.104]) by mx1.freebsd.org (Postfix) with ESMTP id C66108FC14; Mon, 21 Jun 2010 20:33:45 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.24.241.142] (natint3.juniper.net [66.129.224.36]) by asmtp029.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4D00M5DT41AJ10@asmtp029.mac.com>; Mon, 21 Jun 2010 13:33:42 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006210120 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-21_01:2010-02-06, 2010-06-21, 2010-06-20 signatures=0 From: Marcel Moolenaar In-reply-to: <201006212027.o5LKRWGu028630@svn.freebsd.org> Date: Mon, 21 Jun 2010 13:33:36 -0700 Message-id: References: <201006212027.o5LKRWGu028630@svn.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209402 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:33:46 -0000 On Jun 21, 2010, at 1:27 PM, Alexander Motin wrote: > Author: mav > Date: Mon Jun 21 20:27:32 2010 > New Revision: 209402 > URL: http://svn.freebsd.org/changeset/base/209402 > > Log: > Fix ia64 build broken by r209371. > ia64, same as amd64 has ACPI and always has APIC. Thanks ;-) -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:34:23 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B35A2106564A; Mon, 21 Jun 2010 20:34:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3B8E98FC1C; Mon, 21 Jun 2010 20:34:22 +0000 (UTC) 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 o5LKYJfu071715 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jun 2010 23:34:19 +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.4/8.14.4) with ESMTP id o5LKYJ29020394; Mon, 21 Jun 2010 23:34:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5LKYJ2I020393; Mon, 21 Jun 2010 23:34:19 +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: Mon, 21 Jun 2010 23:34:19 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100621203419.GK13238@deviant.kiev.zoral.com.ua> References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kJESre7KIk3SwaPI" Content-Disposition: inline In-Reply-To: <4C1FC6E1.4080001@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:34:23 -0000 --kJESre7KIk3SwaPI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 21, 2010 at 11:09:05PM +0300, Alexander Motin wrote: > Alexander Motin wrote: > > Kostik Belousov wrote: > >> On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: > >>> Author: mav > >>> Date: Sun Jun 20 21:33:29 2010 > >>> New Revision: 209371 > >>> URL: http://svn.freebsd.org/changeset/base/209371 > >>> > >>> Log: > >>> Implement new event timers infrastructure. It provides unified APIs= for > >>> writing event timer drivers, for choosing best possible drivers by = machine > >>> independent code and for operating them to supply kernel with hardc= lock(), > >>> statclock() and profclock() events in unified fashion on various ha= rdware. > >> This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. > >> QEMU (not FreeBSD kernel) panics with > >> qemu: level-triggered hpet not supported > >> message. > >=20 > > According to specification, it is not optional. No more cookies! Is there a way to disable hpet at all ? It would be fine with me. Does hint below supposed to do this ? > >=20 > >> Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE > >> does not help. > >=20 > > Try `hint.apic.0.clock=3D0` and send me verbose dmesg, I'll try to make > > workaround if possible. >=20 > Sorry, 'hint.hpet.0.clock=3D0'. >=20 Setting the hint results in panic: lock (time lock) sleep mutex does not match earlier (spin mutex) loc= k, with the backtrace enroll() witness_init() lock_init() mtx_init() initclocks() mi_startup() (transribed by hand). --kJESre7KIk3SwaPI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwfzMoACgkQC3+MBN1Mb4gv1gCg4e69dxWGN9uWAMn+L1cdtLB8 NuwAoIi1ZliveXXEHs9nIilxElX8hKlX =72Lh -----END PGP SIGNATURE----- --kJESre7KIk3SwaPI-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:35:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EBCC106566B; Mon, 21 Jun 2010 20:35:55 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 424EF8FC1B; Mon, 21 Jun 2010 20:35:53 +0000 (UTC) Received: by fxm7 with SMTP id 7so2529738fxm.13 for ; Mon, 21 Jun 2010 13:35:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=gtm0X+HYhzZZVnhkZXrydzpyAshKPOspO0hbI20joxo=; b=fJlgSrWkUwR2hkD8F8KDJqR0Ju7BD7MfSug3DRipdQJTktUHYUdvcAw3DUj1N8Krrs TfpeoZwdBfTP3f47hzWEkeXEeA/8fvCdPnvSg8tJhwn2SwvBeRl2YWvb6tq7xpMsPt+/ uWj9aJAvI1f9GMBngc3YlILkWa6jaL/wi/4v0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=IwgD6GpGQpkRaZn90GUtLOORrSkX5dUvewWHk+Jod5IHBMrNh6+uRFqCEcwFO6juoZ B6iQGhhR3Kgkd18Fy/Ag1pSVZVvqAOcrpCDbl5Y5b6nuMqYSVuJp5ypBhJs85QDViXOB bvFqWh9k/wJM8gSR6kR2f1aHw+wkILri41nxY= Received: by 10.223.65.18 with SMTP id g18mr5401793fai.32.1277152553080; Mon, 21 Jun 2010 13:35:53 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id o19sm28201504fal.23.2010.06.21.13.35.51 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 13:35:52 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1FCD25.3060307@FreeBSD.org> Date: Mon, 21 Jun 2010 23:35:49 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: John Baldwin References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <201006211628.22494.jhb@freebsd.org> In-Reply-To: <201006211628.22494.jhb@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:35:55 -0000 John Baldwin wrote: > On Monday 21 June 2010 4:08:33 pm Alexander Motin wrote: >> Kostik Belousov wrote: >>> On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: >>>> Author: mav >>>> Date: Sun Jun 20 21:33:29 2010 >>>> New Revision: 209371 >>>> URL: http://svn.freebsd.org/changeset/base/209371 >>>> >>>> Log: >>>> Implement new event timers infrastructure. It provides unified APIs for >>>> writing event timer drivers, for choosing best possible drivers by > machine >>>> independent code and for operating them to supply kernel with > hardclock(), >>>> statclock() and profclock() events in unified fashion on various > hardware. >>> This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. >>> QEMU (not FreeBSD kernel) panics with >>> qemu: level-triggered hpet not supported >>> message. >> According to specification, it is not optional. No more cookies! > > Why do you even need a level triggered interrupt? The FSB interrupt is not > shared with anything else, so it can be edge triggered just fine. We set all > MSI interrupts to edge triggered on x86. FSB interrupts, when supported, surely work as edge-triggered. But not all hardware support FSB interrupts. In such cases level-triggering used, to be able to share interrupts. Without verbose dmesg I can't imagine what QEMU supports and what exactly happened there. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:36:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351BE106564A; Mon, 21 Jun 2010 20:36:37 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id 1A00C8FC12; Mon, 21 Jun 2010 20:36:36 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [172.24.241.142] (natint3.juniper.net [66.129.224.36]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4D000FNT8HQR90@asmtp026.mac.com>; Mon, 21 Jun 2010 13:36:21 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006210121 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-21_01:2010-02-06, 2010-06-21, 2010-06-20 signatures=0 From: Marcel Moolenaar In-reply-to: <201006210824.o5L8OpFD067283@svn.freebsd.org> Date: Mon, 21 Jun 2010 13:36:17 -0700 Message-id: <26741DCD-9BF2-49D3-93B7-659B33552917@mac.com> References: <201006210824.o5L8OpFD067283@svn.freebsd.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209388 - in head/sbin/geom: class/part core misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:36:37 -0000 On Jun 21, 2010, at 1:24 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Mon Jun 21 08:24:50 2010 > New Revision: 209388 > URL: http://svn.freebsd.org/changeset/base/209388 > > Log: > Remove G_TYPE_ASCLBA type and replace it with G_TYPE_STRING in gpart. *snip* > PR: bin/146277 > Reviewed by: marcel (previous version) > Approved by: kib (mentor) > MFC after: 1 month Well done! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 20:46:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72B201065675; Mon, 21 Jun 2010 20:46:17 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9FC748FC13; Mon, 21 Jun 2010 20:46:16 +0000 (UTC) Received: by fxm7 with SMTP id 7so2535105fxm.13 for ; Mon, 21 Jun 2010 13:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=JIvd8FIKKbJK88VVyxK+uai7aEzONeN75i+hp7vELNw=; b=LT7kdukop5J+FeFG1Eyv9fC53hPtHk0yfMieWj+uOC+KJ16sxmvsWHCATWBOtbtX5N 8nvvM/7jCSQ+LOolaOECUt4/duyzt3Vw0iY7FdDGLaBYs8uJgk31hUjuMe8KE9RKQJOd fbn9vWrRqfTBRHocNllCb2Xg2XX5F0SyIUVmc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=VJc0nDJEomYGlxQ8/fWfQ4nZup1QfPmYe8XXV8nYD2scjRZ4mlzpEa0Yv6PYJydLfv W+3GFra0JjCYTel9UF2rGcgni/hJIUJlBIcL3aXXelOWc5k46Ec64yaueUQwVvRnkY1E 0mcBPmOr1+IYyYv4PVQTtN4SXz3OPuegov+9w= Received: by 10.223.66.21 with SMTP id l21mr5388110fai.90.1277153175330; Mon, 21 Jun 2010 13:46:15 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id e11sm28246108fak.17.2010.06.21.13.46.14 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 13:46:14 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1FCF93.9000703@FreeBSD.org> Date: Mon, 21 Jun 2010 23:46:11 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Kostik Belousov References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> <20100621203419.GK13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100621203419.GK13238@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 20:46:17 -0000 Kostik Belousov wrote: > On Mon, Jun 21, 2010 at 11:09:05PM +0300, Alexander Motin wrote: >> Alexander Motin wrote: >>> Kostik Belousov wrote: >>>> On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: >>>>> Author: mav >>>>> Date: Sun Jun 20 21:33:29 2010 >>>>> New Revision: 209371 >>>>> URL: http://svn.freebsd.org/changeset/base/209371 >>>>> >>>>> Log: >>>>> Implement new event timers infrastructure. It provides unified APIs for >>>>> writing event timer drivers, for choosing best possible drivers by machine >>>>> independent code and for operating them to supply kernel with hardclock(), >>>>> statclock() and profclock() events in unified fashion on various hardware. >>>> This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymore. >>>> QEMU (not FreeBSD kernel) panics with >>>> qemu: level-triggered hpet not supported >>>> message. >>> According to specification, it is not optional. No more cookies! > Is there a way to disable hpet at all ? It would be fine with me. > Does hint below supposed to do this ? Yes. Hint below disables HPET event timers, leaving only time counter part, almost same as it was before. >>>> Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE >>>> does not help. >>> Try `hint.apic.0.clock=0` and send me verbose dmesg, I'll try to make >>> workaround if possible. >> Sorry, 'hint.hpet.0.clock=0'. >> > Setting the hint results in > panic: lock (time lock) sleep mutex does not match earlier (spin mutex) lock, > with the backtrace > enroll() > witness_init() > lock_init() > mtx_init() > initclocks() > mi_startup() > (transribed by hand). I am surprised that none of my systems fired it. Try this: --- subr_witness.c.prev 2010-06-17 14:07:36.000000000 +0300 +++ subr_witness.c 2010-06-21 23:43:14.000000000 +0300 @@ -495,6 +495,7 @@ static struct witness_order_list_entry o #ifdef HWPMC_HOOKS { "pmc-sleep", &lock_class_mtx_sleep }, #endif + { "time lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* * Sockets @@ -654,7 +655,6 @@ static struct witness_order_list_entry o { "callout", &lock_class_mtx_spin }, { "entropy harvest mutex", &lock_class_mtx_spin }, { "syscons video lock", &lock_class_mtx_spin }, - { "time lock", &lock_class_mtx_spin }, #ifdef SMP { "smp rendezvous", &lock_class_mtx_spin }, #endif -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 21:06:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3872D1065674; Mon, 21 Jun 2010 21:06:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C3DF08FC12; Mon, 21 Jun 2010 21:06:33 +0000 (UTC) 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 o5LL6TG0074241 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 00:06:29 +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.4/8.14.4) with ESMTP id o5LL6Tx5020625; Tue, 22 Jun 2010 00:06:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5LL6TbQ020624; Tue, 22 Jun 2010 00:06:29 +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: Tue, 22 Jun 2010 00:06:29 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100621210629.GN13238@deviant.kiev.zoral.com.ua> References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> <20100621203419.GK13238@deviant.kiev.zoral.com.ua> <4C1FCF93.9000703@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6HoVBnoRn/ylzab8" Content-Disposition: inline In-Reply-To: <4C1FCF93.9000703@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:06:34 -0000 --6HoVBnoRn/ylzab8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 21, 2010 at 11:46:11PM +0300, Alexander Motin wrote: > Kostik Belousov wrote: > > On Mon, Jun 21, 2010 at 11:09:05PM +0300, Alexander Motin wrote: > >> Alexander Motin wrote: > >>> Kostik Belousov wrote: > >>>> On Sun, Jun 20, 2010 at 09:33:29PM +0000, Alexander Motin wrote: > >>>>> Author: mav > >>>>> Date: Sun Jun 20 21:33:29 2010 > >>>>> New Revision: 209371 > >>>>> URL: http://svn.freebsd.org/changeset/base/209371 > >>>>> > >>>>> Log: > >>>>> Implement new event timers infrastructure. It provides unified AP= Is for > >>>>> writing event timer drivers, for choosing best possible drivers b= y machine > >>>>> independent code and for operating them to supply kernel with har= dclock(), > >>>>> statclock() and profclock() events in unified fashion on various = hardware. > >>>> This broke QEMU for me. I cannot boot FreeBSD guest under QEMU anymo= re. > >>>> QEMU (not FreeBSD kernel) panics with > >>>> qemu: level-triggered hpet not supported > >>>> message. > >>> According to specification, it is not optional. No more cookies! > > Is there a way to disable hpet at all ? It would be fine with me. > > Does hint below supposed to do this ? >=20 > Yes. Hint below disables HPET event timers, leaving only time counter > part, almost same as it was before. >=20 > >>>> Setting kern.eventtimer.timer1 to LAPIC or i8254, and timer2 to NONE > >>>> does not help. > >>> Try `hint.apic.0.clock=3D0` and send me verbose dmesg, I'll try to ma= ke > >>> workaround if possible. > >> Sorry, 'hint.hpet.0.clock=3D0'. > >> > > Setting the hint results in > > panic: lock (time lock) sleep mutex does not match earlier (spin mutex)= lock, > > with the backtrace > > enroll() > > witness_init() > > lock_init() > > mtx_init() > > initclocks() > > mi_startup() > > (transribed by hand). >=20 > I am surprised that none of my systems fired it. Try this: >=20 > --- subr_witness.c.prev 2010-06-17 14:07:36.000000000 +0300 > +++ subr_witness.c 2010-06-21 23:43:14.000000000 +0300 > @@ -495,6 +495,7 @@ static struct witness_order_list_entry o > #ifdef HWPMC_HOOKS > { "pmc-sleep", &lock_class_mtx_sleep }, > #endif > + { "time lock", &lock_class_mtx_sleep }, > { NULL, NULL }, > /* > * Sockets > @@ -654,7 +655,6 @@ static struct witness_order_list_entry o > { "callout", &lock_class_mtx_spin }, > { "entropy harvest mutex", &lock_class_mtx_spin }, > { "syscons video lock", &lock_class_mtx_spin }, > - { "time lock", &lock_class_mtx_spin }, > #ifdef SMP > { "smp rendezvous", &lock_class_mtx_spin }, > #endif Witness patch worked for me, and I can boot multiuser in the qemu-hosted system with hint.hpet.0.clock=3D0. Does the same hint should work for amd64 ? The issue is no longer critical for me due to hint, below is the dmesg you asked for. Thanks. Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #200: Mon Jun 21 23:56:04 EEST 2010 root@pooma.home:/usr/home/kostik/work/build/bsd/DEV/obj-i386/i386/usr/h= ome/kostik/work/build/bsd/DEV/src/sys/QEMU i386 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. CPU: Pentium II/Pentium II Xeon/Celeron (2786.35-MHz 686-class CPU) Origin =3D "GenuineIntel" Id =3D 0x633 Family =3D 6 Model =3D 3 Stepp= ing =3D 3 Features=3D0x781abfd Features2=3D0x80000001> real memory =3D 67108864 (64 MB) avail memory =3D 55808000 (53 MB) Event timer "LAPIC" frequency 0 Hz quality 500 ACPI APIC Table: ioapic0: Changing APIC ID to 1 MADT: Forcing active-low polarity and level trigger for SCI ioapic0 irqs 0-23 on motherboard acpi0: on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 cpu0: on acpi0 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 100000000 Hz quality 900 pcib0: port 0xcf8-0xcff on acpi0 pci_link0: BIOS IRQ 9 does not match initial IRQ 11 pci0: on pcib0 Correcting Natoma config for non-SMP isab0: at device 1.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x= c000-0xc00f at device 1.1 on pci0 ata0: on atapci0 ata0: [ITHREAD] ata1: on atapci0 ata1: [ITHREAD] pci0: at device 1.3 (no driver attached) vgapci0: mem 0xf0000000-0xf1ffffff,0xf2000000-0xf2= 000fff at device 2.0 on pci0 ed0: port 0xc100-0xc1ff irq 11 at device 3.0 on pci0 ed0: ed_stop_hw RST never set ed0: Ethernet address: 52:54:00:12:34:56 ed0: [ITHREAD] pci0: at device 4.0 (no driver attached) atrtc0: port 0x70-0x71,0x72-0x77 irq 8 on acpi0 atrtc0: [FILTER] Event timer "RTC" frequency 32768 Hz quality 0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse Explorer, device ID 4 pmtimer0 on isa0 sc0: on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 2786349400 Hz quality 800 Starting kernel event timers: LAPIC @ 100Hz, RTC @ 128Hz Timecounters tick every 10.000 msec ad0: 512MB at ata0-master UDMA33=20 GEOM: ad0s1: geometry does not match label (255h,63s !=3D 16h,63s). ad1: 512MB at ata0-slave UDMA33=20 GEOM: ad1s1: geometry does not match label (255h,63s !=3D 16h,63s). ad2: 512MB at ata1-master UDMA33=20 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Trying to mount root from ufs:/dev/ad0s1a --6HoVBnoRn/ylzab8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwf1FUACgkQC3+MBN1Mb4ibZACgxZGsryMkbDZQe1xxBbCNHrgT +nAAmgOK6Y5FTnUaiEU7Nj3aY2AS6VUP =am8o -----END PGP SIGNATURE----- --6HoVBnoRn/ylzab8-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 21:12:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1925F106566B; Mon, 21 Jun 2010 21:12:50 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3DDE38FC1A; Mon, 21 Jun 2010 21:12:49 +0000 (UTC) Received: by fxm7 with SMTP id 7so2547400fxm.13 for ; Mon, 21 Jun 2010 14:12:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=68AO7UOK3O0EZdNohMx3k46OWIAv+cfOa6YUOGIaItY=; b=jPcBqQEbyXmN3gBVhzoPbjVVk7vAKwpysMqgU9fnH/E4tunkx5f95Wji492+1o+BHN 0djbJL6uzj/iHboho7pWn+/lz6JIKhVmBfCVCetNmqFGgw5yKCon682fxZnNR3td9m0v 4Tj41sX0Ih/6ELuarbork2YMpzPLeOXIM40ls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=grK5F52GbNhfXPUVWRij5kbHbTunGCnyusXAMcLLVlZRtg0vu2GyTCiGNZ5Vy+BGDE huavRwk5rKLBX4pKLdJvju4HGLu09ExOd26YN+coSnMQwepnVQkNTL6/V14ieEMqOLmN 27nRZ64rs8KqMD1dghgua19MNR0MbCaHrW8Vo= Received: by 10.223.161.211 with SMTP id s19mr5424733fax.47.1277154768286; Mon, 21 Jun 2010 14:12:48 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 2sm33900598fav.1.2010.06.21.14.12.46 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 14:12:47 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C1FD5CC.6070909@FreeBSD.org> Date: Tue, 22 Jun 2010 00:12:44 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Kostik Belousov References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> <20100621203419.GK13238@deviant.kiev.zoral.com.ua> <4C1FCF93.9000703@FreeBSD.org> <20100621210629.GN13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100621210629.GN13238@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:12:50 -0000 Kostik Belousov wrote: > Witness patch worked for me, and I can boot multiuser in the qemu-hosted > system with hint.hpet.0.clock=0. Does the same hint should work for > amd64 ? Yes. > The issue is no longer critical for me due to hint, below is the dmesg > you asked for. Thanks. It is not verbose. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 21:15:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF9D31065673; Mon, 21 Jun 2010 21:15:51 +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 CF0248FC08; Mon, 21 Jun 2010 21:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LLFp8w039222; Mon, 21 Jun 2010 21:15:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LLFpnV039220; Mon, 21 Jun 2010 21:15:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006212115.o5LLFpnV039220@svn.freebsd.org> From: Alexander Motin Date: Mon, 21 Jun 2010 21:15: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: r209403 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:15:52 -0000 Author: mav Date: Mon Jun 21 21:15:51 2010 New Revision: 209403 URL: http://svn.freebsd.org/changeset/base/209403 Log: "time lock" is no longer a spin-lock since r209371. Reported by: kib@ Modified: head/sys/kern/subr_witness.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Jun 21 20:27:32 2010 (r209402) +++ head/sys/kern/subr_witness.c Mon Jun 21 21:15:51 2010 (r209403) @@ -495,6 +495,7 @@ static struct witness_order_list_entry o #ifdef HWPMC_HOOKS { "pmc-sleep", &lock_class_mtx_sleep }, #endif + { "time lock", &lock_class_mtx_sleep }, { NULL, NULL }, /* * Sockets @@ -654,7 +655,6 @@ static struct witness_order_list_entry o { "callout", &lock_class_mtx_spin }, { "entropy harvest mutex", &lock_class_mtx_spin }, { "syscons video lock", &lock_class_mtx_spin }, - { "time lock", &lock_class_mtx_spin }, #ifdef SMP { "smp rendezvous", &lock_class_mtx_spin }, #endif From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 21:27:23 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE6591065672; Mon, 21 Jun 2010 21:27:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 463198FC0C; Mon, 21 Jun 2010 21:27:22 +0000 (UTC) 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 o5LLRJVQ075714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 00:27:19 +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.4/8.14.4) with ESMTP id o5LLRJeU020762; Tue, 22 Jun 2010 00:27:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5LLRJrZ020761; Tue, 22 Jun 2010 00:27:19 +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: Tue, 22 Jun 2010 00:27:19 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100621212719.GO13238@deviant.kiev.zoral.com.ua> References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> <20100621203419.GK13238@deviant.kiev.zoral.com.ua> <4C1FCF93.9000703@FreeBSD.org> <20100621210629.GN13238@deviant.kiev.zoral.com.ua> <4C1FD5CC.6070909@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hV9LobOkkIdnlvrX" Content-Disposition: inline In-Reply-To: <4C1FD5CC.6070909@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 21:27:24 -0000 --hV9LobOkkIdnlvrX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 22, 2010 at 12:12:44AM +0300, Alexander Motin wrote: > Kostik Belousov wrote: > > Witness patch worked for me, and I can boot multiuser in the qemu-hosted > > system with hint.hpet.0.clock=3D0. Does the same hint should work for > > amd64 ? >=20 > Yes. >=20 > > The issue is no longer critical for me due to hint, below is the dmesg > > you asked for. Thanks. >=20 > It is not verbose. Fair enough. Copyright (c) 1992-2010 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 9.0-CURRENT #200: Mon Jun 21 23:56:04 EEST 2010 root@pooma.home:/usr/home/kostik/work/build/bsd/DEV/obj-i386/i386/usr/h= ome/kostik/work/build/bsd/DEV/src/sys/QEMU i386 WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Preloaded elf kernel "/boot/kernel/kernel" at 0xc0af1000. Preloaded elf module "/boot/kernel/if_ed.ko" at 0xc0af1158. Preloaded elf module "/boot/kernel/miibus.ko" at 0xc0af1204. Preloaded elf module "/boot/kernel/random.ko" at 0xc0af12b0. Preloaded elf module "/boot/kernel/ufs.ko" at 0xc0af135c. Preloaded elf module "/boot/kernel/ata.ko" at 0xc0af1404. Preloaded elf module "/boot/kernel/atapci.ko" at 0xc0af14ac. Preloaded elf module "/boot/kernel/atadisk.ko" at 0xc0af1558. Preloaded elf module "/boot/kernel/acpi.ko" at 0xc0af1604. Calibrating TSC clock ... TSC clock: 2786270228 Hz CPU: Pentium II/Pentium II Xeon/Celeron (2786.27-MHz 686-class CPU) Origin =3D "GenuineIntel" Id =3D 0x633 Family =3D 6 Model =3D 3 Stepp= ing =3D 3 Features=3D0x781abfd Features2=3D0x80000001> 2nd-level cache: 2-MB, 8-way set associative, 64-byte line size 1st-level instruction cache: 32 KB, 8-way set associative, 64 byte line size 1st-level data cache: 32 KB, 8-way set associative, 64 byte line size real memory =3D 67108864 (64 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009efff, 647168 bytes (158 pages) 0x0000000000100000 - 0x00000000003fffff, 3145728 bytes (768 pages) 0x0000000000c26000 - 0x0000000003e8dfff, 52854784 bytes (12904 pages) avail memory =3D 55808000 (53 MB) Table 'FACP' at 0x3ff0038 Table 'APIC' at 0x3ff0948 APIC: Found table at 0x3ff0948 MP Configuration Table version 1.4 found at 0xc00fba00 APIC: Using the MADT enumerator. MADT: Found CPU APIC ID 0 ACPI ID 0: enabled Event timer "LAPIC" frequency 0 Hz quality 500 ACPI APIC Table: x86bios: IVT 0x000000-0x0004ff at 0xc0000000 x86bios: SSEG 0x010000-0x01ffff at 0xc126b000 x86bios: EBDA 0x09f000-0x09ffff at 0xc009f000 x86bios: ROM 0x0a0000-0x0effff at 0xc00a0000 APIC: CPU 0 has ACPI ID 0 bios32: Found BIOS32 Service Directory header at 0xc00fb3e0 bios32: Entry =3D 0xfb3f0 (c00fb3f0) Rev =3D 0 Len =3D 1 pcibios: PCI BIOS entry at 0xf0000+0xb430 Other BIOS signatures found: ULE: setup cpu 0 ACPI: RSDP 0xfbbf0 00014 (v0 QEMU ) ACPI: RSDT 0x3ff0000 00034 (v1 QEMU QEMURSDT 00000001 QEMU 00000001) ACPI: FACP 0x3ff0038 00074 (v1 QEMU QEMUFACP 00000001 QEMU 00000001) ACPI: DSDT 0x3ff0100 0080D (v1 BXPC BXDSDT 00000001 INTL 20061109) ACPI: FACS 0x3ff00c0 00040 ACPI: APIC 0x3ff0948 0004A (v1 QEMU QEMUAPIC 00000001 QEMU 00000001) ACPI: SSDT 0x3ff090d 00037 (v1 QEMU QEMUSSDT 00000001 QEMU 00000001) ACPI: HPET 0x3ff0998 00038 (v1 QEMU QEMUHPET 00000001 QEMU 00000001) MADT: Found IO APIC ID 1, Interrupt 0 at 0xfec00000 ioapic0: Changing APIC ID to 1 ioapic0: Routing external 8259A's -> intpin 0 MADT: Interrupt override: source 0, irq 2 ioapic0: Routing IRQ 0 -> intpin 2 MADT: Forcing active-low polarity and level trigger for SCI ioapic0: intpin 9 polarity: low ioapic0: intpin 9 trigger: level ioapic0 irqs 0-23 on motherboard cpu0 BSP: ID: 0x00000000 VER: 0x00050011 LDR: 0x00000000 DFR: 0xf0000000 lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 cmci: 0x00000000 random: mem: io: null: npx0: INT 16 interface acpi0: on motherboard ioapic0: routing intpin 9 (ISA IRQ 9) to lapic 0 vector 48 acpi0: [MPSAFE] acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi0: wakeup code va 0xc10b5000 pa 0x1000 pci_open(1): mode 1 addr port (0x0cf8) is 0x80000000 pci_open(1a): mode1res=3D0x80000000 (0x80000000) pci_cfgcheck: device 0 [class=3D060000] [hdr=3D00] is there (id=3D12378086) pcibios: BIOS version 2.10 acpi_bus_number: root bus has no _BBN, assuming 0 AcpiOsDerivePciId: \\_SB_.PCI0.PX13.P13C -> bus 0 dev 1 func 3 acpi_bus_number: root bus has no _BBN, assuming 0 AcpiOsDerivePciId: \\_SB_.PCI0.ISA_.P40C -> bus 0 dev 1 func 0 ACPI timer: 0/79 0/21 0/91 0/20 0/19 0/18 0/20 0/18 0/19 0/193 -> 0 Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 cpu0: on acpi0 cpu0: switching to generic Cx mode pci_link0: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 12 Validation 0 11 N 0 3 4 5 6 7 9 10 11 12 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 12 pci_link1: Index IRQ Rtd Ref IRQs Initial Probe 0 9 N 0 3 4 5 6 7 9 10 11 12 Validation 0 9 N 0 3 4 5 6 7 9 10 11 12 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 12 pci_link2: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 12 Validation 0 11 N 0 3 4 5 6 7 9 10 11 12 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 12 pci_link3: Index IRQ Rtd Ref IRQs Initial Probe 0 9 N 0 3 4 5 6 7 9 10 11 12 Validation 0 9 N 0 3 4 5 6 7 9 10 11 12 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 12 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 hpet0: vendor 0x8086, rev 0x1, 100000000Hz 64bit, 3 timers, legacy route hpet0: t0: irqs 0x00000004 (0), 64bit, periodic hpet0: t1: irqs 0x00000004 (0), 64bit, periodic hpet0: t2: irqs 0x00000004 (0), 64bit, periodic Timecounter "HPET" frequency 100000000 Hz quality 900 pcib0: port 0xcf8-0xcff on acpi0 ACPI: Found matching pin for 0.1.INTA at func 3: 9 pci_link0: BIOS IRQ 9 does not match initial IRQ 11 ACPI: Found matching pin for 0.3.INTA at func 0: 11 ACPI: Found matching pin for 0.4.INTA at func 0: 9 pci0: on pcib0 pci0: domain=3D0, physical bus=3D0 found-> vendor=3D0x8086, dev=3D0x1237, revid=3D0x02 domain=3D0, bus=3D0, slot=3D0, func=3D0 class=3D06-00-00, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0000, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) found-> vendor=3D0x8086, dev=3D0x7000, revid=3D0x00 domain=3D0, bus=3D0, slot=3D1, func=3D0 class=3D06-01-00, hdrtype=3D0x00, mfdev=3D1 cmdreg=3D0x0007, statreg=3D0x0200, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) found-> vendor=3D0x8086, dev=3D0x7010, revid=3D0x00 domain=3D0, bus=3D0, slot=3D1, func=3D1 class=3D01-01-80, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0001, statreg=3D0x0280, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) map[20]: type I/O Port, range 32, base 0xc000, size 4, enabled found-> vendor=3D0x8086, dev=3D0x7113, revid=3D0x03 domain=3D0, bus=3D0, slot=3D1, func=3D3 class=3D06-80-00, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0000, statreg=3D0x0280, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) intpin=3Da, irq=3D9 pcib0: matched entry for 0.1.INTA (src \\_SB_.LNKA:0) pcib0: slot 1 INTA routed to irq 9 via \\_SB_.LNKA found-> vendor=3D0x1013, dev=3D0x00b8, revid=3D0x00 domain=3D0, bus=3D0, slot=3D2, func=3D0 class=3D03-00-00, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0003, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) map[10]: type Prefetchable Memory, range 32, base 0xf0000000, size 25, ena= bled map[14]: type Memory, range 32, base 0xf2000000, size 12, enabled found-> vendor=3D0x10ec, dev=3D0x8029, revid=3D0x00 domain=3D0, bus=3D0, slot=3D3, func=3D0 class=3D02-00-00, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0001, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) intpin=3Da, irq=3D11 map[10]: type I/O Port, range 32, base 0xc100, size 8, enabled pcib0: matched entry for 0.3.INTA (src \\_SB_.LNKC:0) ioapic0: Changing trigger for pin 11 to level ioapic0: Changing polarity for pin 11 to low pcib0: slot 3 INTA routed to irq 11 via \\_SB_.LNKC found-> vendor=3D0x1af4, dev=3D0x1002, revid=3D0x00 domain=3D0, bus=3D0, slot=3D4, func=3D0 class=3D05-00-00, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0001, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 ns) intpin=3Da, irq=3D9 map[10]: type I/O Port, range 32, base 0xc200, size 5, enabled pcib0: matched entry for 0.4.INTA (src \\_SB_.LNKD:0) pcib0: slot 4 INTA routed to irq 9 via \\_SB_.LNKD Correcting Natoma config for non-SMP isab0: at device 1.0 on pci0 isa0: on isab0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x= c000-0xc00f at device 1.1 on pci0 ata0: on atapci0 ata0: reset tp1 mask=3D03 ostat0=3D50 ostat1=3D50 ata0: stat0=3D0x50 err=3D0x01 lsb=3D0x00 msb=3D0x00 ata0: stat1=3D0x50 err=3D0x01 lsb=3D0x00 msb=3D0x00 ata0: reset tp2 stat0=3D50 stat1=3D50 devices=3D0x3 ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 0 vector 49 ata0: [MPSAFE] ata0: [ITHREAD] ata1: on atapci0 ata1: reset tp1 mask=3D03 ostat0=3D50 ostat1=3D00 ata1: stat0=3D0x50 err=3D0x01 lsb=3D0x00 msb=3D0x00 ata1: stat1=3D0x00 err=3D0x00 lsb=3D0xff msb=3D0xff ata1: reset tp2 stat0=3D50 stat1=3D00 devices=3D0x1 ioapic0: routing intpin 15 (ISA IRQ 15) to lapic 0 vector 50 ata1: [MPSAFE] ata1: [ITHREAD] pci0: at device 1.3 (no driver attached) vgapci0: mem 0xf0000000-0xf1ffffff,0xf2000000-0xf2= 000fff at device 2.0 on pci0 ed0: port 0xc100-0xc1ff irq 11 at device 3.0 on pci0 ed0: ed_stop_hw RST never set ed0: bpf attached ed0: Ethernet address: 52:54:00:12:34:56 ed0: type RTL8029 (16 bit) ioapic0: routing intpin 11 (ISA IRQ 11) to lapic 0 vector 51 ed0: [MPSAFE] ed0: [ITHREAD] pci0: at device 4.0 (no driver attached) atrtc0: port 0x70-0x71,0x72-0x77 irq 8 on acpi0 ioapic0: routing intpin 8 (ISA IRQ 8) to lapic 0 vector 52 atrtc0: [MPSAFE] atrtc0: [FILTER] atrtc0: registered as a time-of-day clock (resolution 1000000us) Event timer "RTC" frequency 32768 Hz quality 0 atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 atkbd: the current kbd controller command byte 0061 atkbd: keyboard ID 0x41ab (2) kbd0 at atkbd0 kbd0: atkbd0, AT 101/102 (2), config:0x0, flags:0x3d0000 ioapic0: routing intpin 1 (ISA IRQ 1) to lapic 0 vector 53 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: unable to allocate IRQ psmcpnp0: irq 12 on acpi0 psm0: current command byte:0061 psm0: irq 12 on atkbdc0 ioapic0: routing intpin 12 (ISA IRQ 12) to lapic 0 vector 54 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse Explorer, device ID 4-00, 5 buttons psm0: config:00000000, flags:00000008, packet size:4 psm0: syncmask:08, syncbits:00 pnp_identify: Trying Read_Port at 203 pnp_identify: Trying Read_Port at 243 pnp_identify: Trying Read_Port at 283 pnp_identify: Trying Read_Port at 2c3 pnp_identify: Trying Read_Port at 303 pnp_identify: Trying Read_Port at 343 pnp_identify: Trying Read_Port at 383 pnp_identify: Trying Read_Port at 3c3 PNP Identify complete isa_probe_children: disabling PnP devices pmtimer0 on isa0 isa_probe_children: probing non-PnP devices sc0: on isa0 sc0: VGA <16 virtual consoles, flags=3D0x300> sc0: fb0, kbd0, terminal emulator: scteken (teken terminal) vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 isa_probe_children: probing PnP devices Device configuration finished. Timecounter "TSC" frequency 2786270228 Hz quality 800 Starting kernel event timers: LAPIC @ 100Hz, RTC @ 128Hz lapic: Divisor 2, Frequency 500045678 Hz Timecounters tick every 10.000 msec lo0: bpf attached ata0: Identifying devices: 00000003 ata0: New devices: 00000003 ata0-slave: pio=3DPIO4 wdma=3DWDMA2 udma=3DUDMA100 cable=3D80 wire ata0-master: pio=3DPIO4 wdma=3DWDMA2 udma=3DUDMA100 cable=3D80 wire ad0: setting UDMA33 ad0: 512MB at ata0-master UDMA33=20 ad0: 1048576 sectors [1040C/16H/63S] 16 sectors/interrupt 1 depth queue GEOM: new disk ad0 ad1: setting UDMA33 GEOM: ad0s1: geometry does not match label (255h,63s !=3D 16h,63s). ad1: 512MB at ata0-slave UDMA33=20 ad1: 1048576 sectors [1040C/16H/63S] 16 sectors/interrupt 1 depth queue ata1: Identifying devices: 00000001 ata1: New devices: 00000001 GEOM: new disk ad1 GEOM: ad1s1: geometry does not match label (255h,63s !=3D 16h,63s). ata1-master: pio=3DPIO4 wdma=3DWDMA2 udma=3DUDMA100 cable=3D80 wire ad2: setting UDMA33 ad2: 512MB at ata1-master UDMA33=20 ad2: 1048576 sectors [1040C/16H/63S] 16 sectors/interrupt 1 depth queue WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. GEOM: new disk ad2 Trying to mount root from ufs:/dev/ad0s1a ct_to_ts([2010-06-21 21:18:21]) =3D 1277155101.000000000 start_init: trying /sbin/init t_delta 15.fdb4d9e67e3e66c0 too short --hV9LobOkkIdnlvrX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwf2TYACgkQC3+MBN1Mb4hC0QCffNVP0ZEdf09UkpKflPqhF+AU lNwAoKniaj8ARF6BCJMAyZT6vmh4R7rv =62xV -----END PGP SIGNATURE----- --hV9LobOkkIdnlvrX-- From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 22:00:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA70A1065781; Mon, 21 Jun 2010 22:00:57 +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 A7C288FC08; Mon, 21 Jun 2010 22:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LM0vC1049125; Mon, 21 Jun 2010 22:00:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LM0vjn049114; Mon, 21 Jun 2010 22:00:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006212200.o5LM0vjn049114@svn.freebsd.org> From: Xin LI Date: Mon, 21 Jun 2010 22:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209404 - stable/8/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 22:00:57 -0000 Author: delphij Date: Mon Jun 21 22:00:57 2010 New Revision: 209404 URL: http://svn.freebsd.org/changeset/base/209404 Log: MFC r208969,209268: Driver update of twa(4) from LSI. Many thanks to LSI for continuing to support FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed successfully. 2) Remove G66_WORKAROUND code (this bug never shipped). 3) Remove unnecessary interrupt lock (intr_lock). 4) Timeout firmware handshake for PChip reset (don't wait forever). 5) Handle interrupts inline. 6) Unmask command interrupt ONLY when adding a command to the pending queue. 7) Mask command interrupt ONLY after removing the last command from the pending queue. 8) Remove TW_OSLI_DEFERRED_INTR_USED code. 9) Replace controller "state" with separate data fields to avoid races: TW_CLI_CTLR_STATE_ACTIVE ctlr->active TW_CLI_CTLR_STATE_INTR_ENABLED ctlr->interrupts_enabled TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY ctlr->internal_req_busy TW_CLI_CTLR_STATE_GET_MORE_AENS ctlr->get_more_aens TW_CLI_CTLR_STATE_RESET_IN_PROGRESS ctlr->reset_in_progress TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS ctlr->reset_phase1_in_progress 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT null. 11) Replace softc "state" with separate data fields to avoid races: TW_OSLI_CTLR_STATE_OPEN sc->open TW_OSLI_CTLR_STATE_SIMQ_FROZEN sc->simq_frozen 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in tw_osl_complete_passthru() 13) Use correct CAM status values. Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID. Remove use of CAM_RELEASE_SIMQ for physical data addresses. 14) Do not freeze/ release the simq with non I/O commands. When it is appropriate to temporarily freeze the simq with an I/O command use: xpt_freeze_simq(sim, 1); ccb->ccb_h.status |= CAM_RELEASE_SIMQ; otherwise use: xpt_freeze_simq(sim, 1); xpt_release_simq(sim, 1); Submitted by: Tom Couch PR: kern/147695 Modified: stable/8/sys/dev/twa/tw_cl.h stable/8/sys/dev/twa/tw_cl_fwif.h stable/8/sys/dev/twa/tw_cl_init.c stable/8/sys/dev/twa/tw_cl_intr.c stable/8/sys/dev/twa/tw_cl_io.c stable/8/sys/dev/twa/tw_cl_misc.c stable/8/sys/dev/twa/tw_cl_share.h stable/8/sys/dev/twa/tw_osl.h stable/8/sys/dev/twa/tw_osl_cam.c stable/8/sys/dev/twa/tw_osl_externs.h stable/8/sys/dev/twa/tw_osl_freebsd.c stable/8/sys/dev/twa/tw_osl_inline.h stable/8/sys/dev/twa/tw_osl_share.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/twa/tw_cl.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl.h Mon Jun 21 22:00:57 2010 (r209404) @@ -51,22 +51,6 @@ #define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */ #define TW_CLI_MAX_RESET_ATTEMPTS 2 -/* Possible values of ctlr->state. */ -/* Initialization done, and controller is active. */ -#define TW_CLI_CTLR_STATE_ACTIVE (1<<0) -/* Interrupts on controller enabled. */ -#define TW_CLI_CTLR_STATE_INTR_ENABLED (1<<1) -/* Data buffer for internal requests in use. */ -#define TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY (1<<2) -/* More AEN's need to be retrieved. */ -#define TW_CLI_CTLR_STATE_GET_MORE_AENS (1<<3) -/* Controller is being reset. */ -#define TW_CLI_CTLR_STATE_RESET_IN_PROGRESS (1<<4) -/* G133 controller is in 'phase 1' of being reset. */ -#define TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS (1<<5) -/* G66 register write access bug needs to be worked around. */ -#define TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED (1<<6) - /* Possible values of ctlr->ioctl_lock.lock. */ #define TW_CLI_LOCK_FREE 0x0 /* lock is free */ #define TW_CLI_LOCK_HELD 0x1 /* lock is held */ @@ -146,7 +130,12 @@ struct tw_cli_ctlr_context { TW_UINT32 device_id; /* controller device id */ TW_UINT32 arch_id; /* controller architecture id */ - TW_UINT32 state; /* controller state */ + TW_UINT8 active; /* Initialization done, and controller is active. */ + TW_UINT8 interrupts_enabled; /* Interrupts on controller enabled. */ + TW_UINT8 internal_req_busy; /* Data buffer for internal requests in use. */ + TW_UINT8 get_more_aens; /* More AEN's need to be retrieved. */ + TW_UINT8 reset_in_progress; /* Controller is being reset. */ + TW_UINT8 reset_phase1_in_progress; /* In 'phase 1' of reset. */ TW_UINT32 flags; /* controller settings */ TW_UINT32 sg_size_factor; /* SG element size should be a multiple of this */ @@ -199,10 +188,6 @@ struct tw_cli_ctlr_context { submission */ TW_LOCK_HANDLE *io_lock;/* ptr to lock held during cmd submission */ - TW_LOCK_HANDLE intr_lock_handle;/* lock held during - ISR/response intr processing */ - TW_LOCK_HANDLE *intr_lock;/* ptr to lock held during ISR/ - response intr processing */ #ifdef TW_OSL_CAN_SLEEP TW_SLEEP_HANDLE sleep_handle; /* handle to co-ordinate sleeps Modified: stable/8/sys/dev/twa/tw_cl_fwif.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl_fwif.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_fwif.h Mon Jun 21 22:00:57 2010 (r209404) @@ -89,7 +89,6 @@ #define TWA_STATUS_MINOR_VERSION_MASK 0x0F000000 #define TWA_STATUS_MAJOR_VERSION_MASK 0xF0000000 -#define TWA_STATUS_EXPECTED_BITS 0x00002000 #define TWA_STATUS_UNEXPECTED_BITS 0x00F00000 @@ -142,7 +141,7 @@ #define TWA_BASE_FW_SRL 24 #define TWA_BASE_FW_BRANCH 0 #define TWA_BASE_FW_BUILD 1 -#define TWA_CURRENT_FW_SRL 30 +#define TWA_CURRENT_FW_SRL 41 #define TWA_CURRENT_FW_BRANCH_9K 4 #define TWA_CURRENT_FW_BUILD_9K 8 #define TWA_CURRENT_FW_BRANCH_9K_X 8 Modified: stable/8/sys/dev/twa/tw_cl_init.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_init.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_init.c Mon Jun 21 22:00:57 2010 (r209404) @@ -208,7 +208,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *non_dma_mem_size = sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens); @@ -220,7 +220,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *dma_mem_size = (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + (TW_CLI_SECTOR_SIZE); + (max_simult_reqs)) + (TW_CLI_SECTOR_SIZE); return(0); } @@ -287,12 +287,12 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle } tw_osl_memzero(non_dma_mem, sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens)); tw_osl_memzero(dma_mem, (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + + max_simult_reqs) + TW_CLI_SECTOR_SIZE); free_non_dma_mem = (TW_UINT8 *)non_dma_mem; @@ -307,7 +307,7 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle ctlr->arch_id = TWA_ARCH_ID(device_id); ctlr->flags = flags; ctlr->sg_size_factor = TWA_SG_ELEMENT_SIZE_FACTOR(device_id); - ctlr->max_simult_reqs = max_simult_reqs + 1; + ctlr->max_simult_reqs = max_simult_reqs; ctlr->max_aens_supported = max_aens; /* Initialize queues of CL internal request context packets. */ @@ -321,55 +321,23 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle tw_osl_init_lock(ctlr_handle, "tw_cl_gen_lock", ctlr->gen_lock); ctlr->io_lock = &(ctlr->io_lock_handle); tw_osl_init_lock(ctlr_handle, "tw_cl_io_lock", ctlr->io_lock); - /* - * If 64 bit cmd pkt addresses are used, we will need to serialize - * writes to the hardware (across registers), since existing (G66) - * hardware will get confused if, for example, we wrote the low 32 bits - * of the cmd pkt address, followed by a response interrupt mask to the - * control register, followed by the high 32 bits of the cmd pkt - * address. It will then interpret the value written to the control - * register as the low cmd pkt address. So, for this case, we will - * make a note that we will need to synchronize control register writes - * with command register writes. - */ - if ((ctlr->flags & TW_CL_64BIT_ADDRESSES) && - ((ctlr->device_id == TW_CL_DEVICE_ID_9K) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_X) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_E) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_SA))) { - ctlr->state |= TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED; - ctlr->intr_lock = ctlr->io_lock; - } else { - ctlr->intr_lock = &(ctlr->intr_lock_handle); - tw_osl_init_lock(ctlr_handle, "tw_cl_intr_lock", - ctlr->intr_lock); - } /* Initialize CL internal request context packets. */ ctlr->req_ctxt_buf = (struct tw_cli_req_context *)free_non_dma_mem; free_non_dma_mem += (sizeof(struct tw_cli_req_context) * - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->cmd_pkt_buf = (struct tw_cl_command_packet *)dma_mem; ctlr->cmd_pkt_phys = dma_mem_phys; ctlr->internal_req_data = (TW_UINT8 *) (ctlr->cmd_pkt_buf + - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->internal_req_data_phys = ctlr->cmd_pkt_phys + (sizeof(struct tw_cl_command_packet) * - ( - max_simult_reqs + - 1)); - - for (i = 0; - i < ( - max_simult_reqs + - 1); i++) { + max_simult_reqs); + + for (i = 0; i < max_simult_reqs; i++) { req = &(ctlr->req_ctxt_buf[i]); req->cmd_pkt = &(ctlr->cmd_pkt_buf[i]); @@ -421,8 +389,8 @@ start_ctlr: /* Notify some info about the controller to the OSL. */ tw_cli_notify_ctlr_info(ctlr); - /* Mark the controller as active. */ - ctlr->state |= TW_CLI_CTLR_STATE_ACTIVE; + /* Mark the controller active. */ + ctlr->active = TW_CL_TRUE; return(error); } @@ -597,7 +565,7 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha * Mark the controller as inactive, disable any further interrupts, * and notify the controller that we are going down. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_ACTIVE; + ctlr->active = TW_CL_FALSE; tw_cli_disable_interrupts(ctlr); @@ -617,8 +585,6 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha /* Destroy all locks used by CL. */ tw_osl_destroy_lock(ctlr_handle, ctlr->gen_lock); tw_osl_destroy_lock(ctlr_handle, ctlr->io_lock); - if (!(ctlr->flags & TW_CL_64BIT_ADDRESSES)) - tw_osl_destroy_lock(ctlr_handle, ctlr->intr_lock); ret: return(error); Modified: stable/8/sys/dev/twa/tw_cl_intr.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_intr.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_intr.c Mon Jun 21 22:00:57 2010 (r209404) @@ -75,22 +75,16 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle if (ctlr == NULL) goto out; - /* If we get an interrupt while resetting, it is a shared - one for another device, so just bail */ - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) - goto out; - /* - * Synchronize access between writes to command and control registers - * in 64-bit environments, on G66. + * Bail If we get an interrupt while resetting, or shutting down. */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); + if (ctlr->reset_in_progress || !(ctlr->active)) + goto out; /* Read the status register to determine the type of interrupt. */ status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr_handle); if (tw_cli_check_ctlr_state(ctlr, status_reg)) - goto out_unlock; + goto out; /* Clear the interrupt. */ if (status_reg & TWA_STATUS_HOST_INTERRUPT) { @@ -98,36 +92,30 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle "Host interrupt"); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_HOST_INTERRUPT); - ctlr->host_intr_pending = 0; /* we don't use this */ - rc |= TW_CL_FALSE; /* don't request for a deferred isr call */ } if (status_reg & TWA_STATUS_ATTENTION_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Attention interrupt"); + rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_attn_intr(ctlr); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT); - ctlr->attn_intr_pending = 1; - rc |= TW_CL_TRUE; /* request for a deferred isr call */ } if (status_reg & TWA_STATUS_COMMAND_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Command interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_COMMAND_INTERRUPT); - ctlr->cmd_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_cmd_intr(ctlr); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); } if (status_reg & TWA_STATUS_RESPONSE_INTERRUPT) { tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "Response interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_RESPONSE_INTERRUPT); - ctlr->resp_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_resp_intr(ctlr); } -out_unlock: - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); out: return(rc); } @@ -135,52 +123,6 @@ out: /* - * Function name: tw_cl_deferred_interrupt - * Description: Deferred interrupt handler. Does most of the processing - * related to an interrupt. - * - * Input: ctlr_handle -- controller handle - * Output: None - * Return value: None - */ -TW_VOID -tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle) -{ - struct tw_cli_ctlr_context *ctlr = - (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); - - /* Dispatch based on the kind of interrupt. */ - if (ctlr->host_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Host interrupt"); - ctlr->host_intr_pending = 0; - tw_cli_process_host_intr(ctlr); - } - if (ctlr->attn_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Attention interrupt"); - ctlr->attn_intr_pending = 0; - tw_cli_process_attn_intr(ctlr); - } - if (ctlr->cmd_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Command interrupt"); - ctlr->cmd_intr_pending = 0; - tw_cli_process_cmd_intr(ctlr); - } - if (ctlr->resp_intr_pending) { - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), - "Processing Response interrupt"); - ctlr->resp_intr_pending = 0; - tw_cli_process_resp_intr(ctlr); - } -} - - - -/* * Function name: tw_cli_process_host_intr * Description: This function gets called if we triggered an interrupt. * We don't use it as of now. @@ -248,12 +190,6 @@ tw_cli_process_cmd_intr(struct tw_cli_ct { tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* - * Let the OS Layer submit any requests in its pending queue, - * if it has one. - */ - tw_osl_ctlr_ready(ctlr->ctlr_handle); - /* Start any requests that might be in the pending queue. */ tw_cli_submit_pending_queue(ctlr); @@ -286,9 +222,6 @@ tw_cli_process_resp_intr(struct tw_cli_c tw_cli_dbg_printf(10, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* Serialize access to the controller response queue. */ - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->intr_lock); - for (;;) { status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr->ctlr_handle); if ((error = tw_cli_check_ctlr_state(ctlr, status_reg))) @@ -315,7 +248,6 @@ tw_cli_process_resp_intr(struct tw_cli_c #ifdef TW_OSL_DEBUG tw_cl_print_ctlr_stats(ctlr->ctlr_handle); #endif /* TW_OSL_DEBUG */ - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); tw_cl_reset_ctlr(ctlr->ctlr_handle); return(TW_OSL_EIO); } @@ -330,12 +262,6 @@ tw_cli_process_resp_intr(struct tw_cli_c } - /* Unmask the response interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, - TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT); - - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); - /* Complete this, and other requests in the complete queue. */ tw_cli_process_complete_queue(ctlr); @@ -614,12 +540,11 @@ tw_cli_param_callback(struct tw_cli_req_ "status = %d", cmd->param.status); } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); - if ((ctlr->state & TW_CLI_CTLR_STATE_GET_MORE_AENS) && - (!(ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS))) { - ctlr->state &= ~TW_CLI_CTLR_STATE_GET_MORE_AENS; + if ((ctlr->get_more_aens) && (!(ctlr->reset_in_progress))) { + ctlr->get_more_aens = TW_CL_FALSE; tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "Fetching more AEN's"); if ((error = tw_cli_get_aen(ctlr))) @@ -677,7 +602,7 @@ tw_cli_aen_callback(struct tw_cli_req_co } if (error) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return; } @@ -688,7 +613,7 @@ tw_cli_aen_callback(struct tw_cli_req_co aen_code = tw_cli_manage_aen(ctlr, req); if (aen_code != TWA_AEN_SYNC_TIME_WITH_HOST) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); if (aen_code != TWA_AEN_QUEUE_EMPTY) if ((error = tw_cli_get_aen(ctlr))) @@ -736,25 +661,25 @@ tw_cli_manage_aen(struct tw_cli_ctlr_con * Free the internal req pkt right here, since * tw_cli_set_param will need it. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); /* * We will use a callback in tw_cli_set_param only when * interrupts are enabled and we can expect our callback - * to get called. Setting the TW_CLI_CTLR_STATE_GET_MORE_AENS + * to get called. Setting the get_more_aens * flag will make the callback continue to try to retrieve * more AEN's. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) - ctlr->state |= TW_CLI_CTLR_STATE_GET_MORE_AENS; + if (ctlr->interrupts_enabled) + ctlr->get_more_aens = TW_CL_TRUE; /* Calculate time (in seconds) since last Sunday 12.00 AM. */ local_time = tw_osl_get_local_time(); sync_time = (local_time - (3 * 86400)) % 604800; if ((error = tw_cli_set_param(ctlr, TWA_PARAM_TIME_TABLE, TWA_PARAM_TIME_SCHED_TIME, 4, &sync_time, - (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) + (ctlr->interrupts_enabled) ? tw_cli_param_callback : TW_CL_NULL))) tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, @@ -799,7 +724,7 @@ tw_cli_enable_interrupts(struct tw_cli_c { tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_TRUE; TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT | TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT | @@ -823,6 +748,6 @@ tw_cli_disable_interrupts(struct tw_cli_ TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_DISABLE_INTERRUPTS); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_FALSE; } Modified: stable/8/sys/dev/twa/tw_cl_io.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_io.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_io.c Mon Jun 21 22:00:57 2010 (r209404) @@ -49,6 +49,10 @@ #include "tw_cl_externs.h" #include "tw_osl_ioctl.h" +#include +#include +#include + /* @@ -76,11 +80,9 @@ tw_cl_start_io(struct tw_cl_ctlr_handle ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "I/O during reset: returning busy. Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "I/O during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -101,7 +103,6 @@ tw_cl_start_io(struct tw_cl_ctlr_handle )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -171,7 +172,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; TW_INT32 error; - TW_UINT8 notify_osl_of_ctlr_busy = TW_CL_FALSE; tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -208,10 +208,13 @@ tw_cli_submit_cmd(struct tw_cli_req_cont req->state = TW_CLI_REQ_STATE_PENDING; tw_cli_req_q_insert_tail(req, TW_CLI_PENDING_Q); error = 0; + /* Unmask command interrupt. */ + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); } else error = TW_OSL_EBUSY; } else { - notify_osl_of_ctlr_busy = TW_CL_TRUE; + tw_osl_ctlr_busy(ctlr_handle, req->req_handle); error = TW_OSL_EBUSY; } } else { @@ -246,25 +249,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont out: tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - if (status_reg & TWA_STATUS_COMMAND_QUEUE_FULL) { - if (notify_osl_of_ctlr_busy) - tw_osl_ctlr_busy(ctlr_handle, req->req_handle); - - /* - * Synchronize access between writes to command and control - * registers in 64-bit environments, on G66. - */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); - - /* Unmask command interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); - - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - } - return(error); } @@ -299,12 +283,9 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "Passthru request during reset: returning busy. " - "Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "Passthru request during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -312,7 +293,6 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -759,11 +739,11 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -821,7 +801,7 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; } tw_osl_memcpy(param_data, param->data, param_size); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -838,7 +818,7 @@ out: "get_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(1); @@ -878,11 +858,11 @@ tw_cli_set_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -939,7 +919,7 @@ tw_cli_set_param(struct tw_cli_ctlr_cont &(req->cmd_pkt->cmd_hdr)); goto out; } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -956,7 +936,7 @@ out: "set_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(error); @@ -1054,8 +1034,11 @@ tw_cli_submit_and_poll_request(struct tw * taking care of it). */ tw_cli_req_q_remove_item(req, TW_CLI_PENDING_Q); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } @@ -1079,12 +1062,16 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl { struct tw_cli_ctlr_context *ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); + struct twa_softc *sc = ctlr_handle->osl_ctlr_ctxt; TW_INT32 reset_attempt = 1; TW_INT32 error; tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_TRUE; + xpt_freeze_simq(sc->sim, 1); + + tw_cli_disable_interrupts(ctlr); /* * Error back all requests in the complete, busy, and pending queues. @@ -1098,8 +1085,8 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl tw_cli_drain_complete_queue(ctlr); tw_cli_drain_busy_queue(ctlr); tw_cli_drain_pending_queue(ctlr); - - tw_cli_disable_interrupts(ctlr); + ctlr->internal_req_busy = TW_CL_FALSE; + ctlr->get_more_aens = TW_CL_FALSE; /* Soft reset the controller. */ try_reset: @@ -1135,7 +1122,9 @@ try_reset: " "); out: - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_FALSE; + xpt_release_simq(sc->sim, 1); + /* * Enable interrupts, and also clear attention and response interrupts. */ @@ -1163,6 +1152,8 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con { struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; + int found; + int loop_count; TW_UINT32 error; tw_cli_dbg_printf(1, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -1192,12 +1183,27 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con * make sure we don't access any hardware registers (for * polling) during that window. */ - ctlr->state |= TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; - while (tw_cli_find_response(ctlr, - TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) != TW_OSL_ESUCCESS) + ctlr->reset_phase1_in_progress = TW_CL_TRUE; + loop_count = 0; + do { + found = (tw_cli_find_response(ctlr, TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) == TW_OSL_ESUCCESS); tw_osl_delay(10); + loop_count++; + error = 0x7888; + } while (!found && (loop_count < 6000000)); /* Loop for no more than 60 seconds */ + + if (!found) { + tw_cl_create_event(ctlr_handle, TW_CL_TRUE, + TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, + 0x1109, 0x1, TW_CL_SEVERITY_ERROR_STRING, + "Missed firmware handshake after soft-reset", + "error = %d", error); + tw_osl_free_lock(ctlr_handle, ctlr->io_lock); + return(error); + } + tw_osl_delay(TWA_RESET_PHASE1_WAIT_TIME_MS * 1000); - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; + ctlr->reset_phase1_in_progress = TW_CL_FALSE; } if ((error = tw_cli_poll_status(ctlr, @@ -1285,9 +1291,9 @@ tw_cli_send_scsi_cmd(struct tw_cli_req_c tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) + if (ctlr->internal_req_busy) return(TW_OSL_EBUSY); - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; tw_osl_memzero(req->data, TW_CLI_SECTOR_SIZE); @@ -1365,7 +1371,7 @@ tw_cli_get_aen(struct tw_cli_ctlr_contex "Could not send SCSI command", "request = %p, error = %d", req, error); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); Modified: stable/8/sys/dev/twa/tw_cl_misc.c ============================================================================== --- stable/8/sys/dev/twa/tw_cl_misc.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_misc.c Mon Jun 21 22:00:57 2010 (r209404) @@ -368,14 +368,14 @@ tw_cli_drain_aen_queue(struct tw_cli_ctl if (aen_code == TWA_AEN_SYNC_TIME_WITH_HOST) continue; - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } out: if (req) { if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); @@ -447,34 +447,7 @@ tw_cli_poll_status(struct tw_cli_ctlr_co /* got the required bit(s) */ return(TW_OSL_ESUCCESS); - /* - * The OSL should not define TW_OSL_CAN_SLEEP if it calls - * tw_cl_deferred_interrupt from within the ISR and not a - * lower interrupt level, since, in that case, we might end - * up here, and try to sleep (within an ISR). - */ -#ifndef TW_OSL_CAN_SLEEP - /* OSL doesn't support sleeping; will spin. */ - tw_osl_delay(1000); -#else /* TW_OSL_CAN_SLEEP */ -#if 0 - /* Will spin if initializing, sleep otherwise. */ - if (!(ctlr->state & TW_CLI_CTLR_STATE_ACTIVE)) - tw_osl_delay(1000); - else - tw_osl_sleep(ctlr->ctlr_handle, - &(ctlr->sleep_handle), 1 /* ms */); -#else /* #if 0 */ - /* - * Will always spin for now (since reset holds a spin lock). - * We could free io_lock after the call to TW_CLI_SOFT_RESET, - * so we could sleep here. To block new requests (since - * the lock will have been released) we could use the - * ...RESET_IN_PROGRESS flag. Need to revisit. - */ tw_osl_delay(1000); -#endif /* #if 0 */ -#endif /* TW_OSL_CAN_SLEEP */ } while (tw_osl_get_local_time() <= end_time); return(TW_OSL_ETIMEDOUT); @@ -736,22 +709,20 @@ tw_cli_check_ctlr_state(struct tw_cli_ct tw_cli_dbg_printf(8, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Check if the 'micro-controller ready' bit is not set. */ - if ((status_reg & TWA_STATUS_EXPECTED_BITS) != - TWA_STATUS_EXPECTED_BITS) { + if (!(status_reg & TWA_STATUS_MICROCONTROLLER_READY)) { TW_INT8 desc[200]; tw_osl_memzero(desc, 200); - if ((status_reg & TWA_STATUS_MICROCONTROLLER_READY) || - (!(ctlr->state & - TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS))) { + if (!(ctlr->reset_phase1_in_progress)) { tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1301, 0x1, TW_CL_SEVERITY_ERROR_STRING, "Missing expected status bit(s)", "status reg = 0x%x; Missing bits: %s", status_reg, - tw_cli_describe_bits (~status_reg & - TWA_STATUS_EXPECTED_BITS, desc)); + tw_cli_describe_bits( + TWA_STATUS_MICROCONTROLLER_READY, + desc)); error = TW_OSL_EGENFAILURE; } } @@ -765,7 +736,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0) || + (!(ctlr->reset_in_progress)) || ((status_reg & TWA_STATUS_QUEUE_ERROR_INTERRUPT) == 0)) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, @@ -819,7 +790,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0)) + (!(ctlr->reset_in_progress))) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1305, 0x1, TW_CL_SEVERITY_ERROR_STRING, Modified: stable/8/sys/dev/twa/tw_cl_share.h ============================================================================== --- stable/8/sys/dev/twa/tw_cl_share.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_cl_share.h Mon Jun 21 22:00:57 2010 (r209404) @@ -76,7 +76,7 @@ * of supporting only 255, since we want to keep one CL internal request * context packet always available for internal requests. */ -#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 0xFF /* max simult reqs supported */ +#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 256 /* max simult reqs supported */ #define TW_CL_MAX_32BIT_SG_ELEMENTS 109 /* max 32-bit sg elements */ #define TW_CL_MAX_64BIT_SG_ELEMENTS 72 /* max 64-bit sg elements */ @@ -144,6 +144,7 @@ struct tw_cl_ctlr_handle { struct tw_cl_req_handle { TW_VOID *osl_req_ctxt; /* OSL's request context */ TW_VOID *cl_req_ctxt; /* CL's request context */ + TW_UINT8 is_io; /* Only freeze/release simq for IOs */ }; @@ -353,12 +354,6 @@ extern TW_VOID tw_osl_ctlr_busy(struct t #endif -#ifndef tw_osl_ctlr_ready -/* Called on cmd interrupt. Allows re-submission of any pending requests. */ -extern TW_VOID tw_osl_ctlr_ready(struct tw_cl_ctlr_handle *ctlr_handle); -#endif - - #ifndef tw_osl_cur_func /* Text name of current function. */ extern TW_INT8 *tw_osl_cur_func(TW_VOID); @@ -528,10 +523,6 @@ extern TW_VOID tw_cl_create_event(struct extern TW_INT32 tw_cl_ctlr_supported(TW_INT32 vendor_id, TW_INT32 device_id); -/* Deferred interrupt handler. */ -extern TW_VOID tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle); - - /* Submit a firmware cmd packet. */ extern TW_INT32 tw_cl_fw_passthru(struct tw_cl_ctlr_handle *ctlr_handle, struct tw_cl_req_packet *req_pkt, struct tw_cl_req_handle *req_handle); Modified: stable/8/sys/dev/twa/tw_osl.h ============================================================================== --- stable/8/sys/dev/twa/tw_osl.h Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_osl.h Mon Jun 21 22:00:57 2010 (r209404) @@ -50,13 +50,11 @@ #define TW_OSLI_DEVICE_NAME "3ware 9000 series Storage Controller" #define TW_OSLI_MALLOC_CLASS M_TWA -#define TW_OSLI_MAX_NUM_IOS TW_CL_MAX_SIMULTANEOUS_REQUESTS +#define TW_OSLI_MAX_NUM_REQUESTS TW_CL_MAX_SIMULTANEOUS_REQUESTS +/* Reserve two command packets. One for ioctls and one for AENs */ +#define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) #define TW_OSLI_MAX_NUM_AENS 0x100 -/* Disabled, doesn't work yet. -#define TW_OSLI_DEFERRED_INTR_USED -*/ - #ifdef PAE #define TW_OSLI_DMA_BOUNDARY (1u << 31) #else @@ -80,10 +78,6 @@ #define TW_OSLI_REQ_FLAGS_PASSTHRU (1<<5) /* pass through request */ #define TW_OSLI_REQ_FLAGS_SLEEPING (1<<6) /* owner sleeping on this cmd */ -/* Possible values of sc->state. */ -#define TW_OSLI_CTLR_STATE_OPEN (1<<0) /* control device is open */ -#define TW_OSLI_CTLR_STATE_SIMQ_FROZEN (1<<1) /* simq frozen */ - #ifdef TW_OSL_DEBUG struct tw_osli_q_stats { @@ -101,6 +95,8 @@ struct tw_osli_q_stats { /* Driver's request packet. */ struct tw_osli_req_context { struct tw_cl_req_handle req_handle;/* tag to track req b/w OSL & CL */ + struct mtx ioctl_wake_timeout_lock_handle;/* non-spin lock used to detect ioctl timeout */ + struct mtx *ioctl_wake_timeout_lock;/* ptr to above lock */ struct twa_softc *ctlr; /* ptr to OSL's controller context */ TW_VOID *data; /* ptr to data being passed to CL */ TW_UINT32 length; /* length of buf being passed to CL */ @@ -130,10 +126,10 @@ struct tw_osli_req_context { /* Per-controller structure. */ struct twa_softc { struct tw_cl_ctlr_handle ctlr_handle; - struct tw_osli_req_context *req_ctxt_buf; + struct tw_osli_req_context *req_ctx_buf; /* Controller state. */ - TW_UINT32 state; + TW_UINT8 open; TW_UINT32 flags; TW_INT32 device_id; Modified: stable/8/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/8/sys/dev/twa/tw_osl_cam.c Mon Jun 21 21:15:51 2010 (r209403) +++ stable/8/sys/dev/twa/tw_osl_cam.c Mon Jun 21 22:00:57 2010 (r209404) @@ -81,7 +81,7 @@ tw_osli_cam_attach(struct twa_softc *sc) /* * Create the device queue for our SIM. */ - if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_IOS)) == NULL) { + if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_REQUESTS)) == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, @@ -92,15 +92,15 @@ tw_osli_cam_attach(struct twa_softc *sc) } /* - * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_IOS + * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_REQUESTS * simultaneous requests, we claim to be able to handle only - * (TW_OSLI_MAX_NUM_IOS - 1), so that we always have a request - * packet available to service ioctls. + * TW_OSLI_MAX_NUM_IOS (two less), so that we always have a request + * packet available to service ioctls and AENs. */ tw_osli_dbg_dprintf(3, sc, "Calling cam_sim_alloc"); sc->sim = cam_sim_alloc(twa_action, twa_poll, "twa", sc, device_get_unit(sc->bus_dev), sc->sim_lock, - TW_OSLI_MAX_NUM_IOS - 1, 1, devq); + TW_OSLI_MAX_NUM_IOS, 1, devq); if (sc->sim == NULL) { cam_simq_free(devq); tw_osli_printf(sc, "error = %d", @@ -168,14 +168,6 @@ tw_osli_cam_detach(struct twa_softc *sc) { tw_osli_dbg_dprintf(3, sc, "entered"); -#ifdef TW_OSLI_DEFERRED_INTR_USED - /* - drain the taskqueue - Ctrl is already went down so, no more enqueuetask will - happen . Don't hold any locks, that task might need. - */ - - taskqueue_drain(taskqueue_fast, &(sc->deferred_intr_callback)); -#endif mtx_lock(sc->sim_lock); if (sc->path) @@ -236,7 +228,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2105, "Physical CDB address!"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } @@ -297,7 +289,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2107, "XPT_SCSI_IO: Got SGList"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 22:20:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E30A7106566B; Mon, 21 Jun 2010 22:20:52 +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 D081F8FC15; Mon, 21 Jun 2010 22:20:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LMKqdc053525; Mon, 21 Jun 2010 22:20:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LMKqp0053514; Mon, 21 Jun 2010 22:20:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006212220.o5LMKqp0053514@svn.freebsd.org> From: Xin LI Date: Mon, 21 Jun 2010 22:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209405 - stable/7/sys/dev/twa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 22:20:53 -0000 Author: delphij Date: Mon Jun 21 22:20:52 2010 New Revision: 209405 URL: http://svn.freebsd.org/changeset/base/209405 Log: MFC r208969,209268: Driver update of twa(4) from LSI. Many thanks to LSI for continuing to support FreeBSD. 1) Timeout ioctl command timeouts. Do not reset the controller if ioctl command completed successfully. 2) Remove G66_WORKAROUND code (this bug never shipped). 3) Remove unnecessary interrupt lock (intr_lock). 4) Timeout firmware handshake for PChip reset (don't wait forever). 5) Handle interrupts inline. 6) Unmask command interrupt ONLY when adding a command to the pending queue. 7) Mask command interrupt ONLY after removing the last command from the pending queue. 8) Remove TW_OSLI_DEFERRED_INTR_USED code. 9) Replace controller "state" with separate data fields to avoid races: TW_CLI_CTLR_STATE_ACTIVE ctlr->active TW_CLI_CTLR_STATE_INTR_ENABLED ctlr->interrupts_enabled TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY ctlr->internal_req_busy TW_CLI_CTLR_STATE_GET_MORE_AENS ctlr->get_more_aens TW_CLI_CTLR_STATE_RESET_IN_PROGRESS ctlr->reset_in_progress TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS ctlr->reset_phase1_in_progress 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT null. 11) Replace softc "state" with separate data fields to avoid races: TW_OSLI_CTLR_STATE_OPEN sc->open TW_OSLI_CTLR_STATE_SIMQ_FROZEN sc->simq_frozen 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in tw_osl_complete_passthru() 13) Use correct CAM status values. Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID. Remove use of CAM_RELEASE_SIMQ for physical data addresses. 14) Do not freeze/ release the simq with non I/O commands. When it is appropriate to temporarily freeze the simq with an I/O command use: xpt_freeze_simq(sim, 1); ccb->ccb_h.status |= CAM_RELEASE_SIMQ; otherwise use: xpt_freeze_simq(sim, 1); xpt_release_simq(sim, 1); Submitted by: Tom Couch PR: kern/147694 Modified: stable/7/sys/dev/twa/tw_cl.h stable/7/sys/dev/twa/tw_cl_fwif.h stable/7/sys/dev/twa/tw_cl_init.c stable/7/sys/dev/twa/tw_cl_intr.c stable/7/sys/dev/twa/tw_cl_io.c stable/7/sys/dev/twa/tw_cl_misc.c stable/7/sys/dev/twa/tw_cl_share.h stable/7/sys/dev/twa/tw_osl.h stable/7/sys/dev/twa/tw_osl_cam.c stable/7/sys/dev/twa/tw_osl_externs.h stable/7/sys/dev/twa/tw_osl_freebsd.c stable/7/sys/dev/twa/tw_osl_inline.h stable/7/sys/dev/twa/tw_osl_share.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/twa/tw_cl.h ============================================================================== --- stable/7/sys/dev/twa/tw_cl.h Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl.h Mon Jun 21 22:20:52 2010 (r209405) @@ -51,22 +51,6 @@ #define TW_CLI_RESET_TIMEOUT_PERIOD 60 /* seconds */ #define TW_CLI_MAX_RESET_ATTEMPTS 2 -/* Possible values of ctlr->state. */ -/* Initialization done, and controller is active. */ -#define TW_CLI_CTLR_STATE_ACTIVE (1<<0) -/* Interrupts on controller enabled. */ -#define TW_CLI_CTLR_STATE_INTR_ENABLED (1<<1) -/* Data buffer for internal requests in use. */ -#define TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY (1<<2) -/* More AEN's need to be retrieved. */ -#define TW_CLI_CTLR_STATE_GET_MORE_AENS (1<<3) -/* Controller is being reset. */ -#define TW_CLI_CTLR_STATE_RESET_IN_PROGRESS (1<<4) -/* G133 controller is in 'phase 1' of being reset. */ -#define TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS (1<<5) -/* G66 register write access bug needs to be worked around. */ -#define TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED (1<<6) - /* Possible values of ctlr->ioctl_lock.lock. */ #define TW_CLI_LOCK_FREE 0x0 /* lock is free */ #define TW_CLI_LOCK_HELD 0x1 /* lock is held */ @@ -146,7 +130,12 @@ struct tw_cli_ctlr_context { TW_UINT32 device_id; /* controller device id */ TW_UINT32 arch_id; /* controller architecture id */ - TW_UINT32 state; /* controller state */ + TW_UINT8 active; /* Initialization done, and controller is active. */ + TW_UINT8 interrupts_enabled; /* Interrupts on controller enabled. */ + TW_UINT8 internal_req_busy; /* Data buffer for internal requests in use. */ + TW_UINT8 get_more_aens; /* More AEN's need to be retrieved. */ + TW_UINT8 reset_in_progress; /* Controller is being reset. */ + TW_UINT8 reset_phase1_in_progress; /* In 'phase 1' of reset. */ TW_UINT32 flags; /* controller settings */ TW_UINT32 sg_size_factor; /* SG element size should be a multiple of this */ @@ -199,10 +188,6 @@ struct tw_cli_ctlr_context { submission */ TW_LOCK_HANDLE *io_lock;/* ptr to lock held during cmd submission */ - TW_LOCK_HANDLE intr_lock_handle;/* lock held during - ISR/response intr processing */ - TW_LOCK_HANDLE *intr_lock;/* ptr to lock held during ISR/ - response intr processing */ #ifdef TW_OSL_CAN_SLEEP TW_SLEEP_HANDLE sleep_handle; /* handle to co-ordinate sleeps Modified: stable/7/sys/dev/twa/tw_cl_fwif.h ============================================================================== --- stable/7/sys/dev/twa/tw_cl_fwif.h Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl_fwif.h Mon Jun 21 22:20:52 2010 (r209405) @@ -89,7 +89,6 @@ #define TWA_STATUS_MINOR_VERSION_MASK 0x0F000000 #define TWA_STATUS_MAJOR_VERSION_MASK 0xF0000000 -#define TWA_STATUS_EXPECTED_BITS 0x00002000 #define TWA_STATUS_UNEXPECTED_BITS 0x00F00000 @@ -142,7 +141,7 @@ #define TWA_BASE_FW_SRL 24 #define TWA_BASE_FW_BRANCH 0 #define TWA_BASE_FW_BUILD 1 -#define TWA_CURRENT_FW_SRL 30 +#define TWA_CURRENT_FW_SRL 41 #define TWA_CURRENT_FW_BRANCH_9K 4 #define TWA_CURRENT_FW_BUILD_9K 8 #define TWA_CURRENT_FW_BRANCH_9K_X 8 Modified: stable/7/sys/dev/twa/tw_cl_init.c ============================================================================== --- stable/7/sys/dev/twa/tw_cl_init.c Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl_init.c Mon Jun 21 22:20:52 2010 (r209405) @@ -208,7 +208,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *non_dma_mem_size = sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens); @@ -220,7 +220,7 @@ tw_cl_get_mem_requirements(struct tw_cl_ */ *dma_mem_size = (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + (TW_CLI_SECTOR_SIZE); + (max_simult_reqs)) + (TW_CLI_SECTOR_SIZE); return(0); } @@ -287,12 +287,12 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle } tw_osl_memzero(non_dma_mem, sizeof(struct tw_cli_ctlr_context) + - (sizeof(struct tw_cli_req_context) * (max_simult_reqs + 1)) + + (sizeof(struct tw_cli_req_context) * max_simult_reqs) + (sizeof(struct tw_cl_event_packet) * max_aens)); tw_osl_memzero(dma_mem, (sizeof(struct tw_cl_command_packet) * - (max_simult_reqs + 1)) + + max_simult_reqs) + TW_CLI_SECTOR_SIZE); free_non_dma_mem = (TW_UINT8 *)non_dma_mem; @@ -307,7 +307,7 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle ctlr->arch_id = TWA_ARCH_ID(device_id); ctlr->flags = flags; ctlr->sg_size_factor = TWA_SG_ELEMENT_SIZE_FACTOR(device_id); - ctlr->max_simult_reqs = max_simult_reqs + 1; + ctlr->max_simult_reqs = max_simult_reqs; ctlr->max_aens_supported = max_aens; /* Initialize queues of CL internal request context packets. */ @@ -321,55 +321,23 @@ tw_cl_init_ctlr(struct tw_cl_ctlr_handle tw_osl_init_lock(ctlr_handle, "tw_cl_gen_lock", ctlr->gen_lock); ctlr->io_lock = &(ctlr->io_lock_handle); tw_osl_init_lock(ctlr_handle, "tw_cl_io_lock", ctlr->io_lock); - /* - * If 64 bit cmd pkt addresses are used, we will need to serialize - * writes to the hardware (across registers), since existing (G66) - * hardware will get confused if, for example, we wrote the low 32 bits - * of the cmd pkt address, followed by a response interrupt mask to the - * control register, followed by the high 32 bits of the cmd pkt - * address. It will then interpret the value written to the control - * register as the low cmd pkt address. So, for this case, we will - * make a note that we will need to synchronize control register writes - * with command register writes. - */ - if ((ctlr->flags & TW_CL_64BIT_ADDRESSES) && - ((ctlr->device_id == TW_CL_DEVICE_ID_9K) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_X) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_E) || - (ctlr->device_id == TW_CL_DEVICE_ID_9K_SA))) { - ctlr->state |= TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED; - ctlr->intr_lock = ctlr->io_lock; - } else { - ctlr->intr_lock = &(ctlr->intr_lock_handle); - tw_osl_init_lock(ctlr_handle, "tw_cl_intr_lock", - ctlr->intr_lock); - } /* Initialize CL internal request context packets. */ ctlr->req_ctxt_buf = (struct tw_cli_req_context *)free_non_dma_mem; free_non_dma_mem += (sizeof(struct tw_cli_req_context) * - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->cmd_pkt_buf = (struct tw_cl_command_packet *)dma_mem; ctlr->cmd_pkt_phys = dma_mem_phys; ctlr->internal_req_data = (TW_UINT8 *) (ctlr->cmd_pkt_buf + - ( - max_simult_reqs + - 1)); + max_simult_reqs); ctlr->internal_req_data_phys = ctlr->cmd_pkt_phys + (sizeof(struct tw_cl_command_packet) * - ( - max_simult_reqs + - 1)); - - for (i = 0; - i < ( - max_simult_reqs + - 1); i++) { + max_simult_reqs); + + for (i = 0; i < max_simult_reqs; i++) { req = &(ctlr->req_ctxt_buf[i]); req->cmd_pkt = &(ctlr->cmd_pkt_buf[i]); @@ -421,8 +389,8 @@ start_ctlr: /* Notify some info about the controller to the OSL. */ tw_cli_notify_ctlr_info(ctlr); - /* Mark the controller as active. */ - ctlr->state |= TW_CLI_CTLR_STATE_ACTIVE; + /* Mark the controller active. */ + ctlr->active = TW_CL_TRUE; return(error); } @@ -597,7 +565,7 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha * Mark the controller as inactive, disable any further interrupts, * and notify the controller that we are going down. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_ACTIVE; + ctlr->active = TW_CL_FALSE; tw_cli_disable_interrupts(ctlr); @@ -617,8 +585,6 @@ tw_cl_shutdown_ctlr(struct tw_cl_ctlr_ha /* Destroy all locks used by CL. */ tw_osl_destroy_lock(ctlr_handle, ctlr->gen_lock); tw_osl_destroy_lock(ctlr_handle, ctlr->io_lock); - if (!(ctlr->flags & TW_CL_64BIT_ADDRESSES)) - tw_osl_destroy_lock(ctlr_handle, ctlr->intr_lock); ret: return(error); Modified: stable/7/sys/dev/twa/tw_cl_intr.c ============================================================================== --- stable/7/sys/dev/twa/tw_cl_intr.c Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl_intr.c Mon Jun 21 22:20:52 2010 (r209405) @@ -75,22 +75,16 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle if (ctlr == NULL) goto out; - /* If we get an interrupt while resetting, it is a shared - one for another device, so just bail */ - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) - goto out; - /* - * Synchronize access between writes to command and control registers - * in 64-bit environments, on G66. + * Bail If we get an interrupt while resetting, or shutting down. */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); + if (ctlr->reset_in_progress || !(ctlr->active)) + goto out; /* Read the status register to determine the type of interrupt. */ status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr_handle); if (tw_cli_check_ctlr_state(ctlr, status_reg)) - goto out_unlock; + goto out; /* Clear the interrupt. */ if (status_reg & TWA_STATUS_HOST_INTERRUPT) { @@ -98,36 +92,30 @@ tw_cl_interrupt(struct tw_cl_ctlr_handle "Host interrupt"); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_HOST_INTERRUPT); - ctlr->host_intr_pending = 0; /* we don't use this */ - rc |= TW_CL_FALSE; /* don't request for a deferred isr call */ } if (status_reg & TWA_STATUS_ATTENTION_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Attention interrupt"); + rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_attn_intr(ctlr); TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT); - ctlr->attn_intr_pending = 1; - rc |= TW_CL_TRUE; /* request for a deferred isr call */ } if (status_reg & TWA_STATUS_COMMAND_INTERRUPT) { tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), "Command interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_COMMAND_INTERRUPT); - ctlr->cmd_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_cmd_intr(ctlr); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); } if (status_reg & TWA_STATUS_RESPONSE_INTERRUPT) { tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "Response interrupt"); - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_MASK_RESPONSE_INTERRUPT); - ctlr->resp_intr_pending = 1; rc |= TW_CL_TRUE; /* request for a deferred isr call */ + tw_cli_process_resp_intr(ctlr); } -out_unlock: - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); out: return(rc); } @@ -135,52 +123,6 @@ out: /* - * Function name: tw_cl_deferred_interrupt - * Description: Deferred interrupt handler. Does most of the processing - * related to an interrupt. - * - * Input: ctlr_handle -- controller handle - * Output: None - * Return value: None - */ -TW_VOID -tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle) -{ - struct tw_cli_ctlr_context *ctlr = - (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); - - /* Dispatch based on the kind of interrupt. */ - if (ctlr->host_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Host interrupt"); - ctlr->host_intr_pending = 0; - tw_cli_process_host_intr(ctlr); - } - if (ctlr->attn_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Attention interrupt"); - ctlr->attn_intr_pending = 0; - tw_cli_process_attn_intr(ctlr); - } - if (ctlr->cmd_intr_pending) { - tw_cli_dbg_printf(6, ctlr_handle, tw_osl_cur_func(), - "Processing Command interrupt"); - ctlr->cmd_intr_pending = 0; - tw_cli_process_cmd_intr(ctlr); - } - if (ctlr->resp_intr_pending) { - tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), - "Processing Response interrupt"); - ctlr->resp_intr_pending = 0; - tw_cli_process_resp_intr(ctlr); - } -} - - - -/* * Function name: tw_cli_process_host_intr * Description: This function gets called if we triggered an interrupt. * We don't use it as of now. @@ -248,12 +190,6 @@ tw_cli_process_cmd_intr(struct tw_cli_ct { tw_cli_dbg_printf(6, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* - * Let the OS Layer submit any requests in its pending queue, - * if it has one. - */ - tw_osl_ctlr_ready(ctlr->ctlr_handle); - /* Start any requests that might be in the pending queue. */ tw_cli_submit_pending_queue(ctlr); @@ -286,9 +222,6 @@ tw_cli_process_resp_intr(struct tw_cli_c tw_cli_dbg_printf(10, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - /* Serialize access to the controller response queue. */ - tw_osl_get_lock(ctlr->ctlr_handle, ctlr->intr_lock); - for (;;) { status_reg = TW_CLI_READ_STATUS_REGISTER(ctlr->ctlr_handle); if ((error = tw_cli_check_ctlr_state(ctlr, status_reg))) @@ -315,7 +248,6 @@ tw_cli_process_resp_intr(struct tw_cli_c #ifdef TW_OSL_DEBUG tw_cl_print_ctlr_stats(ctlr->ctlr_handle); #endif /* TW_OSL_DEBUG */ - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); tw_cl_reset_ctlr(ctlr->ctlr_handle); return(TW_OSL_EIO); } @@ -330,12 +262,6 @@ tw_cli_process_resp_intr(struct tw_cli_c } - /* Unmask the response interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, - TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT); - - tw_osl_free_lock(ctlr->ctlr_handle, ctlr->intr_lock); - /* Complete this, and other requests in the complete queue. */ tw_cli_process_complete_queue(ctlr); @@ -614,12 +540,11 @@ tw_cli_param_callback(struct tw_cli_req_ "status = %d", cmd->param.status); } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); - if ((ctlr->state & TW_CLI_CTLR_STATE_GET_MORE_AENS) && - (!(ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS))) { - ctlr->state &= ~TW_CLI_CTLR_STATE_GET_MORE_AENS; + if ((ctlr->get_more_aens) && (!(ctlr->reset_in_progress))) { + ctlr->get_more_aens = TW_CL_FALSE; tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "Fetching more AEN's"); if ((error = tw_cli_get_aen(ctlr))) @@ -677,7 +602,7 @@ tw_cli_aen_callback(struct tw_cli_req_co } if (error) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return; } @@ -688,7 +613,7 @@ tw_cli_aen_callback(struct tw_cli_req_co aen_code = tw_cli_manage_aen(ctlr, req); if (aen_code != TWA_AEN_SYNC_TIME_WITH_HOST) { - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); if (aen_code != TWA_AEN_QUEUE_EMPTY) if ((error = tw_cli_get_aen(ctlr))) @@ -736,25 +661,25 @@ tw_cli_manage_aen(struct tw_cli_ctlr_con * Free the internal req pkt right here, since * tw_cli_set_param will need it. */ - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); /* * We will use a callback in tw_cli_set_param only when * interrupts are enabled and we can expect our callback - * to get called. Setting the TW_CLI_CTLR_STATE_GET_MORE_AENS + * to get called. Setting the get_more_aens * flag will make the callback continue to try to retrieve * more AEN's. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) - ctlr->state |= TW_CLI_CTLR_STATE_GET_MORE_AENS; + if (ctlr->interrupts_enabled) + ctlr->get_more_aens = TW_CL_TRUE; /* Calculate time (in seconds) since last Sunday 12.00 AM. */ local_time = tw_osl_get_local_time(); sync_time = (local_time - (3 * 86400)) % 604800; if ((error = tw_cli_set_param(ctlr, TWA_PARAM_TIME_TABLE, TWA_PARAM_TIME_SCHED_TIME, 4, &sync_time, - (ctlr->state & TW_CLI_CTLR_STATE_INTR_ENABLED) + (ctlr->interrupts_enabled) ? tw_cli_param_callback : TW_CL_NULL))) tw_cl_create_event(ctlr->ctlr_handle, TW_CL_FALSE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_ERROR, @@ -799,7 +724,7 @@ tw_cli_enable_interrupts(struct tw_cli_c { tw_cli_dbg_printf(3, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_TRUE; TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_CLEAR_ATTENTION_INTERRUPT | TWA_CONTROL_UNMASK_RESPONSE_INTERRUPT | @@ -823,6 +748,6 @@ tw_cli_disable_interrupts(struct tw_cli_ TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, TWA_CONTROL_DISABLE_INTERRUPTS); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTR_ENABLED; + ctlr->interrupts_enabled = TW_CL_FALSE; } Modified: stable/7/sys/dev/twa/tw_cl_io.c ============================================================================== --- stable/7/sys/dev/twa/tw_cl_io.c Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl_io.c Mon Jun 21 22:20:52 2010 (r209405) @@ -49,6 +49,10 @@ #include "tw_cl_externs.h" #include "tw_osl_ioctl.h" +#include +#include +#include + /* @@ -76,11 +80,9 @@ tw_cl_start_io(struct tw_cl_ctlr_handle ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "I/O during reset: returning busy. Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "I/O during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -101,7 +103,6 @@ tw_cl_start_io(struct tw_cl_ctlr_handle )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -171,7 +172,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; TW_INT32 error; - TW_UINT8 notify_osl_of_ctlr_busy = TW_CL_FALSE; tw_cli_dbg_printf(10, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -208,10 +208,13 @@ tw_cli_submit_cmd(struct tw_cli_req_cont req->state = TW_CLI_REQ_STATE_PENDING; tw_cli_req_q_insert_tail(req, TW_CLI_PENDING_Q); error = 0; + /* Unmask command interrupt. */ + TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, + TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); } else error = TW_OSL_EBUSY; } else { - notify_osl_of_ctlr_busy = TW_CL_TRUE; + tw_osl_ctlr_busy(ctlr_handle, req->req_handle); error = TW_OSL_EBUSY; } } else { @@ -246,25 +249,6 @@ tw_cli_submit_cmd(struct tw_cli_req_cont out: tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - if (status_reg & TWA_STATUS_COMMAND_QUEUE_FULL) { - if (notify_osl_of_ctlr_busy) - tw_osl_ctlr_busy(ctlr_handle, req->req_handle); - - /* - * Synchronize access between writes to command and control - * registers in 64-bit environments, on G66. - */ - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_get_lock(ctlr_handle, ctlr->io_lock); - - /* Unmask command interrupt. */ - TW_CLI_WRITE_CONTROL_REGISTER(ctlr_handle, - TWA_CONTROL_UNMASK_COMMAND_INTERRUPT); - - if (ctlr->state & TW_CLI_CTLR_STATE_G66_WORKAROUND_NEEDED) - tw_osl_free_lock(ctlr_handle, ctlr->io_lock); - } - return(error); } @@ -299,12 +283,9 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); - if (ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) { + if (ctlr->reset_in_progress) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), - "Passthru request during reset: returning busy. " - "Ctlr state = 0x%x", - ctlr->state); - tw_osl_ctlr_busy(ctlr_handle, req_handle); + "Passthru request during reset: returning busy."); return(TW_OSL_EBUSY); } @@ -312,7 +293,6 @@ tw_cl_fw_passthru(struct tw_cl_ctlr_hand )) == TW_CL_NULL) { tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "Out of request context packets: returning busy"); - tw_osl_ctlr_busy(ctlr_handle, req_handle); return(TW_OSL_EBUSY); } @@ -759,11 +739,11 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -821,7 +801,7 @@ tw_cli_get_param(struct tw_cli_ctlr_cont goto out; } tw_osl_memcpy(param_data, param->data, param_size); - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -838,7 +818,7 @@ out: "get_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(1); @@ -878,11 +858,11 @@ tw_cli_set_param(struct tw_cli_ctlr_cont goto out; /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) { + if (ctlr->internal_req_busy) { error = TW_OSL_EBUSY; goto out; } - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; req->length = TW_CLI_SECTOR_SIZE; @@ -939,7 +919,7 @@ tw_cli_set_param(struct tw_cli_ctlr_cont &(req->cmd_pkt->cmd_hdr)); goto out; } - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } else { /* There's a call back. Simply submit the command. */ @@ -956,7 +936,7 @@ out: "set_param failed", "error = %d", error); if (param) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; if (req) tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); return(error); @@ -1054,8 +1034,11 @@ tw_cli_submit_and_poll_request(struct tw * taking care of it). */ tw_cli_req_q_remove_item(req, TW_CLI_PENDING_Q); + if ((TW_CL_Q_FIRST_ITEM(&(ctlr->req_q_head[TW_CLI_PENDING_Q]))) == TW_CL_NULL) + TW_CLI_WRITE_CONTROL_REGISTER(ctlr->ctlr_handle, + TWA_CONTROL_MASK_COMMAND_INTERRUPT); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } @@ -1079,12 +1062,16 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl { struct tw_cli_ctlr_context *ctlr = (struct tw_cli_ctlr_context *)(ctlr_handle->cl_ctlr_ctxt); + struct twa_softc *sc = ctlr_handle->osl_ctlr_ctxt; TW_INT32 reset_attempt = 1; TW_INT32 error; tw_cli_dbg_printf(2, ctlr_handle, tw_osl_cur_func(), "entered"); - ctlr->state |= TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_TRUE; + xpt_freeze_simq(sc->sim, 1); + + tw_cli_disable_interrupts(ctlr); /* * Error back all requests in the complete, busy, and pending queues. @@ -1098,8 +1085,8 @@ tw_cl_reset_ctlr(struct tw_cl_ctlr_handl tw_cli_drain_complete_queue(ctlr); tw_cli_drain_busy_queue(ctlr); tw_cli_drain_pending_queue(ctlr); - - tw_cli_disable_interrupts(ctlr); + ctlr->internal_req_busy = TW_CL_FALSE; + ctlr->get_more_aens = TW_CL_FALSE; /* Soft reset the controller. */ try_reset: @@ -1135,7 +1122,9 @@ try_reset: " "); out: - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_IN_PROGRESS; + ctlr->reset_in_progress = TW_CL_FALSE; + xpt_release_simq(sc->sim, 1); + /* * Enable interrupts, and also clear attention and response interrupts. */ @@ -1163,6 +1152,8 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con { struct tw_cl_ctlr_handle *ctlr_handle = ctlr->ctlr_handle; TW_UINT32 status_reg; + int found; + int loop_count; TW_UINT32 error; tw_cli_dbg_printf(1, ctlr_handle, tw_osl_cur_func(), "entered"); @@ -1192,12 +1183,27 @@ tw_cli_soft_reset(struct tw_cli_ctlr_con * make sure we don't access any hardware registers (for * polling) during that window. */ - ctlr->state |= TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; - while (tw_cli_find_response(ctlr, - TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) != TW_OSL_ESUCCESS) + ctlr->reset_phase1_in_progress = TW_CL_TRUE; + loop_count = 0; + do { + found = (tw_cli_find_response(ctlr, TWA_RESET_PHASE1_NOTIFICATION_RESPONSE) == TW_OSL_ESUCCESS); tw_osl_delay(10); + loop_count++; + error = 0x7888; + } while (!found && (loop_count < 6000000)); /* Loop for no more than 60 seconds */ + + if (!found) { + tw_cl_create_event(ctlr_handle, TW_CL_TRUE, + TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, + 0x1109, 0x1, TW_CL_SEVERITY_ERROR_STRING, + "Missed firmware handshake after soft-reset", + "error = %d", error); + tw_osl_free_lock(ctlr_handle, ctlr->io_lock); + return(error); + } + tw_osl_delay(TWA_RESET_PHASE1_WAIT_TIME_MS * 1000); - ctlr->state &= ~TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS; + ctlr->reset_phase1_in_progress = TW_CL_FALSE; } if ((error = tw_cli_poll_status(ctlr, @@ -1285,9 +1291,9 @@ tw_cli_send_scsi_cmd(struct tw_cli_req_c tw_cli_dbg_printf(4, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Make sure this is the only CL internal request at this time. */ - if (ctlr->state & TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY) + if (ctlr->internal_req_busy) return(TW_OSL_EBUSY); - ctlr->state |= TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_TRUE; req->data = ctlr->internal_req_data; req->data_phys = ctlr->internal_req_data_phys; tw_osl_memzero(req->data, TW_CLI_SECTOR_SIZE); @@ -1365,7 +1371,7 @@ tw_cli_get_aen(struct tw_cli_ctlr_contex "Could not send SCSI command", "request = %p, error = %d", req, error); if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); Modified: stable/7/sys/dev/twa/tw_cl_misc.c ============================================================================== --- stable/7/sys/dev/twa/tw_cl_misc.c Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl_misc.c Mon Jun 21 22:20:52 2010 (r209405) @@ -368,14 +368,14 @@ tw_cli_drain_aen_queue(struct tw_cli_ctl if (aen_code == TWA_AEN_SYNC_TIME_WITH_HOST) continue; - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } out: if (req) { if (req->data) - ctlr->state &= ~TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY; + ctlr->internal_req_busy = TW_CL_FALSE; tw_cli_req_q_insert_tail(req, TW_CLI_FREE_Q); } return(error); @@ -447,34 +447,7 @@ tw_cli_poll_status(struct tw_cli_ctlr_co /* got the required bit(s) */ return(TW_OSL_ESUCCESS); - /* - * The OSL should not define TW_OSL_CAN_SLEEP if it calls - * tw_cl_deferred_interrupt from within the ISR and not a - * lower interrupt level, since, in that case, we might end - * up here, and try to sleep (within an ISR). - */ -#ifndef TW_OSL_CAN_SLEEP - /* OSL doesn't support sleeping; will spin. */ - tw_osl_delay(1000); -#else /* TW_OSL_CAN_SLEEP */ -#if 0 - /* Will spin if initializing, sleep otherwise. */ - if (!(ctlr->state & TW_CLI_CTLR_STATE_ACTIVE)) - tw_osl_delay(1000); - else - tw_osl_sleep(ctlr->ctlr_handle, - &(ctlr->sleep_handle), 1 /* ms */); -#else /* #if 0 */ - /* - * Will always spin for now (since reset holds a spin lock). - * We could free io_lock after the call to TW_CLI_SOFT_RESET, - * so we could sleep here. To block new requests (since - * the lock will have been released) we could use the - * ...RESET_IN_PROGRESS flag. Need to revisit. - */ tw_osl_delay(1000); -#endif /* #if 0 */ -#endif /* TW_OSL_CAN_SLEEP */ } while (tw_osl_get_local_time() <= end_time); return(TW_OSL_ETIMEDOUT); @@ -736,22 +709,20 @@ tw_cli_check_ctlr_state(struct tw_cli_ct tw_cli_dbg_printf(8, ctlr->ctlr_handle, tw_osl_cur_func(), "entered"); /* Check if the 'micro-controller ready' bit is not set. */ - if ((status_reg & TWA_STATUS_EXPECTED_BITS) != - TWA_STATUS_EXPECTED_BITS) { + if (!(status_reg & TWA_STATUS_MICROCONTROLLER_READY)) { TW_INT8 desc[200]; tw_osl_memzero(desc, 200); - if ((status_reg & TWA_STATUS_MICROCONTROLLER_READY) || - (!(ctlr->state & - TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS))) { + if (!(ctlr->reset_phase1_in_progress)) { tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1301, 0x1, TW_CL_SEVERITY_ERROR_STRING, "Missing expected status bit(s)", "status reg = 0x%x; Missing bits: %s", status_reg, - tw_cli_describe_bits (~status_reg & - TWA_STATUS_EXPECTED_BITS, desc)); + tw_cli_describe_bits( + TWA_STATUS_MICROCONTROLLER_READY, + desc)); error = TW_OSL_EGENFAILURE; } } @@ -765,7 +736,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0) || + (!(ctlr->reset_in_progress)) || ((status_reg & TWA_STATUS_QUEUE_ERROR_INTERRUPT) == 0)) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, @@ -819,7 +790,7 @@ tw_cli_check_ctlr_state(struct tw_cli_ct /* Skip queue error msgs during 9650SE/9690SA reset */ if (((ctlr->device_id != TW_CL_DEVICE_ID_9K_E) && (ctlr->device_id != TW_CL_DEVICE_ID_9K_SA)) || - ((ctlr->state & TW_CLI_CTLR_STATE_RESET_IN_PROGRESS) == 0)) + (!(ctlr->reset_in_progress))) tw_cl_create_event(ctlr_handle, TW_CL_TRUE, TW_CL_MESSAGE_SOURCE_COMMON_LAYER_EVENT, 0x1305, 0x1, TW_CL_SEVERITY_ERROR_STRING, Modified: stable/7/sys/dev/twa/tw_cl_share.h ============================================================================== --- stable/7/sys/dev/twa/tw_cl_share.h Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_cl_share.h Mon Jun 21 22:20:52 2010 (r209405) @@ -76,7 +76,7 @@ * of supporting only 255, since we want to keep one CL internal request * context packet always available for internal requests. */ -#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 0xFF /* max simult reqs supported */ +#define TW_CL_MAX_SIMULTANEOUS_REQUESTS 256 /* max simult reqs supported */ #define TW_CL_MAX_32BIT_SG_ELEMENTS 109 /* max 32-bit sg elements */ #define TW_CL_MAX_64BIT_SG_ELEMENTS 72 /* max 64-bit sg elements */ @@ -144,6 +144,7 @@ struct tw_cl_ctlr_handle { struct tw_cl_req_handle { TW_VOID *osl_req_ctxt; /* OSL's request context */ TW_VOID *cl_req_ctxt; /* CL's request context */ + TW_UINT8 is_io; /* Only freeze/release simq for IOs */ }; @@ -353,12 +354,6 @@ extern TW_VOID tw_osl_ctlr_busy(struct t #endif -#ifndef tw_osl_ctlr_ready -/* Called on cmd interrupt. Allows re-submission of any pending requests. */ -extern TW_VOID tw_osl_ctlr_ready(struct tw_cl_ctlr_handle *ctlr_handle); -#endif - - #ifndef tw_osl_cur_func /* Text name of current function. */ extern TW_INT8 *tw_osl_cur_func(TW_VOID); @@ -528,10 +523,6 @@ extern TW_VOID tw_cl_create_event(struct extern TW_INT32 tw_cl_ctlr_supported(TW_INT32 vendor_id, TW_INT32 device_id); -/* Deferred interrupt handler. */ -extern TW_VOID tw_cl_deferred_interrupt(struct tw_cl_ctlr_handle *ctlr_handle); - - /* Submit a firmware cmd packet. */ extern TW_INT32 tw_cl_fw_passthru(struct tw_cl_ctlr_handle *ctlr_handle, struct tw_cl_req_packet *req_pkt, struct tw_cl_req_handle *req_handle); Modified: stable/7/sys/dev/twa/tw_osl.h ============================================================================== --- stable/7/sys/dev/twa/tw_osl.h Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_osl.h Mon Jun 21 22:20:52 2010 (r209405) @@ -50,13 +50,11 @@ #define TW_OSLI_DEVICE_NAME "3ware 9000 series Storage Controller" #define TW_OSLI_MALLOC_CLASS M_TWA -#define TW_OSLI_MAX_NUM_IOS TW_CL_MAX_SIMULTANEOUS_REQUESTS +#define TW_OSLI_MAX_NUM_REQUESTS TW_CL_MAX_SIMULTANEOUS_REQUESTS +/* Reserve two command packets. One for ioctls and one for AENs */ +#define TW_OSLI_MAX_NUM_IOS (TW_OSLI_MAX_NUM_REQUESTS - 2) #define TW_OSLI_MAX_NUM_AENS 0x100 -/* Disabled, doesn't work yet. -#define TW_OSLI_DEFERRED_INTR_USED -*/ - #ifdef PAE #define TW_OSLI_DMA_BOUNDARY (1u << 31) #else @@ -80,10 +78,6 @@ #define TW_OSLI_REQ_FLAGS_PASSTHRU (1<<5) /* pass through request */ #define TW_OSLI_REQ_FLAGS_SLEEPING (1<<6) /* owner sleeping on this cmd */ -/* Possible values of sc->state. */ -#define TW_OSLI_CTLR_STATE_OPEN (1<<0) /* control device is open */ -#define TW_OSLI_CTLR_STATE_SIMQ_FROZEN (1<<1) /* simq frozen */ - #ifdef TW_OSL_DEBUG struct tw_osli_q_stats { @@ -101,6 +95,8 @@ struct tw_osli_q_stats { /* Driver's request packet. */ struct tw_osli_req_context { struct tw_cl_req_handle req_handle;/* tag to track req b/w OSL & CL */ + struct mtx ioctl_wake_timeout_lock_handle;/* non-spin lock used to detect ioctl timeout */ + struct mtx *ioctl_wake_timeout_lock;/* ptr to above lock */ struct twa_softc *ctlr; /* ptr to OSL's controller context */ TW_VOID *data; /* ptr to data being passed to CL */ TW_UINT32 length; /* length of buf being passed to CL */ @@ -130,10 +126,10 @@ struct tw_osli_req_context { /* Per-controller structure. */ struct twa_softc { struct tw_cl_ctlr_handle ctlr_handle; - struct tw_osli_req_context *req_ctxt_buf; + struct tw_osli_req_context *req_ctx_buf; /* Controller state. */ - TW_UINT32 state; + TW_UINT8 open; TW_UINT32 flags; TW_INT32 device_id; Modified: stable/7/sys/dev/twa/tw_osl_cam.c ============================================================================== --- stable/7/sys/dev/twa/tw_osl_cam.c Mon Jun 21 22:00:57 2010 (r209404) +++ stable/7/sys/dev/twa/tw_osl_cam.c Mon Jun 21 22:20:52 2010 (r209405) @@ -83,7 +83,7 @@ tw_osli_cam_attach(struct twa_softc *sc) /* * Create the device queue for our SIM. */ - if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_IOS)) == NULL) { + if ((devq = cam_simq_alloc(TW_OSLI_MAX_NUM_REQUESTS)) == NULL) { tw_osli_printf(sc, "error = %d", TW_CL_SEVERITY_ERROR_STRING, TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, @@ -94,15 +94,15 @@ tw_osli_cam_attach(struct twa_softc *sc) } /* - * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_IOS + * Create a SIM entry. Though we can support TW_OSLI_MAX_NUM_REQUESTS * simultaneous requests, we claim to be able to handle only - * (TW_OSLI_MAX_NUM_IOS - 1), so that we always have a request - * packet available to service ioctls. + * TW_OSLI_MAX_NUM_IOS (two less), so that we always have a request + * packet available to service ioctls and AENs. */ tw_osli_dbg_dprintf(3, sc, "Calling cam_sim_alloc"); sc->sim = cam_sim_alloc(twa_action, twa_poll, "twa", sc, device_get_unit(sc->bus_dev), sc->sim_lock, - TW_OSLI_MAX_NUM_IOS - 1, 1, devq); + TW_OSLI_MAX_NUM_IOS, 1, devq); if (sc->sim == NULL) { cam_simq_free(devq); tw_osli_printf(sc, "error = %d", @@ -185,14 +185,6 @@ tw_osli_cam_detach(struct twa_softc *sc) { tw_osli_dbg_dprintf(3, sc, "entered"); -#ifdef TW_OSLI_DEFERRED_INTR_USED - /* - drain the taskqueue - Ctrl is already went down so, no more enqueuetask will - happen . Don't hold any locks, that task might need. - */ - - taskqueue_drain(taskqueue_fast, &(sc->deferred_intr_callback)); -#endif mtx_lock(sc->sim_lock); if (sc->path) @@ -253,7 +245,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2105, "Physical CDB address!"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } @@ -314,7 +306,7 @@ tw_osli_execute_scsi(struct tw_osli_req_ TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, 0x2107, "XPT_SCSI_IO: Got SGList"); - ccb_h->status = CAM_REQ_CMP_ERR; + ccb_h->status = CAM_REQ_INVALID; xpt_done(ccb); return(1); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 22:54:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C699106568A; Mon, 21 Jun 2010 22:54:49 +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 0B1578FC08; Mon, 21 Jun 2010 22:54:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LMsm7O061050; Mon, 21 Jun 2010 22:54:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LMsmZD061048; Mon, 21 Jun 2010 22:54:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006212254.o5LMsmZD061048@svn.freebsd.org> From: Xin LI Date: Mon, 21 Jun 2010 22:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209406 - stable/7/contrib/cpio/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 22:54:49 -0000 Author: delphij Date: Mon Jun 21 22:54:47 2010 New Revision: 209406 URL: http://svn.freebsd.org/changeset/base/209406 Log: Fix a regression when dealing with tar(1) format files introduced with GNU cpio 2.8. This is a direct commit against stable/7 because the code have been removed on -HEAD and stable/8. PR: bin/147969 Submitted by: kientzle Modified: stable/7/contrib/cpio/src/tar.c Modified: stable/7/contrib/cpio/src/tar.c ============================================================================== --- stable/7/contrib/cpio/src/tar.c Mon Jun 21 22:20:52 2010 (r209405) +++ stable/7/contrib/cpio/src/tar.c Mon Jun 21 22:54:47 2010 (r209406) @@ -32,6 +32,32 @@ /* Stash the tar linkname in static storage. */ +#undef FROM_OCTAL +#define FROM_OCTAL(f) tar_otoa(f, sizeof f) + +/* Convert the string of octal digits S into a number. + * Converted from GNU cpio 2.6 sources in + * order to fix tar breakage caused by using + * from_ascii. + */ +static unsigned long +tar_otoa(const char *where, size_t digs) +{ + const char *s = where; + const char *end = s + digs; + unsigned long val = 0; + + while (s < end && *s == ' ') + ++s; + while (s < end && *s >= '0' && *s <= '7') + val = 8 * val + *s++ - '0'; + while (s < end && (*s == ' ' || *s == '\0')) + ++s; + if (s < end) + error (0, 0, _("Malformed number %.*s"), digs, where); + return val; +} + static char * stash_tar_linkname (char *linkname) { From owner-svn-src-all@FreeBSD.ORG Mon Jun 21 23:27:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8051106566C; Mon, 21 Jun 2010 23:27:24 +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 D79A58FC19; Mon, 21 Jun 2010 23:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5LNRO9h068260; Mon, 21 Jun 2010 23:27:24 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5LNROZN068256; Mon, 21 Jun 2010 23:27:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201006212327.o5LNROZN068256@svn.freebsd.org> From: Alan Cox Date: Mon, 21 Jun 2010 23:27: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: r209407 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 23:27:25 -0000 Author: alc Date: Mon Jun 21 23:27:24 2010 New Revision: 209407 URL: http://svn.freebsd.org/changeset/base/209407 Log: Introduce vm_page_next() and vm_page_prev(), and use them in vm_pageout_clean(). When iterating over a range of pages, these functions can be cheaper than vm_page_lookup() because their implementation takes advantage of the vm_object's memq being ordered. Reviewed by: kib@ MFC after: 3 weeks Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Jun 21 22:54:47 2010 (r209406) +++ head/sys/vm/vm_page.c Mon Jun 21 23:27:24 2010 (r209407) @@ -879,6 +879,42 @@ vm_page_lookup(vm_object_t object, vm_pi } /* + * Returns the given page's successor (by pindex) within the object if it is + * resident; if none is found, NULL is returned. + * + * The object must be locked. + */ +vm_page_t +vm_page_next(vm_page_t m) +{ + vm_page_t next; + + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((next = TAILQ_NEXT(m, listq)) != NULL && + next->pindex != m->pindex + 1) + next = NULL; + return (next); +} + +/* + * Returns the given page's predecessor (by pindex) within the object if it is + * resident; if none is found, NULL is returned. + * + * The object must be locked. + */ +vm_page_t +vm_page_prev(vm_page_t m) +{ + vm_page_t prev; + + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); + if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && + prev->pindex != m->pindex - 1) + prev = NULL; + return (prev); +} + +/* * vm_page_rename: * * Move the given memory entry from its Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Jun 21 22:54:47 2010 (r209406) +++ head/sys/vm/vm_page.h Mon Jun 21 23:27:24 2010 (r209407) @@ -359,7 +359,9 @@ void vm_page_dontneed(vm_page_t); void vm_page_deactivate (vm_page_t); void vm_page_insert (vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_lookup (vm_object_t, vm_pindex_t); +vm_page_t vm_page_next(vm_page_t m); int vm_page_pa_tryrelock(pmap_t, vm_paddr_t, vm_paddr_t *); +vm_page_t vm_page_prev(vm_page_t m); void vm_page_remove (vm_page_t); void vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); void vm_page_requeue(vm_page_t m); Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Mon Jun 21 22:54:47 2010 (r209406) +++ head/sys/vm/vm_pageout.c Mon Jun 21 23:27:24 2010 (r209407) @@ -320,7 +320,7 @@ static int vm_pageout_clean(vm_page_t m) { vm_object_t object; - vm_page_t mc[2*vm_pageout_page_count]; + vm_page_t mc[2*vm_pageout_page_count], pb, ps; int pageout_count; int ib, is, page_base; vm_pindex_t pindex = m->pindex; @@ -347,7 +347,7 @@ vm_pageout_clean(vm_page_t m) return 0; } - mc[vm_pageout_page_count] = m; + mc[vm_pageout_page_count] = pb = ps = m; pageout_count = 1; page_base = vm_pageout_page_count; ib = 1; @@ -382,11 +382,8 @@ more: break; } - if ((p = vm_page_lookup(object, pindex - ib)) == NULL) { - ib = 0; - break; - } - if ((p->oflags & VPO_BUSY) || p->busy) { + if ((p = vm_page_prev(pb)) == NULL || + (p->oflags & VPO_BUSY) != 0 || p->busy != 0) { ib = 0; break; } @@ -400,7 +397,7 @@ more: break; } vm_page_unlock(p); - mc[--page_base] = p; + mc[--page_base] = pb = p; ++pageout_count; ++ib; /* @@ -415,11 +412,9 @@ more: pindex + is < object->size) { vm_page_t p; - if ((p = vm_page_lookup(object, pindex + is)) == NULL) + if ((p = vm_page_next(ps)) == NULL || + (p->oflags & VPO_BUSY) != 0 || p->busy != 0) break; - if ((p->oflags & VPO_BUSY) || p->busy) { - break; - } vm_page_lock(p); vm_page_test_dirty(p); if (p->dirty == 0 || @@ -429,7 +424,7 @@ more: break; } vm_page_unlock(p); - mc[page_base + pageout_count] = p; + mc[page_base + pageout_count] = ps = p; ++pageout_count; ++is; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 00:26:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 187A5106564A; Tue, 22 Jun 2010 00:26:08 +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 06DD68FC13; Tue, 22 Jun 2010 00:26:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M0Q8q8081263; Tue, 22 Jun 2010 00:26:08 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M0Q8VL081260; Tue, 22 Jun 2010 00:26:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006220026.o5M0Q8VL081260@svn.freebsd.org> From: Xin LI Date: Tue, 22 Jun 2010 00:26: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: r209408 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 00:26:08 -0000 Author: delphij Date: Tue Jun 22 00:26:07 2010 New Revision: 209408 URL: http://svn.freebsd.org/changeset/base/209408 Log: Improve fsck robustness for SU+J cases: - Use err/errx only when the case is really fatal. For other cases, fall back to full fsck instead of quiting fsck. - Plug a memory leak. - Avoid divide by zero when printing summary. - Output "FILE SYSTEM IS MARKED CLEAN" when a successful journal recovering is done. - When -f is specified, do full fsck instead of journal recovery. Modified: head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Jun 21 23:27:24 2010 (r209407) +++ head/sbin/fsck_ffs/main.c Tue Jun 22 00:26:07 2010 (r209408) @@ -388,16 +388,18 @@ checkfilesys(char *filesys) /* * Determine if we can and should do journal recovery. */ - if ((sblock.fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == FS_SUJ) { - if (preen || reply("USE JOURNAL?")) { - if (suj_check(filesys) == 0) { - if (chkdoreload(mntp) == 0) - exit(0); - exit(4); + if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) { + if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) { + if (preen || reply("USE JOURNAL?")) { + if (suj_check(filesys) == 0) { + printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); + if (chkdoreload(mntp) == 0) + exit(0); + exit(4); + } } - /* suj_check failed, fall through. */ + printf("** Skipping journal, falling through to full fsck\n\n"); } - printf("** Skipping journal, falling through to full fsck\n"); /* * Write the superblock so we don't try to recover the * journal on another pass. Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Mon Jun 21 23:27:24 2010 (r209407) +++ head/sbin/fsck_ffs/suj.c Tue Jun 22 00:26:07 2010 (r209408) @@ -37,12 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include #include #include #include +#include #include #include @@ -141,7 +144,10 @@ uint64_t freedir; uint64_t jbytes; uint64_t jrecs; +static jmp_buf jmpbuf; + typedef void (*ino_visitor)(ino_t, ufs_lbn_t, ufs2_daddr_t, int); +static void err_suj(const char *, ...) __dead2; static void ino_trunc(ino_t, off_t); static void ino_decr(ino_t); static void ino_adjust(struct suj_ino *); @@ -155,11 +161,30 @@ errmalloc(size_t n) a = malloc(n); if (a == NULL) - errx(1, "malloc(%zu)", n); + err(EX_OSERR, "malloc(%zu)", n); return (a); } /* + * When hit a fatal error in journalling check, print out + * the error and then offer to fallback to normal fsck. + */ +static void +err_suj(const char * restrict fmt, ...) +{ + va_list ap; + + if (preen) + (void)fprintf(stdout, "%s: ", cdevname); + + va_start(ap, fmt); + (void)vfprintf(stdout, fmt, ap); + va_end(ap); + + longjmp(jmpbuf, -1); +} + +/* * Open the given provider, load superblock. */ static void @@ -169,9 +194,9 @@ opendisk(const char *devnam) return; disk = malloc(sizeof(*disk)); if (disk == NULL) - errx(1, "malloc(%zu)", sizeof(*disk)); + err(EX_OSERR, "malloc(%zu)", sizeof(*disk)); if (ufs_disk_fillout(disk, devnam) == -1) { - err(1, "ufs_disk_fillout(%s) failed: %s", devnam, + err(EX_OSERR, "ufs_disk_fillout(%s) failed: %s", devnam, disk->d_error); } fs = &disk->d_fs; @@ -203,9 +228,9 @@ closedisk(const char *devnam) fs->fs_time = time(NULL); fs->fs_mtime = time(NULL); if (sbwrite(disk, 0) == -1) - err(1, "sbwrite(%s)", devnam); + err(EX_OSERR, "sbwrite(%s)", devnam); if (ufs_disk_close(disk) == -1) - err(1, "ufs_disk_close(%s)", devnam); + err(EX_OSERR, "ufs_disk_close(%s)", devnam); free(disk); disk = NULL; fs = NULL; @@ -221,10 +246,8 @@ cg_lookup(int cgx) struct cghd *hd; struct suj_cg *sc; - if (cgx < 0 || cgx >= fs->fs_ncg) { - abort(); - errx(1, "Bad cg number %d", cgx); - } + if (cgx < 0 || cgx >= fs->fs_ncg) + err_suj("Bad cg number %d\n", cgx); if (lastcg && lastcg->sc_cgx == cgx) return (lastcg); hd = &cghash[SUJ_HASH(cgx)]; @@ -241,7 +264,7 @@ cg_lookup(int cgx) LIST_INSERT_HEAD(hd, sc, sc_next); if (bread(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf, fs->fs_bsize) == -1) - err(1, "Unable to read cylinder group %d", sc->sc_cgx); + err_suj("Unable to read cylinder group %d\n", sc->sc_cgx); return (sc); } @@ -344,7 +367,7 @@ dblk_read(ufs2_daddr_t blk, int size) dblk->db_buf = errmalloc(size); dblk->db_size = size; if (bread(disk, fsbtodb(fs, blk), dblk->db_buf, size) == -1) - err(1, "Failed to read data block %jd", blk); + err_suj("Failed to read data block %jd\n", blk); } return (dblk->db_buf); } @@ -370,7 +393,7 @@ dblk_write(void) continue; if (bwrite(disk, fsbtodb(fs, dblk->db_blk), dblk->db_buf, dblk->db_size) == -1) - err(1, "Unable to write block %jd", + err_suj("Unable to write block %jd\n", dblk->db_blk); } } @@ -403,7 +426,7 @@ ino_read(ino_t ino) iblk->ib_blk = blk; LIST_INSERT_HEAD(hd, iblk, ib_next); if (bread(disk, fsbtodb(fs, blk), iblk->ib_buf, fs->fs_bsize) == -1) - err(1, "Failed to read inode block %jd", blk); + err_suj("Failed to read inode block %jd\n", blk); found: sc->sc_lastiblk = iblk; off = ino_to_fsbo(fs, ino); @@ -447,7 +470,7 @@ iblk_write(struct ino_blk *iblk) return; if (bwrite(disk, fsbtodb(fs, iblk->ib_blk), iblk->ib_buf, fs->fs_bsize) == -1) - err(1, "Failed to write inode block %jd", iblk->ib_blk); + err_suj("Failed to write inode block %jd\n", iblk->ib_blk); } static int @@ -679,9 +702,9 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i return (0); level = lbn_level(cur); if (level == -1) - errx(1, "Invalid indir lbn %jd", lbn); + err_suj("Invalid indir lbn %jd\n", lbn); if (level == 0 && lbn < 0) - errx(1, "Invalid lbn %jd", lbn); + err_suj("Invalid lbn %jd\n", lbn); bap2 = (void *)dblk_read(blk, fs->fs_bsize); bap1 = (void *)bap2; lbnadd = 1; @@ -693,7 +716,7 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i else i = (-lbn - base) / lbnadd; if (i < 0 || i >= NINDIR(fs)) - errx(1, "Invalid indirect index %d produced by lbn %jd", + err_suj("Invalid indirect index %d produced by lbn %jd\n", i, lbn); if (level == 0) cur = base + (i * lbnadd); @@ -705,10 +728,8 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i blk = bap2[i]; if (cur == lbn) return (blk); - if (level == 0) { - abort(); - errx(1, "Invalid lbn %jd at level 0", lbn); - } + if (level == 0) + err_suj("Invalid lbn %jd at level 0\n", lbn); return indir_blkatoff(blk, ino, cur, lbn); } @@ -762,7 +783,8 @@ ino_blkatoff(union dinode *ip, ino_t ino continue; return indir_blkatoff(DIP(ip, di_ib[i]), ino, -cur - i, lbn); } - errx(1, "lbn %jd not in ino", lbn); + err_suj("lbn %jd not in ino\n", lbn); + /* NOTREACHED */ } /* @@ -851,7 +873,7 @@ ino_isat(ino_t parent, off_t diroff, ino dpoff += dp->d_reclen; } while (dpoff <= doff); if (dpoff > fs->fs_bsize) - errx(1, "Corrupt directory block in dir ino %d", parent); + err_suj("Corrupt directory block in dir ino %d\n", parent); /* Not found. */ if (dpoff != doff) { if (debug) @@ -907,7 +929,7 @@ indir_visit(ino_t ino, ufs_lbn_t lbn, uf return; level = lbn_level(lbn); if (level == -1) - errx(1, "Invalid level for lbn %jd", lbn); + err_suj("Invalid level for lbn %jd\n", lbn); if ((flags & VISIT_ROOT) == 0 && blk_isindir(blk, ino, lbn) == 0) { if (debug) printf("blk %jd ino %d lbn %jd(%d) is not indir.\n", @@ -1203,7 +1225,7 @@ ino_reclaim(union dinode *ip, ino_t ino, uint32_t gen; if (ino == ROOTINO) - errx(1, "Attempting to free ROOTINO"); + err_suj("Attempting to free ROOTINO\n"); if (debug) printf("Truncating and freeing ino %d, nlink %d, mode %o\n", ino, DIP(ip, di_nlink), DIP(ip, di_mode)); @@ -1240,9 +1262,9 @@ ino_decr(ino_t ino) nlink = DIP(ip, di_nlink); mode = DIP(ip, di_mode); if (nlink < 1) - errx(1, "Inode %d link count %d invalid", ino, nlink); + err_suj("Inode %d link count %d invalid\n", ino, nlink); if (mode == 0) - errx(1, "Inode %d has a link of %d with 0 mode.", ino, nlink); + err_suj("Inode %d has a link of %d with 0 mode\n", ino, nlink); nlink--; if ((mode & IFMT) == IFDIR) reqlink = 2; @@ -1300,8 +1322,8 @@ ino_adjust(struct suj_ino *sino) ip = ino_read(ino); mode = DIP(ip, di_mode) & IFMT; if (nlink > LINK_MAX) - errx(1, - "ino %d nlink manipulation error, new link %d, old link %d", + err_suj( + "ino %d nlink manipulation error, new link %d, old link %d\n", ino, nlink, DIP(ip, di_nlink)); if (debug) printf("Adjusting ino %d, nlink %d, old link %d lastmode %o\n", @@ -1359,7 +1381,7 @@ indir_trunc(ino_t ino, ufs_lbn_t lbn, uf dirty = 0; level = lbn_level(lbn); if (level == -1) - errx(1, "Invalid level for lbn %jd", lbn); + err_suj("Invalid level for lbn %jd\n", lbn); lbnadd = 1; for (i = level; i > 0; i--) lbnadd *= NINDIR(fs); @@ -1488,7 +1510,7 @@ ino_trunc(ino_t ino, off_t size) bn = DIP(ip, di_db[visitlbn]); if (bn == 0) - errx(1, "Bad blk at ino %d lbn %jd\n", ino, visitlbn); + err_suj("Bad blk at ino %d lbn %jd\n", ino, visitlbn); oldspace = sblksize(fs, cursize, visitlbn); newspace = sblksize(fs, size, visitlbn); if (oldspace != newspace) { @@ -1512,7 +1534,7 @@ ino_trunc(ino_t ino, off_t size) bn = ino_blkatoff(ip, ino, visitlbn, &frags); if (bn == 0) - errx(1, "Block missing from ino %d at lbn %jd\n", + err_suj("Block missing from ino %d at lbn %jd\n", ino, visitlbn); clrsize = frags * fs->fs_fsize; buf = dblk_read(bn, clrsize); @@ -1555,7 +1577,7 @@ ino_check(struct suj_ino *sino) isat = ino_isat(rrec->jr_parent, rrec->jr_diroff, rrec->jr_ino, &mode, &isdot); if (isat && (mode & IFMT) != (rrec->jr_mode & IFMT)) - errx(1, "Inode mode/directory type mismatch %o != %o", + err_suj("Inode mode/directory type mismatch %o != %o\n", mode, rrec->jr_mode); if (debug) printf("jrefrec: op %d ino %d, nlink %d, parent %d, " @@ -1778,7 +1800,7 @@ cg_write(struct suj_cg *sc) fs->fs_cs(fs, sc->sc_cgx) = cgp->cg_cs; if (bwrite(disk, fsbtodb(fs, cgtod(fs, sc->sc_cgx)), sc->sc_cgbuf, fs->fs_bsize) == -1) - err(1, "Unable to write cylinder group %d", sc->sc_cgx); + err_suj("Unable to write cylinder group %d\n", sc->sc_cgx); } /* @@ -1970,6 +1992,7 @@ ino_build_ref(struct suj_ino *sino, stru continue; diroff = mvrec->jm_oldoff; TAILQ_REMOVE(&sino->si_movs, srn, sr_next); + free(srn); ino_dup_ref(sino, refrec, diroff); } } @@ -2026,7 +2049,7 @@ ino_build_ref(struct suj_ino *sino, stru TAILQ_REMOVE(&sino->si_newrecs, srn, sr_next); break; default: - errx(1, "ino_build_ref: Unknown op %d", + err_suj("ino_build_ref: Unknown op %d\n", srn->sr_rec->rec_jrefrec.jr_op); } } @@ -2056,7 +2079,7 @@ ino_build(struct suj_ino *sino) TAILQ_INSERT_TAIL(&sino->si_movs, srec, sr_next); break; default: - errx(1, "ino_build: Unknown op %d", + err_suj("ino_build: Unknown op %d\n", srec->sr_rec->rec_jrefrec.jr_op); } } @@ -2107,7 +2130,7 @@ blk_build(struct jblkrec *blkrec) blkrec->jb_blkno -= frag; blkrec->jb_oldfrags = frag; if (blkrec->jb_oldfrags + blkrec->jb_frags > fs->fs_frag) - errx(1, "Invalid fragment count %d oldfrags %d", + err_suj("Invalid fragment count %d oldfrags %d\n", blkrec->jb_frags, frag); /* * Detect dups. If we detect a dup we always discard the oldest @@ -2185,7 +2208,7 @@ suj_build(void) ino_build_trunc((struct jtrncrec *)rec); break; default: - errx(1, "Unknown journal operation %d (%d)", + err_suj("Unknown journal operation %d (%d)\n", rec->rec_jrefrec.jr_op, off); } i++; @@ -2233,9 +2256,10 @@ suj_prune(void) newseq = seg->ss_rec.jsr_seq; } - if (newseq != oldseq) - errx(1, "Journal file sequence mismatch %jd != %jd", + if (newseq != oldseq) { + err_suj("Journal file sequence mismatch %jd != %jd\n", newseq, oldseq); + } /* * The kernel may asynchronously write segments which can create * gaps in the sequence space. Throw away any segments after the @@ -2463,9 +2487,10 @@ restart: /* * Read 1MB at a time and scan for records within this block. */ - if (bread(disk, blk, &block, size) == -1) - err(1, "Error reading journal block %jd", + if (bread(disk, blk, &block, size) == -1) { + err_suj("Error reading journal block %jd\n", (intmax_t)blk); + } for (rec = (void *)block; size; size -= recsize, rec = (struct jsegrec *)((uintptr_t)rec + recsize)) { recsize = DEV_BSIZE; @@ -2544,7 +2569,7 @@ suj_find(ino_t ino, ufs_lbn_t lbn, ufs2_ return; bytes = lfragtosize(fs, frags); if (bread(disk, fsbtodb(fs, blk), block, bytes) <= 0) - err(1, "Failed to read ROOTINO directory block %jd", blk); + err_suj("Failed to read ROOTINO directory block %jd\n", blk); for (off = 0; off < bytes; off += dp->d_reclen) { dp = (struct direct *)&block[off]; if (dp->d_reclen == 0) @@ -2569,17 +2594,43 @@ suj_check(const char *filesys) union dinode *jip; union dinode *ip; uint64_t blocks; + int retval; + struct suj_seg *seg; + struct suj_seg *segn; opendisk(filesys); TAILQ_INIT(&allsegs); + + /* + * Set an exit point when SUJ check failed + */ + retval = setjmp(jmpbuf); + if (retval != 0) { + pwarn("UNEXPECTED SU+J INCONSISTENCY\n"); + TAILQ_FOREACH_SAFE(seg, &allsegs, ss_next, segn) { + TAILQ_REMOVE(&allsegs, seg, ss_next); + free(seg->ss_blk); + free(seg); + } + if (reply("FALLBACK TO FULL FSCK") == 0) { + ckfini(0); + exit(EEXIT); + } else + return (-1); + } + /* * Find the journal inode. */ ip = ino_read(ROOTINO); sujino = 0; ino_visit(ip, ROOTINO, suj_find, 0); - if (sujino == 0) - errx(1, "Journal inode removed. Use tunefs to re-create."); + if (sujino == 0) { + printf("Journal inode removed. Use tunefs to re-create.\n"); + sblock.fs_flags &= ~FS_SUJ; + sblock.fs_sujfree = 0; + return (-1); + } /* * Fetch the journal inode and verify it. */ @@ -2595,8 +2646,10 @@ suj_check(const char *filesys) DIP(jip, di_size), sujino); suj_jblocks = jblocks_create(); blocks = ino_visit(jip, sujino, suj_add_block, 0); - if (blocks != numfrags(fs, DIP(jip, di_size))) - errx(1, "Sparse journal inode %d.\n", sujino); + if (blocks != numfrags(fs, DIP(jip, di_size))) { + printf("Sparse journal inode %d.\n", sujino); + return (-1); + } suj_read(); jblocks_destroy(suj_jblocks); suj_jblocks = NULL; @@ -2612,7 +2665,7 @@ suj_check(const char *filesys) cg_apply(cg_check_blk); cg_apply(cg_check_ino); } - if (preen == 0 && reply("WRITE CHANGES") == 0) + if (preen == 0 && (jrecs > 0 || jbytes > 0) && reply("WRITE CHANGES") == 0) return (0); /* * To remain idempotent with partial truncations the free bitmaps @@ -2625,10 +2678,12 @@ suj_check(const char *filesys) cg_apply(cg_write_inos); /* Write back superblock. */ closedisk(filesys); - printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", - jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); - printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", - freeinos, freedir, freeblocks, freefrags); + if (jrecs > 0 || jbytes > 0) { + printf("** %jd journal records in %jd bytes for %.2f%% utilization\n", + jrecs, jbytes, ((float)jrecs / (float)(jbytes / JREC_SIZE)) * 100); + printf("** Freed %jd inodes (%jd dirs) %jd blocks, and %jd frags.\n", + freeinos, freedir, freeblocks, freefrags); + } return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 01:30:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C4E8106564A; Tue, 22 Jun 2010 01:30:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 415958FC13; Tue, 22 Jun 2010 01:30:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M1Ul5W095468; Tue, 22 Jun 2010 01:30:47 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M1UlYb095465; Tue, 22 Jun 2010 01:30:47 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201006220130.o5M1UlYb095465@svn.freebsd.org> From: Rick Macklem Date: Tue, 22 Jun 2010 01:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209409 - in stable/8/sys/fs: nfsclient nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 01:30:47 -0000 Author: rmacklem Date: Tue Jun 22 01:30:46 2010 New Revision: 209409 URL: http://svn.freebsd.org/changeset/base/209409 Log: MFC: r209191 Add MODULE_DEPEND() macros to the experimental NFS client and server so that the modules will load when kernels are built with none of the NFS* configuration options specified. I believe this resolves the problems reported by PR kern/144458 and the email on freebsd-stable@ posted by Dmitry Pryanishnikov on June 13. Modified: stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Tue Jun 22 00:26:07 2010 (r209408) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Tue Jun 22 01:30:46 2010 (r209409) @@ -1275,4 +1275,6 @@ DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_ /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfscl, 1); MODULE_DEPEND(nfscl, nfscommon, 1, 1, 1); +MODULE_DEPEND(nfscl, krpc, 1, 1, 1); +MODULE_DEPEND(nfscl, nfssvc, 1, 1, 1); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jun 22 00:26:07 2010 (r209408) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Tue Jun 22 01:30:46 2010 (r209409) @@ -3147,4 +3147,6 @@ DECLARE_MODULE(nfsd, nfsd_mod, SI_SUB_VF MODULE_VERSION(nfsd, 1); MODULE_DEPEND(nfsd, nfscommon, 1, 1, 1); MODULE_DEPEND(nfsd, nfslockd, 1, 1, 1); +MODULE_DEPEND(nfsd, krpc, 1, 1, 1); +MODULE_DEPEND(nfsd, nfssvc, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 04:37:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D52C106566B; Tue, 22 Jun 2010 04:37:06 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B0518FC0C; Tue, 22 Jun 2010 04:37:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M4b5R6036673; Tue, 22 Jun 2010 04:37:05 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M4b5P7036669; Tue, 22 Jun 2010 04:37:05 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006220437.o5M4b5P7036669@svn.freebsd.org> From: Matt Jacob Date: Tue, 22 Jun 2010 04:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209410 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 04:37:06 -0000 Author: mjacob Date: Tue Jun 22 04:37:05 2010 New Revision: 209410 URL: http://svn.freebsd.org/changeset/base/209410 Log: This is an MFC of 208905 Make additional definitions up to and including SPC-4. Add in definitions for REPORT and SET TARGET PORT GROUP commands (foundations for future work). Regularize opcodes to be upper case hex. Pick *one* of tab or space after #define (tab) and stick with that. Modified: stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_ch.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Tue Jun 22 01:30:46 2010 (r209409) +++ stable/8/sys/cam/scsi/scsi_all.c Tue Jun 22 04:37:05 2010 (r209410) @@ -3954,6 +3954,57 @@ scsi_report_luns(struct ccb_scsiio *csio scsi_ulto4b(alloc_len, scsi_cmd->length); } +void +scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t pdf, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_IN; + scsi_cmd->service_action = REPORT_TARGET_PORT_GROUPS | pdf; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + +void +scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_target_group *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_target_group *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_OUT; + scsi_cmd->service_action = SET_TARGET_PORT_GROUPS; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + /* * Syncronize the media to the contents of the cache for * the given lba/count pair. Specifying 0/0 means sync Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 01:30:46 2010 (r209409) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:37:05 2010 (r209410) @@ -22,7 +22,7 @@ */ #ifndef _SCSI_SCSI_ALL_H -#define _SCSI_SCSI_ALL_H 1 +#define _SCSI_SCSI_ALL_H 1 #include @@ -41,13 +41,13 @@ extern int scsi_delay; /* * Define dome bits that are in ALL (or a lot of) scsi commands */ -#define SCSI_CTL_LINK 0x01 -#define SCSI_CTL_FLAG 0x02 -#define SCSI_CTL_VENDOR 0xC0 +#define SCSI_CTL_LINK 0x01 +#define SCSI_CTL_FLAG 0x02 +#define SCSI_CTL_VENDOR 0xC0 #define SCSI_CMD_LUN 0xA0 /* these two should not be needed */ #define SCSI_CMD_LUN_SHIFT 5 /* LUN in the cmd is no longer SCSI */ -#define SCSI_MAX_CDBLEN 16 /* +#define SCSI_MAX_CDBLEN 16 /* * 16 byte commands are in the * SCSI-3 spec */ @@ -56,7 +56,7 @@ extern int scsi_delay; #endif /* 6byte CDBs special case 0 length to be 256 */ -#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) +#define SCSI_CDB6_LEN(len) ((len) == 0 ? 256 : len) /* * This type defines actions to be taken when a particular sense code is @@ -94,16 +94,16 @@ typedef enum { } scsi_sense_action_qualifier; /* Mask for error status values */ -#define SS_ERRMASK 0xff +#define SS_ERRMASK 0xff /* The default, retyable, error action */ -#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO +#define SS_RDEF SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE|EIO /* The retyable, error action, with table specified error code */ -#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE +#define SS_RET SS_RETRY|SSQ_DECREMENT_COUNT|SSQ_PRINT_SENSE /* Fatal error action, with table specified error code */ -#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE +#define SS_FATAL SS_FAIL|SSQ_PRINT_SENSE struct scsi_generic { @@ -168,16 +168,16 @@ struct scsi_mode_sense_6 #define SMS_DBD 0x08 u_int8_t page; #define SMS_PAGE_CODE 0x3F -#define SMS_VENDOR_SPECIFIC_PAGE 0x00 -#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 -#define SMS_FORMAT_DEVICE_PAGE 0x03 -#define SMS_GEOMETRY_PAGE 0x04 -#define SMS_CACHE_PAGE 0x08 -#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 -#define SMS_CONTROL_MODE_PAGE 0x0A -#define SMS_PROTO_SPECIFIC_PAGE 0x19 -#define SMS_INFO_EXCEPTIONS_PAGE 0x1C -#define SMS_ALL_PAGES_PAGE 0x3F +#define SMS_VENDOR_SPECIFIC_PAGE 0x00 +#define SMS_DISCONNECT_RECONNECT_PAGE 0x02 +#define SMS_FORMAT_DEVICE_PAGE 0x03 +#define SMS_GEOMETRY_PAGE 0x04 +#define SMS_CACHE_PAGE 0x08 +#define SMS_PERIPHERAL_DEVICE_PAGE 0x09 +#define SMS_CONTROL_MODE_PAGE 0x0A +#define SMS_PROTO_SPECIFIC_PAGE 0x19 +#define SMS_INFO_EXCEPTIONS_PAGE 0x1C +#define SMS_ALL_PAGES_PAGE 0x3F #define SMS_PAGE_CTRL_MASK 0xC0 #define SMS_PAGE_CTRL_CURRENT 0x00 #define SMS_PAGE_CTRL_CHANGEABLE 0x40 @@ -262,8 +262,8 @@ struct scsi_log_sense #define SLS_ERROR_VERIFY_PAGE 0x05 #define SLS_ERROR_NONMEDIUM_PAGE 0x06 #define SLS_ERROR_LASTN_PAGE 0x07 -#define SLS_SELF_TEST_PAGE 0x10 -#define SLS_IE_PAGE 0x2f +#define SLS_SELF_TEST_PAGE 0x10 +#define SLS_IE_PAGE 0x2f #define SLS_PAGE_CTRL_MASK 0xC0 #define SLS_PAGE_CTRL_THRESHOLD 0x00 #define SLS_PAGE_CTRL_CUMULATIVE 0x40 @@ -320,30 +320,30 @@ struct scsi_control_page { u_int8_t page_code; u_int8_t page_length; u_int8_t rlec; -#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ +#define SCB_RLEC 0x01 /*Report Log Exception Cond*/ u_int8_t queue_flags; -#define SCP_QUEUE_ALG_MASK 0xF0 -#define SCP_QUEUE_ALG_RESTRICTED 0x00 -#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 -#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ -#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ +#define SCP_QUEUE_ALG_MASK 0xF0 +#define SCP_QUEUE_ALG_RESTRICTED 0x00 +#define SCP_QUEUE_ALG_UNRESTRICTED 0x10 +#define SCP_QUEUE_ERR 0x02 /*Queued I/O aborted for CACs*/ +#define SCP_QUEUE_DQUE 0x01 /*Queued I/O disabled*/ u_int8_t eca_and_aen; -#define SCP_EECA 0x80 /*Enable Extended CA*/ -#define SCP_RAENP 0x04 /*Ready AEN Permission*/ -#define SCP_UAAENP 0x02 /*UA AEN Permission*/ -#define SCP_EAENP 0x01 /*Error AEN Permission*/ +#define SCP_EECA 0x80 /*Enable Extended CA*/ +#define SCP_RAENP 0x04 /*Ready AEN Permission*/ +#define SCP_UAAENP 0x02 /*UA AEN Permission*/ +#define SCP_EAENP 0x01 /*Error AEN Permission*/ u_int8_t reserved; u_int8_t aen_holdoff_period[2]; }; struct scsi_cache_page { u_int8_t page_code; -#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SCHP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t cache_flags; -#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ -#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ -#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ +#define SCHP_FLAGS_WCE 0x04 /* Write Cache Enable */ +#define SCHP_FLAGS_MF 0x02 /* Multiplication factor */ +#define SCHP_FLAGS_RCD 0x01 /* Read Cache Disable */ u_int8_t rw_cache_policy; u_int8_t dis_prefetch[2]; u_int8_t min_prefetch[2]; @@ -353,16 +353,16 @@ struct scsi_cache_page { struct scsi_info_exceptions_page { u_int8_t page_code; -#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SIEP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t info_flags; -#define SIEP_FLAGS_PERF 0x80 -#define SIEP_FLAGS_EBF 0x20 -#define SIEP_FLAGS_EWASC 0x10 -#define SIEP_FLAGS_DEXCPT 0x08 -#define SIEP_FLAGS_TEST 0x04 -#define SIEP_FLAGS_EBACKERR 0x02 -#define SIEP_FLAGS_LOGERR 0x01 +#define SIEP_FLAGS_PERF 0x80 +#define SIEP_FLAGS_EBF 0x20 +#define SIEP_FLAGS_EWASC 0x10 +#define SIEP_FLAGS_DEXCPT 0x08 +#define SIEP_FLAGS_TEST 0x04 +#define SIEP_FLAGS_EBACKERR 0x02 +#define SIEP_FLAGS_LOGERR 0x01 u_int8_t mrie; u_int8_t interval_timer[4]; u_int8_t report_count[4]; @@ -370,19 +370,19 @@ struct scsi_info_exceptions_page { struct scsi_proto_specific_page { u_int8_t page_code; -#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ +#define SPSP_PAGE_SAVABLE 0x80 /* Page is savable */ u_int8_t page_length; u_int8_t protocol; -#define SPSP_PROTO_FC 0x00 -#define SPSP_PROTO_SPI 0x01 -#define SPSP_PROTO_SSA 0x02 -#define SPSP_PROTO_1394 0x03 -#define SPSP_PROTO_RDMA 0x04 -#define SPSP_PROTO_ISCSI 0x05 -#define SPSP_PROTO_SAS 0x06 -#define SPSP_PROTO_ADT 0x07 -#define SPSP_PROTO_ATA 0x08 -#define SPSP_PROTO_NONE 0x0f +#define SPSP_PROTO_FC 0x00 +#define SPSP_PROTO_SPI 0x01 +#define SPSP_PROTO_SSA 0x02 +#define SPSP_PROTO_1394 0x03 +#define SPSP_PROTO_RDMA 0x04 +#define SPSP_PROTO_ISCSI 0x05 +#define SPSP_PROTO_SAS 0x06 +#define SPSP_PROTO_ADT 0x07 +#define SPSP_PROTO_ATA 0x08 +#define SPSP_PROTO_NONE 0x0f }; struct scsi_reserve @@ -412,7 +412,7 @@ struct scsi_prevent u_int8_t control; }; #define PR_PREVENT 0x01 -#define PR_ALLOW 0x00 +#define PR_ALLOW 0x00 struct scsi_sync_cache { @@ -490,7 +490,7 @@ struct scsi_rw_12 { u_int8_t opcode; #define SRW12_RELADDR 0x01 -#define SRW12_FUA 0x08 +#define SRW12_FUA 0x08 #define SRW12_DPO 0x10 u_int8_t byte2; u_int8_t addr[4]; @@ -527,13 +527,13 @@ struct scsi_start_stop_unit struct ata_pass_12 { u_int8_t opcode; u_int8_t protocol; -#define AP_MULTI 0xe0 +#define AP_MULTI 0xe0 u_int8_t flags; -#define AP_T_LEN 0x03 -#define AP_BB 0x04 -#define AP_T_DIR 0x08 -#define AP_CK_COND 0x20 -#define AP_OFFLINE 0x60 +#define AP_T_LEN 0x03 +#define AP_BB 0x04 +#define AP_T_DIR 0x08 +#define AP_CK_COND 0x20 +#define AP_OFFLINE 0x60 u_int8_t features; u_int8_t sector_count; u_int8_t lba_low; @@ -548,7 +548,7 @@ struct ata_pass_12 { struct ata_pass_16 { u_int8_t opcode; u_int8_t protocol; -#define AP_EXTEND 0x01 +#define AP_EXTEND 0x01 u_int8_t flags; u_int8_t features_ext; u_int8_t features; @@ -565,51 +565,69 @@ struct ata_pass_16 { u_int8_t control; }; -#define SC_SCSI_1 0x01 -#define SC_SCSI_2 0x03 +#define SC_SCSI_1 0x01 +#define SC_SCSI_2 0x03 /* * Opcodes */ #define TEST_UNIT_READY 0x00 -#define REQUEST_SENSE 0x03 +#define REQUEST_SENSE 0x03 #define READ_6 0x08 -#define WRITE_6 0x0a -#define INQUIRY 0x12 -#define MODE_SELECT_6 0x15 -#define MODE_SENSE_6 0x1a -#define START_STOP_UNIT 0x1b -#define START_STOP 0x1b -#define RESERVE 0x16 -#define RELEASE 0x17 -#define RECEIVE_DIAGNOSTIC 0x1c -#define SEND_DIAGNOSTIC 0x1d -#define PREVENT_ALLOW 0x1e +#define WRITE_6 0x0A +#define INQUIRY 0x12 +#define MODE_SELECT_6 0x15 +#define MODE_SENSE_6 0x1A +#define START_STOP_UNIT 0x1B +#define START_STOP 0x1B +#define RESERVE 0x16 +#define RELEASE 0x17 +#define RECEIVE_DIAGNOSTIC 0x1C +#define SEND_DIAGNOSTIC 0x1D +#define PREVENT_ALLOW 0x1E #define READ_CAPACITY 0x25 #define READ_10 0x28 -#define WRITE_10 0x2a -#define POSITION_TO_ELEMENT 0x2b +#define WRITE_10 0x2A +#define POSITION_TO_ELEMENT 0x2B #define SYNCHRONIZE_CACHE 0x35 #define READ_DEFECT_DATA_10 0x37 -#define WRITE_BUFFER 0x3b -#define READ_BUFFER 0x3c +#define WRITE_BUFFER 0x3B +#define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 -#define LOG_SELECT 0x4c -#define LOG_SENSE 0x4d +#define LOG_SELECT 0x4C +#define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 #define MODE_SENSE_10 0x5A #define ATA_PASS_16 0x85 #define READ_16 0x88 -#define WRITE_16 0x8a -#define SERVICE_ACTION_IN 0x9e +#define WRITE_16 0x8A +#define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 -#define ATA_PASS_12 0xa1 -#define MOVE_MEDIUM 0xa5 -#define READ_12 0xa8 -#define WRITE_12 0xaa -#define READ_ELEMENT_STATUS 0xb8 - +#define ATA_PASS_12 0xA1 +#define MAINTENANCE_IN 0xA3 +#define MAINTENANCE_OUT 0xA4 +#define MOVE_MEDIUM 0xA5 +#define READ_12 0xA8 +#define WRITE_12 0xAA +#define READ_ELEMENT_STATUS 0xB8 + +/* Maintenance In Service Action Codes */ +#define REPORT_IDENTIFYING_INFRMATION 0x05 +#define REPORT_TARGET_PORT_GROUPS 0x0A +#define REPORT_ALIASES 0x0B +#define REPORT_SUPPORTED_OPERATION_CODES 0x0C +#define REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0D +#define REPORT_PRIORITY 0x0E +#define REPORT_TIMESTAMP 0x0F +#define MANAGEMENT_PROTOCOL_IN 0x10 +/* Maintenance Out Service Action Codes */ +#define SET_IDENTIFY_INFORMATION 0x06 +#define SET_TARGET_PORT_GROUPS 0x0A +#define CHANGE_ALIASES 0x0B +#define SET_PRIORITY 0x0E +#define SET_TIMESTAMP 0x0F +#define MANGAEMENT_PROTOCOL_OUT 0x10 /* * Device Types @@ -635,7 +653,7 @@ struct ata_pass_16 { #define T_NODEVICE 0x1f #define T_ANY 0xff /* Used in Quirk table matches */ -#define T_REMOV 1 +#define T_REMOV 1 #define T_FIXED 0 /* @@ -670,7 +688,7 @@ struct scsi_inquiry_data * physical device is not currently * connected to this logical unit. */ -#define SID_QUAL_RSVD 0x02 +#define SID_QUAL_RSVD 0x02 #define SID_QUAL_BAD_LU 0x03 /* * The target is not capable of * supporting a physical device on @@ -688,30 +706,39 @@ struct scsi_inquiry_data #define SID_QUAL2 0x7F #define SID_IS_REMOVABLE(inq_data) (((inq_data)->dev_qual2 & 0x80) != 0) u_int8_t version; -#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) +#define SID_ANSI_REV(inq_data) ((inq_data)->version & 0x07) #define SCSI_REV_0 0 #define SCSI_REV_CCS 1 #define SCSI_REV_2 2 #define SCSI_REV_SPC 3 #define SCSI_REV_SPC2 4 +#define SCSI_REV_SPC3 5 +#define SCSI_REV_SPC4 6 -#define SID_ECMA 0x38 -#define SID_ISO 0xC0 +#define SID_ECMA 0x38 +#define SID_ISO 0xC0 u_int8_t response_format; -#define SID_AENC 0x80 -#define SID_TrmIOP 0x40 +#define SID_AENC 0x80 +#define SID_TrmIOP 0x40 u_int8_t additional_length; #define SID_ADDITIONAL_LENGTH(iqd) \ ((iqd)->additional_length + \ offsetof(struct scsi_inquiry_data, additional_length) + 1) - u_int8_t reserved; + u_int8_t spc3_flags; +#define SPC3_SID_PROTECT 0x01 +#define SPC3_SID_3PC 0x08 +#define SPC3_SID_TPGS_MASK 0x30 +#define SPC3_SID_TPGS_IMPLICIT 0x10 +#define SPC3_SID_TPGS_EXPLICIT 0x20 +#define SPC3_SID_ACC 0x40 +#define SPC3_SID_SCCS 0x80 u_int8_t spc2_flags; -#define SPC2_SID_MChngr 0x08 -#define SPC2_SID_MultiP 0x10 -#define SPC2_SID_EncServ 0x40 -#define SPC2_SID_BQueue 0x80 +#define SPC2_SID_MChngr 0x08 +#define SPC2_SID_MultiP 0x10 +#define SPC2_SID_EncServ 0x40 +#define SPC2_SID_BQueue 0x80 -#define INQ_DATA_TQ_ENABLED(iqd) \ +#define INQ_DATA_TQ_ENABLED(iqd) \ ((SID_ANSI_REV(iqd) < SCSI_REV_SPC2)? ((iqd)->flags & SID_CmdQue) : \ (((iqd)->flags & SID_CmdQue) && !((iqd)->spc2_flags & SPC2_SID_BQueue)) || \ (!((iqd)->flags & SID_CmdQue) && ((iqd)->spc2_flags & SPC2_SID_BQueue))) @@ -724,11 +751,11 @@ struct scsi_inquiry_data #define SID_WBus16 0x20 #define SID_WBus32 0x40 #define SID_RelAdr 0x80 -#define SID_VENDOR_SIZE 8 +#define SID_VENDOR_SIZE 8 char vendor[SID_VENDOR_SIZE]; -#define SID_PRODUCT_SIZE 16 +#define SID_PRODUCT_SIZE 16 char product[SID_PRODUCT_SIZE]; -#define SID_REVISION_SIZE 4 +#define SID_REVISION_SIZE 4 char revision[SID_REVISION_SIZE]; /* * The following fields were taken from SCSI Primary Commands - 2 @@ -769,10 +796,10 @@ struct scsi_vpd_supported_page_list { u_int8_t device; u_int8_t page_code; -#define SVPD_SUPPORTED_PAGE_LIST 0x00 +#define SVPD_SUPPORTED_PAGE_LIST 0x00 u_int8_t reserved; u_int8_t length; /* number of VPD entries */ -#define SVPD_SUPPORTED_PAGES_SIZE 251 +#define SVPD_SUPPORTED_PAGES_SIZE 251 u_int8_t list[SVPD_SUPPORTED_PAGES_SIZE]; }; @@ -780,10 +807,10 @@ struct scsi_vpd_unit_serial_number { u_int8_t device; u_int8_t page_code; -#define SVPD_UNIT_SERIAL_NUMBER 0x80 +#define SVPD_UNIT_SERIAL_NUMBER 0x80 u_int8_t reserved; u_int8_t length; /* serial number length */ -#define SVPD_SERIAL_NUM_SIZE 251 +#define SVPD_SERIAL_NUM_SIZE 251 u_int8_t serial_num[SVPD_SERIAL_NUM_SIZE]; }; @@ -860,6 +887,63 @@ struct scsi_report_luns_data { #define RPL_LUNDATA_ATYP_LUN 0x80 #define RPL_LUNDATA_ATYP_EXTLUN 0xc0 +struct scsi_target_group +{ + uint8_t opcode; + uint8_t service_action; +#define STG_PDF_LENGTH 0x00 +#define RPL_PDF_EXTENDED 0x20 + uint8_t reserved1[3]; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_target_port_descriptor { + uint8_t reserved[2]; + uint8_t relative_target_port_identifier[2]; +}; + +struct scsi_target_port_group_descriptor { + uint8_t pref_state; +#define TPG_PRIMARY 0x80 +#define TPG_ASYMMETRIC_ACCESS_STATE_MASK 0xf +#define TPG_ASYMMETRIC_ACCESS_OPTIMIZED 0x0 +#define TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED 0x1 +#define TPG_ASYMMETRIC_ACCESS_STANDBY 0x2 +#define TPG_ASYMMETRIC_ACCESS_UNAVAILABLE 0x3 +#define TPG_ASYMMETRIC_ACCESS_LBA_DEPENDENT 0x4 +#define TPG_ASYMMETRIC_ACCESS_OFFLINE 0xE +#define TPG_ASYMMETRIC_ACCESS_TRANSITIONING 0xF + uint8_t support; +#define TPG_AO_SUP 0x01 +#define TPG_AN_SUP 0x02 +#define TPG_S_SUP 0x04 +#define TPG_U_SUP 0x08 +#define TPG_LBD_SUP 0x10 +#define TPG_O_SUP 0x40 +#define TPG_T_SUP 0x80 + uint8_t target_port_group[2]; + uint8_t reserved; + uint8_t status; + uint8_t vendor_specific; + uint8_t target_port_count; + struct scsi_target_port_descriptor descriptors[1]; +}; + +struct scsi_target_group_data { + uint8_t length[4]; /* length of returned data, in bytes */ + struct scsi_target_port_group_descriptor groups[1]; +}; + +struct scsi_target_group_data_extended { + uint8_t length[4]; /* length of returned data, in bytes */ + uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ + uint8_t implicit_transition_time; + uint8_t reserved[2]; + struct scsi_target_port_group_descriptor groups[1]; +}; + struct scsi_sense_data { @@ -898,12 +982,12 @@ struct scsi_sense_data u_int8_t fru; u_int8_t sense_key_spec[3]; #define SSD_SCS_VALID 0x80 -#define SSD_FIELDPTR_CMD 0x40 -#define SSD_BITPTR_VALID 0x08 -#define SSD_BITPTR_VALUE 0x07 -#define SSD_MIN_SIZE 18 +#define SSD_FIELDPTR_CMD 0x40 +#define SSD_BITPTR_VALID 0x08 +#define SSD_BITPTR_VALUE 0x07 +#define SSD_MIN_SIZE 18 u_int8_t extra_bytes[14]; -#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) +#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) }; struct scsi_mode_header_6 @@ -948,13 +1032,13 @@ struct scsi_mode_blk_desc #define SCSI_STATUS_CHECK_COND 0x02 #define SCSI_STATUS_COND_MET 0x04 #define SCSI_STATUS_BUSY 0x08 -#define SCSI_STATUS_INTERMED 0x10 -#define SCSI_STATUS_INTERMED_COND_MET 0x14 -#define SCSI_STATUS_RESERV_CONFLICT 0x18 -#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ -#define SCSI_STATUS_QUEUE_FULL 0x28 -#define SCSI_STATUS_ACA_ACTIVE 0x30 -#define SCSI_STATUS_TASK_ABORTED 0x40 +#define SCSI_STATUS_INTERMED 0x10 +#define SCSI_STATUS_INTERMED_COND_MET 0x14 +#define SCSI_STATUS_RESERV_CONFLICT 0x18 +#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */ +#define SCSI_STATUS_QUEUE_FULL 0x28 +#define SCSI_STATUS_ACA_ACTIVE 0x30 +#define SCSI_STATUS_TASK_ABORTED 0x40 struct scsi_inquiry_pattern { u_int8_t type; @@ -1065,9 +1149,9 @@ int scsi_interpret_sense(struct cam_dev #endif /* _KERNEL */ #define SF_RETRY_UA 0x01 -#define SF_NO_PRINT 0x02 -#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ -#define SF_PRINT_ALWAYS 0x08 +#define SF_NO_PRINT 0x02 +#define SF_QUIET_IR 0x04 /* Be quiet about Illegal Request reponses */ +#define SF_PRINT_ALWAYS 0x08 const char * scsi_op_desc(u_int16_t opcode, @@ -1174,6 +1258,20 @@ void scsi_report_luns(struct ccb_scsiio u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_report_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + u_int8_t pdf, + void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, Modified: stable/8/sys/cam/scsi/scsi_ch.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_ch.h Tue Jun 22 01:30:46 2010 (r209409) +++ stable/8/sys/cam/scsi/scsi_ch.h Tue Jun 22 04:37:05 2010 (r209410) @@ -105,7 +105,6 @@ struct scsi_initialize_element_status { */ struct scsi_move_medium { u_int8_t opcode; -#define MOVE_MEDIUM 0xa5 u_int8_t byte2; u_int8_t tea[2]; /* transport element address */ u_int8_t src[2]; /* source element address */ @@ -122,7 +121,6 @@ struct scsi_move_medium { */ struct scsi_position_to_element { u_int8_t opcode; -#define POSITION_TO_ELEMENT 0x2b u_int8_t byte2; u_int8_t tea[2]; /* transport element address */ u_int8_t dst[2]; /* destination element address */ @@ -137,7 +135,6 @@ struct scsi_position_to_element { */ struct scsi_read_element_status { u_int8_t opcode; -#define READ_ELEMENT_STATUS 0xb8 u_int8_t byte2; #define READ_ELEMENT_STATUS_VOLTAG 0x10 /* report volume tag info */ /* ...next 4 bits are an element type code... */ @@ -151,7 +148,6 @@ struct scsi_read_element_status { struct scsi_request_volume_element_address { u_int8_t opcode; -#define REQUEST_VOLUME_ELEMENT_ADDRESS 0xb5 u_int8_t byte2; #define REQUEST_VOLUME_ELEMENT_ADDRESS_VOLTAG 0x10 /* ...next 4 bits are an element type code... */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 04:38:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF12A106566B; Tue, 22 Jun 2010 04:38:41 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE0118FC13; Tue, 22 Jun 2010 04:38:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M4cfx7037077; Tue, 22 Jun 2010 04:38:41 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M4cfsS037075; Tue, 22 Jun 2010 04:38:41 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006220438.o5M4cfsS037075@svn.freebsd.org> From: Matt Jacob Date: Tue, 22 Jun 2010 04:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209411 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 04:38:41 -0000 Author: mjacob Date: Tue Jun 22 04:38:41 2010 New Revision: 209411 URL: http://svn.freebsd.org/changeset/base/209411 Log: This is an MFC of 208918 One byte off for scsi_target_group cdb. Modified: stable/8/sys/cam/scsi/scsi_all.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:37:05 2010 (r209410) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:38:41 2010 (r209411) @@ -893,7 +893,7 @@ struct scsi_target_group uint8_t service_action; #define STG_PDF_LENGTH 0x00 #define RPL_PDF_EXTENDED 0x20 - uint8_t reserved1[3]; + uint8_t reserved1[4]; uint8_t length[4]; uint8_t reserved2; uint8_t control; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 04:40:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 144431065670; Tue, 22 Jun 2010 04:40:51 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE0808FC19; Tue, 22 Jun 2010 04:40:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M4eoVT037591; Tue, 22 Jun 2010 04:40:50 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M4eoN2037589; Tue, 22 Jun 2010 04:40:50 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201006220440.o5M4eoN2037589@svn.freebsd.org> From: Matt Jacob Date: Tue, 22 Jun 2010 04:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209412 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 04:40:51 -0000 Author: mjacob Date: Tue Jun 22 04:40:50 2010 New Revision: 209412 URL: http://svn.freebsd.org/changeset/base/209412 Log: This is an MFC of 209188 For the target port groups structures, don't allocate the initial element. This makes things easier for target implementations to calculate how many elements they need to allocate. Modified: stable/8/sys/cam/scsi/scsi_all.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:38:41 2010 (r209411) +++ stable/8/sys/cam/scsi/scsi_all.h Tue Jun 22 04:40:50 2010 (r209412) @@ -902,6 +902,7 @@ struct scsi_target_group struct scsi_target_port_descriptor { uint8_t reserved[2]; uint8_t relative_target_port_identifier[2]; + uint8_t desc_list[]; }; struct scsi_target_port_group_descriptor { @@ -928,12 +929,12 @@ struct scsi_target_port_group_descriptor uint8_t status; uint8_t vendor_specific; uint8_t target_port_count; - struct scsi_target_port_descriptor descriptors[1]; + struct scsi_target_port_descriptor descriptors[]; }; struct scsi_target_group_data { uint8_t length[4]; /* length of returned data, in bytes */ - struct scsi_target_port_group_descriptor groups[1]; + struct scsi_target_port_group_descriptor groups[]; }; struct scsi_target_group_data_extended { @@ -941,7 +942,7 @@ struct scsi_target_group_data_extended { uint8_t format_type; /* STG_PDF_LENGTH or RPL_PDF_EXTENDED */ uint8_t implicit_transition_time; uint8_t reserved[2]; - struct scsi_target_port_group_descriptor groups[1]; + struct scsi_target_port_group_descriptor groups[]; }; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 07:31:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE131065674; Tue, 22 Jun 2010 07:31:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F31688FC16; Tue, 22 Jun 2010 07:31:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M7V5pb075031; Tue, 22 Jun 2010 07:31:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7V5gK075029; Tue, 22 Jun 2010 07:31:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220731.o5M7V5gK075029@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:31: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: r209413 - head/contrib/binutils/binutils/doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 07:31:06 -0000 Author: avg Date: Tue Jun 22 07:31:05 2010 New Revision: 209413 URL: http://svn.freebsd.org/changeset/base/209413 Log: readelf.1: remove duplicate -u/--unwind option description MFC after: 2 weeks Modified: head/contrib/binutils/binutils/doc/readelf.1 Modified: head/contrib/binutils/binutils/doc/readelf.1 ============================================================================== --- head/contrib/binutils/binutils/doc/readelf.1 Tue Jun 22 04:40:50 2010 (r209412) +++ head/contrib/binutils/binutils/doc/readelf.1 Tue Jun 22 07:31:05 2010 (r209413) @@ -247,14 +247,6 @@ Displays the contents of the file's relo .PD Displays the contents of the file's unwind section, if it has one. Only the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. -.IP "\fB\-u\fR" 4 -.IX Item "-u" -.PD 0 -.IP "\fB\-\-unwind\fR" 4 -.IX Item "--unwind" -.PD -Displays the contents of the file's unwind section, if it has one. Only -the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 07:38:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 814DA106564A; Tue, 22 Jun 2010 07:38:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 567C18FC19; Tue, 22 Jun 2010 07:38:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M7cU4R076707; Tue, 22 Jun 2010 07:38:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7cUVM076705; Tue, 22 Jun 2010 07:38:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006220738.o5M7cUVM076705@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 22 Jun 2010 07:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209414 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 07:38:30 -0000 Author: ae Date: Tue Jun 22 07:38:30 2010 New Revision: 209414 URL: http://svn.freebsd.org/changeset/base/209414 Log: MFC r207178: Fix undo for schemes that have internal partitions. Internal partitions do not constitute user-visible or active partitions and as such should not prevent undoing pending operations. While here, initialize the last usable sector for the placeholder geom based on the null scheme, created to allow undoing the destruction of a scheme. This gives consistent output with "gpart show". Approved by: mav (mentor) Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Tue Jun 22 07:31:05 2010 (r209413) +++ stable/8/sys/geom/part/g_part.c Tue Jun 22 07:38:30 2010 (r209414) @@ -845,7 +845,9 @@ g_part_ctl_delete(struct gctl_req *req, static int g_part_ctl_destroy(struct gctl_req *req, struct g_part_parms *gpp) { + struct g_consumer *cp; struct g_geom *gp; + struct g_provider *pp; struct g_part_entry *entry; struct g_part_table *null, *table; struct sbuf *sb; @@ -875,6 +877,11 @@ g_part_ctl_destroy(struct gctl_req *req, null->gpt_gp = gp; null->gpt_scheme = &g_part_null_scheme; LIST_INIT(&null->gpt_entry); + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; + null->gpt_last = pp->mediasize / pp->sectorsize - 1; + null->gpt_depth = table->gpt_depth; null->gpt_opened = table->gpt_opened; null->gpt_smhead = table->gpt_smhead; @@ -1055,10 +1062,16 @@ g_part_ctl_undo(struct gctl_req *req, st table->gpt_created) ? 1 : 0; if (reprobe) { - if (!LIST_EMPTY(&table->gpt_entry)) { + LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { + if (entry->gpe_internal) + continue; error = EBUSY; goto fail; } + while ((entry = LIST_FIRST(&table->gpt_entry)) != NULL) { + LIST_REMOVE(entry, gpe_entry); + g_free(entry); + } error = g_part_probe(gp, cp, table->gpt_depth); if (error) { g_topology_lock(); From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 07:46:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14502106567D; Tue, 22 Jun 2010 07:46:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 033208FC32; Tue, 22 Jun 2010 07:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M7ksoC078674; Tue, 22 Jun 2010 07:46:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7ksBr078672; Tue, 22 Jun 2010 07:46:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220746.o5M7ksBr078672@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209415 - stable/7/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 07:46:55 -0000 Author: avg Date: Tue Jun 22 07:46:54 2010 New Revision: 209415 URL: http://svn.freebsd.org/changeset/base/209415 Log: MFC r208669: zfs boot: fix error handling in zfs_readdir Modified: stable/7/sys/boot/zfs/zfs.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/zfs/zfs.c ============================================================================== --- stable/7/sys/boot/zfs/zfs.c Tue Jun 22 07:38:30 2010 (r209414) +++ stable/7/sys/boot/zfs/zfs.c Tue Jun 22 07:46:54 2010 (r209415) @@ -265,6 +265,8 @@ zfs_readdir(struct open_file *f, struct rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, &mze, sizeof(mze)); + if (rc) + return (rc); fp->f_seekp += sizeof(mze); if (!mze.mze_name[0]) From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 07:52:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5E3106564A; Tue, 22 Jun 2010 07:52:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A14E8FC1C; Tue, 22 Jun 2010 07:52:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M7qwDi080110; Tue, 22 Jun 2010 07:52:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7qwJ1080108; Tue, 22 Jun 2010 07:52:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220752.o5M7qwJ1080108@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:52:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209416 - stable/7/sys/dev/amdsbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 07:52:58 -0000 Author: avg Date: Tue Jun 22 07:52:58 2010 New Revision: 209416 URL: http://svn.freebsd.org/changeset/base/209416 Log: MFC r208670: amdsbwd: fix nonsensical timeout calculations Modified: stable/7/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/7/sys/dev/amdsbwd/amdsbwd.c Tue Jun 22 07:46:54 2010 (r209415) +++ stable/7/sys/dev/amdsbwd/amdsbwd.c Tue Jun 22 07:52:58 2010 (r209416) @@ -230,10 +230,10 @@ amdsbwd_event(void *arg, unsigned int cm cmd &= WD_INTERVAL; if (cmd < WD_TO_1SEC) cmd = 0; - timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; - if (timeout > sc->max_ticks) - timeout = sc->max_ticks; if (cmd) { + timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (timeout > sc->max_ticks) + timeout = sc->max_ticks; if (timeout != sc->timeout) { amdsbwd_tmr_set(sc, timeout); if (!sc->active) From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 07:54:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CDC91065673; Tue, 22 Jun 2010 07:54:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BADE8FC1B; Tue, 22 Jun 2010 07:54:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M7sKZg080458; Tue, 22 Jun 2010 07:54:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7sJmt080456; Tue, 22 Jun 2010 07:54:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220754.o5M7sJmt080456@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209417 - stable/8/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 07:54:20 -0000 Author: avg Date: Tue Jun 22 07:54:19 2010 New Revision: 209417 URL: http://svn.freebsd.org/changeset/base/209417 Log: MFC r208669: zfs boot: fix error handling in zfs_readdir Modified: stable/8/sys/boot/zfs/zfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/boot/zfs/zfs.c ============================================================================== --- stable/8/sys/boot/zfs/zfs.c Tue Jun 22 07:52:58 2010 (r209416) +++ stable/8/sys/boot/zfs/zfs.c Tue Jun 22 07:54:19 2010 (r209417) @@ -265,6 +265,8 @@ zfs_readdir(struct open_file *f, struct rc = dnode_read(spa, &fp->f_dnode, fp->f_seekp, &mze, sizeof(mze)); + if (rc) + return (rc); fp->f_seekp += sizeof(mze); if (!mze.mze_name[0]) From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 07:55:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 654D9106566B; Tue, 22 Jun 2010 07:55:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5423A8FC0C; Tue, 22 Jun 2010 07:55:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M7tUp8080758; Tue, 22 Jun 2010 07:55:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M7tUAX080756; Tue, 22 Jun 2010 07:55:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220755.o5M7tUAX080756@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 07:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209418 - stable/8/sys/dev/amdsbwd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 07:55:30 -0000 Author: avg Date: Tue Jun 22 07:55:30 2010 New Revision: 209418 URL: http://svn.freebsd.org/changeset/base/209418 Log: MFC r208670: amdsbwd: fix nonsensical timeout calculations Modified: stable/8/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/8/sys/dev/amdsbwd/amdsbwd.c Tue Jun 22 07:54:19 2010 (r209417) +++ stable/8/sys/dev/amdsbwd/amdsbwd.c Tue Jun 22 07:55:30 2010 (r209418) @@ -230,10 +230,10 @@ amdsbwd_event(void *arg, unsigned int cm cmd &= WD_INTERVAL; if (cmd < WD_TO_1SEC) cmd = 0; - timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; - if (timeout > sc->max_ticks) - timeout = sc->max_ticks; if (cmd) { + timeout = ((uint64_t)1 << (cmd - WD_TO_1MS)) / sc->ms_per_tick; + if (timeout > sc->max_ticks) + timeout = sc->max_ticks; if (timeout != sc->timeout) { amdsbwd_tmr_set(sc, timeout); if (!sc->active) From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:12:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E081065672; Tue, 22 Jun 2010 08:12:45 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A48AF8FC08; Tue, 22 Jun 2010 08:12:44 +0000 (UTC) Received: by fxm7 with SMTP id 7so2701104fxm.13 for ; Tue, 22 Jun 2010 01:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=laEmHQyAEFBnbQhTJZfJFX8d4V1AAz4DaBNGZbq5iP8=; b=ZoQrfx+HbHvTEMs3cuqStr5r+hGO4Vxkc9357OpJtW3CLwKVR+GfxWIAKzTMA5YvKF g3KFY59NWhBkGAoPhID6wrE7GIxdD38FjbDhKcsB25NL9b0zuAzhvptvnrbTn1/U/Yti Bdqo/47vJ13iMQkvW7BWvvNMWurmS20WeRIfw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=QLsVWjO+n+3kSAti3XqO9/VwGNIOfP1/PRmyifRhUuFmQf5wB7rMMZV9bR7VViGNrw bdQrQ0zILTlQFjLV97dODgI9zvJ9yY/AFJb/qWp2kaIWgnWIVyKkdQGSb3cRqJdRwSic ofyqwwwpf0F4jTcJm31UDV7BYksrYa+ruMj28= Received: by 10.223.19.87 with SMTP id z23mr5874486faa.7.1277194363551; Tue, 22 Jun 2010 01:12:43 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id o11sm29389366fal.43.2010.06.22.01.12.42 (version=SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 01:12:42 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C207078.1020607@FreeBSD.org> Date: Tue, 22 Jun 2010 11:12:40 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Kostik Belousov References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> <20100621203419.GK13238@deviant.kiev.zoral.com.ua> <4C1FCF93.9000703@FreeBSD.org> <20100621210629.GN13238@deviant.kiev.zoral.com.ua> <4C1FD5CC.6070909@FreeBSD.org> <20100621212719.GO13238@deviant.kiev.zoral.com.ua> In-Reply-To: <20100621212719.GO13238@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:12:45 -0000 Kostik Belousov wrote: > On Tue, Jun 22, 2010 at 12:12:44AM +0300, Alexander Motin wrote: >> Kostik Belousov wrote: >>> Witness patch worked for me, and I can boot multiuser in the qemu-hosted >>> system with hint.hpet.0.clock=0. Does the same hint should work for >>> amd64 ? >> Yes. >> >>> The issue is no longer critical for me due to hint, below is the dmesg >>> you asked for. Thanks. >> It is not verbose. > > Fair enough. > > hpet0: iomem 0xfed00000-0xfed003ff on acpi0 > hpet0: vendor 0x8086, rev 0x1, 100000000Hz 64bit, 3 timers, legacy route > hpet0: t0: irqs 0x00000004 (0), 64bit, periodic > hpet0: t1: irqs 0x00000004 (0), 64bit, periodic > hpet0: t2: irqs 0x00000004 (0), 64bit, periodic > Timecounter "HPET" frequency 100000000 Hz quality 900 So there are three timers without FSB interrupts support. They can use only IRQ2 (not sure if this is a good practice) and can steal IRQ0 and IRQ8 from i8254 and RTC, when "legacy route" enabled. So the only way to use all three timers without level-triggered interrupts is to completely and silently brake i8254 and RTC timers. I prefer not to do it now. Please try such a patch, it should fix QEMU panic without using hints, while HPET timers there won't be used until they implement either FSB interrupts or shareable level-triggred IRQ above 15: --- acpi_hpet.c.prev 2010-06-21 23:23:45.000000000 +0300 +++ acpi_hpet.c 2010-06-22 10:52:43.000000000 +0300 @@ -526,6 +526,7 @@ hpet_attach(device_t dev) t->irq = -2; } else #endif + if (sc->irq >= 0) t->caps |= (sc->irq << 9) | HPET_TCNF_INT_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(i), t->caps); /* Skip event timers without set up IRQ. */ -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:14:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D81E1065672; Tue, 22 Jun 2010 08:14:10 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F17188FC23; Tue, 22 Jun 2010 08:14:08 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA15216; Tue, 22 Jun 2010 11:14:06 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1OQycQ-000PYE-Fj; Tue, 22 Jun 2010 11:14:06 +0300 Message-ID: <4C2070CC.6090005@freebsd.org> Date: Tue, 22 Jun 2010 11:14:04 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100603) MIME-Version: 1.0 To: Jack F Vogel References: <201006181636.o5IGavsD011902@svn.freebsd.org> In-Reply-To: <201006181636.o5IGavsD011902@svn.freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209308 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:14:10 -0000 on 18/06/2010 19:36 Jack F Vogel said the following: > Author: jfv > Date: Fri Jun 18 16:36:57 2010 > New Revision: 209308 > URL: http://svn.freebsd.org/changeset/base/209308 > > Log: > MFC of ixgbe driver version 2.2.1 > -mostly stability fixes > > MFC to RELENG 8.1 asap > > Modified: > stable/8/sys/dev/ixgbe/ixgbe.c > stable/8/sys/dev/ixgbe/ixgbe.h > Directory Properties: > stable/8/sys/dev/ixgbe/ (props changed) Looks like this svn merge was done on sys/dev/ixgbe directory. It should have been done on sys/. This pollutes repository, You also haven't mentioned head revisions being MFC-ed. This makes life harder for others. Just in case: http://wiki.freebsd.org/SubversionPrimer/Merging -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:17:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65869106564A; Tue, 22 Jun 2010 08:17:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5428C8FC1B; Tue, 22 Jun 2010 08:17:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M8HKgL085862; Tue, 22 Jun 2010 08:17:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M8HKP4085860; Tue, 22 Jun 2010 08:17:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220817.o5M8HKP4085860@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 08:17:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209423 - stable/8/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:17:20 -0000 Author: avg Date: Tue Jun 22 08:17:20 2010 New Revision: 209423 URL: http://svn.freebsd.org/changeset/base/209423 Log: MFC r208672: g_label: fix possible NULL pointer dereference Modified: stable/8/sys/geom/label/g_label.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/geom/label/g_label.c ============================================================================== --- stable/8/sys/geom/label/g_label.c Tue Jun 22 08:05:54 2010 (r209422) +++ stable/8/sys/geom/label/g_label.c Tue Jun 22 08:17:20 2010 (r209423) @@ -203,10 +203,8 @@ g_label_destroy(struct g_geom *gp, boole pp->acr, pp->acw, pp->ace); return (EBUSY); } - } else { - G_LABEL_DEBUG(1, "Label %s removed.", - LIST_FIRST(&gp->provider)->name); - } + } else if (pp != NULL) + G_LABEL_DEBUG(1, "Label %s removed.", pp->name); g_slice_spoiled(LIST_FIRST(&gp->consumer)); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:17:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C9551065670; Tue, 22 Jun 2010 08:17:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B9DC8FC30; Tue, 22 Jun 2010 08:17:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M8Htfb086028; Tue, 22 Jun 2010 08:17:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M8Hter086026; Tue, 22 Jun 2010 08:17:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220817.o5M8Hter086026@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 08:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209424 - stable/7/sys/geom/label X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:17:55 -0000 Author: avg Date: Tue Jun 22 08:17:55 2010 New Revision: 209424 URL: http://svn.freebsd.org/changeset/base/209424 Log: MFC r208672: g_label: fix possible NULL pointer dereference Modified: stable/7/sys/geom/label/g_label.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/label/g_label.c ============================================================================== --- stable/7/sys/geom/label/g_label.c Tue Jun 22 08:17:20 2010 (r209423) +++ stable/7/sys/geom/label/g_label.c Tue Jun 22 08:17:55 2010 (r209424) @@ -202,10 +202,8 @@ g_label_destroy(struct g_geom *gp, boole pp->acr, pp->acw, pp->ace); return (EBUSY); } - } else { - G_LABEL_DEBUG(1, "Label %s removed.", - LIST_FIRST(&gp->provider)->name); - } + } else if (pp != NULL) + G_LABEL_DEBUG(1, "Label %s removed.", pp->name); g_slice_spoiled(LIST_FIRST(&gp->consumer)); return (0); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:22:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD9991065670; Tue, 22 Jun 2010 08:22:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D36C8FC1B; Tue, 22 Jun 2010 08:22:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M8MPJo087060; Tue, 22 Jun 2010 08:22:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M8MPVR087058; Tue, 22 Jun 2010 08:22:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201006220822.o5M8MPVR087058@svn.freebsd.org> From: Andriy Gapon Date: Tue, 22 Jun 2010 08: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: r209425 - head/sys/fs/udf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:22:25 -0000 Author: avg Date: Tue Jun 22 08:22:25 2010 New Revision: 209425 URL: http://svn.freebsd.org/changeset/base/209425 Log: udf_vnops: cosmetic followup to r208671 - better looking code Suggested by: jhb MFC after: 3 days Modified: head/sys/fs/udf/udf_vnops.c Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Tue Jun 22 08:17:55 2010 (r209424) +++ head/sys/fs/udf/udf_vnops.c Tue Jun 22 08:22:25 2010 (r209425) @@ -904,8 +904,8 @@ udf_readlink(struct vop_readlink_args *a vp = ap->a_vp; node = VTON(vp); len = le64toh(node->fentry->inf_len); + buf = malloc(len, M_DEVBUF, M_WAITOK); iov[0].iov_len = len; - buf = malloc(iov[0].iov_len, M_DEVBUF, M_WAITOK); iov[0].iov_base = buf; uio.uio_iov = iov; uio.uio_iovcnt = 1; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:28:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56931065674; Tue, 22 Jun 2010 08:28:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 307A08FC1D; Tue, 22 Jun 2010 08:28:08 +0000 (UTC) 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 o5M8RSZ6029110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2010 11:27:28 +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.4/8.14.4) with ESMTP id o5M8RR6A039366; Tue, 22 Jun 2010 11:27:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o5M8RRgp039365; Tue, 22 Jun 2010 11:27:27 +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: Tue, 22 Jun 2010 11:27:27 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20100622082727.GS13238@deviant.kiev.zoral.com.ua> References: <201006202133.o5KLXTG1023067@svn.freebsd.org> <20100621195838.GJ13238@deviant.kiev.zoral.com.ua> <4C1FC6C1.5060800@FreeBSD.org> <4C1FC6E1.4080001@FreeBSD.org> <20100621203419.GK13238@deviant.kiev.zoral.com.ua> <4C1FCF93.9000703@FreeBSD.org> <20100621210629.GN13238@deviant.kiev.zoral.com.ua> <4C1FD5CC.6070909@FreeBSD.org> <20100621212719.GO13238@deviant.kiev.zoral.com.ua> <4C207078.1020607@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MhDS85o8hQkNlKhq" Content-Disposition: inline In-Reply-To: <4C207078.1020607@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209371 - in head/sys: amd64/amd64 amd64/include conf dev/acpica i386/i386 i386/include isa kern pc98/cbus sys x86/isa x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:28:09 -0000 --MhDS85o8hQkNlKhq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 22, 2010 at 11:12:40AM +0300, Alexander Motin wrote: > Kostik Belousov wrote: > > On Tue, Jun 22, 2010 at 12:12:44AM +0300, Alexander Motin wrote: > >> Kostik Belousov wrote: > >>> Witness patch worked for me, and I can boot multiuser in the qemu-hos= ted > >>> system with hint.hpet.0.clock=3D0. Does the same hint should work for > >>> amd64 ? > >> Yes. > >> > >>> The issue is no longer critical for me due to hint, below is the dmesg > >>> you asked for. Thanks. > >> It is not verbose. > >=20 > > Fair enough. > >=20 > > hpet0: iomem 0xfed00000-0xfed003ff on acpi0 > > hpet0: vendor 0x8086, rev 0x1, 100000000Hz 64bit, 3 timers, legacy route > > hpet0: t0: irqs 0x00000004 (0), 64bit, periodic > > hpet0: t1: irqs 0x00000004 (0), 64bit, periodic > > hpet0: t2: irqs 0x00000004 (0), 64bit, periodic > > Timecounter "HPET" frequency 100000000 Hz quality 900 >=20 > So there are three timers without FSB interrupts support. They can use > only IRQ2 (not sure if this is a good practice) and can steal IRQ0 and > IRQ8 from i8254 and RTC, when "legacy route" enabled. So the only way to > use all three timers without level-triggered interrupts is to completely > and silently brake i8254 and RTC timers. I prefer not to do it now. >=20 > Please try such a patch, it should fix QEMU panic without using hints, > while HPET timers there won't be used until they implement either FSB > interrupts or shareable level-triggred IRQ above 15: >=20 > --- acpi_hpet.c.prev 2010-06-21 23:23:45.000000000 +0300 > +++ acpi_hpet.c 2010-06-22 10:52:43.000000000 +0300 > @@ -526,6 +526,7 @@ hpet_attach(device_t dev) > t->irq =3D -2; > } else > #endif > + if (sc->irq >=3D 0) > t->caps |=3D (sc->irq << 9) | HPET_TCNF_INT_TYPE; > bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(i), t->caps); > /* Skip event timers without set up IRQ. */ >=20 This worked as well, thank you. --MhDS85o8hQkNlKhq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkwgc+8ACgkQC3+MBN1Mb4jdKACfUrScF7iDPNAtfc/43LeDM6wJ KbgAoM9XYpktkkD+ND+u3a2E/N4mAt3j =NiGk -----END PGP SIGNATURE----- --MhDS85o8hQkNlKhq-- From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 08:58:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 884DF106566B; Tue, 22 Jun 2010 08:58:13 +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 76BB88FC19; Tue, 22 Jun 2010 08:58:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M8wDPi094992; Tue, 22 Jun 2010 08:58:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M8wDkA094991; Tue, 22 Jun 2010 08:58:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006220858.o5M8wDkA094991@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Jun 2010 08:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209426 - stable/8/share/examples/kld/syscall/test X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 08:58:13 -0000 Author: kib Date: Tue Jun 22 08:58:13 2010 New Revision: 209426 URL: http://svn.freebsd.org/changeset/base/209426 Log: MFC r209199: Fix the syscall module name after r205320. Modified: stable/8/share/examples/kld/syscall/test/call.c Directory Properties: stable/8/share/examples/kld/syscall/ (props changed) Modified: stable/8/share/examples/kld/syscall/test/call.c ============================================================================== --- stable/8/share/examples/kld/syscall/test/call.c Tue Jun 22 08:22:25 2010 (r209425) +++ stable/8/share/examples/kld/syscall/test/call.c Tue Jun 22 08:58:13 2010 (r209426) @@ -48,7 +48,7 @@ main(int argc, char **argv) struct module_stat stat; stat.version = sizeof(stat); - modstat(modfind("syscall"), &stat); + modstat(modfind("sys/syscall"), &stat); syscall_num = stat.data.intval; return syscall (syscall_num); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 09:45:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A85B4106566C; Tue, 22 Jun 2010 09:45:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D288FC14; Tue, 22 Jun 2010 09:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5M9jKDa005554; Tue, 22 Jun 2010 09:45:20 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5M9jKos005552; Tue, 22 Jun 2010 09:45:20 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006220945.o5M9jKos005552@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 22 Jun 2010 09:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209427 - stable/8/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 09:45:20 -0000 Author: ae Date: Tue Jun 22 09:45:20 2010 New Revision: 209427 URL: http://svn.freebsd.org/changeset/base/209427 Log: MFC r198235: Clean up markup (mainly). Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Tue Jun 22 08:58:13 2010 (r209426) +++ stable/8/sbin/geom/class/part/gpart.8 Tue Jun 22 09:45:20 2010 (r209427) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2010 +.Dd June 22, 2010 .Dt GPART 8 .Os .Sh NAME @@ -43,23 +43,37 @@ lines in your kernel configuration file: .Cd "options GEOM_PART_VTOC8" .Ed .Pp -The GEOM_PART_APM option adds support for the Apple Partition Map (APM) +The +.Dv GEOM_PART_APM +option adds support for the Apple Partition Map (APM) found on Apple Macintosh computers. -The GEOM_PART_BSD option adds support for the traditional BSD disklabel. -The GEOM_PART_GPT option adds support for the GUID Partition Table (GPT) +The +.Dv GEOM_PART_BSD +option adds support for the traditional +.Bx +disklabel. +The +.Dv GEOM_PART_GPT +option adds support for the GUID Partition Table (GPT) found on Intel Itanium computers and Intel-based Macintosh computers. -The GEOM_PART_MBR option adds support for the Master Boot Record (MBR) +The +.Dv GEOM_PART_MBR +option adds support for the Master Boot Record (MBR) found on PCs and used on many removable media. -The GEOM_PART_PC98 option adds support for the MBR variant as used on +The +.Dv GEOM_PART_PC98 +option adds support for the MBR variant as used on NEC PC-98 computers. -The GEOM_PART_VTOC8 option adds support for Sun's SMI VTOC8 label as +The +.Dv GEOM_PART_VTOC8 +option adds support for Sun's SMI VTOC8 label as found on computers based on .Tn SPARC64 and .Tn UltraSPARC. .Pp Usage of the -.Xr gpart 8 +.Ns Nm utility: .Pp .\" ==== ADD ==== @@ -126,7 +140,7 @@ utility: .Ar geom .\" ==== UNSET ==== .Nm -.Cm unset +.Cm unset .Fl a Ar attrib .Fl i Ar index .Op Fl f Ar flags @@ -137,7 +151,7 @@ The .Nm utility is used to partition GEOM providers, normally disks. The first argument of which is the action to be taken: -.Bl -tag -width ".Cm wwwwwww" +.Bl -tag -width ".Cm bootcode" .\" ==== ADD ==== .It Cm add Add a new partition to the partitioning scheme given by @@ -151,13 +165,15 @@ option. The type of the partition is given by the .Fl t Ar type option. -Partition types are discussed in the section entitled "Partition Types". +Partition types are discussed below in the section entitled +.Sx "PARTITION TYPES" . .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl i Ar index The index in the partition table at which the new partition is to be -placed. The index determines the name of the device special file used +placed. +The index determines the name of the device special file used to represent the partition. .It Fl l Ar label The label attached to the partition. @@ -165,7 +181,9 @@ This option is only valid when used on p partition labels. .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== BOOTCODE ==== @@ -188,7 +206,7 @@ The option specifies a file that contains the bootstrap code. The contents and size of the file are determined by the partitioning scheme. -For the MBR scheme, it's a 512 byte file of which the first 446 bytes +For the MBR scheme, it is a 512 byte file of which the first 446 bytes are installed as bootstrap code. The .Fl p Ar partcode @@ -205,11 +223,13 @@ option is omitted, the bootstrap code is partitions. The size of the file must be smaller than the size of the partition. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== COMMIT ==== @@ -238,8 +258,8 @@ option determines the scheme to use. The kernel needs to have support for a particular scheme before that scheme can be used to partition a disk. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl n Ar entries The number of entries in the partition table. Every partitioning scheme has a minimum and a maximum number of entries @@ -251,7 +271,9 @@ By default, partition tables are created entries. .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== DELETE ==== @@ -263,11 +285,13 @@ and further identified by the option. The partition cannot be actively used by the kernel. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== DESTROY ==== @@ -275,11 +299,13 @@ about its use. Destroy the partitioning scheme as implemented by geom .Ar geom . .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== MODIFY ==== @@ -299,22 +325,26 @@ option. Not all partitioning schemes support labels and it is invalid to try to change a partition label in such cases. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== SET ==== .It Cm set Set the named attribute on the partition entry. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .\" ==== SHOW ==== @@ -323,7 +353,8 @@ Show the current partition information o or all geoms if none are specified. .\" ==== UNDO ==== .It Cm undo -Revert any pending changes. +Revert any pending changes for geom +.Ar geom . This action is the opposite of the .Cm commit action and can be used to undo any changes that have not been committed. @@ -331,11 +362,13 @@ action and can be used to undo any chang .It Cm unset Clear the named attribute on the partition entry. .Pp -Addition options include: -.Bl -tag -width ".Fl w Ar wwwwwww" +Additional options include: +.Bl -tag -width 10n .It Fl f Ar flags Additional operational flags. -See the section entitled "Operational flags" below for a discussion +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion about its use. .El .El @@ -347,47 +380,82 @@ utility uses symbolic names for common p user needs to know what the partitioning scheme in question is and what the actual number or identification needs to be used for a particular type. -the +The .Nm utility also allows the user to specify scheme-specific partition types -for partition types that don't have symbol names. +for partition types that do not have symbol names. The symbolic names currently understood are: -.Bl -tag -width "wwwwwwwwwwwww" -.It efi +.Bl -tag -width ".Cm freebsd-vinum" +.It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). In such cases, the GPT partitioning scheme is being used and the actual partition type for the system partition can also be specified as -"!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab". -.It freebsd -A FreeBSD partition that uses the BSD disklabel to sub-divide the +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . +.It Cm freebsd +A +.Fx +partition that uses the +.Bx +disklabel to sub-divide the partition into file systems. This is a legacy partition type and should not be used for the APM or GPT schemes. -The scheme-specific types are "!165" for MBR, "!FreeBSD" for APM, and -"!516e7cb4-6ecf-11d6-8ff8-00022d09712b" for GPT. -.It freebsd-boot -A FreeBSD partition dedicated to bootstrap code. -The scheme-specific type is "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT. -.It freebsd-swap -A FreeBSD partition dedicated to swap space. -The scheme-specific types are "!FreeBSD-swap" for APM, -"!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0901 for VTOC8. -.It freebsd-ufs -A FreeBSD partition that contains a UFS or UFS2 file system. -the scheme-specific types are "!FreeBSD-UFS" for APM, -"!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0902 for VTOC8. -.It freebsd-vinum -A FreeBSD partition that contains a Vinum volume. -The scheme-specific types are "!FreeBSD-Vinum" for APM, -"!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag 0x0903 for VTOC8. -.It freebsd-zfs -A FreeBSD partition that contains a ZFS volume. -The scheme-specific types are "!FreeBSD-ZFS" for APM, -"!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. -.It mbr +The scheme-specific types are +.Qq Li "!165" +for MBR, +.Qq Li "!FreeBSD" +for APM, and +.Qq Li "!516e7cb4-6ecf-11d6-8ff8-00022d09712b" +for GPT. +.It Cm freebsd-boot +A +.Fx +partition dedicated to bootstrap code. +The scheme-specific type is +.Qq Li "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" +for GPT. +.It Cm freebsd-swap +A +.Fx +partition dedicated to swap space. +The scheme-specific types are +.Qq Li "!FreeBSD-swap" +for APM, +.Qq Li "!516e7cb5-6ecf-11d6-8ff8-00022d09712b" +for GPT, and tag 0x0901 for VTOC8. +.It Cm freebsd-ufs +A +.Fx +partition that contains a UFS or UFS2 file system. +The scheme-specific types are +.Qq Li "!FreeBSD-UFS" +for APM, +.Qq Li "!516e7cb6-6ecf-11d6-8ff8-00022d09712b" +for GPT, and tag 0x0902 for VTOC8. +.It Cm freebsd-vinum +A +.Fx +partition that contains a Vinum volume. +The scheme-specific types are +.Qq Li "!FreeBSD-Vinum" +for APM, +.Qq Li "!516e7cb8-6ecf-11d6-8ff8-00022d09712b" +for GPT, and tag 0x0903 for VTOC8. +.It Cm freebsd-zfs +A +.Fx +partition that contains a ZFS volume. +The scheme-specific types are +.Qq Li "!FreeBSD-ZFS" +for APM, +.Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" + for GPT, and 0x0904 for VTOC8. +.It Cm mbr A partition that is sub-partitioned by a master boot record (MBR). -This type is known as "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. +This type is known as +.Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" +by GPT. .El .Sh OPERATIONAL FLAGS Actions other than the @@ -400,10 +468,12 @@ option. This option is used to specify action-specific operational flags. By default, the .Nm -utility defines the 'C' flag so that the action is immediately +utility defines the +.Ql C +flag so that the action is immediately committed. The user can specify -.Fl f Ar x +.Dq Fl f Cm x to have the action result in a pending change that can later, with other pending changes, be committed as a single compound change with the @@ -426,24 +496,26 @@ Embed GPT bootstrap code into protective .Ed .Pp Create a dedicated -.Pa freebsd-boot -partition that can boot FreeBSD from a -.Pa freebsd-ufs +.Cm freebsd-boot +partition that can boot +.Fx +from a +.Cm freebsd-ufs partition, and install bootstrap code into it. This partition must be larger than .Pa /boot/gptboot , or the GPT boot you are planning to write. A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but lets use 128 blocks (64 KB) here in +booting from UFS but let's use 128 blocks (64 KB) here in this example, in order to reserve some space for potential -future need (e.g. from a ZFS partition). +future need (e.g.\& from a ZFS partition). .Bd -literal -offset indent /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp Create a 512MB-sized -.Pa freebsd-ufs +.Cm freebsd-ufs partition that would contain UFS where the system boots from. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 @@ -468,7 +540,7 @@ After having created all required partit .Ed .Sh SEE ALSO .Xr geom 4 , -.Xr geom 8 , +.Xr geom 8 .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 10:45:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23B7E106564A; Tue, 22 Jun 2010 10:45:36 +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 1327C8FC21; Tue, 22 Jun 2010 10:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MAjZps020500; Tue, 22 Jun 2010 10:45:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MAjZ4q020498; Tue, 22 Jun 2010 10:45:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006221045.o5MAjZ4q020498@svn.freebsd.org> From: Robert Watson Date: Tue, 22 Jun 2010 10:45:35 +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: r209428 - head/tools/tools/netrate/tcpp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 10:45:36 -0000 Author: rwatson Date: Tue Jun 22 10:45:35 2010 New Revision: 209428 URL: http://svn.freebsd.org/changeset/base/209428 Log: Revised tuning advice for tcpp benchmarking: do it in loader.conf, and tweak more TCP/stack parameters. Sponsored by: Juniper Networks MFC after: 1 week Modified: head/tools/tools/netrate/tcpp/README Modified: head/tools/tools/netrate/tcpp/README ============================================================================== --- head/tools/tools/netrate/tcpp/README Tue Jun 22 09:45:20 2010 (r209427) +++ head/tools/tools/netrate/tcpp/README Tue Jun 22 10:45:35 2010 (r209428) @@ -80,12 +80,20 @@ mixes. Configuration Notes ------------------- -In my testing, I use sysctl.conf entries of: +In my testing, I use loader.conf entries of: -net.inet.ip.portrange.first=100 kern.ipc.maxsockets=1000000 net.inet.tcp.maxtcptw=3000000 kern.ipc.somaxconn=49152 +kern.ipc.nmbjumbo16=262144 +kern.ipc.nmbjumbo9=262144 +kern.ipc.nmbjumbop=262144 +kern.ipc.nmbclusters=262144 +net.inet.tcp.syncache.cachelimit=65536 +net.inet.tcp.syncache.bucketlimit=512 + +# May be useful if you can't use multiple IP addresses +net.inet.ip.portrange.first=100 # For running !multiq, do this before loading the driver: kenv hw.cxgb.singleq="1" From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 10:46:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A24A106564A; Tue, 22 Jun 2010 10:46:58 +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 19B768FC12; Tue, 22 Jun 2010 10:46:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MAkvKN020840; Tue, 22 Jun 2010 10:46:57 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MAkvIq020837; Tue, 22 Jun 2010 10:46:57 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201006221046.o5MAkvIq020837@svn.freebsd.org> From: Robert Watson Date: Tue, 22 Jun 2010 10: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: r209429 - head/tools/tools/netrate/tcpp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 10:46:58 -0000 Author: rwatson Date: Tue Jun 22 10:46:57 2010 New Revision: 209429 URL: http://svn.freebsd.org/changeset/base/209429 Log: Add TCP scalability testing wrapper scripts for tcpp. Sponsored by: Juniper Networks MFC after: 1 week Added: head/tools/tools/netrate/tcpp/parallelism.csh (contents, props changed) head/tools/tools/netrate/tcpp/runit.pl (contents, props changed) Added: head/tools/tools/netrate/tcpp/parallelism.csh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netrate/tcpp/parallelism.csh Tue Jun 22 10:46:57 2010 (r209429) @@ -0,0 +1,28 @@ +#!/bin/csh +# +# $FreeBSD$ +# +# Run tcpp -s -p 8 on the server, then this on the client. +# +# Note awkwardly hard-coded IP address below. +# +# Accepts two arguments: [filename] [csvprefix] +# + +set totalbytes=4800000 # Bytes per connection +set cores=8 +set trials=6 +set ptcps=24 # Max TCPs concurrently +set ntcps=240 # Total TCPs over test +set nips=4 # Number of local IP addresses to use +set baseip=192.168.100.200 # First IP address to use + +foreach core (`jot $cores`) + foreach trial (`jot $trials`) + set mflag=`echo $ptcps / $core | bc` + set tflag=`echo $ntcps / $core | bc` + echo -n $2,${core},${trial}, >> $1 + ./tcpp -c 192.168.100.102 -p $core -b $totalbytes -m $mflag \ + -t $tflag -M $nips -l $baseip >> $1 + end +end Added: head/tools/tools/netrate/tcpp/runit.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/netrate/tcpp/runit.pl Tue Jun 22 10:46:57 2010 (r209429) @@ -0,0 +1,64 @@ +#!/usr/bin/perl +# +# $FreeBSD$ +# + +if ($#ARGV != 0) { + print "runit.pl kernelname\n"; + exit(-1); +} + +$tcpp_dir = "/rwatson/svn/base/head/tools/tools/netrate/tcpp"; + +($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); +$mon++; +$year += 1900; +$date = sprintf("%04d%02d%02d", $year, $mon, $mday); + +$kernel = $ARGV[0]; +$outfile = $date."_".$kernel.".csv"; +unlink($outfile); +open(OUTFILE, ">".$outfile) || die $outfile; +print OUTFILE "# $kernel $date\n"; +print OUTFILE "# hydra1: ".`ssh root\@hydra1 uname -a`."\n"; +print OUTFILE "# hydra2: ".`ssh root\@hydra2 uname -a`."\n"; +print OUTFILE "#\n"; +print OUTFILE "kernel,tso,lro,mtu,cores,trial,"; +print OUTFILE "bytes,seconds,conns,bandwidth,user,nice,sys,intr,idle\n"; +close(OUTFILE); + +system("ssh root\@hydra1 killall tcpp"); +system("ssh root\@hydra2 killall tcpp"); +sleep(1); +system("ssh root\@hydra2 ${tcpp_dir}/tcpp -s -p 8&"); +sleep(1); + +sub test { + my ($kernel, $tso, $lro, $mtu) = @_; + + $prefix = "$kernel,$tso,$lro,$mtu"; + print "Configuring $prefix\n"; + + system("ssh root\@hydra1 ifconfig cxgb0 $tso $lro mtu $mtu"); + + system("ssh root\@hydra2 ifconfig cxgb0 $tso $lro mtu $mtu"); + + print "Running $prefix\n"; + system("ssh root\@hydra1 '(cd $tcpp_dir ; csh parallelism.csh ". + "$outfile $prefix)'"); +} + +# Frobbing MTU requires resetting the host cache, which we don't do, +# so don't frob MTU. +@mtu_options = ("1500"); +@tso_options = ("tso", "-tso"); +@lro_options = ("lro", "-lro"); + +foreach $mtu (@mtu_options) { + foreach $tso (@tso_options) { + foreach $lro (@lro_options) { + sleep(5); + test($kernel, $tso, $lro, $mtu); + } + } +} From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 15:01:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EE01065672; Tue, 22 Jun 2010 15:01:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF7198FC12; Tue, 22 Jun 2010 15:01:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MF1Nx4076824; Tue, 22 Jun 2010 15:01:23 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MF1NMM076822; Tue, 22 Jun 2010 15:01:23 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006221501.o5MF1NMM076822@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 Jun 2010 15:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209430 - stable/8/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 15:01:23 -0000 Author: des Date: Tue Jun 22 15:01:23 2010 New Revision: 209430 URL: http://svn.freebsd.org/changeset/base/209430 Log: merge r196650 (check that tty != NULL, prevents segfault on session close) Modified: stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c Directory Properties: stable/8/lib/libpam/ (props changed) Modified: stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c Tue Jun 22 10:46:57 2010 (r209429) +++ stable/8/lib/libpam/modules/pam_lastlog/pam_lastlog.c Tue Jun 22 15:01:23 2010 (r209430) @@ -183,6 +183,11 @@ pam_sm_close_session(pam_handle_t *pamh pam_err = pam_get_item(pamh, PAM_TTY, (const void **)&tty); if (pam_err != PAM_SUCCESS) goto err; + if (tty == NULL) { + PAM_LOG("No PAM_TTY"); + pam_err = PAM_SERVICE_ERR; + goto err; + } if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0) tty = (const char *)tty + strlen(_PATH_DEV); if (*(const char *)tty == '\0') From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 16:10:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969CA106564A; Tue, 22 Jun 2010 16:10:48 +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 862988FC08; Tue, 22 Jun 2010 16:10:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MGAm0r092120; Tue, 22 Jun 2010 16:10:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MGAmSo092118; Tue, 22 Jun 2010 16:10:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221610.o5MGAmSo092118@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 16:10: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: r209431 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 16:10:48 -0000 Author: mav Date: Tue Jun 22 16:10:48 2010 New Revision: 209431 URL: http://svn.freebsd.org/changeset/base/209431 Log: Do not set level-triggered interrupt mode if we are not going to use it. This fixes QEMU crash due to unsupported level-triggered HPET interrupts. Reported by: kib@ Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Jun 22 15:01:23 2010 (r209430) +++ head/sys/dev/acpica/acpi_hpet.c Tue Jun 22 16:10:48 2010 (r209431) @@ -526,6 +526,7 @@ hpet_attach(device_t dev) t->irq = -2; } else #endif + if (sc->irq >= 0 && (t->vectors & (1 << sc->irq))) t->caps |= (sc->irq << 9) | HPET_TCNF_INT_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(i), t->caps); /* Skip event timers without set up IRQ. */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 16:20:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BCF8106566C; Tue, 22 Jun 2010 16:20:11 +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 D56A68FC14; Tue, 22 Jun 2010 16:20:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MGKAIG094249; Tue, 22 Jun 2010 16:20:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MGKAfq094244; Tue, 22 Jun 2010 16:20:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221620.o5MGKAfq094244@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 16:20:10 +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: r209432 - in head/sys: amd64/amd64 conf i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 16:20:11 -0000 Author: mav Date: Tue Jun 22 16:20:10 2010 New Revision: 209432 URL: http://svn.freebsd.org/changeset/base/209432 Log: Some style fixes for r209371. Submitted by: jhb@ Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/i386/mp_machdep.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Tue Jun 22 16:10:48 2010 (r209431) +++ head/sys/amd64/amd64/mp_machdep.c Tue Jun 22 16:20:10 2010 (r209432) @@ -706,9 +706,11 @@ init_secondary(void) load_es(_udatasel); load_fs(_ufssel); mtx_unlock_spin(&ap_boot_mtx); - /* wait until all the AP's are up */ + + /* Wait until all the AP's are up. */ while (smp_started == 0) ia32_pause(); + /* Start per-CPU event timers. */ cpu_initclocks_ap(); Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jun 22 16:10:48 2010 (r209431) +++ head/sys/conf/files.amd64 Tue Jun 22 16:20:10 2010 (r209432) @@ -297,7 +297,6 @@ x86/cpufreq/p4tcc.c optional cpufreq x86/isa/atpic.c optional atpic isa x86/isa/atrtc.c standard x86/isa/clock.c standard -x86/x86/timeevents.c standard x86/isa/elcr.c standard x86/isa/isa.c standard x86/isa/isa_dma.c standard @@ -307,3 +306,4 @@ x86/x86/io_apic.c standard x86/x86/local_apic.c standard x86/x86/mca.c standard x86/x86/msi.c optional pci +x86/x86/timeevents.c standard Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Jun 22 16:10:48 2010 (r209431) +++ head/sys/conf/files.i386 Tue Jun 22 16:20:10 2010 (r209432) @@ -381,7 +381,6 @@ x86/cpufreq/smist.c optional cpufreq x86/isa/atpic.c optional atpic x86/isa/atrtc.c optional atpic x86/isa/clock.c optional native -x86/x86/timeevents.c standard x86/isa/elcr.c standard x86/isa/isa.c optional isa x86/isa/isa_dma.c optional isa @@ -391,3 +390,4 @@ x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard x86/x86/msi.c optional apic pci +x86/x86/timeevents.c standard Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Tue Jun 22 16:10:48 2010 (r209431) +++ head/sys/i386/i386/mp_machdep.c Tue Jun 22 16:20:10 2010 (r209432) @@ -728,13 +728,15 @@ init_secondary(void) } mtx_unlock_spin(&ap_boot_mtx); - /* wait until all the AP's are up */ + + /* Wait until all the AP's are up. */ while (smp_started == 0) ia32_pause(); + /* Start per-CPU event timers. */ cpu_initclocks_ap(); - /* enter the scheduler */ + /* Enter the scheduler. */ sched_throw(NULL); panic("scheduler returned us to %s", __func__); From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 17:45:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B866D106566B; Tue, 22 Jun 2010 17:45:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6DB98FC1B; Tue, 22 Jun 2010 17:45:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MHjLOZ013170; Tue, 22 Jun 2010 17:45:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MHjLGu013167; Tue, 22 Jun 2010 17:45:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006221745.o5MHjLGu013167@svn.freebsd.org> From: Michael Tuexen Date: Tue, 22 Jun 2010 17:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209433 - releng/8.1/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 17:45:21 -0000 Author: tuexen Date: Tue Jun 22 17:45:21 2010 New Revision: 209433 URL: http://svn.freebsd.org/changeset/base/209433 Log: MFC 209264 * Fix a bug where the length of the ASCONF-ACK was calculated wrong due to using an uninitialized variable. * Fix a bug where a NULL pointer was dereferenced when interfaces come and go at a high rate. * Fix a bug where inps where not deregistered from iterators. * Fix a race condition in freeing an association. * Fix a refcount problem related to the iterator. Each of the above bug results in a panic. It shows up when interfaces come and go at a high rate. Approved by: re Modified: releng/8.1/sys/netinet/sctp_asconf.c releng/8.1/sys/netinet/sctp_pcb.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/netinet/sctp_asconf.c ============================================================================== --- releng/8.1/sys/netinet/sctp_asconf.c Tue Jun 22 16:20:10 2010 (r209432) +++ releng/8.1/sys/netinet/sctp_asconf.c Tue Jun 22 17:45:21 2010 (r209433) @@ -826,6 +826,7 @@ send_reply: ack->serial_number = serial_num; ack->last_sent_to = NULL; ack->data = m_ack; + ack->len = 0; n = m_ack; while (n) { ack->len += SCTP_BUF_LEN(n); @@ -1025,7 +1026,8 @@ sctp_asconf_nets_cleanup(struct sctp_tcb * address. */ if (SCTP_ROUTE_HAS_VALID_IFN(&net->ro) && - SCTP_GET_IF_INDEX_FROM_ROUTE(&net->ro) != ifn->ifn_index) { + ((ifn == NULL) || + (SCTP_GET_IF_INDEX_FROM_ROUTE(&net->ro) != ifn->ifn_index))) { /* clear any cached route */ RTFREE(net->ro.ro_rt); net->ro.ro_rt = NULL; Modified: releng/8.1/sys/netinet/sctp_pcb.c ============================================================================== --- releng/8.1/sys/netinet/sctp_pcb.c Tue Jun 22 16:20:10 2010 (r209432) +++ releng/8.1/sys/netinet/sctp_pcb.c Tue Jun 22 17:45:21 2010 (r209433) @@ -3074,6 +3074,9 @@ sctp_iterator_inp_being_freed(struct sct SCTP_FREE(it, SCTP_M_ITER); } else { it->inp = LIST_NEXT(it->inp, sctp_list); + if (it->inp) { + SCTP_INP_INCR_REF(it->inp); + } } /* * When its put in the refcnt is incremented so decr @@ -3114,17 +3117,10 @@ sctp_inpcb_free(struct sctp_inpcb *inp, #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 0); #endif - if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { - /* - * Once we are in we can remove the flag from = 1 is only - * passed from the actual closing routines that are called - * via the sockets layer. - */ - SCTP_ITERATOR_LOCK(); - /* mark any iterators on the list or being processed */ - sctp_iterator_inp_being_freed(inp); - SCTP_ITERATOR_UNLOCK(); - } + SCTP_ITERATOR_LOCK(); + /* mark any iterators on the list or being processed */ + sctp_iterator_inp_being_freed(inp); + SCTP_ITERATOR_UNLOCK(); so = inp->sctp_socket; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { /* been here before.. eeks.. get out of here */ @@ -4637,7 +4633,6 @@ sctp_free_assoc(struct sctp_inpcb *inp, atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); - SCTP_INP_INFO_WLOCK(); SCTP_INP_WLOCK(inp); SCTP_TCB_LOCK(stcb); @@ -4680,6 +4675,16 @@ sctp_free_assoc(struct sctp_inpcb *inp, if (from_inpcbfree == SCTP_NORMAL_PROC) { atomic_add_int(&stcb->asoc.refcnt, -1); } + if (stcb->asoc.refcnt) { + stcb->asoc.state &= ~SCTP_STATE_IN_ACCEPT_QUEUE; + sctp_timer_start(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL); + if (from_inpcbfree == SCTP_NORMAL_PROC) { + SCTP_INP_INFO_WUNLOCK(); + SCTP_INP_WUNLOCK(inp); + } + SCTP_TCB_UNLOCK(stcb); + return (0); + } asoc->state = 0; if (inp->sctp_tcbhash) { LIST_REMOVE(stcb, sctp_tcbhash); From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 18:24:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 057191065670; Tue, 22 Jun 2010 18:24:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7E938FC0A; Tue, 22 Jun 2010 18:24:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MIOQs9022024; Tue, 22 Jun 2010 18:24:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MIOQCi022023; Tue, 22 Jun 2010 18:24:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006221824.o5MIOQCi022023@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 22 Jun 2010 18:24:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209434 - stable/8/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 18:24:27 -0000 Author: ae Date: Tue Jun 22 18:24:26 2010 New Revision: 209434 URL: http://svn.freebsd.org/changeset/base/209434 Log: MFC r198478 (by lulf): - Initialize variable in order to avoid GCC warning and enable WARNS=6. PR: bin/139970 Submitted by: Ulrich Spц╤rlein Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/Makefile stable/8/sbin/geom/class/part/geom_part.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/Makefile ============================================================================== --- stable/8/sbin/geom/class/part/Makefile Tue Jun 22 17:45:21 2010 (r209433) +++ stable/8/sbin/geom/class/part/Makefile Tue Jun 22 18:24:26 2010 (r209434) @@ -6,6 +6,4 @@ CLASS= part LDADD= -lutil -WARNS?= 4 - .include Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Tue Jun 22 17:45:21 2010 (r209433) +++ stable/8/sbin/geom/class/part/geom_part.c Tue Jun 22 18:24:26 2010 (r209434) @@ -206,6 +206,7 @@ find_provider(struct ggeom *gp, unsigned unsigned long long sector, bestsector; bestpp = NULL; + bestsector = 0; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "start"); if (s == NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 19:22:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B851065673; Tue, 22 Jun 2010 19:22:34 +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 821908FC15; Tue, 22 Jun 2010 19:22:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MJMYwD035006; Tue, 22 Jun 2010 19:22:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MJMY0c035004; Tue, 22 Jun 2010 19:22:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221922.o5MJMY0c035004@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 19:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209438 - stable/8/sys/dev/hptiop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 19:22:34 -0000 Author: mav Date: Tue Jun 22 19:22:34 2010 New Revision: 209438 URL: http://svn.freebsd.org/changeset/base/209438 Log: MFC r209340: Report transport type in XPT_PATH_INQ. PR: i386/147929 Modified: stable/8/sys/dev/hptiop/hptiop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Tue Jun 22 19:17:57 2010 (r209437) +++ stable/8/sys/dev/hptiop/hptiop.c Tue Jun 22 19:22:34 2010 (r209438) @@ -1823,6 +1823,10 @@ scsi_done: strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 19:24:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6822E106564A; Tue, 22 Jun 2010 19:24: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 56DE88FC1D; Tue, 22 Jun 2010 19:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MJO8hM035429; Tue, 22 Jun 2010 19:24:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MJO8Bd035396; Tue, 22 Jun 2010 19:24:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221924.o5MJO8Bd035396@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 19:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209439 - stable/8/sys/dev/hptmv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 19:24:08 -0000 Author: mav Date: Tue Jun 22 19:24:07 2010 New Revision: 209439 URL: http://svn.freebsd.org/changeset/base/209439 Log: MFC r209341: Report transport type in XPT_PATH_INQ. Modified: stable/8/sys/dev/hptmv/entry.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/hptmv/entry.c ============================================================================== --- stable/8/sys/dev/hptmv/entry.c Tue Jun 22 19:22:34 2010 (r209438) +++ stable/8/sys/dev/hptmv/entry.c Tue Jun 22 19:24:07 2010 (r209439) @@ -2414,6 +2414,10 @@ hpt_action(struct cam_sim *sim, union cc strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 19:42:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2C2106567E; Tue, 22 Jun 2010 19:42:28 +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 8B36A8FC16; Tue, 22 Jun 2010 19:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MJgSQm039509; Tue, 22 Jun 2010 19:42:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MJgSHX039505; Tue, 22 Jun 2010 19:42:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006221942.o5MJgSHX039505@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Jun 2010 19:42: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: r209440 - in head/sys: dev/acpica x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 19:42:28 -0000 Author: mav Date: Tue Jun 22 19:42:27 2010 New Revision: 209440 URL: http://svn.freebsd.org/changeset/base/209440 Log: Add "legacy route" support to HPET driver. When enabled, this mode makes HPET to steal IRQ0 from i8254 and IRQ8 from RTC timers. It can be suitable for HPETs without FSB interrupts support, as it gives them two unshared IRQs. It allows them to provide one per-CPU event timer on dual-CPU system, that should be suitable for further tickless kernels. To enable it, such lines may be added to /boot/loader.conf: hint.atrtc.0.clock=0 hint.attimer.0.clock=0 hint.hpet.0.legacy_route=1 Modified: head/sys/dev/acpica/acpi_hpet.c head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Jun 22 19:24:07 2010 (r209439) +++ head/sys/dev/acpica/acpi_hpet.c Tue Jun 22 19:42:27 2010 (r209440) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Poul-Henning Kamp + * Copyright (c) 2010 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -72,11 +73,13 @@ struct hpet_softc { int intr_rid; int irq; int useirq; + int legacy_route; struct resource *mem_res; struct resource *intr_res; void *intr_handle; ACPI_HANDLE handle; uint64_t freq; + uint32_t caps; struct timecounter tc; struct hpet_timer { struct eventtimer et; @@ -118,7 +121,10 @@ hpet_enable(struct hpet_softc *sc) uint32_t val; val = bus_read_4(sc->mem_res, HPET_CONFIG); - val &= ~HPET_CNF_LEG_RT; + if (sc->legacy_route) + val |= HPET_CNF_LEG_RT; + else + val &= ~HPET_CNF_LEG_RT; val |= HPET_CNF_ENABLE; bus_write_4(sc->mem_res, HPET_CONFIG, val); } @@ -352,10 +358,10 @@ hpet_attach(device_t dev) } sc->freq = (1000000000000000LL + val / 2) / val; - val = bus_read_4(sc->mem_res, HPET_CAPABILITIES); - vendor = (val & HPET_CAP_VENDOR_ID) >> 16; - rev = val & HPET_CAP_REV_ID; - num_timers = 1 + ((val & HPET_CAP_NUM_TIM) >> 8); + sc->caps = bus_read_4(sc->mem_res, HPET_CAPABILITIES); + vendor = (sc->caps & HPET_CAP_VENDOR_ID) >> 16; + rev = sc->caps & HPET_CAP_REV_ID; + num_timers = 1 + ((sc->caps & HPET_CAP_NUM_TIM) >> 8); /* * ATI/AMD violates IA-PC HPET (High Precision Event Timers) * Specification and provides an off by one number @@ -368,11 +374,11 @@ hpet_attach(device_t dev) if (bootverbose) { device_printf(dev, "vendor 0x%x, rev 0x%x, %jdHz%s, %d timers,%s\n", - vendor, rev, - sc->freq, (val & HPET_CAP_COUNT_SIZE) ? " 64bit" : "", - num_timers, (val & HPET_CAP_LEG_RT) ? " legacy route" : ""); + vendor, rev, sc->freq, + (sc->caps & HPET_CAP_COUNT_SIZE) ? " 64bit" : "", + num_timers, + (sc->caps & HPET_CAP_LEG_RT) ? " legacy route" : ""); } - num_msi = 0; for (i = 0; i < num_timers; i++) { t = &sc->t[i]; t->sc = sc; @@ -391,10 +397,6 @@ hpet_attach(device_t dev) (t->caps & HPET_TCAP_SIZE) ? ", 64bit" : "", (t->caps & HPET_TCAP_PER_INT) ? ", periodic" : ""); } -#ifdef DEV_APIC - if (t->caps & HPET_TCAP_FSB_INT_DEL) - num_msi++; -#endif } if (testenv("debug.acpi.hpet_test")) hpet_test(sc); @@ -425,10 +427,20 @@ hpet_attach(device_t dev) if (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) == 0 && i == 0) return (0); - num_percpu_et = min(num_msi / mp_ncpus, 2); - num_percpu_t = num_percpu_et * mp_ncpus; - cur_cpu = CPU_FIRST(); - pcpu_master = 0; + + /* Check whether we can and want legacy routing. */ + sc->legacy_route = 0; + resource_int_value(device_get_name(dev), device_get_unit(dev), + "legacy_route", &sc->legacy_route); + if ((sc->caps & HPET_CAP_LEG_RT) == 0) + sc->legacy_route = 0; + if (sc->legacy_route) { + sc->t[0].vectors = 0; + sc->t[1].vectors = 0; + } + + num_msi = 0; + sc->useirq = 0; /* Find common legacy IRQ vectors for all timers. */ cvectors = 0xffff0000; /* @@ -440,47 +452,67 @@ hpet_attach(device_t dev) */ if (vendor == HPET_VENDID_AMD) cvectors = 0x00000000; - sc->useirq = 0; for (i = 0; i < num_timers; i++) { t = &sc->t[i]; + if (sc->legacy_route && i < 2) + t->irq = (i == 0) ? 0 : 8; #ifdef DEV_APIC - if (t->caps & HPET_TCAP_FSB_INT_DEL) { + else if (t->caps & HPET_TCAP_FSB_INT_DEL) { if ((j = PCIB_ALLOC_MSIX( device_get_parent(device_get_parent(dev)), dev, &t->irq))) { device_printf(dev, - "Can't allocate interrupt: %d.\n", j); - } else if (!(t->intr_res = + "Can't allocate interrupt for t%d.\n", j); + } + } +#endif + if (t->irq >= 0) { + if (!(t->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &t->intr_rid, - t->irq, t->irq, 1, RF_SHAREABLE | RF_ACTIVE))) { - device_printf(dev, "Can't map interrupt.\n"); + t->irq, t->irq, 1, RF_ACTIVE))) { + t->irq = -1; + device_printf(dev, + "Can't map interrupt for t%d.\n", i); } else if ((bus_setup_intr(dev, t->intr_res, INTR_MPSAFE | INTR_TYPE_CLK, (driver_filter_t *)hpet_intr_single, NULL, t, &t->intr_handle))) { - device_printf(dev, "Can't setup interrupt.\n"); + t->irq = -1; + device_printf(dev, + "Can't setup interrupt for t%d.\n", i); } else { bus_describe_intr(dev, t->intr_res, t->intr_handle, "t%d", i); num_msi++; - if (num_percpu_t > 0) { - if (cur_cpu == CPU_FIRST()) - pcpu_master = i; - t->pcpu_master = pcpu_master; - sc->t[pcpu_master]. - pcpu_slaves[cur_cpu] = i; - bus_bind_intr(dev, t->intr_res, cur_cpu); - cur_cpu = CPU_NEXT(cur_cpu); - num_percpu_t--; - } } - } else -#endif - if ((cvectors & t->vectors) != 0) { + } + if (t->irq < 0 && (cvectors & t->vectors) != 0) { cvectors &= t->vectors; sc->useirq |= (1 << i); } } + if (sc->legacy_route && sc->t[0].irq < 0 && sc->t[1].irq < 0) + sc->legacy_route = 0; + if (sc->legacy_route) + hpet_enable(sc); + /* Group timers for per-CPU operation. */ + num_percpu_et = min(num_msi / mp_ncpus, 2); + num_percpu_t = num_percpu_et * mp_ncpus; + pcpu_master = 0; + cur_cpu = CPU_FIRST(); + for (i = 0; i < num_timers; i++) { + t = &sc->t[i]; + if (t->irq >= 0 && num_percpu_t > 0) { + if (cur_cpu == CPU_FIRST()) + pcpu_master = i; + t->pcpu_master = pcpu_master; + sc->t[pcpu_master]. + pcpu_slaves[cur_cpu] = i; + bus_bind_intr(dev, t->intr_res, cur_cpu); + cur_cpu = CPU_NEXT(cur_cpu); + num_percpu_t--; + } + } bus_write_4(sc->mem_res, HPET_ISR, 0xffffffff); sc->irq = -1; sc->intr_rid = -1; @@ -508,7 +540,11 @@ hpet_attach(device_t dev) t = &sc->t[i]; t->caps &= ~(HPET_TCNF_FSB_EN | HPET_TCNF_INT_ROUTE); t->caps &= ~(HPET_TCNF_VAL_SET | HPET_TCNF_INT_ENB); + t->caps &= ~(HPET_TCNF_INT_TYPE); t->caps |= HPET_TCNF_32MODE; + if (t->irq >= 0 && sc->legacy_route && i < 2) { + /* Legacy route doesn't need more configuration. */ + } else #ifdef DEV_APIC if (t->irq >= 0) { uint64_t addr; @@ -599,7 +635,7 @@ hpet_resume(device_t dev) for (i = 0; i < sc->num_timers; i++) { t = &sc->t[i]; #ifdef DEV_APIC - if (t->irq >= 0) { + if (t->irq >= 0 && (sc->legacy_route == 0 || i >= 2)) { uint64_t addr; uint32_t data; Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Tue Jun 22 19:24:07 2010 (r209439) +++ head/sys/x86/isa/atrtc.c Tue Jun 22 19:42:27 2010 (r209440) @@ -244,34 +244,35 @@ static int atrtc_attach(device_t dev) { struct atrtc_softc *sc; - int i, diag, haveirq = 0; + int i, diag; sc = device_get_softc(dev); if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, IO_RTC, IO_RTC + 1, 2, RF_ACTIVE))) device_printf(dev,"Warning: Couldn't map I/O.\n"); - if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) - device_printf(dev,"Couldn't map Interrupt.\n"); - else if ((bus_setup_intr(dev, sc->intr_res, - INTR_MPSAFE | INTR_TYPE_CLK, (driver_filter_t *)rtc_intr, NULL, - sc, &sc->intr_handler))) { - device_printf(dev, "Can't setup interrupt.\n"); - } else { - haveirq = 1; - /* Bind IRQ to BSP to avoid live migration. */ - bus_bind_intr(dev, sc->intr_res, 0); - } diag = rtcin(RTC_DIAG); if (diag != 0) printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); atrtc_start(); clock_register(dev, 1000000); bzero(&sc->et, sizeof(struct eventtimer)); - if (haveirq && - !atrtcclock_disable && + if (!atrtcclock_disable && (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0)) { + if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { + device_printf(dev,"Can't map interrupt.\n"); + return (0); + } else if ((bus_setup_intr(dev, sc->intr_res, + INTR_MPSAFE | INTR_TYPE_CLK, + (driver_filter_t *)rtc_intr, NULL, + sc, &sc->intr_handler))) { + device_printf(dev, "Can't setup interrupt.\n"); + return (0); + } else { + /* Bind IRQ to BSP to avoid live migration. */ + bus_bind_intr(dev, sc->intr_res, 0); + } sc->et.et_name = "RTC"; sc->et.et_flags = ET_FLAGS_PERIODIC; sc->et.et_quality = 0; Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Tue Jun 22 19:24:07 2010 (r209439) +++ head/sys/x86/isa/clock.c Tue Jun 22 19:42:27 2010 (r209440) @@ -522,9 +522,6 @@ attimer_attach(device_t dev) attimer_sc = sc = device_get_softc(dev); bzero(sc, sizeof(struct attimer_softc)); - if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, - &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) - device_printf(dev,"Warning: Couldn't map Interrupt.\n"); i8254_intsrc = intr_lookup_source(0); if (i8254_intsrc != NULL) i8254_pending = i8254_intsrc->is_pic->pic_source_pending; @@ -538,6 +535,11 @@ attimer_attach(device_t dev) tc_init(&sc->tc); if (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0) { + if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, + &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { + device_printf(dev,"Can't map interrupt.\n"); + return (0); + } /* Dirty hack, to make bus_setup_intr to not enable source. */ i8254_intsrc->is_handlers++; if ((bus_setup_intr(dev, sc->intr_res, @@ -545,18 +547,19 @@ attimer_attach(device_t dev) (driver_filter_t *)clkintr, NULL, sc, &sc->intr_handler))) { device_printf(dev, "Can't setup interrupt.\n"); - } else { - i8254_intsrc->is_pic->pic_enable_intr(i8254_intsrc); - sc->et.et_name = "i8254"; - sc->et.et_flags = ET_FLAGS_PERIODIC; - sc->et.et_quality = 100; - sc->et.et_frequency = i8254_freq; - sc->et.et_start = attimer_start; - sc->et.et_stop = attimer_stop; - sc->et.et_priv = dev; - et_register(&sc->et); + i8254_intsrc->is_handlers--; + return (0); } i8254_intsrc->is_handlers--; + i8254_intsrc->is_pic->pic_enable_intr(i8254_intsrc); + sc->et.et_name = "i8254"; + sc->et.et_flags = ET_FLAGS_PERIODIC; + sc->et.et_quality = 100; + sc->et.et_frequency = i8254_freq; + sc->et.et_start = attimer_start; + sc->et.et_stop = attimer_stop; + sc->et.et_priv = dev; + et_register(&sc->et); } return(0); } From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 19:56:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8835310657D1; Tue, 22 Jun 2010 19:56:07 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 774028FC20; Tue, 22 Jun 2010 19:56:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MJu7hC042555; Tue, 22 Jun 2010 19:56:07 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MJu737042553; Tue, 22 Jun 2010 19:56:07 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201006221956.o5MJu737042553@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 22 Jun 2010 19:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209441 - releng/8.1/lib/libpam/modules/pam_lastlog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 19:56:07 -0000 Author: des Date: Tue Jun 22 19:56:07 2010 New Revision: 209441 URL: http://svn.freebsd.org/changeset/base/209441 Log: merge r196650 from head (via stable/8): tty might be NULL Approved by: re (kib@) Modified: releng/8.1/lib/libpam/modules/pam_lastlog/pam_lastlog.c Directory Properties: releng/8.1/lib/libpam/ (props changed) Modified: releng/8.1/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- releng/8.1/lib/libpam/modules/pam_lastlog/pam_lastlog.c Tue Jun 22 19:42:27 2010 (r209440) +++ releng/8.1/lib/libpam/modules/pam_lastlog/pam_lastlog.c Tue Jun 22 19:56:07 2010 (r209441) @@ -183,6 +183,11 @@ pam_sm_close_session(pam_handle_t *pamh pam_err = pam_get_item(pamh, PAM_TTY, (const void **)&tty); if (pam_err != PAM_SUCCESS) goto err; + if (tty == NULL) { + PAM_LOG("No PAM_TTY"); + pam_err = PAM_SERVICE_ERR; + goto err; + } if (strncmp(tty, _PATH_DEV, strlen(_PATH_DEV)) == 0) tty = (const char *)tty + strlen(_PATH_DEV); if (*(const char *)tty == '\0') From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 20:52:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9774D106566B; Tue, 22 Jun 2010 20:52:35 +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 86DB38FC1E; Tue, 22 Jun 2010 20:52:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MKqZEp054983; Tue, 22 Jun 2010 20:52:35 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MKqZZq054981; Tue, 22 Jun 2010 20:52:35 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222052.o5MKqZZq054981@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 20:52:35 +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: r209442 - head/sys/modules/mqueue X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 20:52:35 -0000 Author: thompsa Date: Tue Jun 22 20:52:35 2010 New Revision: 209442 URL: http://svn.freebsd.org/changeset/base/209442 Log: Add missing opt_compat.h dependency. Found by: Garrett Cooper Modified: head/sys/modules/mqueue/Makefile Modified: head/sys/modules/mqueue/Makefile ============================================================================== --- head/sys/modules/mqueue/Makefile Tue Jun 22 19:56:07 2010 (r209441) +++ head/sys/modules/mqueue/Makefile Tue Jun 22 20:52:35 2010 (r209442) @@ -5,6 +5,6 @@ KMOD= mqueuefs SRCS= uipc_mqueue.c \ vnode_if.h \ - opt_posix.h + opt_posix.h opt_compat.h .include From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 20:57:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93B61106564A; Tue, 22 Jun 2010 20:57:48 +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 694FA8FC14; Tue, 22 Jun 2010 20:57:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MKvmIP056200; Tue, 22 Jun 2010 20:57:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MKvmXv056195; Tue, 22 Jun 2010 20:57:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222057.o5MKvmXv056195@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 20:57: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: r209443 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 20:57:48 -0000 Author: thompsa Date: Tue Jun 22 20:57:48 2010 New Revision: 209443 URL: http://svn.freebsd.org/changeset/base/209443 Log: Add support for LOW speed BULK transfers. This mode is not recommended by the USB 2.0 standard, though some USB devices use it anyway. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue Jun 22 20:52:35 2010 (r209442) +++ head/sys/dev/usb/controller/ehci.c Tue Jun 22 20:57:48 2010 (r209443) @@ -3792,9 +3792,7 @@ ehci_ep_init(struct usb_device *udev, st } break; case UE_BULK: - if (udev->speed != USB_SPEED_LOW) { - ep->methods = &ehci_device_bulk_methods; - } + ep->methods = &ehci_device_bulk_methods; break; default: /* do nothing */ Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Tue Jun 22 20:52:35 2010 (r209442) +++ head/sys/dev/usb/controller/ohci.c Tue Jun 22 20:57:48 2010 (r209443) @@ -2614,9 +2614,7 @@ ohci_ep_init(struct usb_device *udev, st } break; case UE_BULK: - if (udev->speed != USB_SPEED_LOW) { - ep->methods = &ohci_device_bulk_methods; - } + ep->methods = &ohci_device_bulk_methods; break; default: /* do nothing */ Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Tue Jun 22 20:52:35 2010 (r209442) +++ head/sys/dev/usb/controller/uhci.c Tue Jun 22 20:57:48 2010 (r209443) @@ -3068,9 +3068,7 @@ uhci_ep_init(struct usb_device *udev, st } break; case UE_BULK: - if (udev->speed != USB_SPEED_LOW) { - ep->methods = &uhci_device_bulk_methods; - } + ep->methods = &uhci_device_bulk_methods; break; default: /* do nothing */ Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Jun 22 20:52:35 2010 (r209442) +++ head/sys/dev/usb/usb_transfer.c Tue Jun 22 20:57:48 2010 (r209443) @@ -3057,7 +3057,7 @@ usbd_get_std_packet_size(struct usb_std_ }; static const uint16_t bulk_min[USB_SPEED_MAX] = { - [USB_SPEED_LOW] = 0, /* not supported */ + [USB_SPEED_LOW] = 8, [USB_SPEED_FULL] = 8, [USB_SPEED_HIGH] = 512, [USB_SPEED_VARIABLE] = 512, From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:01:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E41841065674; Tue, 22 Jun 2010 21:01:40 +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 D39DC8FC12; Tue, 22 Jun 2010 21:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ML1eld057114; Tue, 22 Jun 2010 21:01:40 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ML1eks057112; Tue, 22 Jun 2010 21:01:40 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222101.o5ML1eks057112@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 21:01: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: r209444 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:01:41 -0000 Author: thompsa Date: Tue Jun 22 21:01:40 2010 New Revision: 209444 URL: http://svn.freebsd.org/changeset/base/209444 Log: Add new device id. PR: usb/146907 Modified: head/sys/dev/usb/net/if_rue.c Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Tue Jun 22 20:57:48 2010 (r209443) +++ head/sys/dev/usb/net/if_rue.c Tue Jun 22 21:01:40 2010 (r209444) @@ -112,6 +112,7 @@ SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, static const struct usb_device_id rue_devs[] = { {USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUAKTX, 0)}, {USB_VPI(USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_USBKR100, 0)}, + {USB_VPI(USB_VENDOR_OQO, USB_PRODUCT_OQO_ETHER01, 0)}, }; /* prototypes */ From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:03:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21C7B1065670; Tue, 22 Jun 2010 21:03:14 +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 113408FC16; Tue, 22 Jun 2010 21:03:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ML3Dou057488; Tue, 22 Jun 2010 21:03:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ML3DtY057485; Tue, 22 Jun 2010 21:03:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222103.o5ML3DtY057485@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 21:03:13 +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: r209445 - in head/sys/dev/usb: . quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:03:14 -0000 Author: thompsa Date: Tue Jun 22 21:03:13 2010 New Revision: 209445 URL: http://svn.freebsd.org/changeset/base/209445 Log: Add a mass storage quirk. PR: usb/147196 Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Tue Jun 22 21:01:40 2010 (r209444) +++ head/sys/dev/usb/quirk/usb_quirk.c Tue Jun 22 21:03:13 2010 (r209445) @@ -450,6 +450,7 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ASUS, GMSC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(UNKNOWN4, USBMEMSTICK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(UNKNOWN5, USB2IDEBRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), }; #undef USB_QUIRK_VP #undef USB_QUIRK Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jun 22 21:01:40 2010 (r209444) +++ head/sys/dev/usb/usbdevs Tue Jun 22 21:03:13 2010 (r209445) @@ -400,6 +400,7 @@ vendor ARASAN 0x07da Arasan Chip System vendor ALLIEDCABLE 0x07e6 Allied Cable vendor STSN 0x07ef STSN vendor CENTURY 0x07f7 Century Corp +vendor UNKNOWN5 0x07ff Unknown vendor ZOOM 0x0803 Zoom Telephonics vendor PCS 0x0810 Personal Communication Systems vendor ALPHASMART 0x081e AlphaSmart, Inc. @@ -3045,6 +3046,9 @@ product UNIACCESS PANACHE 0x0101 Panache /* Unknown vendors */ product UNKNOWN4 USBMEMSTICK 0x6025 Flash Disk CBM +/* Unknown vendors */ +product UNKNOWN5 USB2IDEBRIDGE 0x00ff USB 2.0 ATA/SATA Bridge + /* U.S. Robotics products */ product USR USR5423 0x0121 USR5423 WLAN From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:06:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C1DC1065676; Tue, 22 Jun 2010 21:06:34 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8908FC18; Tue, 22 Jun 2010 21:06:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ML6XI1058246; Tue, 22 Jun 2010 21:06:33 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ML6XxR058244; Tue, 22 Jun 2010 21:06:33 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201006222106.o5ML6XxR058244@svn.freebsd.org> From: Randi Harper Date: Tue, 22 Jun 2010 21:06: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: r209446 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:06:34 -0000 Author: randi Date: Tue Jun 22 21:06:33 2010 New Revision: 209446 URL: http://svn.freebsd.org/changeset/base/209446 Log: Remove unnecessarily inflammatory commentary. Approved by: cperciva (mentor) Modified: head/usr.sbin/sysinstall/sysinstall.8 Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Tue Jun 22 21:03:13 2010 (r209445) +++ head/usr.sbin/sysinstall/sysinstall.8 Tue Jun 22 21:06:33 2010 (r209446) @@ -899,8 +899,5 @@ and .Xr bsdlabel 8 for these tasks. .Pp -This utility is a prototype which lasted several years past -its expiration date and is greatly in need of death. -.Pp There are a (great) number of undocumented variables. UTSL. From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:08:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 767E6106566C; Tue, 22 Jun 2010 21:08:45 +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 65EFD8FC21; Tue, 22 Jun 2010 21:08:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ML8j9E058769; Tue, 22 Jun 2010 21:08:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ML8jva058766; Tue, 22 Jun 2010 21:08:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222108.o5ML8jva058766@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 21:08: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: r209447 - in head/sys/dev/usb: . wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:08:45 -0000 Author: thompsa Date: Tue Jun 22 21:08:45 2010 New Revision: 209447 URL: http://svn.freebsd.org/changeset/base/209447 Log: Add new device id. PR: usb/147190 Modified: head/sys/dev/usb/usbdevs head/sys/dev/usb/wlan/if_upgt.c Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Jun 22 21:06:33 2010 (r209446) +++ head/sys/dev/usb/usbdevs Tue Jun 22 21:08:45 2010 (r209447) @@ -3050,6 +3050,7 @@ product UNKNOWN4 USBMEMSTICK 0x6025 Flas product UNKNOWN5 USB2IDEBRIDGE 0x00ff USB 2.0 ATA/SATA Bridge /* U.S. Robotics products */ +product USR USR5422 0x0118 USR5422 WLAN product USR USR5423 0x0121 USR5423 WLAN /* VIA Technologies products */ Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Tue Jun 22 21:06:33 2010 (r209446) +++ head/sys/dev/usb/wlan/if_upgt.c Tue Jun 22 21:08:45 2010 (r209447) @@ -184,6 +184,7 @@ static const struct usb_device_id upgt_d UPGT_DEV(GLOBESPAN, PRISM_GT_2), UPGT_DEV(INTERSIL, PRISM_GT), UPGT_DEV(SMC, 2862WG), + UPGT_DEV(USR, USR5422), UPGT_DEV(WISTRONNEWEB, UR045G), UPGT_DEV(XYRATEX, PRISM_GT_1), UPGT_DEV(XYRATEX, PRISM_GT_2), From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:12:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA0A8106564A; Tue, 22 Jun 2010 21:12:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8C638FC0C; Tue, 22 Jun 2010 21:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MLCig4059685; Tue, 22 Jun 2010 21:12:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MLCiwb059683; Tue, 22 Jun 2010 21:12:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006222112.o5MLCiwb059683@svn.freebsd.org> From: Doug Barton Date: Tue, 22 Jun 2010 21:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209448 - stable/8/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:12:44 -0000 Author: dougb Date: Tue Jun 22 21:12:44 2010 New Revision: 209448 URL: http://svn.freebsd.org/changeset/base/209448 Log: MFC 209286: Add the AAAA address for i.root-servers.net Modified: stable/8/etc/namedb/named.root Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/namedb/named.root ============================================================================== --- stable/8/etc/namedb/named.root Tue Jun 22 21:08:45 2010 (r209447) +++ stable/8/etc/namedb/named.root Tue Jun 22 21:12:44 2010 (r209448) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Dec 12, 2008 -; related version of root zone: 2008121200 +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; @@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:13:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8ED21065674; Tue, 22 Jun 2010 21:13:35 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7D868FC24; Tue, 22 Jun 2010 21:13:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MLDZM1059954; Tue, 22 Jun 2010 21:13:35 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MLDZUu059952; Tue, 22 Jun 2010 21:13:35 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006222113.o5MLDZUu059952@svn.freebsd.org> From: Doug Barton Date: Tue, 22 Jun 2010 21:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209449 - stable/7/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:13:36 -0000 Author: dougb Date: Tue Jun 22 21:13:35 2010 New Revision: 209449 URL: http://svn.freebsd.org/changeset/base/209449 Log: MFC 209286: Add the AAAA address for i.root-servers.net Modified: stable/7/etc/namedb/named.root Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/namedb/named.root ============================================================================== --- stable/7/etc/namedb/named.root Tue Jun 22 21:12:44 2010 (r209448) +++ stable/7/etc/namedb/named.root Tue Jun 22 21:13:35 2010 (r209449) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Dec 12, 2008 -; related version of root zone: 2008121200 +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; @@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:13:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C5CE1065677; Tue, 22 Jun 2010 21:13:36 +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 4BE428FC27; Tue, 22 Jun 2010 21:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MLDaZF059975; Tue, 22 Jun 2010 21:13:36 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MLDaIf059973; Tue, 22 Jun 2010 21:13:36 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222113.o5MLDaIf059973@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 21:13: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: r209450 - head/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:13:36 -0000 Author: thompsa Date: Tue Jun 22 21:13:36 2010 New Revision: 209450 URL: http://svn.freebsd.org/changeset/base/209450 Log: Reduce MIDI input buffer size to one USB packet, hence some USB devices don't properly short terminate their transfers. This fixes a problem where input appears several seconds late. Reported by: Alexander Yerenkow Submitted by: Hans Petter Selasky Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Jun 22 21:13:35 2010 (r209449) +++ head/sys/dev/sound/usb/uaudio.c Tue Jun 22 21:13:36 2010 (r209450) @@ -507,8 +507,8 @@ static const struct usb_config .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = UMIDI_BULK_SIZE, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .bufsize = 4, /* bytes */ + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,.proxy_buffer = 1,}, .callback = &umidi_bulk_read_callback, }, @@ -3366,10 +3366,6 @@ umidi_bulk_read_callback(struct usb_xfer DPRINTF("actlen=%d bytes\n", actlen); - if (actlen == 0) { - /* should not happen */ - goto tr_error; - } pos = 0; pc = usbd_xfer_get_frame(xfer, 0); @@ -3404,8 +3400,6 @@ umidi_bulk_read_callback(struct usb_xfer return; default: -tr_error: - DPRINTF("error=%s\n", usbd_errstr(error)); if (error != USB_ERR_CANCELLED) { From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:14:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04DC3106566C; Tue, 22 Jun 2010 21:14:16 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7E5D8FC13; Tue, 22 Jun 2010 21:14:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MLEFmi060164; Tue, 22 Jun 2010 21:14:15 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MLEFlp060162; Tue, 22 Jun 2010 21:14:15 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006222114.o5MLEFlp060162@svn.freebsd.org> From: Doug Barton Date: Tue, 22 Jun 2010 21:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209451 - stable/6/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:14:16 -0000 Author: dougb Date: Tue Jun 22 21:14:15 2010 New Revision: 209451 URL: http://svn.freebsd.org/changeset/base/209451 Log: MFC 209286: Add the AAAA address for i.root-servers.net Modified: stable/6/etc/namedb/named.root Directory Properties: stable/6/etc/ (props changed) Modified: stable/6/etc/namedb/named.root ============================================================================== --- stable/6/etc/namedb/named.root Tue Jun 22 21:13:36 2010 (r209450) +++ stable/6/etc/namedb/named.root Tue Jun 22 21:14:15 2010 (r209451) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Dec 12, 2008 -; related version of root zone: 2008121200 +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; @@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; From owner-svn-src-all@FreeBSD.ORG Tue Jun 22 21:16:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E9E106566B; Tue, 22 Jun 2010 21:16:18 +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 B51AD8FC1B; Tue, 22 Jun 2010 21:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5MLGIsW060681; Tue, 22 Jun 2010 21:16:18 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5MLGIlx060678; Tue, 22 Jun 2010 21:16:18 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201006222116.o5MLGIlx060678@svn.freebsd.org> From: Andrew Thompson Date: Tue, 22 Jun 2010 21:16: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: r209452 - head/sys/dev/sound/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2010 21:16:19 -0000 Author: thompsa Date: Tue Jun 22 21:16:18 2010 New Revision: 209452 URL: http://svn.freebsd.org/changeset/base/209452 Log: - fix for USB audio devices which use the 7-byte endpoint descriptor instead of the 9-byte one. - remove sync-endpoint code, which is currently unused. Reported by: Antun Matanovi Submitted by: Hans Petter Selasky Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/sound/usb/uaudioreg.h Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Jun 22 21:14:15 2010 (r209451) +++ head/sys/dev/sound/usb/uaudio.c Tue Jun 22 21:16:18 2010 (r209452) @@ -792,7 +792,8 @@ uaudio_chan_dump_ep_desc(const usb_endpo ed, ed->bLength, ed->bDescriptorType, ed->bEndpointAddress, ed->bmAttributes, UGETW(ed->wMaxPacketSize), ed->bInterval, - ed->bRefresh, ed->bSynchAddress); + UEP_HAS_REFRESH(ed) ? ed->bRefresh : 0, + UEP_HAS_SYNCADDR(ed) ? ed->bSynchAddress : 0); } } @@ -817,8 +818,6 @@ uaudio_chan_fill_info_sub(struct uaudio_ uint16_t alt_index = 0; uint16_t wFormat; uint8_t ep_dir; - uint8_t ep_type; - uint8_t ep_sync; uint8_t bChannels; uint8_t bBitResolution; uint8_t x; @@ -896,34 +895,12 @@ uaudio_chan_fill_info_sub(struct uaudio_ } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= sizeof(*ed1))) { + (desc->bLength >= UEP_MINSIZE)) { if (ed1 == NULL) { ed1 = (void *)desc; if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { ed1 = NULL; } - } else { - if (ed2 == NULL) { - ed2 = (void *)desc; - if (UE_GET_XFERTYPE(ed2->bmAttributes) != UE_ISOCHRONOUS) { - ed2 = NULL; - continue; - } - if (ed2->bSynchAddress != 0) { - DPRINTFN(11, "invalid endpoint: bSynchAddress != 0\n"); - ed2 = NULL; - continue; - } - if (ed2->bEndpointAddress != ed1->bSynchAddress) { - DPRINTFN(11, "invalid endpoint addresses: " - "ep[0]->bSynchAddress=0x%x " - "ep[1]->bEndpointAddress=0x%x\n", - ed1->bSynchAddress, - ed2->bEndpointAddress); - ed2 = NULL; - continue; - } - } } } if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && @@ -936,35 +913,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ if (audio_if && asid && asf1d && ed1 && sed) { ep_dir = UE_GET_DIR(ed1->bEndpointAddress); - ep_type = UE_GET_ISO_TYPE(ed1->bmAttributes); - ep_sync = 0; - - if ((sc->sc_uq_au_inp_async) && - (ep_dir == UE_DIR_IN) && (ep_type == UE_ISO_ADAPT)) { - ep_type = UE_ISO_ASYNC; - } - if ((ep_dir == UE_DIR_IN) && (ep_type == UE_ISO_ADAPT)) { - ep_sync = 1; - } - if ((ep_dir != UE_DIR_IN) && (ep_type == UE_ISO_ASYNC)) { - ep_sync = 1; - } - /* Ignore sync endpoint information until further. */ -#if 0 - if (ep_sync && (!ed2)) { - continue; - } - /* - * we can't handle endpoints that need a sync pipe - * yet - */ - if (ep_sync) { - DPRINTF("skipped sync interface\n"); - audio_if = 0; - continue; - } -#endif + /* We ignore sync endpoint information until further. */ wFormat = UGETW(asid->wFormatTag); bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); Modified: head/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- head/sys/dev/sound/usb/uaudioreg.h Tue Jun 22 21:14:15 2010 (r209451) +++ head/sys/dev/sound/usb/uaudioreg.h Tue Jun 22 21:16:18 2010 (r209452) @@ -47,6 +47,11 @@ #define UDESCSUB_AC_PROCESSING 7 #define UDESCSUB_AC_EXTENSION 8 +/* These macros check if the endpoint descriptor has additional fields */ +#define UEP_MINSIZE 7 +#define UEP_HAS_REFRESH(ep) ((ep)->bLength >= 8) +#define UEP_HAS_SYNCADDR(ep) ((ep)->bLength >= 9) + /* The first fields are identical to struct usb_endpoint_descriptor */ typedef struct { uByte bLength; From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 03:56:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41CD4106566C; Wed, 23 Jun 2010 03:56:54 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 311C28FC0A; Wed, 23 Jun 2010 03:56:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5N3usEM049524; Wed, 23 Jun 2010 03:56:54 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5N3usiw049523; Wed, 23 Jun 2010 03:56:54 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006230356.o5N3usiw049523@svn.freebsd.org> From: Doug Barton Date: Wed, 23 Jun 2010 03:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209453 - releng/8.1/etc/namedb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 03:56:54 -0000 Author: dougb Date: Wed Jun 23 03:56:53 2010 New Revision: 209453 URL: http://svn.freebsd.org/changeset/base/209453 Log: MFC 209286: Add the AAAA address for i.root-servers.net Approved by: re (kensmith) Modified: releng/8.1/etc/namedb/named.root Directory Properties: releng/8.1/etc/ (props changed) Modified: releng/8.1/etc/namedb/named.root ============================================================================== --- releng/8.1/etc/namedb/named.root Tue Jun 22 21:16:18 2010 (r209452) +++ releng/8.1/etc/namedb/named.root Wed Jun 23 03:56:53 2010 (r209453) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Dec 12, 2008 -; related version of root zone: 2008121200 +; last update: Jun 17, 2010 +; related version of root zone: 2010061700 ; ; formerly NS.INTERNIC.NET ; @@ -63,6 +63,7 @@ H.ROOT-SERVERS.NET. 3600000 AA ; . 3600000 NS I.ROOT-SERVERS.NET. I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17 +I.ROOT-SERVERS.NET. 3600000 AAAA 2001:7FE::53 ; ; OPERATED BY VERISIGN, INC. ; From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 03:59:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31128106564A; Wed, 23 Jun 2010 03:59:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 209558FC18; Wed, 23 Jun 2010 03:59:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5N3xRF5050118; Wed, 23 Jun 2010 03:59:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5N3xR7R050116; Wed, 23 Jun 2010 03:59:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201006230359.o5N3xR7R050116@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Jun 2010 03:59: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: r209454 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 03:59:27 -0000 Author: adrian Date: Wed Jun 23 03:59:26 2010 New Revision: 209454 URL: http://svn.freebsd.org/changeset/base/209454 Log: AR71XX GPIO register definitions. Reviewed by: gonzo@ Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Wed Jun 23 03:56:53 2010 (r209453) +++ head/sys/mips/atheros/ar71xxreg.h Wed Jun 23 03:59:26 2010 (r209454) @@ -137,6 +137,27 @@ #define USB_CTRL_CONFIG_RESUME_UTMI_PLS_DIS (1 << 1) #define USB_CTRL_CONFIG_UTMI_BACKWARD_ENB (1 << 0) +#define AR71XX_GPIO_BASE 0x18040000 +#define AR71XX_GPIO_OE 0x00 +#define AR71XX_GPIO_IN 0x04 +#define AR71XX_GPIO_OUT 0x08 +#define AR71XX_GPIO_SET 0x0c +#define AR71XX_GPIO_CLEAR 0x10 +#define AR71XX_GPIO_INT 0x14 +#define AR71XX_GPIO_INT_TYPE 0x18 +#define AR71XX_GPIO_INT_POLARITY 0x1c +#define AR71XX_GPIO_INT_PENDING 0x20 +#define AR71XX_GPIO_INT_MASK 0x24 +#define AR71XX_GPIO_FUNCTION 0x28 +#define GPIO_FUNC_STEREO_EN (1 << 17) +#define GPIO_FUNC_SLIC_EN (1 << 16) +#define GPIO_FUNC_SPI_CS1_EN (1 << 15) +#define GPIO_FUNC_SPI_CS0_EN (1 << 14) +#define GPIO_FUNC_SPI_EN (1 << 13) +#define GPIO_FUNC_UART_EN (1 << 8) +#define GPIO_FUNC_USB_OC_EN (1 << 4) +#define GPIO_FUNC_USB_CLK_EN (0) + #define AR71XX_BASE_FREQ 40000000 #define AR71XX_PLL_CPU_CONFIG 0x18050000 #define PLL_SW_UPDATE (1 << 31) From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 04:42:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B50301065672; Wed, 23 Jun 2010 04:42:47 +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 A42638FC15; Wed, 23 Jun 2010 04:42:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5N4glFg059799; Wed, 23 Jun 2010 04:42:47 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5N4glBD059797; Wed, 23 Jun 2010 04:42:47 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201006230442.o5N4glBD059797@svn.freebsd.org> From: Kevin Lo Date: Wed, 23 Jun 2010 04:42: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: r209455 - head/share/examples/perfmon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 04:42:47 -0000 Author: kevlo Date: Wed Jun 23 04:42:47 2010 New Revision: 209455 URL: http://svn.freebsd.org/changeset/base/209455 Log: Fix missing argument for errx(). While here, clean up the code a bit. Modified: head/share/examples/perfmon/perfmon.c Modified: head/share/examples/perfmon/perfmon.c ============================================================================== --- head/share/examples/perfmon/perfmon.c Wed Jun 23 03:59:26 2010 (r209454) +++ head/share/examples/perfmon/perfmon.c Wed Jun 23 04:42:47 2010 (r209455) @@ -173,15 +173,13 @@ getnum(const char *buf, int min, int max l = strtol(buf, &ep, 0); if (*buf && !*ep && !errno) { if (l < min || l > max) { - errx(1, "`%s': must be between %d and %d", + errx(1, "%s: must be between %d and %d", buf, min, max); } return (int)l; - } else if(errno) { - errx(1, "`%s': must be between %ld and %ld", - LONG_MIN, LONG_MAX); - } - errx(1, "`%s': parameter must be an integer"); + } + + errx(1, "%s: parameter must be an integer", buf); } static void From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 05:43:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51624106566B; Wed, 23 Jun 2010 05:43:22 +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 40CF48FC12; Wed, 23 Jun 2010 05:43:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5N5hMco073116; Wed, 23 Jun 2010 05:43:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5N5hMQq073113; Wed, 23 Jun 2010 05:43:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006230543.o5N5hMQq073113@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Jun 2010 05:43:22 +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: r209456 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 05:43:22 -0000 Author: mav Date: Wed Jun 23 05:43:21 2010 New Revision: 209456 URL: http://svn.freebsd.org/changeset/base/209456 Log: Do not trust IRQ reported by ACPI. There are cases when it is wrong. Modified: head/sys/x86/isa/atrtc.c head/sys/x86/isa/clock.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Wed Jun 23 04:42:47 2010 (r209455) +++ head/sys/x86/isa/atrtc.c Wed Jun 23 05:43:21 2010 (r209456) @@ -259,6 +259,7 @@ atrtc_attach(device_t dev) if (!atrtcclock_disable && (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0)) { + sc->intr_rid = -1; if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, 8, 8, 1, RF_ACTIVE))) { device_printf(dev,"Can't map interrupt.\n"); Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Wed Jun 23 04:42:47 2010 (r209455) +++ head/sys/x86/isa/clock.c Wed Jun 23 05:43:21 2010 (r209456) @@ -535,6 +535,7 @@ attimer_attach(device_t dev) tc_init(&sc->tc); if (resource_int_value(device_get_name(dev), device_get_unit(dev), "clock", &i) != 0 || i != 0) { + sc->intr_rid = -1; if (!(sc->intr_res = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->intr_rid, 0, 0, 1, RF_ACTIVE))) { device_printf(dev,"Can't map interrupt.\n"); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 10:04:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9A12106566C; Wed, 23 Jun 2010 10:04:48 +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 C8D1E8FC1B; Wed, 23 Jun 2010 10:04:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NA4m6x031368; Wed, 23 Jun 2010 10:04:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NA4muH031367; Wed, 23 Jun 2010 10:04:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006231004.o5NA4muH031367@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Jun 2010 10:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209457 - releng/8.1/sys/dev/hptiop X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 10:04:48 -0000 Author: mav Date: Wed Jun 23 10:04:48 2010 New Revision: 209457 URL: http://svn.freebsd.org/changeset/base/209457 Log: MFC r209340: Report transport type in XPT_PATH_INQ. PR: i386/147929 Approved by: re (kib) Modified: releng/8.1/sys/dev/hptiop/hptiop.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/dev/hptiop/hptiop.c ============================================================================== --- releng/8.1/sys/dev/hptiop/hptiop.c Wed Jun 23 05:43:21 2010 (r209456) +++ releng/8.1/sys/dev/hptiop/hptiop.c Wed Jun 23 10:04:48 2010 (r209457) @@ -1823,6 +1823,10 @@ scsi_done: strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 10:06:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F44A106564A; Wed, 23 Jun 2010 10:06:32 +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 2DB8E8FC17; Wed, 23 Jun 2010 10:06:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NA6VLv031785; Wed, 23 Jun 2010 10:06:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NA6VJM031783; Wed, 23 Jun 2010 10:06:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201006231006.o5NA6VJM031783@svn.freebsd.org> From: Alexander Motin Date: Wed, 23 Jun 2010 10:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209458 - releng/8.1/sys/dev/hptmv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 10:06:32 -0000 Author: mav Date: Wed Jun 23 10:06:31 2010 New Revision: 209458 URL: http://svn.freebsd.org/changeset/base/209458 Log: MFC r209341: Report transport type in XPT_PATH_INQ. Approved by: re (kib) Modified: releng/8.1/sys/dev/hptmv/entry.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/dev/hptmv/entry.c ============================================================================== --- releng/8.1/sys/dev/hptmv/entry.c Wed Jun 23 10:04:48 2010 (r209457) +++ releng/8.1/sys/dev/hptmv/entry.c Wed Jun 23 10:06:31 2010 (r209458) @@ -2414,6 +2414,10 @@ hpt_action(struct cam_sim *sim, union cc strncpy(cpi->hba_vid, "HPT ", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); + cpi->transport = XPORT_SPI; + cpi->transport_version = 2; + cpi->protocol = PROTO_SCSI; + cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 10:06:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9C6F1065676; Wed, 23 Jun 2010 10:06:57 +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 CE2A48FC12; Wed, 23 Jun 2010 10:06:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NA6vNk031920; Wed, 23 Jun 2010 10:06:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NA6vbe031918; Wed, 23 Jun 2010 10:06:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006231006.o5NA6vbe031918@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 10:06:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209459 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 10:06:58 -0000 Author: kib Date: Wed Jun 23 10:06:57 2010 New Revision: 209459 URL: http://svn.freebsd.org/changeset/base/209459 Log: MFC r208920: Reorganize the code in bdwrite() which handles move of dirtiness from the buffer pages to buffer. Drain the VPO_BUSY bit of the buffer pages before setting valid and clean bits. Stable/8 version of vfs_page_set_validclean() requires page queue lock. Tested by: pho Modified: stable/8/sys/kern/vfs_bio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Wed Jun 23 10:06:31 2010 (r209458) +++ stable/8/sys/kern/vfs_bio.c Wed Jun 23 10:06:57 2010 (r209459) @@ -102,8 +102,8 @@ static void vm_hold_load_pages(struct bu static void vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, vm_page_t m); static void vfs_page_set_validclean(struct buf *bp, vm_ooffset_t off, vm_page_t m); -static void vfs_clean_pages(struct buf *bp); -static void vfs_setdirty(struct buf *bp); +static void vfs_drain_busy_pages(struct buf *bp); +static void vfs_clean_pages_dirty_buf(struct buf *bp); static void vfs_setdirty_locked_object(struct buf *bp); static void vfs_vmio_release(struct buf *bp); static int vfs_bio_clcheck(struct vnode *vp, int size, @@ -1009,18 +1009,17 @@ bdwrite(struct buf *bp) } /* - * Set the *dirty* buffer range based upon the VM system dirty pages. - */ - vfs_setdirty(bp); - - /* - * We need to do this here to satisfy the vnode_pager and the - * pageout daemon, so that it thinks that the pages have been - * "cleaned". Note that since the pages are in a delayed write - * buffer -- the VFS layer "will" see that the pages get written - * out on the next sync, or perhaps the cluster will be completed. + * Set the *dirty* buffer range based upon the VM system dirty + * pages. + * + * Mark the buffer pages as clean. We need to do this here to + * satisfy the vnode_pager and the pageout daemon, so that it + * thinks that the pages have been "cleaned". Note that since + * the pages are in a delayed write buffer -- the VFS layer + * "will" see that the pages get written out on the next sync, + * or perhaps the cluster will be completed. */ - vfs_clean_pages(bp); + vfs_clean_pages_dirty_buf(bp); bqrelse(bp); /* @@ -2380,31 +2379,46 @@ notinmem: } /* - * vfs_setdirty: - * - * Sets the dirty range for a buffer based on the status of the dirty - * bits in the pages comprising the buffer. + * Set the dirty range for a buffer based on the status of the dirty + * bits in the pages comprising the buffer. The range is limited + * to the size of the buffer. * - * The range is limited to the size of the buffer. + * Tell the VM system that the pages associated with this buffer + * are clean. This is used for delayed writes where the data is + * going to go to disk eventually without additional VM intevention. * - * This routine is primarily used by NFS, but is generalized for the - * B_VMIO case. + * Note that while we only really need to clean through to b_bcount, we + * just go ahead and clean through to b_bufsize. */ static void -vfs_setdirty(struct buf *bp) +vfs_clean_pages_dirty_buf(struct buf *bp) { + vm_ooffset_t foff, noff, eoff; + vm_page_t m; + int i; - /* - * Degenerate case - empty buffer - */ - if (bp->b_bufsize == 0) + if ((bp->b_flags & B_VMIO) == 0 || bp->b_bufsize == 0) return; - if ((bp->b_flags & B_VMIO) == 0) - return; + foff = bp->b_offset; + KASSERT(bp->b_offset != NOOFFSET, + ("vfs_clean_pages_dirty_buf: no buffer offset")); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); + vfs_drain_busy_pages(bp); vfs_setdirty_locked_object(bp); + vm_page_lock_queues(); + for (i = 0; i < bp->b_npages; i++) { + noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; + eoff = noff; + if (eoff > bp->b_offset + bp->b_bufsize) + eoff = bp->b_offset + bp->b_bufsize; + m = bp->b_pages[i]; + vfs_page_set_validclean(bp, foff, m); + /* vm_page_clear_dirty(m, foff & PAGE_MASK, eoff - foff); */ + foff = noff; + } + vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); } @@ -3508,6 +3522,31 @@ vfs_page_set_validclean(struct buf *bp, } /* + * Ensure that all buffer pages are not busied by VPO_BUSY flag. If + * any page is busy, drain the flag. + */ +static void +vfs_drain_busy_pages(struct buf *bp) +{ + vm_page_t m; + int i, last_busied; + + VM_OBJECT_LOCK_ASSERT(bp->b_bufobj->bo_object, MA_OWNED); + last_busied = 0; + for (i = 0; i < bp->b_npages; i++) { + m = bp->b_pages[i]; + if ((m->oflags & VPO_BUSY) != 0) { + for (; last_busied < i; last_busied++) + vm_page_busy(bp->b_pages[last_busied]); + while ((m->oflags & VPO_BUSY) != 0) + vm_page_sleep(m, "vbpage"); + } + } + for (i = 0; i < last_busied; i++) + vm_page_wakeup(bp->b_pages[i]); +} + +/* * This routine is called before a device strategy routine. * It is used to tell the VM system that paging I/O is in * progress, and treat the pages associated with the buffer @@ -3535,15 +3574,9 @@ vfs_busy_pages(struct buf *bp, int clear KASSERT(bp->b_offset != NOOFFSET, ("vfs_busy_pages: no buffer offset")); VM_OBJECT_LOCK(obj); + vfs_drain_busy_pages(bp); if (bp->b_bufsize != 0) vfs_setdirty_locked_object(bp); -retry: - for (i = 0; i < bp->b_npages; i++) { - m = bp->b_pages[i]; - - if (vm_page_sleep_if_busy(m, FALSE, "vbpage")) - goto retry; - } bogus = 0; if (clear_modify) vm_page_lock_queues(); @@ -3588,44 +3621,6 @@ retry: } /* - * Tell the VM system that the pages associated with this buffer - * are clean. This is used for delayed writes where the data is - * going to go to disk eventually without additional VM intevention. - * - * Note that while we only really need to clean through to b_bcount, we - * just go ahead and clean through to b_bufsize. - */ -static void -vfs_clean_pages(struct buf *bp) -{ - int i; - vm_ooffset_t foff, noff, eoff; - vm_page_t m; - - if (!(bp->b_flags & B_VMIO)) - return; - - foff = bp->b_offset; - KASSERT(bp->b_offset != NOOFFSET, - ("vfs_clean_pages: no buffer offset")); - VM_OBJECT_LOCK(bp->b_bufobj->bo_object); - vm_page_lock_queues(); - for (i = 0; i < bp->b_npages; i++) { - m = bp->b_pages[i]; - noff = (foff + PAGE_SIZE) & ~(off_t)PAGE_MASK; - eoff = noff; - - if (eoff > bp->b_offset + bp->b_bufsize) - eoff = bp->b_offset + bp->b_bufsize; - vfs_page_set_validclean(bp, foff, m); - /* vm_page_clear_dirty(m, foff & PAGE_MASK, eoff - foff); */ - foff = noff; - } - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); -} - -/* * vfs_bio_set_valid: * * Set the range within the buffer to valid. The range is From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 10:40:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15792106564A; Wed, 23 Jun 2010 10:40: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 02F418FC14; Wed, 23 Jun 2010 10:40:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NAeSeE040604; Wed, 23 Jun 2010 10:40:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NAeSto040598; Wed, 23 Jun 2010 10:40:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006231040.o5NAeSto040598@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 10:40: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: r209460 - in head/sys: dev/fb i386/i386 i386/include i386/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 10:40:29 -0000 Author: kib Date: Wed Jun 23 10:40:28 2010 New Revision: 209460 URL: http://svn.freebsd.org/changeset/base/209460 Log: Remove unused i586 optimized bcopy/bzero/etc implementations that utilize FPU registers for copying. Remove the switch table and jumps from bcopy/bzero/... to the actual implementation. As a side-effect, i486-optimized bzero is removed. Reviewed by: bde Tested by: pho (previous version) Modified: head/sys/dev/fb/fbreg.h head/sys/i386/i386/identcpu.c head/sys/i386/i386/support.s head/sys/i386/include/md_var.h head/sys/i386/isa/npx.c Modified: head/sys/dev/fb/fbreg.h ============================================================================== --- head/sys/dev/fb/fbreg.h Wed Jun 23 10:06:57 2010 (r209459) +++ head/sys/dev/fb/fbreg.h Wed Jun 23 10:40:28 2010 (r209460) @@ -34,16 +34,7 @@ #define V_MAX_ADAPTERS 8 /* XXX */ /* some macros */ -#ifdef __i386__ -#define bcopy_io(s, d, c) generic_bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_toio(s, d, c) generic_bcopy((void *)(s), (void *)(d), (c)) -#define bcopy_fromio(s, d, c) generic_bcopy((void *)(s), (void *)(d), (c)) -#define bzero_io(d, c) generic_bzero((void *)(d), (c)) -#define fill_io(p, d, c) fill((p), (void *)(d), (c)) -#define fillw_io(p, d, c) fillw((p), (void *)(d), (c)) -void generic_bcopy(const void *s, void *d, size_t c); -void generic_bzero(void *d, size_t c); -#elif defined(__amd64__) +#if defined(__amd64__) || defined(__i386__) #define bcopy_io(s, d, c) bcopy((void *)(s), (void *)(d), (c)) #define bcopy_toio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) #define bcopy_fromio(s, d, c) bcopy((void *)(s), (void *)(d), (c)) Modified: head/sys/i386/i386/identcpu.c ============================================================================== --- head/sys/i386/i386/identcpu.c Wed Jun 23 10:06:57 2010 (r209459) +++ head/sys/i386/i386/identcpu.c Wed Jun 23 10:40:28 2010 (r209460) @@ -634,7 +634,6 @@ printcpuinfo(void) #if defined(I486_CPU) case CPUCLASS_486: printf("486"); - bzero_vector = i486_bzero; break; #endif #if defined(I586_CPU) Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Wed Jun 23 10:06:57 2010 (r209459) +++ head/sys/i386/i386/support.s Wed Jun 23 10:40:28 2010 (r209460) @@ -42,23 +42,6 @@ #define IDXSHIFT 10 .data - .globl bcopy_vector -bcopy_vector: - .long generic_bcopy - .globl bzero_vector -bzero_vector: - .long generic_bzero - .globl copyin_vector -copyin_vector: - .long generic_copyin - .globl copyout_vector -copyout_vector: - .long generic_copyout -#if defined(I586_CPU) && defined(DEV_NPX) -kernel_fpu_lock: - .byte 0xfe - .space 3 -#endif ALIGN_DATA .globl intrcnt, eintrcnt intrcnt: @@ -76,13 +59,7 @@ eintrnames: * bcopy family * void bzero(void *buf, u_int len) */ - ENTRY(bzero) - MEXITCOUNT - jmp *bzero_vector -END(bzero) - -ENTRY(generic_bzero) pushl %edi movl 8(%esp),%edi movl 12(%esp),%ecx @@ -97,270 +74,8 @@ ENTRY(generic_bzero) stosb popl %edi ret -END(generic_bzero) +END(bzero) -#ifdef I486_CPU -ENTRY(i486_bzero) - movl 4(%esp),%edx - movl 8(%esp),%ecx - xorl %eax,%eax -/* - * do 64 byte chunks first - * - * XXX this is probably over-unrolled at least for DX2's - */ -2: - cmpl $64,%ecx - jb 3f - movl %eax,(%edx) - movl %eax,4(%edx) - movl %eax,8(%edx) - movl %eax,12(%edx) - movl %eax,16(%edx) - movl %eax,20(%edx) - movl %eax,24(%edx) - movl %eax,28(%edx) - movl %eax,32(%edx) - movl %eax,36(%edx) - movl %eax,40(%edx) - movl %eax,44(%edx) - movl %eax,48(%edx) - movl %eax,52(%edx) - movl %eax,56(%edx) - movl %eax,60(%edx) - addl $64,%edx - subl $64,%ecx - jnz 2b - ret - -/* - * do 16 byte chunks - */ - SUPERALIGN_TEXT -3: - cmpl $16,%ecx - jb 4f - movl %eax,(%edx) - movl %eax,4(%edx) - movl %eax,8(%edx) - movl %eax,12(%edx) - addl $16,%edx - subl $16,%ecx - jnz 3b - ret - -/* - * do 4 byte chunks - */ - SUPERALIGN_TEXT -4: - cmpl $4,%ecx - jb 5f - movl %eax,(%edx) - addl $4,%edx - subl $4,%ecx - jnz 4b - ret - -/* - * do 1 byte chunks - * a jump table seems to be faster than a loop or more range reductions - * - * XXX need a const section for non-text - */ - .data -jtab: - .long do0 - .long do1 - .long do2 - .long do3 - - .text - SUPERALIGN_TEXT -5: - jmp *jtab(,%ecx,4) - - SUPERALIGN_TEXT -do3: - movw %ax,(%edx) - movb %al,2(%edx) - ret - - SUPERALIGN_TEXT -do2: - movw %ax,(%edx) - ret - - SUPERALIGN_TEXT -do1: - movb %al,(%edx) - ret - - SUPERALIGN_TEXT -do0: - ret -END(i486_bzero) -#endif - -#if defined(I586_CPU) && defined(DEV_NPX) -ENTRY(i586_bzero) - movl 4(%esp),%edx - movl 8(%esp),%ecx - - /* - * The FPU register method is twice as fast as the integer register - * method unless the target is in the L1 cache and we pre-allocate a - * cache line for it (then the integer register method is 4-5 times - * faster). However, we never pre-allocate cache lines, since that - * would make the integer method 25% or more slower for the common - * case when the target isn't in either the L1 cache or the L2 cache. - * Thus we normally use the FPU register method unless the overhead - * would be too large. - */ - cmpl $256,%ecx /* empirical; clts, fninit, smsw cost a lot */ - jb intreg_i586_bzero - - /* - * The FPU registers may belong to an application or to fastmove() - * or to another invocation of bcopy() or ourself in a higher level - * interrupt or trap handler. Preserving the registers is - * complicated since we avoid it if possible at all levels. We - * want to localize the complications even when that increases them. - * Here the extra work involves preserving CR0_TS in TS. - * `fpcurthread != NULL' is supposed to be the condition that all the - * FPU resources belong to an application, but fpcurthread and CR0_TS - * aren't set atomically enough for this condition to work in - * interrupt handlers. - * - * Case 1: FPU registers belong to the application: we must preserve - * the registers if we use them, so we only use the FPU register - * method if the target size is large enough to amortize the extra - * overhead for preserving them. CR0_TS must be preserved although - * it is very likely to end up as set. - * - * Case 2: FPU registers belong to fastmove(): fastmove() currently - * makes the registers look like they belong to an application so - * that cpu_switch() and savectx() don't have to know about it, so - * this case reduces to case 1. - * - * Case 3: FPU registers belong to the kernel: don't use the FPU - * register method. This case is unlikely, and supporting it would - * be more complicated and might take too much stack. - * - * Case 4: FPU registers don't belong to anyone: the FPU registers - * don't need to be preserved, so we always use the FPU register - * method. CR0_TS must be preserved although it is very likely to - * always end up as clear. - */ - cmpl $0,PCPU(FPCURTHREAD) - je i586_bz1 - - /* - * XXX don't use the FPU for cases 1 and 2, since preemptive - * scheduling of ithreads broke these cases. Note that we can - * no longer get here from an interrupt handler, since the - * context sitch to the interrupt handler will have saved the - * FPU state. - */ - jmp intreg_i586_bzero - - cmpl $256+184,%ecx /* empirical; not quite 2*108 more */ - jb intreg_i586_bzero - sarb $1,kernel_fpu_lock - jc intreg_i586_bzero - smsw %ax - clts - subl $108,%esp - fnsave 0(%esp) - jmp i586_bz2 - -i586_bz1: - sarb $1,kernel_fpu_lock - jc intreg_i586_bzero - smsw %ax - clts - fninit /* XXX should avoid needing this */ -i586_bz2: - fldz - - /* - * Align to an 8 byte boundary (misalignment in the main loop would - * cost a factor of >= 2). Avoid jumps (at little cost if it is - * already aligned) by always zeroing 8 bytes and using the part up - * to the _next_ alignment position. - */ - fstl 0(%edx) - addl %edx,%ecx /* part of %ecx -= new_%edx - %edx */ - addl $8,%edx - andl $~7,%edx - subl %edx,%ecx - - /* - * Similarly align `len' to a multiple of 8. - */ - fstl -8(%edx,%ecx) - decl %ecx - andl $~7,%ecx - - /* - * This wouldn't be any faster if it were unrolled, since the loop - * control instructions are much faster than the fstl and/or done - * in parallel with it so their overhead is insignificant. - */ -fpureg_i586_bzero_loop: - fstl 0(%edx) - addl $8,%edx - subl $8,%ecx - cmpl $8,%ecx - jae fpureg_i586_bzero_loop - - cmpl $0,PCPU(FPCURTHREAD) - je i586_bz3 - - /* XXX check that the condition for cases 1-2 stayed false. */ -i586_bzero_oops: - int $3 - jmp i586_bzero_oops - - frstor 0(%esp) - addl $108,%esp - lmsw %ax - movb $0xfe,kernel_fpu_lock - ret - -i586_bz3: - fstp %st(0) - lmsw %ax - movb $0xfe,kernel_fpu_lock - ret - -intreg_i586_bzero: - /* - * `rep stos' seems to be the best method in practice for small - * counts. Fancy methods usually take too long to start up due - * to cache and BTB misses. - */ - pushl %edi - movl %edx,%edi - xorl %eax,%eax - shrl $2,%ecx - cld - rep - stosl - movl 12(%esp),%ecx - andl $3,%ecx - jne 1f - popl %edi - ret - -1: - rep - stosb - popl %edi - ret -END(i586_bzero) -#endif /* I586_CPU && defined(DEV_NPX) */ - ENTRY(sse2_pagezero) pushl %ebx movl 8(%esp),%ecx @@ -473,16 +188,11 @@ ENTRY(bcopyb) ret END(bcopyb) -ENTRY(bcopy) - MEXITCOUNT - jmp *bcopy_vector -END(bcopy) - /* - * generic_bcopy(src, dst, cnt) + * bcopy(src, dst, cnt) * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ -ENTRY(generic_bcopy) +ENTRY(bcopy) pushl %esi pushl %edi movl 12(%esp),%esi @@ -526,157 +236,7 @@ ENTRY(generic_bcopy) popl %esi cld ret -END(generic_bcopy) - -#if defined(I586_CPU) && defined(DEV_NPX) -ENTRY(i586_bcopy) - pushl %esi - pushl %edi - movl 12(%esp),%esi - movl 16(%esp),%edi - movl 20(%esp),%ecx - - movl %edi,%eax - subl %esi,%eax - cmpl %ecx,%eax /* overlapping && src < dst? */ - jb 1f - - cmpl $1024,%ecx - jb small_i586_bcopy - - sarb $1,kernel_fpu_lock - jc small_i586_bcopy - cmpl $0,PCPU(FPCURTHREAD) - je i586_bc1 - - /* XXX turn off handling of cases 1-2, as above. */ - movb $0xfe,kernel_fpu_lock - jmp small_i586_bcopy - - smsw %dx - clts - subl $108,%esp - fnsave 0(%esp) - jmp 4f - -i586_bc1: - smsw %dx - clts - fninit /* XXX should avoid needing this */ - - ALIGN_TEXT -4: - pushl %ecx -#define DCACHE_SIZE 8192 - cmpl $(DCACHE_SIZE-512)/2,%ecx - jbe 2f - movl $(DCACHE_SIZE-512)/2,%ecx -2: - subl %ecx,0(%esp) - cmpl $256,%ecx - jb 5f /* XXX should prefetch if %ecx >= 32 */ - pushl %esi - pushl %ecx - ALIGN_TEXT -3: - movl 0(%esi),%eax - movl 32(%esi),%eax - movl 64(%esi),%eax - movl 96(%esi),%eax - movl 128(%esi),%eax - movl 160(%esi),%eax - movl 192(%esi),%eax - movl 224(%esi),%eax - addl $256,%esi - subl $256,%ecx - cmpl $256,%ecx - jae 3b - popl %ecx - popl %esi -5: - ALIGN_TEXT -large_i586_bcopy_loop: - fildq 0(%esi) - fildq 8(%esi) - fildq 16(%esi) - fildq 24(%esi) - fildq 32(%esi) - fildq 40(%esi) - fildq 48(%esi) - fildq 56(%esi) - fistpq 56(%edi) - fistpq 48(%edi) - fistpq 40(%edi) - fistpq 32(%edi) - fistpq 24(%edi) - fistpq 16(%edi) - fistpq 8(%edi) - fistpq 0(%edi) - addl $64,%esi - addl $64,%edi - subl $64,%ecx - cmpl $64,%ecx - jae large_i586_bcopy_loop - popl %eax - addl %eax,%ecx - cmpl $64,%ecx - jae 4b - - cmpl $0,PCPU(FPCURTHREAD) - je i586_bc2 - - /* XXX check that the condition for cases 1-2 stayed false. */ -i586_bcopy_oops: - int $3 - jmp i586_bcopy_oops - - frstor 0(%esp) - addl $108,%esp -i586_bc2: - lmsw %dx - movb $0xfe,kernel_fpu_lock - -/* - * This is a duplicate of the main part of generic_bcopy. See the comments - * there. Jumping into generic_bcopy would cost a whole 0-1 cycles and - * would mess up high resolution profiling. - */ - ALIGN_TEXT -small_i586_bcopy: - shrl $2,%ecx - cld - rep - movsl - movl 20(%esp),%ecx - andl $3,%ecx - rep - movsb - popl %edi - popl %esi - ret - - ALIGN_TEXT -1: - addl %ecx,%edi - addl %ecx,%esi - decl %edi - decl %esi - andl $3,%ecx - std - rep - movsb - movl 20(%esp),%ecx - shrl $2,%ecx - subl $3,%esi - subl $3,%edi - rep - movsl - popl %edi - popl %esi - cld - ret -END(i586_bcopy) -#endif /* I586_CPU && defined(DEV_NPX) */ +END(bcopy) /* * Note: memcpy does not support overlapping copies @@ -723,11 +283,6 @@ END(memcpy) * copyout(from_kernel, to_user, len) - MP SAFE */ ENTRY(copyout) - MEXITCOUNT - jmp *copyout_vector -END(copyout) - -ENTRY(generic_copyout) movl PCPU(CURPCB),%eax movl $copyout_fault,PCB_ONFAULT(%eax) pushl %esi @@ -764,10 +319,6 @@ ENTRY(generic_copyout) /* bcopy(%esi, %edi, %ebx) */ movl %ebx,%ecx -#if defined(I586_CPU) && defined(DEV_NPX) - ALIGN_TEXT -slow_copyout: -#endif shrl $2,%ecx cld rep @@ -785,7 +336,7 @@ done_copyout: movl PCPU(CURPCB),%edx movl %eax,PCB_ONFAULT(%edx) ret -END(generic_copyout) +END(copyout) ALIGN_TEXT copyout_fault: @@ -797,70 +348,10 @@ copyout_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && defined(DEV_NPX) -ENTRY(i586_copyout) - /* - * Duplicated from generic_copyout. Could be done a bit better. - */ - movl PCPU(CURPCB),%eax - movl $copyout_fault,PCB_ONFAULT(%eax) - pushl %esi - pushl %edi - pushl %ebx - movl 16(%esp),%esi - movl 20(%esp),%edi - movl 24(%esp),%ebx - testl %ebx,%ebx /* anything to do? */ - jz done_copyout - - /* - * Check explicitly for non-user addresses. If 486 write protection - * is being used, this check is essential because we are in kernel - * mode so the h/w does not provide any protection against writing - * kernel addresses. - */ - - /* - * First, prevent address wrapping. - */ - movl %edi,%eax - addl %ebx,%eax - jc copyout_fault -/* - * XXX STOP USING VM_MAXUSER_ADDRESS. - * It is an end address, not a max, so every time it is used correctly it - * looks like there is an off by one error, and of course it caused an off - * by one error in several places. - */ - cmpl $VM_MAXUSER_ADDRESS,%eax - ja copyout_fault - - /* bcopy(%esi, %edi, %ebx) */ -3: - movl %ebx,%ecx - /* - * End of duplicated code. - */ - - cmpl $1024,%ecx - jb slow_copyout - - pushl %ecx - call fastmove - addl $4,%esp - jmp done_copyout -END(i586_copyout) -#endif /* I586_CPU && defined(DEV_NPX) */ - /* * copyin(from_user, to_kernel, len) - MP SAFE */ ENTRY(copyin) - MEXITCOUNT - jmp *copyin_vector -END(copyin) - -ENTRY(generic_copyin) movl PCPU(CURPCB),%eax movl $copyin_fault,PCB_ONFAULT(%eax) pushl %esi @@ -878,10 +369,6 @@ ENTRY(generic_copyin) cmpl $VM_MAXUSER_ADDRESS,%edx ja copyin_fault -#if defined(I586_CPU) && defined(DEV_NPX) - ALIGN_TEXT -slow_copyin: -#endif movb %cl,%al shrl $2,%ecx /* copy longword-wise */ cld @@ -892,17 +379,13 @@ slow_copyin: rep movsb -#if defined(I586_CPU) && defined(DEV_NPX) - ALIGN_TEXT -done_copyin: -#endif popl %edi popl %esi xorl %eax,%eax movl PCPU(CURPCB),%edx movl %eax,PCB_ONFAULT(%edx) ret -END(generic_copyin) +END(copyin) ALIGN_TEXT copyin_fault: @@ -913,250 +396,6 @@ copyin_fault: movl $EFAULT,%eax ret -#if defined(I586_CPU) && defined(DEV_NPX) -ENTRY(i586_copyin) - /* - * Duplicated from generic_copyin. Could be done a bit better. - */ - movl PCPU(CURPCB),%eax - movl $copyin_fault,PCB_ONFAULT(%eax) - pushl %esi - pushl %edi - movl 12(%esp),%esi /* caddr_t from */ - movl 16(%esp),%edi /* caddr_t to */ - movl 20(%esp),%ecx /* size_t len */ - - /* - * make sure address is valid - */ - movl %esi,%edx - addl %ecx,%edx - jc copyin_fault - cmpl $VM_MAXUSER_ADDRESS,%edx - ja copyin_fault - /* - * End of duplicated code. - */ - - cmpl $1024,%ecx - jb slow_copyin - - pushl %ebx /* XXX prepare for fastmove_fault */ - pushl %ecx - call fastmove - addl $8,%esp - jmp done_copyin -END(i586_copyin) -#endif /* I586_CPU && defined(DEV_NPX) */ - -#if defined(I586_CPU) && defined(DEV_NPX) -/* fastmove(src, dst, len) - src in %esi - dst in %edi - len in %ecx XXX changed to on stack for profiling - uses %eax and %edx for tmp. storage - */ -/* XXX use ENTRY() to get profiling. fastmove() is actually a non-entry. */ -ENTRY(fastmove) - pushl %ebp - movl %esp,%ebp - subl $PCB_SAVEFPU_SIZE+3*4,%esp - - movl 8(%ebp),%ecx - cmpl $63,%ecx - jbe fastmove_tail - - testl $7,%esi /* check if src addr is multiple of 8 */ - jnz fastmove_tail - - testl $7,%edi /* check if dst addr is multiple of 8 */ - jnz fastmove_tail - - /* XXX grab FPU context atomically. */ - cli - -/* if (fpcurthread != NULL) { */ - cmpl $0,PCPU(FPCURTHREAD) - je 6f -/* fnsave(&curpcb->pcb_savefpu); */ - movl PCPU(CURPCB),%eax - fnsave PCB_SAVEFPU(%eax) -/* FPCURTHREAD = NULL; */ - movl $0,PCPU(FPCURTHREAD) -/* } */ -6: -/* now we own the FPU. */ - -/* - * The process' FP state is saved in the pcb, but if we get - * switched, the cpu_switch() will store our FP state in the - * pcb. It should be possible to avoid all the copying for - * this, e.g., by setting a flag to tell cpu_switch() to - * save the state somewhere else. - */ -/* tmp = curpcb->pcb_savefpu; */ - movl %ecx,-12(%ebp) - movl %esi,-8(%ebp) - movl %edi,-4(%ebp) - movl %esp,%edi - movl PCPU(CURPCB),%esi - addl $PCB_SAVEFPU,%esi - cld - movl $PCB_SAVEFPU_SIZE>>2,%ecx - rep - movsl - movl -12(%ebp),%ecx - movl -8(%ebp),%esi - movl -4(%ebp),%edi -/* stop_emulating(); */ - clts -/* fpcurthread = curthread; */ - movl PCPU(CURTHREAD),%eax - movl %eax,PCPU(FPCURTHREAD) - movl PCPU(CURPCB),%eax - - /* XXX end of atomic FPU context grab. */ - sti - - movl $fastmove_fault,PCB_ONFAULT(%eax) -4: - movl %ecx,-12(%ebp) - cmpl $1792,%ecx - jbe 2f - movl $1792,%ecx -2: - subl %ecx,-12(%ebp) - cmpl $256,%ecx - jb 5f - movl %ecx,-8(%ebp) - movl %esi,-4(%ebp) - ALIGN_TEXT -3: - movl 0(%esi),%eax - movl 32(%esi),%eax - movl 64(%esi),%eax - movl 96(%esi),%eax - movl 128(%esi),%eax - movl 160(%esi),%eax - movl 192(%esi),%eax - movl 224(%esi),%eax - addl $256,%esi - subl $256,%ecx - cmpl $256,%ecx - jae 3b - movl -8(%ebp),%ecx - movl -4(%ebp),%esi -5: - ALIGN_TEXT -fastmove_loop: - fildq 0(%esi) - fildq 8(%esi) - fildq 16(%esi) - fildq 24(%esi) - fildq 32(%esi) - fildq 40(%esi) - fildq 48(%esi) - fildq 56(%esi) - fistpq 56(%edi) - fistpq 48(%edi) - fistpq 40(%edi) - fistpq 32(%edi) - fistpq 24(%edi) - fistpq 16(%edi) - fistpq 8(%edi) - fistpq 0(%edi) - addl $-64,%ecx - addl $64,%esi - addl $64,%edi - cmpl $63,%ecx - ja fastmove_loop - movl -12(%ebp),%eax - addl %eax,%ecx - cmpl $64,%ecx - jae 4b - - /* XXX ungrab FPU context atomically. */ - cli - -/* curpcb->pcb_savefpu = tmp; */ - movl %ecx,-12(%ebp) - movl %esi,-8(%ebp) - movl %edi,-4(%ebp) - movl PCPU(CURPCB),%edi - addl $PCB_SAVEFPU,%edi - movl %esp,%esi - cld - movl $PCB_SAVEFPU_SIZE>>2,%ecx - rep - movsl - movl -12(%ebp),%ecx - movl -8(%ebp),%esi - movl -4(%ebp),%edi - -/* start_emulating(); */ - smsw %ax - orb $CR0_TS,%al - lmsw %ax -/* fpcurthread = NULL; */ - movl $0,PCPU(FPCURTHREAD) - - /* XXX end of atomic FPU context ungrab. */ - sti - - ALIGN_TEXT -fastmove_tail: - movl PCPU(CURPCB),%eax - movl $fastmove_tail_fault,PCB_ONFAULT(%eax) - - movb %cl,%al - shrl $2,%ecx /* copy longword-wise */ - cld - rep - movsl - movb %al,%cl - andb $3,%cl /* copy remaining bytes */ - rep - movsb - - movl %ebp,%esp - popl %ebp - ret - - ALIGN_TEXT -fastmove_fault: - /* XXX ungrab FPU context atomically. */ - cli - - movl PCPU(CURPCB),%edi - addl $PCB_SAVEFPU,%edi - movl %esp,%esi - cld - movl $PCB_SAVEFPU_SIZE>>2,%ecx - rep - movsl - - smsw %ax - orb $CR0_TS,%al - lmsw %ax - movl $0,PCPU(FPCURTHREAD) - - /* XXX end of atomic FPU context ungrab. */ - sti - -fastmove_tail_fault: - movl %ebp,%esp - popl %ebp - addl $8,%esp - popl %ebx - popl %edi - popl %esi - movl PCPU(CURPCB),%edx - movl $0,PCB_ONFAULT(%edx) - movl $EFAULT,%eax - ret -END(fastmove) -#endif /* I586_CPU && defined(DEV_NPX) */ - /* * casuword. Compare and set user word. Returns -1 or the current value. */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Wed Jun 23 10:06:57 2010 (r209459) +++ head/sys/i386/include/md_var.h Wed Jun 23 10:40:28 2010 (r209460) @@ -36,11 +36,6 @@ * Miscellaneous machine-dependent declarations. */ -extern void (*bcopy_vector)(const void *from, void *to, size_t len); -extern void (*bzero_vector)(void *buf, size_t len); -extern int (*copyin_vector)(const void *udaddr, void *kaddr, size_t len); -extern int (*copyout_vector)(const void *kaddr, void *udaddr, size_t len); - extern long Maxmem; extern u_int basemem; /* PA of original top of base memory */ extern int busdma_swi_pending; @@ -98,11 +93,6 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); -void i486_bzero(void *buf, size_t len); -void i586_bcopy(const void *from, void *to, size_t len); -void i586_bzero(void *buf, size_t len); -int i586_copyin(const void *udaddr, void *kaddr, size_t len); -int i586_copyout(const void *kaddr, void *udaddr, size_t len); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Wed Jun 23 10:06:57 2010 (r209459) +++ head/sys/i386/isa/npx.c Wed Jun 23 10:40:28 2010 (r209460) @@ -85,11 +85,6 @@ __FBSDID("$FreeBSD$"); * 387 and 287 Numeric Coprocessor Extension (NPX) Driver. */ -/* Configuration flags. */ -#define NPX_DISABLE_I586_OPTIMIZED_BCOPY (1 << 0) -#define NPX_DISABLE_I586_OPTIMIZED_BZERO (1 << 1) -#define NPX_DISABLE_I586_OPTIMIZED_COPYIO (1 << 2) - #if defined(__GNUCLIKE_ASM) && !defined(lint) #define fldcw(addr) __asm("fldcw %0" : : "m" (*(addr))) @@ -168,10 +163,6 @@ static int npx_attach(device_t dev); static void npx_identify(driver_t *driver, device_t parent); static int npx_intr(void *); static int npx_probe(device_t dev); -#ifdef I586_CPU_XXX -static long timezero(const char *funcname, - void (*func)(void *buf, size_t len)); -#endif /* I586_CPU */ int hw_float; /* XXX currently just alias for npx_exists */ @@ -442,22 +433,8 @@ npx_attach(dev) bzero(npx_initialstate.sv_87.sv_ac, sizeof(npx_initialstate.sv_87.sv_ac)); intr_restore(s); -#ifdef I586_CPU_XXX - if (cpu_class == CPUCLASS_586 && npx_ex16 && - timezero("i586_bzero()", i586_bzero) < - timezero("bzero()", bzero) * 4 / 5) { - if (!(flags & NPX_DISABLE_I586_OPTIMIZED_BCOPY)) - bcopy_vector = i586_bcopy; - if (!(flags & NPX_DISABLE_I586_OPTIMIZED_BZERO)) - bzero_vector = i586_bzero; - if (!(flags & NPX_DISABLE_I586_OPTIMIZED_COPYIO)) { - copyin_vector = i586_copyin; - copyout_vector = i586_copyout; - } - } -#endif - return (0); /* XXX unused */ + return (0); } /* @@ -1085,36 +1062,6 @@ fpurstor(addr) frstor(addr); } -#ifdef I586_CPU_XXX -static long -timezero(funcname, func) - const char *funcname; - void (*func)(void *buf, size_t len); - -{ - void *buf; -#define BUFSIZE 1048576 - long usec; - struct timeval finish, start; - - buf = malloc(BUFSIZE, M_TEMP, M_NOWAIT); - if (buf == NULL) - return (BUFSIZE); - microtime(&start); - (*func)(buf, BUFSIZE); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 11:12:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E927106566B; Wed, 23 Jun 2010 11:12:59 +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 2C0698FC1A; Wed, 23 Jun 2010 11:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NBCxmL047931; Wed, 23 Jun 2010 11:12:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NBCxml047925; Wed, 23 Jun 2010 11:12:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006231112.o5NBCxml047925@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 11:12: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: r209461 - in head/sys: i386/i386 i386/include i386/isa kern pc98/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 11:12:59 -0000 Author: kib Date: Wed Jun 23 11:12:58 2010 New Revision: 209461 URL: http://svn.freebsd.org/changeset/base/209461 Log: Remove the support for int13 FPU exception reporting on i386. It is believed that all 486-class CPUs FreeBSD is capable to run on, either have no FPU and cannot use external coprocessor, or have FPU on the package and can use #MF. Reviewed by: bde Tested by: pho (previous version) Modified: head/sys/i386/i386/vm_machdep.c head/sys/i386/include/npx.h head/sys/i386/include/pcb.h head/sys/i386/isa/npx.c head/sys/kern/subr_trap.c head/sys/pc98/include/npx.h Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Wed Jun 23 10:40:28 2010 (r209460) +++ head/sys/i386/i386/vm_machdep.c Wed Jun 23 11:12:58 2010 (r209461) @@ -441,7 +441,7 @@ cpu_set_upcall(struct thread *td, struct * values here. */ bcopy(td0->td_pcb, pcb2, sizeof(*pcb2)); - pcb2->pcb_flags &= ~(PCB_NPXTRAP|PCB_NPXINITDONE|PCB_NPXUSERINITDONE); + pcb2->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE); pcb2->pcb_save = &pcb2->pcb_user_save; /* Modified: head/sys/i386/include/npx.h ============================================================================== --- head/sys/i386/include/npx.h Wed Jun 23 10:40:28 2010 (r209460) +++ head/sys/i386/include/npx.h Wed Jun 23 11:12:58 2010 (r209461) @@ -138,11 +138,6 @@ union savefpu { #ifdef _KERNEL -#define IO_NPX 0x0F0 /* Numeric Coprocessor */ -#define IO_NPXSIZE 16 /* 80387/80487 NPX registers */ - -#define IRQ_NPX 13 - struct fpu_kern_ctx { union savefpu hwstate; union savefpu *prev; @@ -152,9 +147,6 @@ struct fpu_kern_ctx { #define PCB_USER_FPU(pcb) (((pcb)->pcb_flags & PCB_KERNNPX) == 0) -/* full reset on some systems, NOP on others */ -#define npx_full_reset() outb(IO_NPX + 1, 0) - int npxdna(void); void npxdrop(void); void npxexit(struct thread *td); Modified: head/sys/i386/include/pcb.h ============================================================================== --- head/sys/i386/include/pcb.h Wed Jun 23 10:40:28 2010 (r209460) +++ head/sys/i386/include/pcb.h Wed Jun 23 11:12:58 2010 (r209461) @@ -65,7 +65,6 @@ struct pcb { u_int pcb_flags; #define FP_SOFTFP 0x01 /* process using software fltng pnt emulator */ #define PCB_DBREGS 0x02 /* process using debug registers */ -#define PCB_NPXTRAP 0x04 /* npx trap pending */ #define PCB_NPXINITDONE 0x08 /* fpu state is initialized */ #define PCB_VM86CALL 0x10 /* in vm86 call */ #define PCB_NPXUSERINITDONE 0x20 /* user fpu state is initialized */ Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Wed Jun 23 10:40:28 2010 (r209460) +++ head/sys/i386/isa/npx.c Wed Jun 23 11:12:58 2010 (r209461) @@ -161,21 +161,15 @@ static void fpusave(union savefpu *); static void fpurstor(union savefpu *); static int npx_attach(device_t dev); static void npx_identify(driver_t *driver, device_t parent); -static int npx_intr(void *); static int npx_probe(device_t dev); -int hw_float; /* XXX currently just alias for npx_exists */ +int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); -static volatile u_int npx_intrs_while_probing; static volatile u_int npx_traps_while_probing; - static union savefpu npx_initialstate; -static bool_t npx_ex16; -static bool_t npx_exists; -static bool_t npx_irq13; alias_for_inthand_t probetrap; __asm(" \n\ @@ -205,58 +199,14 @@ npx_identify(driver, parent) } /* - * Do minimal handling of npx interrupts to convert them to traps. - */ -static int -npx_intr(dummy) - void *dummy; -{ - struct thread *td; - - npx_intrs_while_probing++; - - /* - * The BUSY# latch must be cleared in all cases so that the next - * unmasked npx exception causes an interrupt. - */ - outb(IO_NPX, 0); - - /* - * fpcurthread is normally non-null here. In that case, schedule an - * AST to finish the exception handling in the correct context - * (this interrupt may occur after the thread has entered the - * kernel via a syscall or an interrupt). Otherwise, the npx - * state of the thread that caused this interrupt must have been - * pushed to the thread's pcb, and clearing of the busy latch - * above has finished the (essentially null) handling of this - * interrupt. Control will eventually return to the instruction - * that caused it and it will repeat. We will eventually (usually - * soon) win the race to handle the interrupt properly. - */ - td = PCPU_GET(fpcurthread); - if (td != NULL) { - td->td_pcb->pcb_flags |= PCB_NPXTRAP; - thread_lock(td); - td->td_flags |= TDF_ASTPENDING; - thread_unlock(td); - } - return (FILTER_HANDLED); -} - -/* * Probe routine. Set flags to tell npxattach() what to do. Set up an * interrupt handler if npx needs to use interrupts. */ static int -npx_probe(dev) - device_t dev; +npx_probe(device_t dev) { struct gate_descriptor save_idt_npxtrap; - struct resource *ioport_res, *irq_res; - void *irq_cookie; - int ioport_rid, irq_num, irq_rid; - u_short control; - u_short status; + u_short control, status; device_set_desc(dev, "math processor"); @@ -266,8 +216,7 @@ npx_probe(dev) * common case right away. */ if (cpu_feature & CPUID_FPU) { - hw_float = npx_exists = 1; - npx_ex16 = 1; + hw_float = 1; device_quiet(dev); return (0); } @@ -275,28 +224,6 @@ npx_probe(dev) save_idt_npxtrap = idt[IDT_MF]; setidt(IDT_MF, probetrap, SDT_SYS386TGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL)); - ioport_rid = 0; - ioport_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &ioport_rid, - IO_NPX, IO_NPX + IO_NPXSIZE - 1, IO_NPXSIZE, RF_ACTIVE); - if (ioport_res == NULL) - panic("npx: can't get ports"); - if (resource_int_value("npx", 0, "irq", &irq_num) != 0) - irq_num = IRQ_NPX; - irq_rid = 0; - irq_res = bus_alloc_resource(dev, SYS_RES_IRQ, &irq_rid, irq_num, - irq_num, 1, RF_ACTIVE); - if (irq_res != NULL) { - if (bus_setup_intr(dev, irq_res, INTR_TYPE_MISC, - npx_intr, NULL, NULL, &irq_cookie) != 0) - panic("npx: can't create intr"); - } - - /* - * Partially reset the coprocessor, if any. Some BIOS's don't reset - * it after a warm boot. - */ - npx_full_reset(); - outb(IO_NPX, 0); /* * Don't trap while we're probing. @@ -317,9 +244,6 @@ npx_probe(dev) */ DELAY(1000); /* wait for any IRQ13 */ #ifdef DIAGNOSTIC - if (npx_intrs_while_probing != 0) - printf("fninit caused %u bogus npx interrupt(s)\n", - npx_intrs_while_probing); if (npx_traps_while_probing != 0) printf("fninit caused %u bogus npx trap(s)\n", npx_traps_while_probing); @@ -336,7 +260,6 @@ npx_probe(dev) control = 0x5a5a; fnstcw(&control); if ((control & 0x1f3f) == 0x033f) { - hw_float = npx_exists = 1; /* * We have an npx, now divide by 0 to see if exception * 16 works. @@ -348,70 +271,46 @@ npx_probe(dev) * FPU error signal doesn't work on some CPU * accelerator board. */ - npx_ex16 = 1; + hw_float = 1; return (0); #endif - npx_traps_while_probing = npx_intrs_while_probing = 0; + npx_traps_while_probing = 0; fp_divide_by_0(); - DELAY(1000); /* wait for any IRQ13 */ if (npx_traps_while_probing != 0) { /* * Good, exception 16 works. */ - npx_ex16 = 1; - goto no_irq13; - } - if (npx_intrs_while_probing != 0) { - /* - * Bad, we are stuck with IRQ13. - */ - npx_irq13 = 1; - idt[IDT_MF] = save_idt_npxtrap; -#ifdef SMP - if (mp_ncpus > 1) - panic("npx0 cannot use IRQ 13 on an SMP system"); -#endif - return (0); + hw_float = 1; + goto cleanup; } - /* - * Worse, even IRQ13 is broken. - */ + device_printf(dev, + "FPU does not use exception 16 for error reporting\n"); + goto cleanup; } } - /* Probe failed. Floating point simply won't work. */ + /* + * Probe failed. Floating point simply won't work. + * Notify user and disable FPU/MMX/SSE instruction execution. + */ device_printf(dev, "WARNING: no FPU!\n"); + __asm __volatile("smsw %%ax; orb %0,%%al; lmsw %%ax" : : + "n" (CR0_EM | CR0_MP) : "ax"); - /* FALLTHROUGH */ -no_irq13: +cleanup: idt[IDT_MF] = save_idt_npxtrap; - if (irq_res != NULL) { - bus_teardown_intr(dev, irq_res, irq_cookie); - bus_release_resource(dev, SYS_RES_IRQ, irq_rid, irq_res); - } - bus_release_resource(dev, SYS_RES_IOPORT, ioport_rid, ioport_res); - return (npx_exists ? 0 : ENXIO); + return (hw_float ? 0 : ENXIO); } /* * Attach routine - announce which it is, and wire into system */ static int -npx_attach(dev) - device_t dev; +npx_attach(device_t dev) { - int flags; register_t s; - flags = device_get_flags(dev); - - if (npx_irq13) - device_printf(dev, "IRQ 13 interface\n"); - else if (!device_is_quiet(dev) || bootverbose) - device_printf(dev, "INT 16 interface\n"); - npxinit(); - s = intr_disable(); stop_emulating(); fpusave(&npx_initialstate); @@ -447,7 +346,7 @@ npxinit(void) register_t savecrit; u_short control; - if (!npx_exists) + if (!hw_float) return; /* * fninit has the same h/w bugs as fnsave. Use the detoxified @@ -482,7 +381,7 @@ npxexit(td) npxsave(PCPU_GET(curpcb)->pcb_save); intr_restore(savecrit); #ifdef NPX_DEBUG - if (npx_exists) { + if (hw_float) { u_int masked_exceptions; masked_exceptions = GET_FPU_CW(td) & GET_FPU_SW(td) & 0x7f; @@ -503,7 +402,7 @@ int npxformat() { - if (!npx_exists) + if (!hw_float) return (_MC_FPFMT_NODEV); #ifdef CPU_ENABLE_SSE if (cpu_fxsr) @@ -706,9 +605,9 @@ npxtrap() register_t savecrit; u_short control, status; - if (!npx_exists) { - printf("npxtrap: fpcurthread = %p, curthread = %p, npx_exists = %d\n", - PCPU_GET(fpcurthread), curthread, npx_exists); + if (!hw_float) { + printf("npxtrap: fpcurthread = %p, curthread = %p, hw_float = %d\n", + PCPU_GET(fpcurthread), curthread, hw_float); panic("npxtrap from nowhere"); } savecrit = intr_disable(); @@ -748,7 +647,7 @@ npxdna(void) struct pcb *pcb; register_t s; - if (!npx_exists) + if (!hw_float) return (0); if (PCPU_GET(fpcurthread) == curthread) { printf("npxdna: fpcurthread == curthread %d times\n", @@ -879,7 +778,7 @@ npxgetregs(struct thread *td, union save struct pcb *pcb; register_t s; - if (!npx_exists) + if (!hw_float) return (_MC_FPOWNED_NONE); pcb = td->td_pcb; @@ -915,7 +814,7 @@ npxgetuserregs(struct thread *td, union struct pcb *pcb; register_t s; - if (!npx_exists) + if (!hw_float) return (_MC_FPOWNED_NONE); pcb = td->td_pcb; @@ -954,7 +853,7 @@ npxsetregs(struct thread *td, union save struct pcb *pcb; register_t s; - if (!npx_exists) + if (!hw_float) return; pcb = td->td_pcb; @@ -981,7 +880,7 @@ npxsetuserregs(struct thread *td, union struct pcb *pcb; register_t s; - if (!npx_exists) + if (!hw_float) return; pcb = td->td_pcb; Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Wed Jun 23 10:40:28 2010 (r209460) +++ head/sys/kern/subr_trap.c Wed Jun 23 11:12:58 2010 (r209461) @@ -46,9 +46,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include "opt_kdtrace.h" -#ifdef __i386__ -#include "opt_npx.h" -#endif #include "opt_sched.h" #include @@ -75,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #ifdef XEN #include @@ -147,10 +143,6 @@ ast(struct trapframe *framep) struct proc *p; int flags; int sig; -#if defined(DEV_NPX) && !defined(SMP) - int ucode; - ksiginfo_t ksi; -#endif td = curthread; p = td->td_proc; @@ -190,19 +182,6 @@ ast(struct trapframe *framep) psignal(p, SIGVTALRM); PROC_UNLOCK(p); } -#if defined(DEV_NPX) && !defined(SMP) - if (PCPU_GET(curpcb)->pcb_flags & PCB_NPXTRAP) { - atomic_clear_int(&PCPU_GET(curpcb)->pcb_flags, - PCB_NPXTRAP); - ucode = npxtrap(); - if (ucode != -1) { - ksiginfo_init_trap(&ksi); - ksi.ksi_signo = SIGFPE; - ksi.ksi_code = ucode; - trapsignal(td, &ksi); - } - } -#endif if (flags & TDF_PROFPEND) { PROC_LOCK(p); psignal(p, SIGPROF); Modified: head/sys/pc98/include/npx.h ============================================================================== --- head/sys/pc98/include/npx.h Wed Jun 23 10:40:28 2010 (r209460) +++ head/sys/pc98/include/npx.h Wed Jun 23 11:12:58 2010 (r209461) @@ -1,49 +1,6 @@ /*- - * Copyright (C) 2005 TAKAHASHI Yoshihiro. 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 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 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$ + * This file is in the public domain. */ - -#ifndef _PC98_INCLUDE_NPX_H_ -#define _PC98_INCLUDE_NPX_H_ +/* $FreeBSD$ */ #include - -#ifdef _KERNEL - -#undef IO_NPX -#define IO_NPX 0x0F8 /* Numeric Coprocessor */ -#undef IO_NPXSIZE -#define IO_NPXSIZE 8 /* 80387/80487 NPX registers */ - -#undef IRQ_NPX -#define IRQ_NPX 8 - -/* full reset of npx: not needed on pc98 */ -#undef npx_full_reset -#define npx_full_reset() - -#endif /* _KERNEL */ - -#endif /* _PC98_INCLUDE_NPX_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 11:21:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309D1106567B; Wed, 23 Jun 2010 11:21:20 +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 BCD158FC25; Wed, 23 Jun 2010 11:21:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NBLJ21049790; Wed, 23 Jun 2010 11:21:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NBLJ8M049785; Wed, 23 Jun 2010 11:21:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006231121.o5NBLJ8M049785@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 11:21: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: r209462 - in head/sys: i386/i386 i386/isa pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 11:21:20 -0000 Author: kib Date: Wed Jun 23 11:21:19 2010 New Revision: 209462 URL: http://svn.freebsd.org/changeset/base/209462 Log: After the FPU use requires #MF working due to INT13 FPU exception handling removal, MFi386 r209198: Use critical sections instead of disabling local interrupts to ensure the consistency between PCPU fpcurthread and the state of FPU. Reviewed by: bde Tested by: pho Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/vm_machdep.c head/sys/i386/isa/npx.c head/sys/pc98/pc98/machdep.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Jun 23 11:12:58 2010 (r209461) +++ head/sys/i386/i386/machdep.c Wed Jun 23 11:21:19 2010 (r209462) @@ -3391,10 +3391,9 @@ set_fpcontext(struct thread *td, const m static void fpstate_drop(struct thread *td) { - register_t s; KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); - s = intr_disable(); + critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) npxdrop(); @@ -3411,7 +3410,7 @@ fpstate_drop(struct thread *td) */ curthread->td_pcb->pcb_flags &= ~(PCB_NPXINITDONE | PCB_NPXUSERINITDONE); - intr_restore(s); + critical_exit(); } int Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Wed Jun 23 11:12:58 2010 (r209461) +++ head/sys/i386/i386/vm_machdep.c Wed Jun 23 11:21:19 2010 (r209462) @@ -150,9 +150,6 @@ cpu_fork(td1, p2, td2, flags) register struct proc *p1; struct pcb *pcb2; struct mdproc *mdp2; -#ifdef DEV_NPX - register_t savecrit; -#endif p1 = td1->td_proc; if ((flags & RFPROC) == 0) { @@ -180,10 +177,10 @@ cpu_fork(td1, p2, td2, flags) if (td1 == curthread) td1->td_pcb->pcb_gs = rgs(); #ifdef DEV_NPX - savecrit = intr_disable(); + critical_enter(); if (PCPU_GET(fpcurthread) == td1) npxsave(td1->td_pcb->pcb_save); - intr_restore(savecrit); + critical_exit(); #endif /* Point the pcb to the top of the stack */ @@ -328,8 +325,10 @@ cpu_thread_exit(struct thread *td) { #ifdef DEV_NPX + critical_enter(); if (td == PCPU_GET(fpcurthread)) npxdrop(); + critical_exit(); #endif /* Disable any hardware breakpoints. */ Modified: head/sys/i386/isa/npx.c ============================================================================== --- head/sys/i386/isa/npx.c Wed Jun 23 11:12:58 2010 (r209461) +++ head/sys/i386/isa/npx.c Wed Jun 23 11:21:19 2010 (r209462) @@ -308,10 +308,9 @@ cleanup: static int npx_attach(device_t dev) { - register_t s; npxinit(); - s = intr_disable(); + critical_enter(); stop_emulating(); fpusave(&npx_initialstate); start_emulating(); @@ -331,7 +330,7 @@ npx_attach(device_t dev) #endif bzero(npx_initialstate.sv_87.sv_ac, sizeof(npx_initialstate.sv_87.sv_ac)); - intr_restore(s); + critical_exit(); return (0); } @@ -352,6 +351,8 @@ npxinit(void) * fninit has the same h/w bugs as fnsave. Use the detoxified * fnsave to throw away any junk in the fpu. npxsave() initializes * the fpu and sets fpcurthread = NULL as important side effects. + * + * It is too early for critical_enter() to work on AP. */ savecrit = intr_disable(); npxsave(&dummy); @@ -374,12 +375,11 @@ void npxexit(td) struct thread *td; { - register_t savecrit; - savecrit = intr_disable(); + critical_enter(); if (curthread == PCPU_GET(fpcurthread)) npxsave(PCPU_GET(curpcb)->pcb_save); - intr_restore(savecrit); + critical_exit(); #ifdef NPX_DEBUG if (hw_float) { u_int masked_exceptions; @@ -602,7 +602,6 @@ static char fpetable[128] = { int npxtrap() { - register_t savecrit; u_short control, status; if (!hw_float) { @@ -610,7 +609,7 @@ npxtrap() PCPU_GET(fpcurthread), curthread, hw_float); panic("npxtrap from nowhere"); } - savecrit = intr_disable(); + critical_enter(); /* * Interrupt handling (for another interrupt) may have pushed the @@ -627,7 +626,7 @@ npxtrap() if (PCPU_GET(fpcurthread) == curthread) fnclex(); - intr_restore(savecrit); + critical_exit(); return (fpetable[status & ((~control & 0x3f) | 0x40)]); } @@ -645,14 +644,15 @@ int npxdna(void) { struct pcb *pcb; - register_t s; if (!hw_float) return (0); + critical_enter(); if (PCPU_GET(fpcurthread) == curthread) { printf("npxdna: fpcurthread == curthread %d times\n", ++err_count); stop_emulating(); + critical_exit(); return (1); } if (PCPU_GET(fpcurthread) != NULL) { @@ -662,7 +662,6 @@ npxdna(void) curthread, curthread->td_proc->p_pid); panic("npxdna"); } - s = intr_disable(); stop_emulating(); /* * Record new context early in case frstor causes an IRQ13. @@ -704,7 +703,7 @@ npxdna(void) */ fpurstor(pcb->pcb_save); } - intr_restore(s); + critical_exit(); return (1); } @@ -744,10 +743,6 @@ npxsave(addr) PCPU_SET(fpcurthread, NULL); } -/* - * This should be called with interrupts disabled and only when the owning - * FPU thread is non-null. - */ void npxdrop() { @@ -763,6 +758,8 @@ npxdrop() fnclex(); td = PCPU_GET(fpcurthread); + KASSERT(td == curthread, ("fpudrop: fpcurthread != curthread")); + CRITICAL_ASSERT(td); PCPU_SET(fpcurthread, NULL); td->td_pcb->pcb_flags &= ~PCB_NPXINITDONE; start_emulating(); @@ -776,7 +773,6 @@ int npxgetregs(struct thread *td, union savefpu *addr) { struct pcb *pcb; - register_t s; if (!hw_float) return (_MC_FPOWNED_NONE); @@ -787,7 +783,7 @@ npxgetregs(struct thread *td, union save SET_FPU_CW(addr, pcb->pcb_initial_npxcw); return (_MC_FPOWNED_NONE); } - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread)) { fpusave(addr); #ifdef CPU_ENABLE_SSE @@ -799,10 +795,10 @@ npxgetregs(struct thread *td, union save * starts with a clean state next time. */ npxdrop(); - intr_restore(s); + critical_exit(); return (_MC_FPOWNED_FPU); } else { - intr_restore(s); + critical_exit(); bcopy(pcb->pcb_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } @@ -812,7 +808,6 @@ int npxgetuserregs(struct thread *td, union savefpu *addr) { struct pcb *pcb; - register_t s; if (!hw_float) return (_MC_FPOWNED_NONE); @@ -823,7 +818,7 @@ npxgetuserregs(struct thread *td, union SET_FPU_CW(addr, pcb->pcb_initial_npxcw); return (_MC_FPOWNED_NONE); } - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fpusave(addr); #ifdef CPU_ENABLE_SSE @@ -835,10 +830,10 @@ npxgetuserregs(struct thread *td, union * starts with a clean state next time. */ npxdrop(); - intr_restore(s); + critical_exit(); return (_MC_FPOWNED_FPU); } else { - intr_restore(s); + critical_exit(); bcopy(&pcb->pcb_user_save, addr, sizeof(*addr)); return (_MC_FPOWNED_PCB); } @@ -851,22 +846,21 @@ void npxsetregs(struct thread *td, union savefpu *addr) { struct pcb *pcb; - register_t s; if (!hw_float) return; pcb = td->td_pcb; - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread)) { #ifdef CPU_ENABLE_SSE if (!cpu_fxsr) #endif fnclex(); /* As in npxdrop(). */ fpurstor(addr); - intr_restore(s); + critical_exit(); } else { - intr_restore(s); + critical_exit(); bcopy(addr, pcb->pcb_save, sizeof(*addr)); } if (PCB_USER_FPU(pcb)) @@ -878,23 +872,22 @@ void npxsetuserregs(struct thread *td, union savefpu *addr) { struct pcb *pcb; - register_t s; if (!hw_float) return; pcb = td->td_pcb; - s = intr_disable(); + critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { #ifdef CPU_ENABLE_SSE if (!cpu_fxsr) #endif fnclex(); /* As in npxdrop(). */ fpurstor(addr); - intr_restore(s); + critical_exit(); pcb->pcb_flags |= PCB_NPXUSERINITDONE | PCB_NPXINITDONE; } else { - intr_restore(s); + critical_exit(); bcopy(addr, &pcb->pcb_user_save, sizeof(*addr)); if (PCB_USER_FPU(pcb)) pcb->pcb_flags |= PCB_NPXINITDONE; @@ -1062,13 +1055,12 @@ int fpu_kern_leave(struct thread *td, struct fpu_kern_ctx *ctx) { struct pcb *pcb; - register_t savecrit; pcb = td->td_pcb; - savecrit = intr_disable(); + critical_enter(); if (curthread == PCPU_GET(fpcurthread)) npxdrop(); - intr_restore(savecrit); + critical_exit(); pcb->pcb_save = ctx->prev; if (pcb->pcb_save == &pcb->pcb_user_save) { if ((pcb->pcb_flags & PCB_NPXUSERINITDONE) != 0) Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Wed Jun 23 11:12:58 2010 (r209461) +++ head/sys/pc98/pc98/machdep.c Wed Jun 23 11:21:19 2010 (r209462) @@ -2719,9 +2719,8 @@ set_fpcontext(struct thread *td, const m static void fpstate_drop(struct thread *td) { - register_t s; - s = intr_disable(); + critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) npxdrop(); @@ -2737,7 +2736,7 @@ fpstate_drop(struct thread *td) * have too many layers. */ curthread->td_pcb->pcb_flags &= ~PCB_NPXINITDONE; - intr_restore(s); + critical_exit(); } int From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 12:17:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A39411065679; Wed, 23 Jun 2010 12:17:13 +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 920328FC17; Wed, 23 Jun 2010 12:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NCHD8E062367; Wed, 23 Jun 2010 12:17:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NCHDJ8062363; Wed, 23 Jun 2010 12:17:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006231217.o5NCHDJ8062363@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 12:17:13 +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: r209463 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 12:17:13 -0000 Author: kib Date: Wed Jun 23 12:17:13 2010 New Revision: 209463 URL: http://svn.freebsd.org/changeset/base/209463 Log: Fix bugs on pc98, use npxgetuserregs() instead of npxgetregs() for get_fpcontext(), and npxsetuserregs() for set_fpcontext). Also, note that usercontext is not initialized anymore in fpstate_drop(). Systematically replace references to npxgetregs() and npxsetregs() by npxgetuserregs() and npxsetuserregs() in comments. Noted by: bde Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Jun 23 11:21:19 2010 (r209462) +++ head/sys/amd64/amd64/machdep.c Wed Jun 23 12:17:13 2010 (r209463) @@ -2123,10 +2123,10 @@ fpstate_drop(struct thread *td) * XXX force a full drop of the fpu. The above only drops it if we * owned it. * - * XXX I don't much like fpugetregs()'s semantics of doing a full + * XXX I don't much like fpugetuserregs()'s semantics of doing a full * drop. Dropping only to the pcb matches fnsave's behaviour. * We only need to drop to !PCB_INITDONE in sendsig(). But - * sendsig() is the only caller of fpugetregs()... perhaps we just + * sendsig() is the only caller of fpugetuserregs()... perhaps we just * have too many layers. */ curthread->td_pcb->pcb_flags &= ~(PCB_FPUINITDONE | Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Jun 23 11:21:19 2010 (r209462) +++ head/sys/i386/i386/machdep.c Wed Jun 23 12:17:13 2010 (r209463) @@ -3319,7 +3319,7 @@ get_fpcontext(struct thread *td, mcontex * * XXX unpessimize most cases by only aligning when fxsave might be * called, although this requires knowing too much about - * npxgetregs()'s internals. + * npxgetuserregs()'s internals. */ addr = (union savefpu *)&mcp->mc_fpstate; if (td == PCPU_GET(fpcurthread) && @@ -3372,10 +3372,6 @@ set_fpcontext(struct thread *td, const m if (cpu_fxsr) addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; #endif - /* - * XXX we violate the dubious requirement that npxsetregs() - * be called with interrupts disabled. - */ npxsetuserregs(td, addr); #endif /* @@ -3400,12 +3396,12 @@ fpstate_drop(struct thread *td) #endif /* * XXX force a full drop of the npx. The above only drops it if we - * owned it. npxgetregs() has the same bug in the !cpu_fxsr case. + * owned it. npxgetuserregs() has the same bug in the !cpu_fxsr case. * - * XXX I don't much like npxgetregs()'s semantics of doing a full + * XXX I don't much like npxgetuserregs()'s semantics of doing a full * drop. Dropping only to the pcb matches fnsave's behaviour. * We only need to drop to !PCB_INITDONE in sendsig(). But - * sendsig() is the only caller of npxgetregs()... perhaps we just + * sendsig() is the only caller of npxgetuserregs()... perhaps we just * have too many layers. */ curthread->td_pcb->pcb_flags &= ~(PCB_NPXINITDONE | Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Wed Jun 23 11:21:19 2010 (r209462) +++ head/sys/pc98/pc98/machdep.c Wed Jun 23 12:17:13 2010 (r209463) @@ -2647,7 +2647,7 @@ get_fpcontext(struct thread *td, mcontex * * XXX unpessimize most cases by only aligning when fxsave might be * called, although this requires knowing too much about - * npxgetregs()'s internals. + * npxgetuserregs()'s internals. */ addr = (union savefpu *)&mcp->mc_fpstate; if (td == PCPU_GET(fpcurthread) && @@ -2659,7 +2659,7 @@ get_fpcontext(struct thread *td, mcontex addr = (void *)((char *)addr + 4); while ((uintptr_t)(void *)addr & 0xF); } - mcp->mc_ownedfp = npxgetregs(td, addr); + mcp->mc_ownedfp = npxgetuserregs(td, addr); if (addr != (union savefpu *)&mcp->mc_fpstate) { bcopy(addr, &mcp->mc_fpstate, sizeof(mcp->mc_fpstate)); bzero(&mcp->mc_spare2, sizeof(mcp->mc_spare2)); @@ -2700,11 +2700,7 @@ set_fpcontext(struct thread *td, const m if (cpu_fxsr) addr->sv_xmm.sv_env.en_mxcsr &= cpu_mxcsr_mask; #endif - /* - * XXX we violate the dubious requirement that npxsetregs() - * be called with interrupts disabled. - */ - npxsetregs(td, addr); + npxsetuserregs(td, addr); #endif /* * Don't bother putting things back where they were in the @@ -2727,15 +2723,16 @@ fpstate_drop(struct thread *td) #endif /* * XXX force a full drop of the npx. The above only drops it if we - * owned it. npxgetregs() has the same bug in the !cpu_fxsr case. + * owned it. npxusergetregs() has the same bug in the !cpu_fxsr case. * - * XXX I don't much like npxgetregs()'s semantics of doing a full + * XXX I don't much like npxgetuserregs()'s semantics of doing a full * drop. Dropping only to the pcb matches fnsave's behaviour. * We only need to drop to !PCB_INITDONE in sendsig(). But - * sendsig() is the only caller of npxgetregs()... perhaps we just + * sendsig() is the only caller of npxgetuserregs()... perhaps we just * have too many layers. */ - curthread->td_pcb->pcb_flags &= ~PCB_NPXINITDONE; + curthread->td_pcb->pcb_flags &= ~(PCB_NPXINITDONE | + PCB_NPXUSERINITDONE); critical_exit(); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 13:13:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1257D1065672; Wed, 23 Jun 2010 13:13:15 +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 007C48FC19; Wed, 23 Jun 2010 13:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NDDEou074830; Wed, 23 Jun 2010 13:13:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NDDEbU074827; Wed, 23 Jun 2010 13:13:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006231313.o5NDDEbU074827@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Jun 2010 13:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209464 - stable/8/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 13:13:15 -0000 Author: nwhitehorn Date: Wed Jun 23 13:13:14 2010 New Revision: 209464 URL: http://svn.freebsd.org/changeset/base/209464 Log: MFC r209369: Temporarily disable instruction relocation while setting up the kernel's IBAT entry in early boot in order to prevent possible faults from races between the instruction cache and the MMU. PR: powerpc/148003 Modified: stable/8/sys/powerpc/aim/mmu_oea.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/powerpc/aim/mmu_oea.c ============================================================================== --- stable/8/sys/powerpc/aim/mmu_oea.c Wed Jun 23 12:17:13 2010 (r209463) +++ stable/8/sys/powerpc/aim/mmu_oea.c Wed Jun 23 13:13:14 2010 (r209464) @@ -670,6 +670,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k vm_size_t size, physsz, hwphyssz; vm_offset_t pa, va, off; void *dpcpu; + register_t msr; /* * Set up BAT0 to map the lowest 256 MB area @@ -700,12 +701,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* * Use an IBAT and a DBAT to map the bottom segment of memory - * where we are. + * where we are. Turn off instruction relocation temporarily + * to prevent faults while reprogramming the IBAT. */ + msr = mfmsr(); + mtmsr(msr & ~PSL_IR); __asm (".balign 32; \n" "mtibatu 0,%0; mtibatl 0,%1; isync; \n" "mtdbatu 0,%0; mtdbatl 0,%1; isync" :: "r"(battable[0].batu), "r"(battable[0].batl)); + mtmsr(msr); /* map pci space */ __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 13:47:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D095106566C; Wed, 23 Jun 2010 13:47:28 +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 2BD468FC1C; Wed, 23 Jun 2010 13:47:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NDlRlZ082582; Wed, 23 Jun 2010 13:47:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NDlRUZ082580; Wed, 23 Jun 2010 13:47:27 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006231347.o5NDlRUZ082580@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Jun 2010 13:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209465 - releng/8.1/sys/powerpc/aim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 13:47:28 -0000 Author: nwhitehorn Date: Wed Jun 23 13:47:27 2010 New Revision: 209465 URL: http://svn.freebsd.org/changeset/base/209465 Log: MFC r209369: Temporarily disable instruction relocation while setting up the kernel's IBAT entry in early boot in order to prevent possible faults from races between the instruction cache and the MMU. PR: powerpc/148003 Approved by: re (kib) Modified: releng/8.1/sys/powerpc/aim/mmu_oea.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/powerpc/aim/mmu_oea.c ============================================================================== --- releng/8.1/sys/powerpc/aim/mmu_oea.c Wed Jun 23 13:13:14 2010 (r209464) +++ releng/8.1/sys/powerpc/aim/mmu_oea.c Wed Jun 23 13:47:27 2010 (r209465) @@ -670,6 +670,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k vm_size_t size, physsz, hwphyssz; vm_offset_t pa, va, off; void *dpcpu; + register_t msr; /* * Set up BAT0 to map the lowest 256 MB area @@ -700,12 +701,16 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k /* * Use an IBAT and a DBAT to map the bottom segment of memory - * where we are. + * where we are. Turn off instruction relocation temporarily + * to prevent faults while reprogramming the IBAT. */ + msr = mfmsr(); + mtmsr(msr & ~PSL_IR); __asm (".balign 32; \n" "mtibatu 0,%0; mtibatl 0,%1; isync; \n" "mtdbatu 0,%0; mtdbatl 0,%1; isync" :: "r"(battable[0].batu), "r"(battable[0].batl)); + mtmsr(msr); /* map pci space */ __asm __volatile("mtdbatu 1,%0" :: "r"(battable[8].batu)); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 14:06:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3112C106564A; Wed, 23 Jun 2010 14:06:06 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFF08FC19; Wed, 23 Jun 2010 14:06:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NE666R086742; Wed, 23 Jun 2010 14:06:06 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NE66XA086740; Wed, 23 Jun 2010 14:06:06 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006231406.o5NE66XA086740@svn.freebsd.org> From: Bruce Cran Date: Wed, 23 Jun 2010 14:06: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: r209466 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:06:06 -0000 Author: brucec Date: Wed Jun 23 14:06:05 2010 New Revision: 209466 URL: http://svn.freebsd.org/changeset/base/209466 Log: Add some more modules to loader.conf. Remove if_awi since support for it was removed 2 years ago. PR: conf/147126 PR: conf/116071 Approved by: rrs (mentor) Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Wed Jun 23 13:47:27 2010 (r209465) +++ head/sys/boot/forth/loader.conf Wed Jun 23 14:06:05 2010 (r209466) @@ -119,6 +119,35 @@ module_path="/boot/modules" # Set the mo ############################################################## +### ATA modules ############################################## +############################################################## + +ataahci_load="NO" # AHCI SATA +ataacard_load="NO" # ACARD +ataacerlabs_load="NO" # Acer Labs Inc. (ALI) +ataadaptec_load="NO" # Adaptec +ataamd_load="NO" # American Micro Devices (AMD) +ataati_load="NO" # ATI +atacenatek_load="NO" # Cenatek +atacypress_load="NO" # Cypress +atacyrix_load="NO" # Cyrix +atahighpoint_load="NO" # HighPoint +ataintel_load="NO" # Intel +ataite_load="NO" # Integrated Technology Inc. (ITE) +atajmicron_load="NO" # JMicron +atamarvell_load="NO" # Marvell +atamicron_load="NO" # Micron +atanational_load="NO" # National +atanetcell_load="NO" # NetCell +atanvidia_load="NO" # nVidia +atapromise_load="NO" # Promise +ataserverworks_load="NO" # ServerWorks +atasiliconimage_load="NO" # Silicon Image Inc. (SiI) (formerly CMD) +atasis_load="NO" # Silicon Integrated Systems Corp.(SiS) +atavia_load="NO" # VIA Technologies Inc. + + +############################################################## ### Filesystem and related modules ######################### ############################################################## @@ -133,6 +162,7 @@ msdosfs_load="NO" # FAT-12/16/32 nfsclient_load="NO" # NFS client nfsserver_load="NO" # NFS server ntfs_load="NO" # NTFS +ntfs_iconv_load="NO" # NTFS iconv character support nullfs_load="NO" # Null filesystem portalfs_load="NO" # Portal filesystem procfs_load="NO" # Process filesystem @@ -165,6 +195,18 @@ geom_vinum_load="NO" # Concatenated/mir ############################################################## +### FireWire modules ####################################### +############################################################## + +firewire_load="NO" # IEEE1394 High-performance Serial Bus +fwe_load="NO" # Ethernet emulation driver for FireWire +fwip_load="NO" # IP over FireWire driver +fwohci_load="NO" # OHCI FireWire chipset device driver +sbp_load="NO" # SBP-2 Mass Storage Devices driver +sbp_targ_load="NO" # SBP-2 Target mode + + +############################################################## ### Screen saver modules ################################### ############################################################## @@ -217,16 +259,17 @@ if_ale_load="NO" # Atheros AR8121/AR811 if_an_load="NO" # Aironet 4500/4800 802.11 wireless NICs if_ath_load="NO" # Atheros IEEE 802.11 wireless NICs if_aue_load="NO" # ADMtek AN986 Pegasus USB Ethernet -if_awi_load="NO" # AMD PCnetMobile IEEE 802.11 wireless NICs if_axe_load="NO" # ASIX Electronics AX88172 USB Ethernet if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_bwi_load="NO" # Broadcom BCM53xx IEEE 802.11b/g wireness NICs if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) if_cs_load="NO" # Crystal Semiconductor CS8920 if_cue_load="NO" # CATC USB-EL1210A USB Ethernet +if_cxgb_load="NO" # Chelsio T3 10 Gigabit Ethernet if_dc_load="NO" # DEC/Intel 21143 and various workalikes if_de_load="NO" # DEC DC21x4x Ethernet if_ed_load="NO" # National Semiconductor DS8390/WD83C690 @@ -236,16 +279,19 @@ if_en_load="NO" # Midway-based ATM int if_ep_load="NO" # 3Com Etherlink III (3c5x9) if_et_load="NO" # Agere ET1310 10/100/Gigabit Ethernet if_ex_load="NO" # Intel EtherExpress Pro/10 Ethernet +if_fatm_load="NO" # Fore PCA200E ATM if_fe_load="NO" # Fujitsu MB86960A/MB86965A based Ethernet # adapters if_fxp_load="NO" # Intel EtherExpress PRO/100B (82557, 82558) if_gem_load="NO" # Sun GEM/Sun ERI/Apple GMAC +if_hatm_load="NO" # Fore/Marconi HE155 and HE622 if_hme_load="NO" # Sun Microelectronics STP2002-STQ Ethernet if_ie_load="NO" # Intel 82586 if_igb_load="NO" # Intel(R) PRO/1000 Gigabit Ethernet if_ipw_load="NO" # Intel PRO/Wireless 2100 wireless if_iwi_load="NO" # Intel PRO/Wireless 2200BG/2225BG/2915ABG # wireless +if_iwn_load="NO" # Intel Wireless WiFi Link 802.11n wireless if_ixgb_load="NO" # Intel PRO/10Gb Ethernet if_ixgbe_load="NO" # Intel PRO/10Gb Ethernet PCI Express if_jme_load="NO" # JMicron JMC250 Gigabit/JMC260 Fast Ethernet @@ -261,11 +307,14 @@ if_nfe_load="NO" # NVIDIA nForce MCP Ne if_nge_load="NO" # National Semiconductor PCI Gigabit Ethernet if_nve_load="NO" # NVIDIA nForce MCP Networking Adapter if_nxge_load="NO" # Neterion Xframe 10Gb Ethernet +if_patm_load="NO" # IDT77252 ATM if_pcn_load="NO" # AMD PCnet PCI if_ral_load="NO" # Ralink Technology wireless if_re_load="NO" # RealTek 8139C+/8169/8169S/8110S if_rl_load="NO" # RealTek 8129/8139 if_rue_load="NO" # RealTek RTL8150 USB to Fast Ethernet +if_rum_load="NO" # Ralink Technology USB 802.11a/b/g wireless +if_run_load="NO" # Ralink Technology USB 802.11a/g/n wireless if_sbni_load="NO" # Granch SBNI12 leased line adapters if_sf_load="NO" # Adaptec Duralink PCI (AIC-6915 "starfire") if_sge_load="NO" # Silicon Integrated Systems SiS 190/191 @@ -291,6 +340,7 @@ if_wi_load="NO" # WaveLAN/IEEE 802.11 if_wpi_load="NO" # Intel 3945ABG Wireless LAN IEEE 802.11 if_xe_load="NO" # Xircom CreditCard PCMCIA if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B) +utopia_load="NO" # ATM PHY driver ############################################################## ### Netgraph modules ####################################### @@ -377,18 +427,27 @@ snd_driver_load="NO" # All sound driver usb_load="NO" # USB subsystem udbp_load="NO" # USB double bulk pipe host 2 host cables ugen_load="NO" # USB generic device, if all else fails ... +ucycom_load="NO" # Cyprus USB serial adapters ufm_load="NO" # Fm Radio uhid_load="NO" # Human Interface Devices ukbd_load="NO" # Keyboard ulpt_load="NO" # Printer ums_load="NO" # Mouse umass_load="NO" # Mass Storage Devices +umct_load="NO" # Magic Control Technology USB-RS232 umodem_load="NO" # Modems +uplcom_load="NO" # Prolific USB serial adapters +urio_load="NO" # Rio MP3 players +uvisor_load="NO" # PalmOS based PDAs if_aue_load="NO" # ADMtek USB ethernet if_axe_load="NO" # ASIX Electronics AX88172 USB ethernet +if_cdce_load="NO" # Ethernet over USB (CDC) if_cue_load="NO" # CATC USB ethernet if_kue_load="NO" # Kawasaki LSI USB ethernet +if_rae_load="NO" # Realtek RTL8150 USB adapter. if_rum_load="NO" # Ralink USB 802.11 wireless adapter +if_uath_load="NO" # Atheros AR5523 wireless adapter +if_run_load="NO" # Ralink USB 802.11 wireless adapter if_ural_load="NO" # Ralink RT2500USB 802.11 wireless adapter if_zyd_load="NO" # ZyDAS ZD1211(B) USB 802.11 wireless adapter snd_uaudio_load="NO" # USB audio @@ -397,15 +456,22 @@ snd_uaudio_load="NO" # USB audio ### Other modules ########################################## ############################################################## +aio_load="NO" # Asynchronous I/O bktr_load="NO" # Brooktree Bt848/Bt878 TV/Video Capture Card ispfw_load="NO" # Qlogic ISP Firmware agp_load="NO" # agp module accf_data_load="NO" # Wait for data accept filter accf_dns_load="NO" # Wait for full DNS request accept filter accf_http_load="NO" # Wait for full HTTP request accept filter +ppi_load="NO" # Interface to ppbus parallel 'geek' port +pps_load="NO" # Pulse per second devices +puc_load="NO" # PCI "Universal" Communications driver random_load="NO" # Random device speaker_load="NO" # AT speaker module coretemp_load="NO" # Intel Core CPU temperature monitor +vkbd_load="NO" # Virtual AT keyboard interface +vpd_load="NO" # Vital Product Data kernel interface +vpo_load="NO" # Parallel to SCSI interface driver amdtemp_load="NO" # AMD K8/K10/K11 temperature monitor ############################################################## From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 14:11:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 533701065670; Wed, 23 Jun 2010 14:11:35 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 429718FC15; Wed, 23 Jun 2010 14:11:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NEBZKA088024; Wed, 23 Jun 2010 14:11:35 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NEBZd1088022; Wed, 23 Jun 2010 14:11:35 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006231411.o5NEBZd1088022@svn.freebsd.org> From: Bruce Cran Date: Wed, 23 Jun 2010 14:11:35 +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: r209467 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:11:35 -0000 Author: brucec Date: Wed Jun 23 14:11:34 2010 New Revision: 209467 URL: http://svn.freebsd.org/changeset/base/209467 Log: When installing on a machine which doesn't have a VGA card installed, enable a getty on the serial port so that it's possible to login when the system is rebooted. PR: bin/23098 Submitted by: Doug Ambrisko Reviewed by: randi Approved by: rrs (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/install.c Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Wed Jun 23 14:06:05 2010 (r209466) +++ head/usr.sbin/sysinstall/install.c Wed Jun 23 14:11:34 2010 (r209467) @@ -877,6 +877,9 @@ installConfigure(void) int installFixupBase(dialogMenuItem *self) { + FILE *orig, *new; + char buf[1024]; + char *pos; #if defined(__i386__) || defined(__amd64__) FILE *fp; #endif @@ -895,6 +898,32 @@ installFixupBase(dialogMenuItem *self) fclose(fp); } #endif + + /* Fixup /etc/ttys to start a getty on the serial port. + This way after a serial installation you can login via + the serial port */ + + if (!OnVTY){ + if (((orig=fopen("/etc/ttys","r")) != NULL) && + ((new=fopen("/etc/ttys.tmp","w")) != NULL)) { + while (fgets(buf,sizeof(buf),orig)){ + if (strstr(buf,"ttyu0")){ + if ((pos=strstr(buf,"off"))){ + *pos++='o'; + *pos++='n'; + *pos++=' '; + } + } + fputs(buf,new); + } + fclose(orig); + fclose(new); + + rename("/etc/ttys.tmp","/etc/ttys"); + unlink("/etc/ttys.tmp"); + } + } + /* BOGON #2: We leave /etc in a bad state */ chmod("/etc", 0755); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 14:19:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6848A106566C; Wed, 23 Jun 2010 14:19:21 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 573EC8FC17; Wed, 23 Jun 2010 14:19:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NEJJ0F089736; Wed, 23 Jun 2010 14:19:19 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NEJJ6C089733; Wed, 23 Jun 2010 14:19:19 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006231419.o5NEJJ6C089733@svn.freebsd.org> From: Bruce Cran Date: Wed, 23 Jun 2010 14:19: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: r209468 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:19:21 -0000 Author: brucec Date: Wed Jun 23 14:19:19 2010 New Revision: 209468 URL: http://svn.freebsd.org/changeset/base/209468 Log: Make it easier to cancel a failing installation by only attempting to extract distributions once. If a distribution fails to fetch/extract and the user doesn't want to retry, abort the installation. Reviewed by: randi Approved by: rrs (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/dist.c head/usr.sbin/sysinstall/install.c Modified: head/usr.sbin/sysinstall/dist.c ============================================================================== --- head/usr.sbin/sysinstall/dist.c Wed Jun 23 14:11:34 2010 (r209467) +++ head/usr.sbin/sysinstall/dist.c Wed Jun 23 14:19:19 2010 (r209468) @@ -605,7 +605,7 @@ getinfo: if (fp == NULL) msgConfirm("Failed to find %s on this media. Reinitializing media.", fname); else - msgConfirm("Failed to retreive piece file %s.\n" + msgConfirm("Failed to retrieve piece file %s.\n" "%s: Reinitializing media.", fname, !intr ? "I/O error" : "User interrupt"); DEVICE_SHUTDOWN(mediaDevice); @@ -701,6 +701,7 @@ distExtract(char *parent, Distribution * char *path, *dist; WINDOW *w = savescr(); struct sigaction old, new; + int canceled = 0; status = TRUE; if (isDebug()) @@ -715,7 +716,7 @@ distExtract(char *parent, Distribution * sigaction(SIGINT, &new, &old); /* Loop through to see if we're in our parent's plans */ - for (i = 0; me[i].my_name; i++) { + for (i = 0; me[i].my_name && canceled == 0; i++) { dist = me[i].my_name; path = parent ? parent : dist; @@ -750,8 +751,11 @@ distExtract(char *parent, Distribution * status = msgYesNo("Unable to transfer the %s distribution from\n%s.\n\n" "Do you want to try to retrieve it again?", me[i].my_name, mediaDevice->name); - if (!status) + if (status == 0) --i; + else + canceled = 1; + status = FALSE; } } @@ -765,6 +769,7 @@ distExtract(char *parent, Distribution * if (status) *(me[i].my_mask) &= ~(me[i].my_bit); } + sigaction(SIGINT, &old, NULL); /* Restore signal handler */ restorescr(w); return status; @@ -857,8 +862,9 @@ printSelected(char *buf, int selected, D int distExtractAll(dialogMenuItem *self) { - int old_dists, old_kernel, retries = 0, status = DITEM_SUCCESS; + int old_dists, old_kernel, status = DITEM_SUCCESS; char buf[512]; + int extract_status = TRUE; WINDOW *w; /* paranoia */ @@ -878,9 +884,7 @@ distExtractAll(dialogMenuItem *self) w = savescr(); msgNotify("Attempting to install all selected distributions.."); - /* Try for 3 times around the loop, then give up. */ - while (Dists && ++retries < 3) - distExtract(NULL, DistTable); + extract_status = distExtract(NULL, DistTable); dialog_clear_norefresh(); /* Only do base fixup if base dist was successfully extracted */ @@ -907,5 +911,9 @@ distExtractAll(dialogMenuItem *self) } } restorescr(w); + + if (extract_status == FALSE) + status = DITEM_FAILURE; + return status; } Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Wed Jun 23 14:11:34 2010 (r209467) +++ head/usr.sbin/sysinstall/install.c Wed Jun 23 14:19:19 2010 (r209468) @@ -678,8 +678,7 @@ nodisks: msgConfirm("Installation completed with some errors. You may wish to\n" "scroll through the debugging messages on VTY1 with the\n" "scroll-lock feature. You can also choose \"No\" at the next\n" - "prompt and go back into the installation menus to retry\n" - "whichever operations have failed."); + "prompt and reboot and try the installation again."); return i; } @@ -855,6 +854,9 @@ try_media: /* Now go get it all */ i = distExtractAll(self); + if (i == FALSE) + return FALSE; + /* When running as init, *now* it's safe to grab the rc.foo vars */ installEnvironment(); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 14:28:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE8B106564A; Wed, 23 Jun 2010 14:28:08 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AAE68FC22; Wed, 23 Jun 2010 14:28:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NES8nd091713; Wed, 23 Jun 2010 14:28:08 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NES8he091711; Wed, 23 Jun 2010 14:28:08 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201006231428.o5NES8he091711@svn.freebsd.org> From: Bruce Cran Date: Wed, 23 Jun 2010 14:28: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: r209469 - head/usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 14:28:09 -0000 Author: brucec Date: Wed Jun 23 14:28:08 2010 New Revision: 209469 URL: http://svn.freebsd.org/changeset/base/209469 Log: If a device can't be opened, don't keep going but display the error returned from open() and quit. PR: bin/81035 Submitted by: Peter Schuller Approved by: rrs (mentor) Modified: head/usr.sbin/boot0cfg/boot0cfg.c Modified: head/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- head/usr.sbin/boot0cfg/boot0cfg.c Wed Jun 23 14:19:19 2010 (r209468) +++ head/usr.sbin/boot0cfg/boot0cfg.c Wed Jun 23 14:28:08 2010 (r209469) @@ -356,6 +356,8 @@ write_mbr(const char *fname, int flags, if (n != mbr_size) errx(1, "%s: short write", fname); return; + } else { + err(1, "write_mbr: %s", fname); } /* From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 15:19:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 342311065677; Wed, 23 Jun 2010 15:19:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232448FC14; Wed, 23 Jun 2010 15:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NFJ8Ks003168; Wed, 23 Jun 2010 15:19:08 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NFJ8rn003166; Wed, 23 Jun 2010 15:19:08 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006231519.o5NFJ8rn003166@svn.freebsd.org> From: Michael Tuexen Date: Wed, 23 Jun 2010 15:19: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: r209470 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 15:19:08 -0000 Author: tuexen Date: Wed Jun 23 15:19:07 2010 New Revision: 209470 URL: http://svn.freebsd.org/changeset/base/209470 Log: * Implement sctp_does_stcb_own_this_addr() correclty. It was taking the wrong side into account. * sctp_findassociation_ep_addr() must check the local address if available. This fixes a bug where ABORT chunks were accepted even in the case where the local was not owned by the endpoint. Thanks to brucec for pointing out a bug in my first version of the fix. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Wed Jun 23 14:28:08 2010 (r209469) +++ head/sys/netinet/sctp_pcb.c Wed Jun 23 15:19:07 2010 (r209470) @@ -1010,6 +1010,149 @@ sctp_tcb_special_locate(struct sctp_inpc return (NULL); } +static int +sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) +{ + int loopback_scope, ipv4_local_scope, local_scope, site_scope; + int ipv4_addr_legal, ipv6_addr_legal; + struct sctp_vrf *vrf; + struct sctp_ifn *sctp_ifn; + struct sctp_ifa *sctp_ifa; + + loopback_scope = stcb->asoc.loopback_scope; + ipv4_local_scope = stcb->asoc.ipv4_local_scope; + local_scope = stcb->asoc.local_scope; + site_scope = stcb->asoc.site_scope; + ipv4_addr_legal = ipv6_addr_legal = 0; + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { + ipv6_addr_legal = 1; + if (SCTP_IPV6_V6ONLY(stcb->sctp_ep) == 0) { + ipv4_addr_legal = 1; + } + } else { + ipv4_addr_legal = 1; + } + + SCTP_IPI_ADDR_RLOCK(); + vrf = sctp_find_vrf(stcb->asoc.vrf_id); + if (vrf == NULL) { + /* no vrf, no addresses */ + SCTP_IPI_ADDR_RUNLOCK(); + return (0); + } + if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL) { + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { + if ((loopback_scope == 0) && + SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { + continue; + } + LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifa)) + continue; + switch (sctp_ifa->address.sa.sa_family) { +#ifdef INET + case AF_INET: + if (ipv4_addr_legal) { + struct sockaddr_in *sin, + *rsin; + + sin = &sctp_ifa->address.sin; + rsin = (struct sockaddr_in *)to; + if ((ipv4_local_scope == 0) && + IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { + continue; + } + if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipv6_addr_legal) { + struct sockaddr_in6 *sin6, + *rsin6; + + sin6 = &sctp_ifa->address.sin6; + rsin6 = (struct sockaddr_in6 *)to; + if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { + if (local_scope == 0) + continue; + if (sin6->sin6_scope_id == 0) { + if (sa6_recoverscope(sin6) != 0) + continue; + } + } + if ((site_scope == 0) && + (IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))) { + continue; + } + if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + } + break; +#endif + default: + /* TSNH */ + break; + } + } + } + } else { + struct sctp_laddr *laddr; + + LIST_FOREACH(laddr, &stcb->sctp_ep->sctp_addr_list, sctp_nxt_addr) { + if (sctp_is_addr_restricted(stcb, laddr->ifa)) { + continue; + } + if (laddr->ifa->address.sa.sa_family != to->sa_family) { + continue; + } + switch (to->sa_family) { +#ifdef INET + case AF_INET: + { + struct sockaddr_in *sin, *rsin; + + sin = (struct sockaddr_in *)&laddr->ifa->address.sin; + rsin = (struct sockaddr_in *)to; + if (sin->sin_addr.s_addr == rsin->sin_addr.s_addr) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + break; + } +#endif +#ifdef INET6 + case AF_INET6: + { + struct sockaddr_in6 *sin6, *rsin6; + + sin6 = (struct sockaddr_in6 *)&laddr->ifa->address.sin6; + rsin6 = (struct sockaddr_in6 *)to; + if (SCTP6_ARE_ADDR_EQUAL(sin6, rsin6)) { + SCTP_IPI_ADDR_RUNLOCK(); + return (1); + } + break; + } + +#endif + default: + /* TSNH */ + break; + } + + } + } + SCTP_IPI_ADDR_RUNLOCK(); + return (0); +} + /* * rules for use * @@ -1090,6 +1233,10 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(stcb); goto null_return; } + if (!(local && sctp_does_stcb_own_this_addr(stcb, local))) { + SCTP_TCB_UNLOCK(stcb); + goto null_return; + } /* now look at the list of remote addresses */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { #ifdef INVARIANTS @@ -1187,6 +1334,10 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(stcb); continue; } + if (!(local && sctp_does_stcb_own_this_addr(stcb, local))) { + SCTP_TCB_UNLOCK(stcb); + continue; + } /* now look at the list of remote addresses */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { #ifdef INVARIANTS @@ -1800,63 +1951,6 @@ sctp_findassociation_special_addr(struct return (NULL); } -static int -sctp_does_stcb_own_this_addr(struct sctp_tcb *stcb, struct sockaddr *to) -{ - struct sctp_nets *net; - - /* - * Simple question, the ports match, does the tcb own the to - * address? - */ - if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_BOUNDALL)) { - /* of course */ - return (1); - } - /* have to look at all bound addresses */ - TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (net->ro._l_addr.sa.sa_family != to->sa_family) { - /* not the same family, can't be a match */ - continue; - } - switch (to->sa_family) { - case AF_INET: - { - struct sockaddr_in *sin, *rsin; - - sin = (struct sockaddr_in *)&net->ro._l_addr; - rsin = (struct sockaddr_in *)to; - if (sin->sin_addr.s_addr == - rsin->sin_addr.s_addr) { - /* found it */ - return (1); - } - break; - } -#ifdef INET6 - case AF_INET6: - { - struct sockaddr_in6 *sin6, *rsin6; - - sin6 = (struct sockaddr_in6 *)&net->ro._l_addr; - rsin6 = (struct sockaddr_in6 *)to; - if (SCTP6_ARE_ADDR_EQUAL(sin6, - rsin6)) { - /* Update the endpoint pointer */ - return (1); - } - break; - } -#endif - default: - /* TSNH */ - break; - } - } - /* Nope, do not have the address ;-( */ - return (0); -} - static struct sctp_tcb * sctp_findassoc_by_vtag(struct sockaddr *from, struct sockaddr *to, uint32_t vtag, struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint16_t rport, From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 17:04:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73DE8106564A; Wed, 23 Jun 2010 17:04:42 +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 629A48FC1D; Wed, 23 Jun 2010 17:04:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NH4g4W026600; Wed, 23 Jun 2010 17:04:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NH4gdt026598; Wed, 23 Jun 2010 17:04:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231704.o5NH4gdt026598@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 17:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209471 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:04:42 -0000 Author: jhb Date: Wed Jun 23 17:04:42 2010 New Revision: 209471 URL: http://svn.freebsd.org/changeset/base/209471 Log: MFC 209213: When updating individual CPU's lowest Cx state to use, never set it to a state lower than the lowest one supported by the current CPU. This closes some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx states for individual CPUs were changing (e.g. unplugging the AC adapter of a laptop) that could result in panics. Modified: stable/8/sys/dev/acpica/acpi_cpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_cpu.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_cpu.c Wed Jun 23 15:19:07 2010 (r209470) +++ stable/8/sys/dev/acpica/acpi_cpu.c Wed Jun 23 17:04:42 2010 (r209471) @@ -1009,6 +1009,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no if (isc->cpu_cx_count > cpu_cx_count) cpu_cx_count = isc->cpu_cx_count; } + if (sc->cpu_cx_lowest < cpu_cx_lowest) + acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); ACPI_SERIAL_END(cpu); } @@ -1204,7 +1206,7 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ ACPI_SERIAL_BEGIN(cpu); for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, val); + acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); } ACPI_SERIAL_END(cpu); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 17:20:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90E39106566B; Wed, 23 Jun 2010 17:20:51 +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 7F8138FC1C; Wed, 23 Jun 2010 17:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NHKpNA030219; Wed, 23 Jun 2010 17:20:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NHKpWJ030215; Wed, 23 Jun 2010 17:20:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006231720.o5NHKpWJ030215@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 Jun 2010 17:20: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: r209472 - in head/sys: compat/x86bios dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:20:51 -0000 Author: jkim Date: Wed Jun 23 17:20:51 2010 New Revision: 209472 URL: http://svn.freebsd.org/changeset/base/209472 Log: Let x86bios_alloc() pass contigmalloc(9) flags. Use it to set M_WAITOK from VESA BIOS initialization. All other malloc(9) uses in the function is blocking any way. Modified: head/sys/compat/x86bios/x86bios.c head/sys/compat/x86bios/x86bios.h head/sys/dev/fb/vesa.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Wed Jun 23 17:04:42 2010 (r209471) +++ head/sys/compat/x86bios/x86bios.c Wed Jun 23 17:20:51 2010 (r209472) @@ -353,14 +353,14 @@ x86bios_emu_get_intr(struct x86emu *emu, } void * -x86bios_alloc(uint32_t *offset, size_t size) +x86bios_alloc(uint32_t *offset, size_t size, int flags) { void *vaddr; if (offset == NULL || size == 0) return (NULL); - vaddr = contigmalloc(size, M_DEVBUF, M_NOWAIT, X86BIOS_RAM_BASE, + vaddr = contigmalloc(size, M_DEVBUF, flags, X86BIOS_RAM_BASE, x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0); if (vaddr != NULL) { *offset = vtophys(vaddr); Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Wed Jun 23 17:04:42 2010 (r209471) +++ head/sys/compat/x86bios/x86bios.h Wed Jun 23 17:20:51 2010 (r209472) @@ -142,7 +142,7 @@ typedef struct x86regs x86regs_t; #define X86BIOS_PHYSTOOFF(x) ((x) & 0x000f) __BEGIN_DECLS -void *x86bios_alloc(uint32_t *offset, size_t size); +void *x86bios_alloc(uint32_t *offset, size_t size, int flags); void x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off); void x86bios_free(void *addr, size_t size); uint32_t x86bios_get_intr(int intno); Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Jun 23 17:04:42 2010 (r209471) +++ head/sys/dev/fb/vesa.c Wed Jun 23 17:20:51 2010 (r209472) @@ -284,7 +284,7 @@ vesa_bios_get_mode(int mode, struct vesa uint32_t offs; void *buf; - buf = x86bios_alloc(&offs, sizeof(*vmode)); + buf = x86bios_alloc(&offs, sizeof(*vmode), M_NOWAIT); if (buf == NULL) return (1); @@ -367,7 +367,7 @@ vesa_bios_save_palette(int start, int co u_char *p; int i; - p = (u_char *)x86bios_alloc(&offs, colors * 4); + p = (u_char *)x86bios_alloc(&offs, colors * 4, M_NOWAIT); if (p == NULL) return (1); @@ -407,7 +407,7 @@ vesa_bios_save_palette2(int start, int c u_char *p; int i; - p = (u_char *)x86bios_alloc(&offs, colors * 4); + p = (u_char *)x86bios_alloc(&offs, colors * 4, M_NOWAIT); if (p == NULL) return (1); @@ -446,7 +446,7 @@ vesa_bios_load_palette(int start, int co u_char *p; int i; - p = (u_char *)x86bios_alloc(&offs, colors * 4); + p = (u_char *)x86bios_alloc(&offs, colors * 4, M_NOWAIT); if (p == NULL) return (1); @@ -481,7 +481,7 @@ vesa_bios_load_palette2(int start, int c u_char *p; int i; - p = (u_char *)x86bios_alloc(&offs, colors * 4); + p = (u_char *)x86bios_alloc(&offs, colors * 4, M_NOWAIT); if (p == NULL) return (1); @@ -535,7 +535,7 @@ vesa_bios_save_restore(int code, void *p if (code != STATE_SAVE && code != STATE_LOAD) return (1); - buf = x86bios_alloc(&offs, size); + buf = x86bios_alloc(&offs, size, M_NOWAIT); x86bios_init_regs(®s); regs.R_AX = 0x4f04; @@ -800,9 +800,7 @@ vesa_bios_init(void) x86bios_init_regs(®s); regs.R_AX = 0x4f00; - vmbuf = x86bios_alloc(&offs, sizeof(*buf)); - if (vmbuf == NULL) - return (1); + vmbuf = x86bios_alloc(&offs, sizeof(*buf), M_WAITOK); regs.R_ES = X86BIOS_PHYSTOSEG(offs); regs.R_DI = X86BIOS_PHYSTOOFF(offs); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 17:51:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 779DF106564A; Wed, 23 Jun 2010 17:51:11 +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 666EB8FC13; Wed, 23 Jun 2010 17:51:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NHpBBo037056; Wed, 23 Jun 2010 17:51:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NHpBgc037054; Wed, 23 Jun 2010 17:51:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231751.o5NHpBgc037054@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 17:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209473 - releng/8.1/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:51:11 -0000 Author: jhb Date: Wed Jun 23 17:51:11 2010 New Revision: 209473 URL: http://svn.freebsd.org/changeset/base/209473 Log: MFC 209213: When updating individual CPU's lowest Cx state to use, never set it to a state lower than the lowest one supported by the current CPU. This closes some races with changes to the hw.acpi.cpu_cx_lowest sysctl while Cx states for individual CPUs were changing (e.g. unplugging the AC adapter of a laptop) that could result in panics. Approved by: re (kib) Modified: releng/8.1/sys/dev/acpica/acpi_cpu.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/dev/acpica/acpi_cpu.c ============================================================================== --- releng/8.1/sys/dev/acpica/acpi_cpu.c Wed Jun 23 17:20:51 2010 (r209472) +++ releng/8.1/sys/dev/acpica/acpi_cpu.c Wed Jun 23 17:51:11 2010 (r209473) @@ -1009,6 +1009,8 @@ acpi_cpu_notify(ACPI_HANDLE h, UINT32 no if (isc->cpu_cx_count > cpu_cx_count) cpu_cx_count = isc->cpu_cx_count; } + if (sc->cpu_cx_lowest < cpu_cx_lowest) + acpi_cpu_set_cx_lowest(sc, min(cpu_cx_lowest, sc->cpu_cx_count - 1)); ACPI_SERIAL_END(cpu); } @@ -1204,7 +1206,7 @@ acpi_cpu_global_cx_lowest_sysctl(SYSCTL_ ACPI_SERIAL_BEGIN(cpu); for (i = 0; i < cpu_ndevices; i++) { sc = device_get_softc(cpu_devices[i]); - acpi_cpu_set_cx_lowest(sc, val); + acpi_cpu_set_cx_lowest(sc, min(val, sc->cpu_cx_count - 1)); } ACPI_SERIAL_END(cpu); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 17:56:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 748DE106566B; Wed, 23 Jun 2010 17:56:20 +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 49A0A8FC08; Wed, 23 Jun 2010 17:56:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NHuKMY038241; Wed, 23 Jun 2010 17:56:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NHuKo9038239; Wed, 23 Jun 2010 17:56:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231756.o5NHuKo9038239@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 17:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209474 - stable/8/sys/boot/i386/zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:56:20 -0000 Author: jhb Date: Wed Jun 23 17:56:20 2010 New Revision: 209474 URL: http://svn.freebsd.org/changeset/base/209474 Log: MFC 208388: - Set 'dmadat' earlier so that we properly setup the heap if we fail to locate a high memory area for the heap using the SMAP. - Read the number of hard drive devices from the BIOS instead of hardcoding a limit of 128. Some BIOSes duplicate disk devices once you get beyond the maximum drive number. Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Wed Jun 23 17:51:11 2010 (r209473) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Wed Jun 23 17:56:20 2010 (r209474) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -467,6 +468,7 @@ getstr(void) static inline void putc(int c) { + v86.ctl = 0; v86.addr = 0x10; v86.eax = 0xe00 | (c & 0xff); v86.ebx = 0x7; @@ -617,6 +619,8 @@ main(void) off_t off; struct dsk *dsk; + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + bios_getmem(); if (high_heap_size > 0) { @@ -627,9 +631,6 @@ main(void) heap_end = (char *) PTOV(bios_basemem); } - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; @@ -666,7 +667,7 @@ main(void) * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < 128; i++) { + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue; @@ -1157,6 +1158,7 @@ getc(int fn) * when no such key is pressed in reality. As far as I can tell, * this only happens shortly after a reboot. */ + v86.ctl = V86_FLAGS; v86.addr = 0x16; v86.eax = fn << 8; v86int(); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 17:56:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A2B91065680; Wed, 23 Jun 2010 17:56:52 +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 F37F28FC0A; Wed, 23 Jun 2010 17:56:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NHupIG038394; Wed, 23 Jun 2010 17:56:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NHupNh038374; Wed, 23 Jun 2010 17:56:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231756.o5NHupNh038374@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 17:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209475 - stable/7/sys/boot/i386/zfsboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 17:56:52 -0000 Author: jhb Date: Wed Jun 23 17:56:51 2010 New Revision: 209475 URL: http://svn.freebsd.org/changeset/base/209475 Log: MFC 208388: - Set 'dmadat' earlier so that we properly setup the heap if we fail to locate a high memory area for the heap using the SMAP. - Read the number of hard drive devices from the BIOS instead of hardcoding a limit of 128. Some BIOSes duplicate disk devices once you get beyond the maximum drive number. Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/7/sys/boot/i386/zfsboot/zfsboot.c Wed Jun 23 17:56:20 2010 (r209474) +++ stable/7/sys/boot/i386/zfsboot/zfsboot.c Wed Jun 23 17:56:51 2010 (r209475) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #define V86_CY(x) ((x) & 1) #define V86_ZR(x) ((x) & 0x40) +#define BIOS_NUMDRIVES 0x475 #define DRV_HARD 0x80 #define DRV_MASK 0x7f @@ -467,6 +468,7 @@ getstr(void) static inline void putc(int c) { + v86.ctl = 0; v86.addr = 0x10; v86.eax = 0xe00 | (c & 0xff); v86.ebx = 0x7; @@ -617,6 +619,8 @@ main(void) off_t off; struct dsk *dsk; + dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + bios_getmem(); if (high_heap_size > 0) { @@ -627,9 +631,6 @@ main(void) heap_end = (char *) PTOV(bios_basemem); } - dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); - v86.ctl = V86_FLAGS; - dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; @@ -666,7 +667,7 @@ main(void) * will find any other available pools and it may fill in missing * vdevs for the boot pool. */ - for (i = 0; i < 128; i++) { + for (i = 0; i < *(unsigned char *)PTOV(BIOS_NUMDRIVES); i++) { if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) continue; @@ -1157,6 +1158,7 @@ getc(int fn) * when no such key is pressed in reality. As far as I can tell, * this only happens shortly after a reboot. */ + v86.ctl = V86_FLAGS; v86.addr = 0x16; v86.eax = fn << 8; v86int(); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 18:00:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CE281065678; Wed, 23 Jun 2010 18:00:20 +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 3B41C8FC19; Wed, 23 Jun 2010 18:00:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NI0Kdk039239; Wed, 23 Jun 2010 18:00:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NI0KjP039236; Wed, 23 Jun 2010 18:00:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231800.o5NI0KjP039236@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 18:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209476 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 18:00:20 -0000 Author: jhb Date: Wed Jun 23 18:00:19 2010 New Revision: 209476 URL: http://svn.freebsd.org/changeset/base/209476 Log: MFC 208390: Allow a const char * to be passed as the process name to kproc_kthread_add() without generating a warning. Modified: stable/8/sys/kern/kern_kthread.c stable/8/sys/sys/kthread.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/kern/kern_kthread.c ============================================================================== --- stable/8/sys/kern/kern_kthread.c Wed Jun 23 17:56:51 2010 (r209475) +++ stable/8/sys/kern/kern_kthread.c Wed Jun 23 18:00:19 2010 (r209476) @@ -386,7 +386,7 @@ kthread_suspend_check(struct thread *td) int kproc_kthread_add(void (*func)(void *), void *arg, struct proc **procptr, struct thread **tdptr, - int flags, int pages, char * procname, const char *fmt, ...) + int flags, int pages, const char *procname, const char *fmt, ...) { int error; va_list ap; Modified: stable/8/sys/sys/kthread.h ============================================================================== --- stable/8/sys/sys/kthread.h Wed Jun 23 17:56:51 2010 (r209475) +++ stable/8/sys/sys/kthread.h Wed Jun 23 18:00:19 2010 (r209476) @@ -63,7 +63,7 @@ int kproc_kthread_add(void (*)(void struct proc **, struct thread **, int flags, int pages, - char * procname, const char *, ...) __printflike(8, 9); + const char *procname, const char *, ...) __printflike(8, 9); int kthread_add(void (*)(void *), void *, struct proc *, struct thread **, From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 18:46:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 645D5106564A; Wed, 23 Jun 2010 18:46:11 +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 4F94A8FC13; Wed, 23 Jun 2010 18:46:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NIkBiZ049391; Wed, 23 Jun 2010 18:46:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NIkARx049377; Wed, 23 Jun 2010 18:46:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231846.o5NIkARx049377@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 18:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209477 - in stable/8/sys: dev/ath dev/cxgb dev/hatm dev/nfe dev/patm dev/sk dev/stge net net80211 netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 18:46:11 -0000 Author: jhb Date: Wed Jun 23 18:46:10 2010 New Revision: 209477 URL: http://svn.freebsd.org/changeset/base/209477 Log: MFC 198988: Take a step towards removing if_watchdog/if_timer. Don't explicitly set if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Modified: stable/8/sys/dev/ath/if_ath.c stable/8/sys/dev/cxgb/cxgb_main.c stable/8/sys/dev/hatm/if_hatm.c stable/8/sys/dev/nfe/if_nfe.c stable/8/sys/dev/patm/if_patm_attach.c stable/8/sys/dev/sk/if_sk.c stable/8/sys/dev/stge/if_stge.c stable/8/sys/net/if_ef.c stable/8/sys/net80211/ieee80211.c stable/8/sys/netgraph/ng_eiface.c stable/8/sys/netgraph/ng_fec.c stable/8/sys/netgraph/ng_iface.c stable/8/sys/netgraph/ng_sppp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/dev/ath/if_ath.c ============================================================================== --- stable/8/sys/dev/ath/if_ath.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/ath/if_ath.c Wed Jun 23 18:46:10 2010 (r209477) @@ -560,7 +560,6 @@ ath_attach(u_int16_t devid, struct ath_s ifp->if_softc = sc; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = ath_start; - ifp->if_watchdog = NULL; ifp->if_ioctl = ath_ioctl; ifp->if_init = ath_init; IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); Modified: stable/8/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/8/sys/dev/cxgb/cxgb_main.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/cxgb/cxgb_main.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1019,10 +1019,6 @@ cxgb_port_attach(device_t dev) ifp->if_ioctl = cxgb_ioctl; ifp->if_start = cxgb_start; - - ifp->if_timer = 0; /* Disable ifnet watchdog */ - ifp->if_watchdog = NULL; - ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); Modified: stable/8/sys/dev/hatm/if_hatm.c ============================================================================== --- stable/8/sys/dev/hatm/if_hatm.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/hatm/if_hatm.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1928,7 +1928,6 @@ hatm_attach(device_t dev) ifp->if_flags = IFF_SIMPLEX; ifp->if_ioctl = hatm_ioctl; ifp->if_start = hatm_start; - ifp->if_watchdog = NULL; ifp->if_init = hatm_init; utopia_attach(&sc->utopia, IFP2IFATM(sc->ifp), &sc->media, &sc->mtx, Modified: stable/8/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/8/sys/dev/nfe/if_nfe.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/nfe/if_nfe.c Wed Jun 23 18:46:10 2010 (r209477) @@ -567,7 +567,6 @@ nfe_attach(device_t dev) ifp->if_start = nfe_start; ifp->if_hwassist = 0; ifp->if_capabilities = 0; - ifp->if_watchdog = NULL; ifp->if_init = nfe_init; IFQ_SET_MAXLEN(&ifp->if_snd, NFE_TX_RING_COUNT - 1); ifp->if_snd.ifq_drv_maxlen = NFE_TX_RING_COUNT - 1; Modified: stable/8/sys/dev/patm/if_patm_attach.c ============================================================================== --- stable/8/sys/dev/patm/if_patm_attach.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/patm/if_patm_attach.c Wed Jun 23 18:46:10 2010 (r209477) @@ -197,11 +197,9 @@ patm_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_SIMPLEX; - ifp->if_watchdog = NULL; ifp->if_init = patm_init; ifp->if_ioctl = patm_ioctl; ifp->if_start = patm_start; - ifp->if_watchdog = NULL; /* do this early so we can destroy unconditionally */ mtx_init(&sc->mtx, device_get_nameunit(dev), Modified: stable/8/sys/dev/sk/if_sk.c ============================================================================== --- stable/8/sys/dev/sk/if_sk.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/sk/if_sk.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1372,8 +1372,6 @@ sk_attach(dev) ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = sk_ioctl; ifp->if_start = sk_start; - ifp->if_timer = 0; - ifp->if_watchdog = NULL; ifp->if_init = sk_init; IFQ_SET_MAXLEN(&ifp->if_snd, SK_TX_RING_CNT - 1); ifp->if_snd.ifq_drv_maxlen = SK_TX_RING_CNT - 1; Modified: stable/8/sys/dev/stge/if_stge.c ============================================================================== --- stable/8/sys/dev/stge/if_stge.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/dev/stge/if_stge.c Wed Jun 23 18:46:10 2010 (r209477) @@ -722,8 +722,6 @@ stge_attach(device_t dev) ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = stge_ioctl; ifp->if_start = stge_start; - ifp->if_timer = 0; - ifp->if_watchdog = NULL; ifp->if_init = stge_init; ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_drv_maxlen = STGE_TX_RING_CNT - 1; Modified: stable/8/sys/net/if_ef.c ============================================================================== --- stable/8/sys/net/if_ef.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/net/if_ef.c Wed Jun 23 18:46:10 2010 (r209477) @@ -128,7 +128,6 @@ ef_attach(struct efnet *sc) struct ifnet *ifp = sc->ef_ifp; ifp->if_start = ef_start; - ifp->if_watchdog = NULL; ifp->if_init = ef_init; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); Modified: stable/8/sys/net80211/ieee80211.c ============================================================================== --- stable/8/sys/net80211/ieee80211.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/net80211/ieee80211.c Wed Jun 23 18:46:10 2010 (r209477) @@ -392,7 +392,6 @@ ieee80211_vap_setup(struct ieee80211com ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; ifp->if_start = ieee80211_start; ifp->if_ioctl = ieee80211_ioctl; - ifp->if_watchdog = NULL; /* NB: no watchdog routine */ ifp->if_init = ieee80211_init; /* NB: input+output filled in by ether_ifattach */ IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); Modified: stable/8/sys/netgraph/ng_eiface.c ============================================================================== --- stable/8/sys/netgraph/ng_eiface.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_eiface.c Wed Jun 23 18:46:10 2010 (r209477) @@ -369,7 +369,6 @@ ng_eiface_constructor(node_p node) ifp->if_output = ether_output; ifp->if_start = ng_eiface_start; ifp->if_ioctl = ng_eiface_ioctl; - ifp->if_watchdog = NULL; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_flags = (IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST); Modified: stable/8/sys/netgraph/ng_fec.c ============================================================================== --- stable/8/sys/netgraph/ng_fec.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_fec.c Wed Jun 23 18:46:10 2010 (r209477) @@ -1227,7 +1227,6 @@ ng_fec_constructor(node_p node) ifp->if_start = ng_fec_start; ifp->if_ioctl = ng_fec_ioctl; ifp->if_init = ng_fec_init; - ifp->if_watchdog = NULL; ifp->if_snd.ifq_maxlen = IFQ_MAXLEN; ifp->if_mtu = NG_FEC_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_BROADCAST|IFF_MULTICAST); Modified: stable/8/sys/netgraph/ng_iface.c ============================================================================== --- stable/8/sys/netgraph/ng_iface.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_iface.c Wed Jun 23 18:46:10 2010 (r209477) @@ -558,7 +558,6 @@ ng_iface_constructor(node_p node) ifp->if_output = ng_iface_output; ifp->if_start = ng_iface_start; ifp->if_ioctl = ng_iface_ioctl; - ifp->if_watchdog = NULL; ifp->if_mtu = NG_IFACE_MTU_DEFAULT; ifp->if_flags = (IFF_SIMPLEX|IFF_POINTOPOINT|IFF_NOARP|IFF_MULTICAST); ifp->if_type = IFT_PROPVIRTUAL; /* XXX */ Modified: stable/8/sys/netgraph/ng_sppp.c ============================================================================== --- stable/8/sys/netgraph/ng_sppp.c Wed Jun 23 18:00:19 2010 (r209476) +++ stable/8/sys/netgraph/ng_sppp.c Wed Jun 23 18:46:10 2010 (r209477) @@ -279,7 +279,6 @@ ng_sppp_constructor (node_p node) if_initname (SP2IFP(pp), NG_SPPP_IFACE_NAME, priv->unit); ifp->if_start = ng_sppp_start; ifp->if_ioctl = ng_sppp_ioctl; - ifp->if_watchdog = NULL; ifp->if_flags = (IFF_POINTOPOINT|IFF_MULTICAST); /* Give this node the same name as the interface (if possible) */ From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 19:22:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6BD106567B; Wed, 23 Jun 2010 19:22:38 +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 CC1C48FC13; Wed, 23 Jun 2010 19:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NJMcEN057548; Wed, 23 Jun 2010 19:22:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NJMcVC057547; Wed, 23 Jun 2010 19:22:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231922.o5NJMcVC057547@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 19:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209479 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/ixgbe dev/xen/xenpci geom/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 19:22:39 -0000 Author: jhb Date: Wed Jun 23 19:22:38 2010 New Revision: 209479 URL: http://svn.freebsd.org/changeset/base/209479 Log: Hoist mergeinfo for sys/dev/ixgbe up to sys. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/ixgbe/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 19:28:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BFCA10656CA; Wed, 23 Jun 2010 19:28:36 +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 4904F8FC1B; Wed, 23 Jun 2010 19:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NJSad7058917; Wed, 23 Jun 2010 19:28:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NJSaU9058916; Wed, 23 Jun 2010 19:28:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006231928.o5NJSaU9058916@svn.freebsd.org> From: John Baldwin Date: Wed, 23 Jun 2010 19:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209480 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci geom/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 19:28:36 -0000 Author: jhb Date: Wed Jun 23 19:28:36 2010 New Revision: 209480 URL: http://svn.freebsd.org/changeset/base/209480 Log: Hoist mergeinfo for sys/geom/sched up to sys. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 19:29:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C83F1065849; Wed, 23 Jun 2010 19:29:18 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B55C8FC0A; Wed, 23 Jun 2010 19:29:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NJTIgr059128; Wed, 23 Jun 2010 19:29:18 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NJTIw6059126; Wed, 23 Jun 2010 19:29:18 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201006231929.o5NJTIw6059126@svn.freebsd.org> From: Randi Harper Date: Wed, 23 Jun 2010 19:29: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: r209481 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 19:29:18 -0000 Author: randi Date: Wed Jun 23 19:29:17 2010 New Revision: 209481 URL: http://svn.freebsd.org/changeset/base/209481 Log: Update the man page to reflect the changes to the netDev configuration variable. Approved by: cperciva (mentor) MFC after: 3 days Modified: head/usr.sbin/sysinstall/sysinstall.8 Modified: head/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- head/usr.sbin/sysinstall/sysinstall.8 Wed Jun 23 19:28:36 2010 (r209480) +++ head/usr.sbin/sysinstall/sysinstall.8 Wed Jun 23 19:29:17 2010 (r209481) @@ -640,12 +640,10 @@ The domain name of the host being instal .It defaultrouter The default router for this host (non-optional). .It netDev -Which host interface to use -.Ar ( ed0 -or -.Ar ep0 , -for example. -Non-optional). +Which network interface to use. +Multiple network interfaces may be specified using a comma delimited list. +If netDev is set to ANY, all available network interfaces will be probed and the +first interface found to have a link will be used. (non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 19:42:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BF2106566B; Wed, 23 Jun 2010 19:42:01 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DA6F8FC1C; Wed, 23 Jun 2010 19:42:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NJg1Ub061948; Wed, 23 Jun 2010 19:42:01 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NJg14c061941; Wed, 23 Jun 2010 19:42:01 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006231942.o5NJg14c061941@svn.freebsd.org> From: "Jayachandran C." Date: Wed, 23 Jun 2010 19:42: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: r209482 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 19:42:01 -0000 Author: jchandra Date: Wed Jun 23 19:42:01 2010 New Revision: 209482 URL: http://svn.freebsd.org/changeset/base/209482 Log: Merge jmallett@'s n64 work into HEAD - changeset 6 PTE flag cleanup from http://svn.freebsd.org/base/user/jmallett/octeon - Rename PTE_xx flags to match their MIPS names - Use the new pte_set/test/clear macros uniformly, instead of a mixture of mips_pg_xxx(), pmap_pte_x() macros and direct access. - Remove unused macros and defines from pte.h and pmap.c Discussed on freebsd-mips@ Approved by: rrs(mentor), jmallett Modified: head/sys/mips/include/pte.h head/sys/mips/include/vm.h head/sys/mips/mips/machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/pte.h ============================================================================== --- head/sys/mips/include/pte.h Wed Jun 23 19:29:17 2010 (r209481) +++ head/sys/mips/include/pte.h Wed Jun 23 19:42:01 2010 (r209482) @@ -32,7 +32,7 @@ /* * TLB and PTE management. Most things operate within the context of * EntryLo0,1, and begin with TLBLO_. Things which work with EntryHi - * start with TLBHI_. PTE bits begin with PG_. + * start with TLBHI_. PTE bits begin with PTE_. * * Note that we use the same size VM and TLB pages. */ @@ -63,7 +63,7 @@ #define TLBLO_PFN_TO_PA(pfn) ((vm_paddr_t)((pfn) >> TLBLO_PFN_SHIFT) << TLB_PAGE_SHIFT) #define TLBLO_PTE_TO_PFN(pte) ((pte) & TLBLO_PFN_MASK) #define TLBLO_PTE_TO_PA(pte) (TLBLO_PFN_TO_PA(TLBLO_PTE_TO_PFN((pte)))) - + /* * VPN for EntryHi register. Upper two bits select user, supervisor, * or kernel. Bits 61 to 40 copy bit 63. VPN2 is bits 39 and down to @@ -76,54 +76,57 @@ #define TLBHI_ENTRY(va, asid) (((va) & ~PAGE_MASK) | ((asid) & TLBHI_ASID_MASK)) #ifndef _LOCORE -typedef unsigned int pt_entry_t; -typedef pt_entry_t *pd_entry_t; +typedef uint32_t pt_entry_t; +typedef pt_entry_t *pd_entry_t; #endif #define PDESIZE sizeof(pd_entry_t) /* for assembly files */ #define PTESIZE sizeof(pt_entry_t) /* for assembly files */ -#define PT_ENTRY_NULL ((pt_entry_t *) 0) - -#define PTE_WIRED 0x80000000 /* SW */ -#define PTE_W PTE_WIRED -#define PTE_RO 0x40000000 /* SW */ - -#define PTE_G 0x00000001 /* HW */ -#define PTE_V 0x00000002 -/*#define PTE_NV 0x00000000 Not Used */ -#define PTE_M 0x00000004 -#define PTE_RW PTE_M -#define PTE_ODDPG 0x00001000 -/*#define PG_ATTR 0x0000003f Not Used */ -#define PTE_UNCACHED 0x00000010 -#ifdef CPU_SB1 -#define PTE_CACHE 0x00000028 /* cacheable coherent */ +/* + * TLB flags managed in hardware: + * C: Cache attribute. + * D: Dirty bit. This means a page is writable. It is not + * set at first, and a write is trapped, and the dirty + * bit is set. See also PTE_RO. + * V: Valid bit. Obvious, isn't it? + * G: Global bit. This means that this mapping is present + * in EVERY address space, and to ignore the ASID when + * it is matched. + */ +#define PTE_C(attr) ((attr & 0x07) << 3) +#define PTE_C_UNCACHED (PTE_C(0x02)) +/* + * The preferred cache attribute for cacheable pages, this can be + * implementation dependent. We will use the standard value 0x3 as + * default. + */ +#if defined(CPU_SB1) +#define PTE_C_CACHE (PTE_C(0x05)) #else -#define PTE_CACHE 0x00000018 +#define PTE_C_CACHE (PTE_C(0x03)) #endif -/*#define PG_CACHEMODE 0x00000038 Not Used*/ -#define PTE_ROPAGE (PTE_V | PTE_RO | PTE_CACHE) /* Write protected */ -#define PTE_RWPAGE (PTE_V | PTE_M | PTE_CACHE) /* Not wr-prot not clean */ -#define PTE_CWPAGE (PTE_V | PTE_CACHE) /* Not wr-prot but clean */ -#define PTE_IOPAGE (PTE_G | PTE_V | PTE_M | PTE_UNCACHED) -#define PTE_FRAME 0x3fffffc0 -#define PTE_HVPN 0xffffe000 /* Hardware page no mask */ -#define PTE_ASID 0x000000ff /* Address space ID */ - - -/* User virtual to pte offset in page table */ -#define vad_to_pte_offset(adr) (((adr) >> PAGE_SHIFT) & (NPTEPG -1)) - -#define mips_pg_v(entry) ((entry) & PTE_V) -#define mips_pg_wired(entry) ((entry) & PTE_WIRED) -#define mips_pg_m_bit() (PTE_M) -#define mips_pg_rw_bit() (PTE_M) -#define mips_pg_ro_bit() (PTE_RO) -#define mips_pg_ropage_bit() (PTE_ROPAGE) -#define mips_pg_rwpage_bit() (PTE_RWPAGE) -#define mips_pg_cwpage_bit() (PTE_CWPAGE) -#define mips_pg_global_bit() (PTE_G) -#define mips_pg_wired_bit() (PTE_WIRED) +#define PTE_D 0x04 +#define PTE_V 0x02 +#define PTE_G 0x01 + +/* + * VM flags managed in software: + * RO: Read only. Never set PTE_D on this page, and don't + * listen to requests to write to it. + * W: Wired. ??? + */ +#define PTE_RO (0x01 << TLBLO_SWBITS_SHIFT) +#define PTE_W (0x02 << TLBLO_SWBITS_SHIFT) + +/* + * PTE management functions for bits defined above. + * + * XXX Can make these atomics, but some users of them are using PTEs in local + * registers and such and don't need the overhead. + */ +#define pte_clear(pte, bit) (*(pte) &= ~(bit)) +#define pte_set(pte, bit) (*(pte) |= (bit)) +#define pte_test(pte, bit) ((*(pte) & (bit)) == (bit)) #endif /* !_MACHINE_PTE_H_ */ Modified: head/sys/mips/include/vm.h ============================================================================== --- head/sys/mips/include/vm.h Wed Jun 23 19:29:17 2010 (r209481) +++ head/sys/mips/include/vm.h Wed Jun 23 19:42:01 2010 (r209482) @@ -32,9 +32,7 @@ #include /* Memory attributes. */ -#define VM_MEMATTR_UNCACHED ((vm_memattr_t)PTE_UNCACHED) -#define VM_MEMATTR_CACHEABLE_NONCOHERENT ((vm_memattr_t)PTE_CACHE) - -#define VM_MEMATTR_DEFAULT VM_MEMATTR_CACHEABLE_NONCOHERENT +#define VM_MEMATTR_UNCACHED ((vm_memattr_t)PTE_C_UNCACHED) +#define VM_MEMATTR_DEFAULT ((vm_memattr_t)PTE_C_CACHE) #endif /* !_MACHINE_VM_H_ */ Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed Jun 23 19:29:17 2010 (r209481) +++ head/sys/mips/mips/machdep.c Wed Jun 23 19:42:01 2010 (r209482) @@ -421,7 +421,7 @@ mips_pcpu_tlb_init(struct pcpu *pcpu) * We use a wired tlb index to do this one-time mapping. */ pa = vtophys(pcpu); - pte = PTE_RW | PTE_V | PTE_G | PTE_CACHE; + pte = PTE_D | PTE_V | PTE_G | PTE_C_CACHE; tlb_insert_wired(PCPU_TLB_ENTRY, (vm_offset_t)pcpup, TLBLO_PA_TO_PFN(pa) | pte, TLBLO_PA_TO_PFN(pa + PAGE_SIZE) | pte); Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Wed Jun 23 19:29:17 2010 (r209481) +++ head/sys/mips/mips/pmap.c Wed Jun 23 19:42:01 2010 (r209482) @@ -68,7 +68,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_ddb.h" #include "opt_msgbuf.h" #include #include @@ -120,22 +119,13 @@ __FBSDID("$FreeBSD$"); /* * Get PDEs and PTEs for user/kernel address space */ -#define pmap_pde(m, v) (&((m)->pm_segtab[(vm_offset_t)(v) >> SEGSHIFT])) +#define pmap_pde(m, v) (&((m)->pm_segtab[(vm_offset_t)(v) >> SEGSHIFT])) #define segtab_pde(m, v) (m[(vm_offset_t)(v) >> SEGSHIFT]) -#define pmap_pte_w(pte) ((*(int *)pte & PTE_W) != 0) -#define pmap_pde_v(pte) ((*(int *)pte) != 0) -#define pmap_pte_m(pte) ((*(int *)pte & PTE_M) != 0) -#define pmap_pte_v(pte) ((*(int *)pte & PTE_V) != 0) - -#define pmap_pte_set_w(pte, v) ((v)?(*(int *)pte |= PTE_W):(*(int *)pte &= ~PTE_W)) -#define pmap_pte_set_prot(pte, v) ((*(int *)pte &= ~PG_PROT), (*(int *)pte |= (v))) - #define MIPS_SEGSIZE (1L << SEGSHIFT) #define mips_segtrunc(va) ((va) & ~(MIPS_SEGSIZE-1)) -#define pmap_TLB_invalidate_all() MIPS_TBIAP() -#define pmap_va_asid(pmap, va) ((va) | ((pmap)->pm_asid[PCPU_GET(cpuid)].asid << VMTLB_PID_SHIFT)) #define is_kernel_pmap(x) ((x) == kernel_pmap) +#define vad_to_pte_offset(adr) (((adr) >> PAGE_SHIFT) & (NPTEPG -1)) struct pmap kernel_pmap_store; pd_entry_t *kernel_segmap; @@ -172,9 +162,10 @@ static vm_page_t pmap_enter_quick_locked static int pmap_remove_pte(struct pmap *pmap, pt_entry_t *ptq, vm_offset_t va); static void pmap_remove_page(struct pmap *pmap, vm_offset_t va); static void pmap_remove_entry(struct pmap *pmap, vm_page_t m, vm_offset_t va); -static boolean_t pmap_testbit(vm_page_t m, int bit); static boolean_t pmap_try_insert_pv_entry(pmap_t pmap, vm_page_t mpte, vm_offset_t va, vm_page_t m); +static __inline void +pmap_invalidate_page(pmap_t pmap, vm_offset_t va); static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, int flags); @@ -218,10 +209,10 @@ static struct local_sysmaps sysmap_lmem[ sysm = &sysmap_lmem[cpu]; \ va = sysm->base; \ npte = TLBLO_PA_TO_PFN(phys) | \ - PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ + PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE; \ pte = pmap_pte(kernel_pmap, va); \ *pte = npte; \ - sysm->valid1 = 1; + sysm->valid1 = 1 #define PMAP_LMEM_MAP2(va1, phys1, va2, phys2) \ int cpu; \ @@ -234,11 +225,11 @@ static struct local_sysmaps sysmap_lmem[ va1 = sysm->base; \ va2 = sysm->base + PAGE_SIZE; \ npte = TLBLO_PA_TO_PFN(phys1) | \ - PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ + PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE; \ pte = pmap_pte(kernel_pmap, va1); \ *pte = npte; \ npte = TLBLO_PA_TO_PFN(phys2) | \ - PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; \ + PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE; \ pte = pmap_pte(kernel_pmap, va2); \ *pte = npte; \ sysm->valid1 = 1; \ @@ -543,7 +534,7 @@ pmap_init(void) static int pmap_nw_modified(pt_entry_t pte) { - if ((pte & (PTE_M | PTE_RO)) == (PTE_M | PTE_RO)) + if ((pte & (PTE_D | PTE_RO)) == (PTE_D | PTE_RO)) return (1); else return (0); @@ -694,8 +685,8 @@ pmap_extract_and_hold(pmap_t pmap, vm_of PMAP_LOCK(pmap); retry: pte = *pmap_pte(pmap, va); - if (pte != 0 && pmap_pte_v(&pte) && - ((pte & PTE_RW) || (prot & VM_PROT_WRITE) == 0)) { + if (pte != 0 && pte_test(&pte, PTE_V) && + (pte_test(&pte, PTE_D) || (prot & VM_PROT_WRITE) == 0)) { if (vm_page_pa_tryrelock(pmap, TLBLO_PTE_TO_PA(pte), &pa)) goto retry; @@ -717,18 +708,18 @@ retry: /* PMAP_INLINE */ void pmap_kenter(vm_offset_t va, vm_paddr_t pa) { - register pt_entry_t *pte; - pt_entry_t npte, opte; + pt_entry_t *pte; + pt_entry_t opte, npte; #ifdef PMAP_DEBUG - printf("pmap_kenter: va: 0x%08x -> pa: 0x%08x\n", va, pa); + printf("pmap_kenter: va: %p -> pa: %p\n", (void *)va, (void *)pa); #endif - npte = TLBLO_PA_TO_PFN(pa) | PTE_RW | PTE_V | PTE_G | PTE_W; + npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W; if (is_cacheable_mem(pa)) - npte |= PTE_CACHE; + npte |= PTE_C_CACHE; else - npte |= PTE_UNCACHED; + npte |= PTE_C_UNCACHED; pte = pmap_pte(kernel_pmap, va); opte = *pte; @@ -743,7 +734,7 @@ pmap_kenter(vm_offset_t va, vm_paddr_t p /* PMAP_INLINE */ void pmap_kremove(vm_offset_t va) { - register pt_entry_t *pte; + pt_entry_t *pte; /* * Write back all caches from the page being destroyed @@ -1305,11 +1296,11 @@ retry: oldpte = loadandclear((u_int *)pte); if (is_kernel_pmap(pmap)) *pte = PTE_G; - KASSERT((oldpte & PTE_W) == 0, + KASSERT(!pte_test(&oldpte, PTE_W), ("wired pte for unwired page")); if (m->md.pv_flags & PV_TABLE_REF) vm_page_flag_set(m, PG_REFERENCED); - if (oldpte & PTE_M) + if (pte_test(&oldpte, PTE_D)) vm_page_dirty(m); pmap_invalidate_page(pmap, va); TAILQ_REMOVE(&pmap->pm_pvlist, pv, pv_plist); @@ -1449,7 +1440,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en if (is_kernel_pmap(pmap)) *ptq = PTE_G; - if (oldpte & PTE_W) + if (pte_test(&oldpte, PTE_W)) pmap->pm_stats.wired_count -= 1; pmap->pm_stats.resident_count -= 1; @@ -1457,7 +1448,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en if (page_is_managed(pa)) { m = PHYS_TO_VM_PAGE(pa); - if (oldpte & PTE_M) { + if (pte_test(&oldpte, PTE_D)) { #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified(oldpte)) { printf( @@ -1482,7 +1473,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en static void pmap_remove_page(struct pmap *pmap, vm_offset_t va) { - register pt_entry_t *ptq; + pt_entry_t *ptq; mtx_assert(&vm_page_queue_mtx, MA_OWNED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); @@ -1491,7 +1482,7 @@ pmap_remove_page(struct pmap *pmap, vm_o /* * if there is no pte for this address, just skip it!!! */ - if (!ptq || !pmap_pte_v(ptq)) { + if (!ptq || !pte_test(ptq, PTE_V)) { return; } @@ -1567,8 +1558,8 @@ out: void pmap_remove_all(vm_page_t m) { - register pv_entry_t pv; - register pt_entry_t *pte, tpte; + pv_entry_t pv; + pt_entry_t *pte, tpte; KASSERT((m->flags & PG_FICTITIOUS) == 0, ("pmap_remove_all: page %p is fictitious", m)); @@ -1595,13 +1586,13 @@ pmap_remove_all(vm_page_t m) if (is_kernel_pmap(pv->pv_pmap)) *pte = PTE_G; - if (tpte & PTE_W) + if (pte_test(&tpte, PTE_W)) pv->pv_pmap->pm_stats.wired_count--; /* * Update the vm_page_t clean and reference bits. */ - if (tpte & PTE_M) { + if (pte_test(&tpte, PTE_D)) { #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified(tpte)) { printf( @@ -1663,7 +1654,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv * If pte is invalid, skip this page */ pte = pmap_pte(pmap, sva); - if (!pmap_pte_v(pte)) { + if (!pte_test(pte, PTE_V)) { sva += PAGE_SIZE; continue; } @@ -1671,12 +1662,13 @@ retry: obits = pbits = *pte; pa = TLBLO_PTE_TO_PA(pbits); - if (page_is_managed(pa) && (pbits & PTE_M) != 0) { + if (page_is_managed(pa) && pte_test(&pbits, PTE_D)) { m = PHYS_TO_VM_PAGE(pa); vm_page_dirty(m); m->md.pv_flags &= ~PV_TABLE_MOD; } - pbits = (pbits & ~PTE_M) | PTE_RO; + pte_clear(&pbits, PTE_D); + pte_set(&pbits, PTE_RO); if (pbits != *pte) { if (!atomic_cmpset_int((u_int *)pte, obits, pbits)) @@ -1706,7 +1698,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_prot_t prot, boolean_t wired) { vm_offset_t pa, opa; - register pt_entry_t *pte; + pt_entry_t *pte; pt_entry_t origpte, newpte; pv_entry_t pv; vm_page_t mpte, om; @@ -1750,16 +1742,16 @@ pmap_enter(pmap_t pmap, vm_offset_t va, /* * Mapping has not changed, must be protection or wiring change. */ - if ((origpte & PTE_V) && (opa == pa)) { + if (pte_test(&origpte, PTE_V) && opa == pa) { /* * Wiring change, just update stats. We don't worry about * wiring PT pages as they remain resident as long as there * are valid mappings in them. Hence, if a user page is * wired, the PT page will be also. */ - if (wired && ((origpte & PTE_W) == 0)) + if (wired && !pte_test(&origpte, PTE_W)) pmap->pm_stats.wired_count++; - else if (!wired && (origpte & PTE_W)) + else if (!wired && pte_test(&origpte, PTE_W)) pmap->pm_stats.wired_count--; #if defined(PMAP_DIAGNOSTIC) @@ -1789,7 +1781,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, * handle validating new mapping. */ if (opa) { - if (origpte & PTE_W) + if (pte_test(&origpte, PTE_W)) pmap->pm_stats.wired_count--; if (page_is_managed(opa)) { @@ -1837,7 +1829,7 @@ validate: rw = init_pte_prot(va, m, prot); #ifdef PMAP_DEBUG - printf("pmap_enter: va: 0x%08x -> pa: 0x%08x\n", va, pa); + printf("pmap_enter: va: %p -> pa: %p\n", (void *)va, (void *)pa); #endif /* * Now validate mapping with desired protection/wiring. @@ -1845,23 +1837,22 @@ validate: newpte = TLBLO_PA_TO_PFN(pa) | rw | PTE_V; if (is_cacheable_mem(pa)) - newpte |= PTE_CACHE; + newpte |= PTE_C_CACHE; else - newpte |= PTE_UNCACHED; + newpte |= PTE_C_UNCACHED; if (wired) newpte |= PTE_W; - if (is_kernel_pmap(pmap)) { + if (is_kernel_pmap(pmap)) newpte |= PTE_G; - } /* * if the mapping or permission bits are different, we need to * update the pte. */ if (origpte != newpte) { - if (origpte & PTE_V) { + if (pte_test(&origpte, PTE_V)) { *pte = newpte; if (page_is_managed(opa) && (opa != pa)) { if (om->md.pv_flags & PV_TABLE_REF) @@ -1869,8 +1860,8 @@ validate: om->md.pv_flags &= ~(PV_TABLE_REF | PV_TABLE_MOD); } - if (origpte & PTE_M) { - KASSERT((origpte & PTE_RW), + if (pte_test(&origpte, PTE_D)) { + KASSERT(!pte_test(&origpte, PTE_RO), ("pmap_enter: modified page not writable:" " va: %p, pte: 0x%x", (void *)va, origpte)); if (page_is_managed(opa)) @@ -1978,7 +1969,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ } pte = pmap_pte(pmap, va); - if (pmap_pte_v(pte)) { + if (pte_test(pte, PTE_V)) { if (mpte != NULL) { mpte->wire_count--; mpte = NULL; @@ -2011,9 +2002,9 @@ pmap_enter_quick_locked(pmap_t pmap, vm_ *pte = TLBLO_PA_TO_PFN(pa) | PTE_V; if (is_cacheable_mem(pa)) - *pte |= PTE_CACHE; + *pte |= PTE_C_CACHE; else - *pte |= PTE_UNCACHED; + *pte |= PTE_C_UNCACHED; if (is_kernel_pmap(pmap)) *pte |= PTE_G; @@ -2061,7 +2052,7 @@ pmap_kenter_temporary(vm_paddr_t pa, int cpu = PCPU_GET(cpuid); sysm = &sysmap_lmem[cpu]; /* Since this is for the debugger, no locks or any other fun */ - npte = TLBLO_PA_TO_PFN(pa) | PTE_RW | PTE_V | PTE_G | PTE_W | PTE_CACHE; + npte = TLBLO_PA_TO_PFN(pa) | PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE; pte = pmap_pte(kernel_pmap, sysm->base); *pte = npte; sysm->valid1 = 1; @@ -2160,7 +2151,7 @@ pmap_object_init_pt(pmap_t pmap, vm_offs void pmap_change_wiring(pmap_t pmap, vm_offset_t va, boolean_t wired) { - register pt_entry_t *pte; + pt_entry_t *pte; if (pmap == NULL) return; @@ -2168,16 +2159,19 @@ pmap_change_wiring(pmap_t pmap, vm_offse PMAP_LOCK(pmap); pte = pmap_pte(pmap, va); - if (wired && !pmap_pte_w(pte)) + if (wired && !pte_test(pte, PTE_W)) pmap->pm_stats.wired_count++; - else if (!wired && pmap_pte_w(pte)) + else if (!wired && pte_test(pte, PTE_W)) pmap->pm_stats.wired_count--; /* * Wiring is not a hardware characteristic so there is no need to * invalidate TLB. */ - pmap_pte_set_w(pte, wired); + if (wired) + pte_set(pte, PTE_W); + else + pte_clear(pte, PTE_W); PMAP_UNLOCK(pmap); } @@ -2363,14 +2357,14 @@ pmap_remove_pages(pmap_t pmap) for (pv = TAILQ_FIRST(&pmap->pm_pvlist); pv; pv = npv) { pte = pmap_pte(pv->pv_pmap, pv->pv_va); - if (!pmap_pte_v(pte)) + if (!pte_test(pte, PTE_V)) panic("pmap_remove_pages: page on pm_pvlist has no pte\n"); tpte = *pte; /* * We cannot remove wired pages from a process' mapping at this time */ - if (tpte & PTE_W) { + if (pte_test(&tpte, PTE_W)) { npv = TAILQ_NEXT(pv, pv_plist); continue; } @@ -2385,7 +2379,7 @@ pmap_remove_pages(pmap_t pmap) /* * Update the vm_page_t clean and reference bits. */ - if (tpte & PTE_M) { + if (pte_test(&tpte, PTE_D)) { vm_page_dirty(m); } npv = TAILQ_NEXT(pv, pv_plist); @@ -2433,7 +2427,7 @@ pmap_testbit(vm_page_t m, int bit) #endif PMAP_LOCK(pv->pv_pmap); pte = pmap_pte(pv->pv_pmap, pv->pv_va); - rv = (*pte & bit) != 0; + rv = pte_test(pte, bit); PMAP_UNLOCK(pv->pv_pmap); if (rv) break; @@ -2442,13 +2436,13 @@ pmap_testbit(vm_page_t m, int bit) } /* - * this routine is used to modify bits in ptes + * this routine is used to clear dirty bits in ptes */ static __inline void pmap_changebit(vm_page_t m, int bit, boolean_t setem) { - register pv_entry_t pv; - register pt_entry_t *pte; + pv_entry_t pv; + pt_entry_t *pte; if (m->flags & PG_FICTITIOUS) return; @@ -2476,12 +2470,11 @@ pmap_changebit(vm_page_t m, int bit, boo vm_offset_t pbits = *(vm_offset_t *)pte; if (pbits & bit) { - if (bit == PTE_RW) { - if (pbits & PTE_M) { + if (bit == PTE_D) { + if (pbits & PTE_D) { vm_page_dirty(m); } - *(int *)pte = (pbits & ~(PTE_M | PTE_RW)) | - PTE_RO; + *(int *)pte = (pbits & ~PTE_D) | PTE_RO; } else { *(int *)pte = pbits & ~bit; } @@ -2490,7 +2483,7 @@ pmap_changebit(vm_page_t m, int bit, boo } PMAP_UNLOCK(pv->pv_pmap); } - if (!setem && bit == PTE_RW) + if (!setem && bit == PTE_D) vm_page_flag_clear(m, PG_WRITEABLE); } @@ -2547,8 +2540,7 @@ pmap_remove_write(vm_page_t m) for (pv = TAILQ_FIRST(&m->md.pv_list); pv; pv = npv) { npv = TAILQ_NEXT(pv, pv_plist); pte = pmap_pte(pv->pv_pmap, pv->pv_va); - - if ((pte == NULL) || !mips_pg_v(*pte)) + if (pte == NULL || !pte_test(pte, PTE_V)) panic("page on pm_pvlist has no pte\n"); va = pv->pv_va; @@ -2596,7 +2588,7 @@ pmap_is_modified(vm_page_t m) /* * If the page is not VPO_BUSY, then PG_WRITEABLE cannot be * concurrently set while the object is locked. Thus, if PG_WRITEABLE - * is clear, no PTEs can have PTE_M set. + * is clear, no PTEs can have PTE_D set. */ VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->oflags & VPO_BUSY) == 0 && @@ -2606,7 +2598,7 @@ pmap_is_modified(vm_page_t m) if (m->md.pv_flags & PV_TABLE_MOD) rv = TRUE; else - rv = pmap_testbit(m, PTE_M); + rv = pmap_testbit(m, PTE_D); vm_page_unlock_queues(); return (rv); } @@ -2649,7 +2641,7 @@ pmap_clear_modify(vm_page_t m) ("pmap_clear_modify: page %p is busy", m)); /* - * If the page is not PG_WRITEABLE, then no PTEs can have PTE_M set. + * If the page is not PG_WRITEABLE, then no PTEs can have PTE_D set. * If the object containing the page is locked and the page is not * VPO_BUSY, then PG_WRITEABLE cannot be concurrently set. */ @@ -2657,7 +2649,7 @@ pmap_clear_modify(vm_page_t m) return; vm_page_lock_queues(); if (m->md.pv_flags & PV_TABLE_MOD) { - pmap_changebit(m, PTE_M, FALSE); + pmap_changebit(m, PTE_D, FALSE); m->md.pv_flags &= ~PV_TABLE_MOD; } vm_page_unlock_queues(); @@ -2776,12 +2768,12 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad retry: ptep = pmap_pte(pmap, addr); pte = (ptep != NULL) ? *ptep : 0; - if (!mips_pg_v(pte)) { + if (!pte_test(&pte, PTE_V)) { val = 0; goto out; } val = MINCORE_INCORE; - if ((pte & PTE_M) != 0) + if (pte_test(&pte, PTE_D)) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; pa = TLBLO_PTE_TO_PA(pte); managed = page_is_managed(pa); @@ -2907,13 +2899,13 @@ pmap_pid_dump(int pid) unsigned base = i << SEGSHIFT; pde = &pmap->pm_segtab[i]; - if (pde && pmap_pde_v(pde)) { + if (pde && *pde != 0) { for (j = 0; j < 1024; j++) { vm_offset_t va = base + (j << PAGE_SHIFT); pte = pmap_pte(pmap, va); - if (pte && pmap_pte_v(pte)) { + if (pte && pte_test(pte, PTE_V)) { vm_offset_t pa; vm_page_t m; @@ -3050,16 +3042,16 @@ init_pte_prot(vm_offset_t va, vm_page_t int rw; if (!(prot & VM_PROT_WRITE)) - rw = PTE_ROPAGE; + rw = PTE_V | PTE_RO | PTE_C_CACHE; else if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0) { if ((m->md.pv_flags & PV_TABLE_MOD) != 0) - rw = PTE_RWPAGE; + rw = PTE_V | PTE_D | PTE_C_CACHE; else - rw = PTE_CWPAGE; + rw = PTE_V | PTE_C_CACHE; vm_page_flag_set(m, PG_WRITEABLE); } else /* Needn't emulate a modified bit for unmanaged pages. */ - rw = PTE_RWPAGE; + rw = PTE_V | PTE_D | PTE_C_CACHE; return (rw); } Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Wed Jun 23 19:29:17 2010 (r209481) +++ head/sys/mips/mips/trap.c Wed Jun 23 19:42:01 2010 (r209482) @@ -327,7 +327,7 @@ trap(struct trapframe *trapframe) #ifdef SMP printf("cpuid = %d\n", PCPU_GET(cpuid)); #endif - MachTLBGetPID(pid); + pid = mips_rd_entryhi() & TLBHI_ASID_MASK; printf("badaddr = %#jx, pc = %#jx, ra = %#jx, sp = %#jx, sr = %jx, pid = %d, ASID = %u\n", (intmax_t)trapframe->badvaddr, (intmax_t)trapframe->pc, (intmax_t)trapframe->ra, (intmax_t)trapframe->sp, (intmax_t)trapframe->sr, @@ -378,23 +378,23 @@ trap(struct trapframe *trapframe) panic("trap: ktlbmod: can't find PTE"); #ifdef SMP /* It is possible that some other CPU changed m-bit */ - if (!mips_pg_v(*pte) || (*pte & mips_pg_m_bit())) { + if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) { pmap_update_page(kernel_pmap, trapframe->badvaddr, *pte); PMAP_UNLOCK(kernel_pmap); return (trapframe->pc); } #else - if (!mips_pg_v(*pte) || (*pte & mips_pg_m_bit())) + if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) panic("trap: ktlbmod: invalid pte"); #endif - if (*pte & mips_pg_ro_bit()) { + if (pte_test(pte, PTE_RO)) { /* write to read only page in the kernel */ ftype = VM_PROT_WRITE; PMAP_UNLOCK(kernel_pmap); goto kernel_fault; } - *pte |= mips_pg_m_bit(); + pte_set(pte, PTE_D); pmap_update_page(kernel_pmap, trapframe->badvaddr, *pte); pa = TLBLO_PTE_TO_PA(*pte); if (!page_is_managed(pa)) @@ -417,23 +417,23 @@ trap(struct trapframe *trapframe) panic("trap: utlbmod: can't find PTE"); #ifdef SMP /* It is possible that some other CPU changed m-bit */ - if (!mips_pg_v(*pte) || (*pte & mips_pg_m_bit())) { + if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) { pmap_update_page(pmap, trapframe->badvaddr, *pte); PMAP_UNLOCK(pmap); goto out; } #else - if (!mips_pg_v(*pte) || (*pte & mips_pg_m_bit())) + if (!pte_test(pte, PTE_V) || pte_test(pte, PTE_D)) panic("trap: utlbmod: invalid pte"); #endif - if (*pte & mips_pg_ro_bit()) { + if (pte_test(pte, PTE_RO)) { /* write to read only page */ ftype = VM_PROT_WRITE; PMAP_UNLOCK(pmap); goto dofault; } - *pte |= mips_pg_m_bit(); + pte_set(pte, PTE_D); pmap_update_page(pmap, trapframe->badvaddr, *pte); pa = TLBLO_PTE_TO_PA(*pte); if (!page_is_managed(pa)) Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Wed Jun 23 19:29:17 2010 (r209481) +++ head/sys/mips/mips/vm_machdep.c Wed Jun 23 19:42:01 2010 (r209482) @@ -219,7 +219,7 @@ cpu_thread_swapin(struct thread *td) */ for (i = 0; i < KSTACK_PAGES; i++) { pte = pmap_pte(kernel_pmap, td->td_kstack + i * PAGE_SIZE); - td->td_md.md_upte[i] = *pte & ~(PTE_RO|PTE_WIRED); + td->td_md.md_upte[i] = *pte & ~TLBLO_SWBITS_MASK; } } @@ -241,7 +241,7 @@ cpu_thread_alloc(struct thread *td) for (i = 0; i < KSTACK_PAGES; i++) { pte = pmap_pte(kernel_pmap, td->td_kstack + i * PAGE_SIZE); - td->td_md.md_upte[i] = *pte & ~(PTE_RO|PTE_WIRED); + td->td_md.md_upte[i] = *pte & ~TLBLO_SWBITS_MASK; } } From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 20:44:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25555106564A; Wed, 23 Jun 2010 20:44:08 +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 12F9F8FC18; Wed, 23 Jun 2010 20:44:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NKi7dL075688; Wed, 23 Jun 2010 20:44:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NKi70w075681; Wed, 23 Jun 2010 20:44:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201006232044.o5NKi70w075681@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 23 Jun 2010 20:44: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: r209483 - in head/sys: amd64/amd64 amd64/ia32 amd64/include i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 20:44:08 -0000 Author: kib Date: Wed Jun 23 20:44:07 2010 New Revision: 209483 URL: http://svn.freebsd.org/changeset/base/209483 Log: Clear DF bit in eflags/rflags on the kernel entry. The i386 and amd64 ABI specifies the DF should be zero, and newer compilers do not clear DF before using DF-sensitive instructions. The DF clearing for signal handlers was done some time ago. MFC after: 1 week Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/ia32/ia32_exception.S head/sys/amd64/include/asmacros.h head/sys/i386/i386/apic_vector.s head/sys/i386/i386/atpic_vector.s head/sys/i386/i386/exception.s Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Wed Jun 23 19:42:01 2010 (r209482) +++ head/sys/amd64/amd64/exception.S Wed Jun 23 20:44:07 2010 (r209483) @@ -191,6 +191,7 @@ alltraps_pushregs_no_rdi: movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) movl $TF_HASSEGS,TF_FLAGS(%rsp) + cld FAKE_MCOUNT(TF_RIP(%rsp)) #ifdef KDTRACE_HOOKS /* @@ -270,6 +271,7 @@ IDTVEC(dblfault) movw %es,TF_ES(%rsp) movw %ds,TF_DS(%rsp) movl $TF_HASSEGS,TF_FLAGS(%rsp) + cld testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ jz 1f /* already running with kernel GS.base */ swapgs @@ -369,6 +371,7 @@ IDTVEC(fast_syscall) movq %r14,TF_R14(%rsp) /* C preserved */ movq %r15,TF_R15(%rsp) /* C preserved */ movl $TF_HASSEGS,TF_FLAGS(%rsp) + cld FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp,%rdi call syscall @@ -434,6 +437,7 @@ IDTVEC(nmi) movw %es,TF_ES(%rsp) movw %ds,TF_DS(%rsp) movl $TF_HASSEGS,TF_FLAGS(%rsp) + cld xorl %ebx,%ebx testb $SEL_RPL_MASK,TF_CS(%rsp) jnz nmi_fromuserspace Modified: head/sys/amd64/ia32/ia32_exception.S ============================================================================== --- head/sys/amd64/ia32/ia32_exception.S Wed Jun 23 19:42:01 2010 (r209482) +++ head/sys/amd64/ia32/ia32_exception.S Wed Jun 23 20:44:07 2010 (r209483) @@ -67,6 +67,7 @@ IDTVEC(int0x80_syscall) movq %r14,TF_R14(%rsp) movq %r15,TF_R15(%rsp) movl $TF_HASSEGS,TF_FLAGS(%rsp) + cld FAKE_MCOUNT(TF_RIP(%rsp)) movq %rsp, %rdi call ia32_syscall Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Wed Jun 23 19:42:01 2010 (r209482) +++ head/sys/amd64/include/asmacros.h Wed Jun 23 20:44:07 2010 (r209483) @@ -166,7 +166,8 @@ movw %gs,TF_GS(%rsp) ; \ movw %es,TF_ES(%rsp) ; \ movw %ds,TF_DS(%rsp) ; \ - movl $TF_HASSEGS,TF_FLAGS(%rsp) + movl $TF_HASSEGS,TF_FLAGS(%rsp) ; \ + cld #define POP_FRAME \ movq TF_RDI(%rsp),%rdi ; \ Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Wed Jun 23 19:42:01 2010 (r209482) +++ head/sys/i386/i386/apic_vector.s Wed Jun 23 20:44:07 2010 (r209483) @@ -56,6 +56,7 @@ IDTVEC(vec_name) ; \ PUSH_FRAME ; \ SET_KERNEL_SREGS ; \ + cld ; \ FAKE_MCOUNT(TF_EIP(%esp)) ; \ movl lapic, %edx ; /* pointer to local APIC */ \ movl LA_ISR + 16 * (index)(%edx), %eax ; /* load ISR */ \ @@ -103,6 +104,7 @@ IDTVEC(spuriousint) IDTVEC(timerint) PUSH_FRAME SET_KERNEL_SREGS + cld FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp call lapic_handle_timer @@ -118,6 +120,7 @@ IDTVEC(timerint) IDTVEC(cmcint) PUSH_FRAME SET_KERNEL_SREGS + cld FAKE_MCOUNT(TF_EIP(%esp)) call lapic_handle_cmc MEXITCOUNT @@ -131,6 +134,7 @@ IDTVEC(cmcint) IDTVEC(errorint) PUSH_FRAME SET_KERNEL_SREGS + cld FAKE_MCOUNT(TF_EIP(%esp)) call lapic_handle_error MEXITCOUNT @@ -302,6 +306,7 @@ IDTVEC(invlcache) IDTVEC(ipi_intr_bitmap_handler) PUSH_FRAME SET_KERNEL_SREGS + cld movl lapic, %edx movl $0, LA_EOI(%edx) /* End Of Interrupt to APIC */ @@ -320,6 +325,7 @@ IDTVEC(ipi_intr_bitmap_handler) IDTVEC(cpustop) PUSH_FRAME SET_KERNEL_SREGS + cld movl lapic, %eax movl $0, LA_EOI(%eax) /* End Of Interrupt to APIC */ @@ -339,6 +345,7 @@ IDTVEC(cpustop) IDTVEC(rendezvous) PUSH_FRAME SET_KERNEL_SREGS + cld #ifdef COUNT_IPIS movl PCPU(CPUID), %eax @@ -360,6 +367,7 @@ IDTVEC(rendezvous) IDTVEC(lazypmap) PUSH_FRAME SET_KERNEL_SREGS + cld call pmap_lazyfix_action Modified: head/sys/i386/i386/atpic_vector.s ============================================================================== --- head/sys/i386/i386/atpic_vector.s Wed Jun 23 19:42:01 2010 (r209482) +++ head/sys/i386/i386/atpic_vector.s Wed Jun 23 20:44:07 2010 (r209483) @@ -49,6 +49,7 @@ IDTVEC(vec_name) ; \ PUSH_FRAME ; \ SET_KERNEL_SREGS ; \ + cld ; \ ; \ FAKE_MCOUNT(TF_EIP(%esp)) ; \ pushl %esp ; \ Modified: head/sys/i386/i386/exception.s ============================================================================== --- head/sys/i386/i386/exception.s Wed Jun 23 19:42:01 2010 (r209482) +++ head/sys/i386/i386/exception.s Wed Jun 23 20:44:07 2010 (r209483) @@ -159,6 +159,7 @@ alltraps: pushl %fs alltraps_with_regs_pushed: SET_KERNEL_SREGS + cld FAKE_MCOUNT(TF_EIP(%esp)) calltrap: pushl %esp @@ -233,6 +234,7 @@ IDTVEC(lcall_syscall) pushl %es pushl %fs SET_KERNEL_SREGS + cld FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp call syscall @@ -256,6 +258,7 @@ IDTVEC(int0x80_syscall) pushl %es pushl %fs SET_KERNEL_SREGS + cld FAKE_MCOUNT(TF_EIP(%esp)) pushl %esp call syscall From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 20:59:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3EF7106564A; Wed, 23 Jun 2010 20:59:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C18B58FC12; Wed, 23 Jun 2010 20:59:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NKx0vw079037; Wed, 23 Jun 2010 20:59:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NKx09k079034; Wed, 23 Jun 2010 20:59:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006232059.o5NKx09k079034@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 23 Jun 2010 20:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209484 - in stable/8: sbin/mount share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 20:59:01 -0000 Author: jilles Date: Wed Jun 23 20:59:00 2010 New Revision: 209484 URL: http://svn.freebsd.org/changeset/base/209484 Log: MFC r208647,r208654: Clarify devfs manpages slightly. mount(8): add xref to devfs(5) devfs(5): change example to something more likely to be useful (it is not necessary to mount a devfs on /dev manually, but for chroots/jails it is often needed), mention since when devfs is preferred to device nodes on ufs and when device nodes on ufs stopped working PR: 146600 Modified: stable/8/sbin/mount/mount.8 stable/8/share/man/man5/devfs.5 Directory Properties: stable/8/sbin/mount/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/sbin/mount/mount.8 ============================================================================== --- stable/8/sbin/mount/mount.8 Wed Jun 23 20:44:07 2010 (r209483) +++ stable/8/sbin/mount/mount.8 Wed Jun 23 20:59:00 2010 (r209484) @@ -525,6 +525,7 @@ support for a particular file system mig .Xr nmount 2 , .Xr acl 3 , .Xr mac 4 , +.Xr devfs 5 , .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , Modified: stable/8/share/man/man5/devfs.5 ============================================================================== --- stable/8/share/man/man5/devfs.5 Wed Jun 23 20:44:07 2010 (r209483) +++ stable/8/share/man/man5/devfs.5 Wed Jun 23 20:59:00 2010 (r209484) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 1996 +.Dd May 30, 2010 .Dt DEVFS 5 .Os .Sh NAME @@ -80,9 +80,9 @@ mount point. To mount a .Nm volume located on -.Pa /dev : +.Pa /mychroot/dev : .Pp -.Dl "mount -t devfs devfs /dev" +.Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO .Xr devfs 8 , .Xr mount 8 @@ -91,6 +91,10 @@ The .Nm file system first appeared in .Fx 2.0 . +It became the preferred method for accessing devices in +.Fx 5.0 +and the only method in +.Fx 6.0 . The .Nm manual page first appeared in From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 22:25:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12B6F1065676; Wed, 23 Jun 2010 22:25:53 +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 01D498FC1A; Wed, 23 Jun 2010 22:25:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NMPqkJ098133; Wed, 23 Jun 2010 22:25:52 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NMPqxu098131; Wed, 23 Jun 2010 22:25:52 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006232225.o5NMPqxu098131@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 23 Jun 2010 22:25: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: r209485 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 22:25:53 -0000 Author: marcel Date: Wed Jun 23 22:25:52 2010 New Revision: 209485 URL: http://svn.freebsd.org/changeset/base/209485 Log: In the attach method, refactor to take into account that BUS_GET_RESOURCE_LIST() can return a NULL pointer -- and will for MPC85xx kernels. Modified: head/sys/powerpc/powerpc/openpic.c Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Wed Jun 23 20:59:00 2010 (r209484) +++ head/sys/powerpc/powerpc/openpic.c Wed Jun 23 22:25:52 2010 (r209485) @@ -114,15 +114,22 @@ openpic_attach(device_t dev) /* Check if this is a cascaded PIC */ sc->sc_irq = 0; sc->sc_intr = NULL; - if (resource_list_find(BUS_GET_RESOURCE_LIST(device_get_parent(dev), - dev), SYS_RES_IRQ, 0) != NULL) { + do { + struct resource_list *rl; + + rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); + if (rl == NULL) + break; + if (resource_list_find(rl, SYS_RES_IRQ, 0) == NULL) + break; + sc->sc_intr = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irq, RF_ACTIVE); /* XXX Cascaded PICs pass NULL trapframes! */ bus_setup_intr(dev, sc->sc_intr, INTR_TYPE_MISC | INTR_MPSAFE, openpic_intr, NULL, dev, &sc->sc_icookie); - } + } while (0); /* Reset the PIC */ x = openpic_read(sc, OPENPIC_CONFIG); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 22:33:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0D23106566B; Wed, 23 Jun 2010 22:33:03 +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 CDF6C8FC0C; Wed, 23 Jun 2010 22:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NMX343099786; Wed, 23 Jun 2010 22:33:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NMX3w4099776; Wed, 23 Jun 2010 22:33:03 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006232233.o5NMX3w4099776@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Jun 2010 22:33: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: r209486 - in head/sys/powerpc: aim include mpc85xx powermac powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 22:33:04 -0000 Author: nwhitehorn Date: Wed Jun 23 22:33:03 2010 New Revision: 209486 URL: http://svn.freebsd.org/changeset/base/209486 Log: Configure interrupts on SMP systems to be distributed among all online CPUs by default, and provide a functional version of BUS_BIND_INTR(). While here, fix some potential concurrency problems in the interrupt handling code. Modified: head/sys/powerpc/aim/nexus.c head/sys/powerpc/include/intr_machdep.h head/sys/powerpc/include/openpicvar.h head/sys/powerpc/mpc85xx/opic.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/openpic_macio.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/openpic.c head/sys/powerpc/powerpc/pic_if.m Modified: head/sys/powerpc/aim/nexus.c ============================================================================== --- head/sys/powerpc/aim/nexus.c Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/aim/nexus.c Wed Jun 23 22:33:03 2010 (r209486) @@ -119,6 +119,12 @@ static device_t nexus_add_child(device_t static void nexus_probe_nomatch(device_t, device_t); static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); static int nexus_write_ivar(device_t, device_t, int, uintptr_t); +#ifdef SMP +static int nexus_bind_intr(device_t dev, device_t child, + struct resource *irq, int cpu); +#endif +static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol); static int nexus_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, @@ -162,6 +168,10 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_write_ivar, nexus_write_ivar), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif + DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -363,6 +373,23 @@ nexus_teardown_intr(device_t dev, device return (powerpc_teardown_intr(cookie)); } +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + + return (powerpc_bind_intr(rman_get_start(irq), cpu)); +} +#endif + +static int +nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (powerpc_config_intr(irq, trig, pol)); +} + /* * Allocate resources at the behest of a child. This only handles interrupts, * since I/O resources are handled by child busses. Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/include/intr_machdep.h Wed Jun 23 22:33:03 2010 (r209486) @@ -56,6 +56,7 @@ int powerpc_enable_intr(void); int powerpc_setup_intr(const char *, u_int, driver_filter_t, driver_intr_t, void *, enum intr_type, void **); int powerpc_teardown_intr(void *); +int powerpc_bind_intr(u_int irq, u_char cpu); int powerpc_config_intr(int, enum intr_trigger, enum intr_polarity); #endif /* _MACHINE_INTR_MACHDEP_H_ */ Modified: head/sys/powerpc/include/openpicvar.h ============================================================================== --- head/sys/powerpc/include/openpicvar.h Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/include/openpicvar.h Wed Jun 23 22:33:03 2010 (r209486) @@ -57,6 +57,7 @@ int openpic_attach(device_t); /* * PIC interface. */ +void openpic_bind(device_t dev, u_int irq, cpumask_t cpumask); void openpic_config(device_t, u_int, enum intr_trigger, enum intr_polarity); void openpic_dispatch(device_t, struct trapframe *); void openpic_enable(device_t, u_int, u_int); Modified: head/sys/powerpc/mpc85xx/opic.c ============================================================================== --- head/sys/powerpc/mpc85xx/opic.c Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/mpc85xx/opic.c Wed Jun 23 22:33:03 2010 (r209486) @@ -57,6 +57,7 @@ static device_method_t openpic_ocpbus_m DEVMETHOD(device_attach, openpic_attach), /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), DEVMETHOD(pic_config, openpic_config), DEVMETHOD(pic_dispatch, openpic_dispatch), DEVMETHOD(pic_enable, openpic_enable), Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/powermac/cpcht.c Wed Jun 23 22:33:03 2010 (r209486) @@ -751,6 +751,7 @@ static device_method_t openpic_cpcht_me DEVMETHOD(device_attach, openpic_cpcht_attach), /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), DEVMETHOD(pic_config, openpic_cpcht_config), DEVMETHOD(pic_dispatch, openpic_dispatch), DEVMETHOD(pic_enable, openpic_cpcht_enable), Modified: head/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- head/sys/powerpc/powermac/openpic_macio.c Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/powermac/openpic_macio.c Wed Jun 23 22:33:03 2010 (r209486) @@ -67,6 +67,7 @@ static device_method_t openpic_macio_me DEVMETHOD(device_attach, openpic_attach), /* PIC interface */ + DEVMETHOD(pic_bind, openpic_bind), DEVMETHOD(pic_config, openpic_config), DEVMETHOD(pic_dispatch, openpic_dispatch), DEVMETHOD(pic_enable, openpic_enable), Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/powerpc/intr_machdep.c Wed Jun 23 22:33:03 2010 (r209486) @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -96,6 +97,7 @@ struct powerpc_intr { device_t pic; u_int intline; u_int vector; + cpumask_t cpu; enum intr_trigger trig; enum intr_polarity pol; }; @@ -127,6 +129,23 @@ intr_init(void *dummy __unused) } SYSINIT(intr_init, SI_SUB_INTR, SI_ORDER_FIRST, intr_init, NULL); +#ifdef SMP +static void +smp_intr_init(void *dummy __unused) +{ + struct powerpc_intr *i; + int vector; + + for (vector = 0; vector < nvectors; vector++) { + i = powerpc_intrs[vector]; + if (i != NULL && i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); + } +} + +SYSINIT(smp_intr_init, SI_SUB_SMP, SI_ORDER_ANY, smp_intr_init, NULL); +#endif + static void intrcnt_setname(const char *name, int index) { @@ -150,11 +169,12 @@ intr_lookup(u_int irq) return (i); } } - mtx_unlock(&intr_table_lock); i = malloc(sizeof(*i), M_INTR, M_NOWAIT); - if (i == NULL) + if (i == NULL) { + mtx_unlock(&intr_table_lock); return (NULL); + } i->event = NULL; i->cntp = NULL; @@ -164,7 +184,12 @@ intr_lookup(u_int irq) i->pic = NULL; i->vector = -1; - mtx_lock(&intr_table_lock); +#ifdef SMP + i->cpu = all_cpus; +#else + i->cpu = 1; +#endif + for (vector = 0; vector < INTR_VECTORS && vector <= nvectors; vector++) { iscan = powerpc_intrs[vector]; @@ -359,6 +384,9 @@ powerpc_setup_intr(const char *name, u_i i->pol != INTR_POLARITY_CONFORM)) PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + if (!error && i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); + if (!error && enable) PIC_ENABLE(i->pic, i->intline, i->vector); } @@ -372,6 +400,27 @@ powerpc_teardown_intr(void *cookie) return (intr_event_remove_handler(cookie)); } +#ifdef SMP +int +powerpc_bind_intr(u_int irq, u_char cpu) +{ + struct powerpc_intr *i; + + i = intr_lookup(irq); + if (i == NULL) + return (ENOMEM); + + if (cpu == NOCPU) + i->cpu = all_cpus; + else + i->cpu = 1 << cpu; + + PIC_BIND(i->pic, i->intline, i->cpu); + + return (intr_event_bind(i->event, cpu)); +} +#endif + int powerpc_config_intr(int irq, enum intr_trigger trig, enum intr_polarity pol) { Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/powerpc/openpic.c Wed Jun 23 22:33:03 2010 (r209486) @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include #include @@ -72,11 +74,13 @@ openpic_set_priority(struct openpic_soft u_int tpr; uint32_t x; + sched_pin(); tpr = OPENPIC_PCPU_TPR(PCPU_GET(cpuid)); x = openpic_read(sc, tpr); x &= ~OPENPIC_TPR_MASK; x |= pri; openpic_write(sc, tpr, x); + sched_unpin(); } int @@ -228,6 +232,19 @@ openpic_attach(device_t dev) */ void +openpic_bind(device_t dev, u_int irq, cpumask_t cpumask) +{ + struct openpic_softc *sc; + + /* If we aren't directly connected to the CPU, this won't work */ + if (dev != root_pic) + return; + + sc = device_get_softc(dev); + openpic_write(sc, OPENPIC_IDEST(irq), cpumask); +} + +void openpic_config(device_t dev, u_int irq, enum intr_trigger trig, enum intr_polarity pol) { @@ -313,8 +330,10 @@ openpic_ipi(device_t dev, u_int cpu) struct openpic_softc *sc; sc = device_get_softc(dev); + sched_pin(); openpic_write(sc, OPENPIC_PCPU_IPI_DISPATCH(PCPU_GET(cpuid), 0), 1u << cpu); + sched_unpin(); } void Modified: head/sys/powerpc/powerpc/pic_if.m ============================================================================== --- head/sys/powerpc/powerpc/pic_if.m Wed Jun 23 22:25:52 2010 (r209485) +++ head/sys/powerpc/powerpc/pic_if.m Wed Jun 23 22:33:03 2010 (r209486) @@ -32,6 +32,12 @@ INTERFACE pic; +METHOD void bind { + device_t dev; + u_int irq; + cpumask_t cpumask; +}; + METHOD void config { device_t dev; u_int irq; @@ -73,3 +79,4 @@ METHOD void unmask { device_t dev; u_int irq; }; + From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 23:03:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E46106564A; Wed, 23 Jun 2010 23:03:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5FD18FC15; Wed, 23 Jun 2010 23:03:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NN3P4v006698; Wed, 23 Jun 2010 23:03:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NN3PON006696; Wed, 23 Jun 2010 23:03:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006232303.o5NN3PON006696@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 23 Jun 2010 23:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209487 - releng/8.1/sys/geom/gate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 23:03:25 -0000 Author: pjd Date: Wed Jun 23 23:03:25 2010 New Revision: 209487 URL: http://svn.freebsd.org/changeset/base/209487 Log: MFC r209262: r209186: BIO_DELETE contains range we want to delete and doesn't provide any useful data, so there is no need to copy it to userland. r209187: 'unit' can be negative, so use signed type for it. Found by: Coverity Prevent CID: 3731 Approved by: re (kensmith) Modified: releng/8.1/sys/geom/gate/g_gate.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/geom/gate/g_gate.c ============================================================================== --- releng/8.1/sys/geom/gate/g_gate.c Wed Jun 23 22:33:03 2010 (r209486) +++ releng/8.1/sys/geom/gate/g_gate.c Wed Jun 23 23:03:25 2010 (r209487) @@ -210,7 +210,7 @@ g_gate_start(struct bio *bp) } static struct g_gate_softc * -g_gate_hold(u_int unit, const char *name) +g_gate_hold(int unit, const char *name) { struct g_gate_softc *sc = NULL; @@ -572,8 +572,8 @@ g_gate_ioctl(struct cdev *dev, u_long cm switch (bp->bio_cmd) { case BIO_READ: - break; case BIO_DELETE: + break; case BIO_WRITE: error = copyout(bp->bio_data, ggio->gctl_data, bp->bio_length); From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 23:07:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B10101065674; Wed, 23 Jun 2010 23:07:58 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F3478FC15; Wed, 23 Jun 2010 23:07:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NN7ws8007733; Wed, 23 Jun 2010 23:07:58 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NN7vpH007724; Wed, 23 Jun 2010 23:07:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006232307.o5NN7vpH007724@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 23 Jun 2010 23:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209488 - releng/8.1/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 23:07:58 -0000 Author: pjd Date: Wed Jun 23 23:07:57 2010 New Revision: 209488 URL: http://svn.freebsd.org/changeset/base/209488 Log: MFC r209263: r209175: Eliminate dead code. Found by: Coverity Prevent CID: 5158 r209177: Remove macros that are not really needed. The idea was to have them in case we grow more descriptors, but I'll reconsider readding them once we get there. Passing (a = b) expression to FD_ISSET() is bad idea, as FD_ISSET() evaluates its argument twice. Found by: Coverity Prevent CID: 5243 r209179: Plug memory leaks. Found by: Coverity Prevent CID: 7052, 7053, 7054, 7055 r209180: Plug memory leak. Found by: Coverity Prevent CID: 7051 r209181: Plug memory leak. Found by: Coverity Prevent CID: 7056 r209182: Plug memory leak. Found by: Coverity Prevent CID: 7057 r209183: Initialize gctl_seq for synchronization requests. Reported by: hiroshi@soupacific.com Analysed by: Mikolaj Golub Tested by: hiroshi@soupacific.com, Mikolaj Golub r209184: Fix typos. r209185: Correct various log messages. Submitted by: Mikolaj Golub Note that without some of these changes hastd won't work on 8.x properly. Approved by: re (kensmith) Modified: releng/8.1/sbin/hastd/ebuf.c releng/8.1/sbin/hastd/hast_proto.c releng/8.1/sbin/hastd/hastd.c releng/8.1/sbin/hastd/metadata.c releng/8.1/sbin/hastd/nv.c releng/8.1/sbin/hastd/primary.c releng/8.1/sbin/hastd/secondary.c Directory Properties: releng/8.1/sbin/hastd/ (props changed) Modified: releng/8.1/sbin/hastd/ebuf.c ============================================================================== --- releng/8.1/sbin/hastd/ebuf.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/ebuf.c Wed Jun 23 23:07:57 2010 (r209488) @@ -55,8 +55,8 @@ struct ebuf { size_t eb_size; }; -static int ebuf_head_extent(struct ebuf *eb, size_t size); -static int ebuf_tail_extent(struct ebuf *eb, size_t size); +static int ebuf_head_extend(struct ebuf *eb, size_t size); +static int ebuf_tail_extend(struct ebuf *eb, size_t size); struct ebuf * ebuf_alloc(size_t size) @@ -110,7 +110,7 @@ ebuf_add_head(struct ebuf *eb, const voi * We can't add more entries at the front, so we have to extend * our buffer. */ - if (ebuf_head_extent(eb, size) < 0) + if (ebuf_head_extend(eb, size) < 0) return (-1); } assert(size <= (size_t)(eb->eb_used - eb->eb_start)); @@ -137,13 +137,13 @@ ebuf_add_tail(struct ebuf *eb, const voi * We can't add more entries at the back, so we have to extend * our buffer. */ - if (ebuf_tail_extent(eb, size) < 0) + if (ebuf_tail_extend(eb, size) < 0) return (-1); } assert(size <= (size_t)(eb->eb_end - (eb->eb_used + eb->eb_size))); /* - * If data is NULL the caller just wants to reserve place. + * If data is NULL the caller just wants to reserve space. */ if (data != NULL) bcopy(data, eb->eb_used + eb->eb_size, size); @@ -203,7 +203,7 @@ ebuf_size(struct ebuf *eb) * Function adds size + (PAGE_SIZE / 4) bytes at the front of the buffer.. */ static int -ebuf_head_extent(struct ebuf *eb, size_t size) +ebuf_head_extend(struct ebuf *eb, size_t size) { unsigned char *newstart, *newused; size_t newsize; @@ -231,7 +231,7 @@ ebuf_head_extent(struct ebuf *eb, size_t * Function adds size + ((3 * PAGE_SIZE) / 4) bytes at the back. */ static int -ebuf_tail_extent(struct ebuf *eb, size_t size) +ebuf_tail_extend(struct ebuf *eb, size_t size) { unsigned char *newstart; size_t newsize; Modified: releng/8.1/sbin/hastd/hast_proto.c ============================================================================== --- releng/8.1/sbin/hastd/hast_proto.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/hast_proto.c Wed Jun 23 23:07:57 2010 (r209488) @@ -329,9 +329,7 @@ hast_proto_recv_hdr(struct proto_conn *c *nvp = nv; return (0); fail: - if (nv != NULL) - nv_free(nv); - else if (eb != NULL) + if (eb != NULL) ebuf_free(eb); return (-1); } Modified: releng/8.1/sbin/hastd/hastd.c ============================================================================== --- releng/8.1/sbin/hastd/hastd.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/hastd.c Wed Jun 23 23:07:57 2010 (r209488) @@ -200,7 +200,7 @@ listen_accept(void) proto_local_address(conn, laddr, sizeof(laddr)); proto_remote_address(conn, raddr, sizeof(raddr)); - pjdlog_info("Connection from %s to %s.", laddr, raddr); + pjdlog_info("Connection from %s to %s.", raddr, laddr); /* Error in setting timeout is not critical, but why should it fail? */ if (proto_timeout(conn, HAST_TIMEOUT) < 0) @@ -286,7 +286,7 @@ listen_accept(void) if (token != NULL && memcmp(token, res->hr_token, sizeof(res->hr_token)) != 0) { pjdlog_error("Token received from %s doesn't match.", raddr); - nv_add_stringf(nverr, "errmsg", "Toke doesn't match."); + nv_add_stringf(nverr, "errmsg", "Token doesn't match."); goto fail; } /* @@ -400,7 +400,11 @@ static void main_loop(void) { fd_set rfds, wfds; - int fd, maxfd, ret; + int cfd, lfd, maxfd, ret; + + cfd = proto_descriptor(cfg->hc_controlconn); + lfd = proto_descriptor(cfg->hc_listenconn); + maxfd = cfd > lfd ? cfd : lfd; for (;;) { if (sigchld_received) { @@ -412,22 +416,13 @@ main_loop(void) hastd_reload(); } - maxfd = 0; + /* Setup descriptors for select(2). */ FD_ZERO(&rfds); + FD_SET(cfd, &rfds); + FD_SET(lfd, &rfds); FD_ZERO(&wfds); - - /* Setup descriptors for select(2). */ -#define SETUP_FD(conn) do { \ - fd = proto_descriptor(conn); \ - if (fd >= 0) { \ - maxfd = fd > maxfd ? fd : maxfd; \ - FD_SET(fd, &rfds); \ - FD_SET(fd, &wfds); \ - } \ -} while (0) - SETUP_FD(cfg->hc_controlconn); - SETUP_FD(cfg->hc_listenconn); -#undef SETUP_FD + FD_SET(cfd, &wfds); + FD_SET(lfd, &wfds); ret = select(maxfd + 1, &rfds, &wfds, NULL, NULL); if (ret == -1) { @@ -437,13 +432,10 @@ main_loop(void) pjdlog_exit(EX_OSERR, "select() failed"); } -#define ISSET_FD(conn) \ - (FD_ISSET((fd = proto_descriptor(conn)), &rfds) || FD_ISSET(fd, &wfds)) - if (ISSET_FD(cfg->hc_controlconn)) + if (FD_ISSET(cfd, &rfds) || FD_ISSET(cfd, &wfds)) control_handle(cfg); - if (ISSET_FD(cfg->hc_listenconn)) + if (FD_ISSET(lfd, &rfds) || FD_ISSET(lfd, &wfds)) listen_accept(); -#undef ISSET_FD } } Modified: releng/8.1/sbin/hastd/metadata.c ============================================================================== --- releng/8.1/sbin/hastd/metadata.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/metadata.c Wed Jun 23 23:07:57 2010 (r209488) @@ -96,6 +96,7 @@ metadata_read(struct hast_resource *res, rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to allocate memory to read metadata"); + ebuf_free(eb); goto fail; } buf = ebuf_data(eb, NULL); @@ -154,6 +155,7 @@ metadata_read(struct hast_resource *res, nv_free(nv); goto fail; } + nv_free(nv); return (0); fail: if (opened_here) { @@ -172,6 +174,7 @@ metadata_write(struct hast_resource *res unsigned char *buf, *ptr; size_t size; ssize_t done; + int ret; buf = calloc(1, METADATA_SIZE); if (buf == NULL) { @@ -180,6 +183,8 @@ metadata_write(struct hast_resource *res return (-1); } + ret = -1; + nv = nv_alloc(); nv_add_string(nv, res->hr_name, "resource"); nv_add_uint64(nv, (uint64_t)res->hr_datasize, "datasize"); @@ -199,7 +204,7 @@ metadata_write(struct hast_resource *res nv_add_string(nv, role2str(res->hr_role), "prevrole"); if (nv_error(nv) != 0) { pjdlog_error("Unable to create metadata."); - goto fail; + goto end; } res->hr_previous_role = res->hr_role; eb = nv_hton(nv); @@ -211,12 +216,11 @@ metadata_write(struct hast_resource *res done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); if (done < 0 || done != METADATA_SIZE) { pjdlog_errno(LOG_ERR, "Unable to write metadata"); - goto fail; + goto end; } - - return (0); -fail: + ret = 0; +end: free(buf); nv_free(nv); - return (-1); + return (ret); } Modified: releng/8.1/sbin/hastd/nv.c ============================================================================== --- releng/8.1/sbin/hastd/nv.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/nv.c Wed Jun 23 23:07:57 2010 (r209488) @@ -707,8 +707,10 @@ nv_add(struct nv *nv, const unsigned cha assert(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; + free(nvh); return; } + free(nvh); /* Add the actual data. */ if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { assert(errno != 0); Modified: releng/8.1/sbin/hastd/primary.c ============================================================================== --- releng/8.1/sbin/hastd/primary.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/primary.c Wed Jun 23 23:07:57 2010 (r209488) @@ -195,7 +195,10 @@ static pthread_mutex_t metadata_lock; mtx_unlock(&hio_##name##_list_lock); \ } while (0) -#define SYNCREQ(hio) do { (hio)->hio_ggio.gctl_unit = -1; } while (0) +#define SYNCREQ(hio) do { \ + (hio)->hio_ggio.gctl_unit = -1; \ + (hio)->hio_ggio.gctl_seq = 1; \ +} while (0) #define ISSYNCREQ(hio) ((hio)->hio_ggio.gctl_unit == -1) #define SYNCREQDONE(hio) do { (hio)->hio_ggio.gctl_unit = -2; } while (0) #define ISSYNCREQDONE(hio) ((hio)->hio_ggio.gctl_unit == -2) @@ -447,6 +450,7 @@ init_local(struct hast_resource *res) primary_exit(EX_NOINPUT, "Unable to read activemap"); } activemap_copyin(res->hr_amp, buf, mapsize); + free(buf); if (res->hr_resuid != 0) return; /* Modified: releng/8.1/sbin/hastd/secondary.c ============================================================================== --- releng/8.1/sbin/hastd/secondary.c Wed Jun 23 23:03:25 2010 (r209487) +++ releng/8.1/sbin/hastd/secondary.c Wed Jun 23 23:07:57 2010 (r209488) @@ -295,6 +295,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); exit(EX_TEMPFAIL); } + nv_free(nvout); if (res->hr_secondary_localcnt > res->hr_primary_remotecnt && res->hr_primary_localcnt > res->hr_secondary_remotecnt) { /* Exit on split-brain. */ @@ -687,7 +688,7 @@ send_thread(void *arg) pjdlog_exit(EX_TEMPFAIL, "Unable to send reply."); } nv_free(nvout); - pjdlog_debug(2, "disk: (%p) Moving request to the free queue.", + pjdlog_debug(2, "send: (%p) Moving request to the free queue.", hio); nv_free(hio->hio_nv); hio->hio_error = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 23:16:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD99A1065672; Wed, 23 Jun 2010 23:16:27 +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 9CC618FC13; Wed, 23 Jun 2010 23:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NNGRDg009614; Wed, 23 Jun 2010 23:16:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NNGRNx009612; Wed, 23 Jun 2010 23:16:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006232316.o5NNGRNx009612@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 23 Jun 2010 23:16: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: r209489 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 23:16:27 -0000 Author: marcel Date: Wed Jun 23 23:16:27 2010 New Revision: 209489 URL: http://svn.freebsd.org/changeset/base/209489 Log: With openpic(4) using active-low as the default polarity, reconfigure the internal interrupt sources as active-high. The internal interrupt sources are disabled when programmed as active-low. Note that the internal interrupts have no sense bit like the external interrupts. We program them as edge-triggered to make sure we write a 0 value to a reserved register. It does not in any way say anything about the sense of internal interrupt. Modified: head/sys/powerpc/mpc85xx/ocpbus.c Modified: head/sys/powerpc/mpc85xx/ocpbus.c ============================================================================== --- head/sys/powerpc/mpc85xx/ocpbus.c Wed Jun 23 23:07:57 2010 (r209488) +++ head/sys/powerpc/mpc85xx/ocpbus.c Wed Jun 23 23:16:27 2010 (r209489) @@ -277,8 +277,15 @@ ocpbus_attach(device_t dev) ccsr_read4(OCP85XX_PORDEVSR), ccsr_read4(OCP85XX_PORDEVSR2)); - for (i = INTR_VEC(OPIC_ID, 0); i < INTR_VEC(OPIC_ID, 4); i++) - powerpc_config_intr(i, INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW); + /* + * Internal interrupt are always active-high. Since the sense cannot + * be specified, we program as edge-triggered to make sure we write + * a 0 value to the reserved bit in the OpenPIC compliant PIC. This + * is not to say anything about the sense of any of the internal + * interrupt sources. + */ + for (i = PIC_IRQ_INT(0); i < PIC_IRQ_INT(32); i++) + powerpc_config_intr(i, INTR_TRIGGER_EDGE, INTR_POLARITY_HIGH); return (bus_generic_attach(dev)); } From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 23:26:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A16D106564A; Wed, 23 Jun 2010 23:26:15 +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 196AE8FC0C; Wed, 23 Jun 2010 23:26:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NNQEwg011795; Wed, 23 Jun 2010 23:26:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NNQEtK011793; Wed, 23 Jun 2010 23:26:14 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006232326.o5NNQEtK011793@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 23 Jun 2010 23:26: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: r209490 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 23:26:15 -0000 Author: nwhitehorn Date: Wed Jun 23 23:26:14 2010 New Revision: 209490 URL: http://svn.freebsd.org/changeset/base/209490 Log: Move default HZ from 100 to 1000 on powerpc. Reviewed by: marcel MFC after: 2 weeks Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Wed Jun 23 23:16:27 2010 (r209489) +++ head/sys/kern/subr_param.c Wed Jun 23 23:26:14 2010 (r209490) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); */ #ifndef HZ -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) +# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) # define HZ 1000 # else # define HZ 100 From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 23:32:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0B5106566C; Wed, 23 Jun 2010 23:32:30 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6B88FC13; Wed, 23 Jun 2010 23:32:30 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from macbook-pro.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4H00B8HQQ5MG60@asmtp025.mac.com>; Wed, 23 Jun 2010 16:32:30 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006230154 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-23_03:2010-02-06, 2010-06-23, 2010-06-23 signatures=0 From: Marcel Moolenaar In-reply-to: <201006232326.o5NNQEtK011793@svn.freebsd.org> Date: Wed, 23 Jun 2010 16:32:28 -0700 Message-id: <3659E546-80A0-4E82-8112-40B093728D81@mac.com> References: <201006232326.o5NNQEtK011793@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209490 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 23:32:30 -0000 On Jun 23, 2010, at 4:26 PM, Nathan Whitehorn wrote: > @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); > */ > > #ifndef HZ > -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) > +# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) > # define HZ 1000 > # else > # define HZ 100 Would you mind inverting the #if statement? The common case is obviously 1KHz, so listing the exceptions (I belief that's only arm and mips) is more effective... -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Wed Jun 23 23:34:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC68F1065672; Wed, 23 Jun 2010 23:34:56 +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 AC05C8FC1B; Wed, 23 Jun 2010 23:34:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5NNYuYM013724; Wed, 23 Jun 2010 23:34:56 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5NNYula013722; Wed, 23 Jun 2010 23:34:56 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201006232334.o5NNYula013722@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 23 Jun 2010 23:34: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: r209491 - head/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2010 23:34:56 -0000 Author: jkim Date: Wed Jun 23 23:34:56 2010 New Revision: 209491 URL: http://svn.freebsd.org/changeset/base/209491 Log: Use M_WAITOK for VESA BIOS initialization consistently. Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Wed Jun 23 23:26:14 2010 (r209490) +++ head/sys/dev/fb/vesa.c Wed Jun 23 23:34:56 2010 (r209491) @@ -164,7 +164,7 @@ static char *vesa_revstr = NULL; static int int10_set_mode(int mode); static int vesa_bios_post(void); -static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode); +static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode, int flags); static int vesa_bios_set_mode(int mode); #if 0 static int vesa_bios_get_dac(void); @@ -278,13 +278,13 @@ vesa_bios_post(void) /* VESA BIOS calls */ static int -vesa_bios_get_mode(int mode, struct vesa_mode *vmode) +vesa_bios_get_mode(int mode, struct vesa_mode *vmode, int flags) { x86regs_t regs; uint32_t offs; void *buf; - buf = x86bios_alloc(&offs, sizeof(*vmode), M_NOWAIT); + buf = x86bios_alloc(&offs, sizeof(*vmode), flags); if (buf == NULL) return (1); @@ -856,7 +856,7 @@ vesa_bios_init(void) for (i = 0, modes = 0; (i < (M_VESA_MODE_MAX - M_VESA_BASE + 1)) && (vesa_vmodetab[i] != 0xffff); ++i) { vesa_vmodetab[i] = le16toh(vesa_vmodetab[i]); - if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode)) + if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode, M_WAITOK)) continue; vmode.v_modeattr = le16toh(vmode.v_modeattr); @@ -1788,7 +1788,7 @@ vesa_bios_info(int level) for (i = 0; (i < (M_VESA_MODE_MAX - M_VESA_BASE + 1)) && (vesa_vmodetab[i] != 0xffff); ++i) { - if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode)) + if (vesa_bios_get_mode(vesa_vmodetab[i], &vmode, M_NOWAIT)) continue; /* print something for diagnostic purpose */ From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 00:27:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59CF9106566C; Thu, 24 Jun 2010 00:27:20 +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 493D18FC08; Thu, 24 Jun 2010 00:27:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O0RK23025286; Thu, 24 Jun 2010 00:27:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O0RKUV025284; Thu, 24 Jun 2010 00:27:20 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006240027.o5O0RKUV025284@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 24 Jun 2010 00:27: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: r209492 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 00:27:20 -0000 Author: nwhitehorn Date: Thu Jun 24 00:27:20 2010 New Revision: 209492 URL: http://svn.freebsd.org/changeset/base/209492 Log: Reverse the logic of the if statement that sets the default value of HZ; the list of 1000 Hz platforms was getting unwieldy. Suggested by: marcel Modified: head/sys/kern/subr_param.c Modified: head/sys/kern/subr_param.c ============================================================================== --- head/sys/kern/subr_param.c Wed Jun 23 23:34:56 2010 (r209491) +++ head/sys/kern/subr_param.c Thu Jun 24 00:27:20 2010 (r209492) @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); */ #ifndef HZ -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) -# define HZ 1000 -# else +# if defined(__mips__) || defined(__arm__) # define HZ 100 +# else +# define HZ 1000 # endif # ifndef HZ_VM # define HZ_VM 100 From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 00:36:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCEC1065670; Thu, 24 Jun 2010 00:36:41 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB8F8FC18; Thu, 24 Jun 2010 00:36:41 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from [10.121.220.84] (166-205-136-165.mobile.mymmode.com [166.205.136.165]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L4H00IM7TOVC170@asmtp028.mac.com>; Wed, 23 Jun 2010 17:36:41 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1006230163 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.12.8161:2.4.5,1.2.40,4.0.166 definitions=2010-06-23_03:2010-02-06, 2010-06-23, 2010-06-23 signatures=0 References: <201006240027.o5O0RKUV025284@svn.freebsd.org> In-reply-to: <201006240027.o5O0RKUV025284@svn.freebsd.org> Message-id: <64872A96-3C99-4060-AE99-A5E775AFA2D7@mac.com> X-Mailer: iPhone Mail (8A293) From: Marcel Moolenaar Date: Wed, 23 Jun 2010 17:36:24 -0700 To: Nathan Whitehorn Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r209492 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 00:36:41 -0000 Thanks! It's appreciated. -- Marcel (Mobile) On Jun 23, 2010, at 5:27 PM, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Thu Jun 24 00:27:20 2010 > New Revision: 209492 > URL: http://svn.freebsd.org/changeset/base/209492 > > Log: > Reverse the logic of the if statement that sets the default value of > HZ; the list of 1000 Hz platforms was getting unwieldy. > > Suggested by: marcel > > Modified: > head/sys/kern/subr_param.c > > Modified: head/sys/kern/subr_param.c > ============================================================================== > --- head/sys/kern/subr_param.c Wed Jun 23 23:34:56 2010 (r209491) > +++ head/sys/kern/subr_param.c Thu Jun 24 00:27:20 2010 (r209492) > @@ -53,10 +53,10 @@ __FBSDID("$FreeBSD$"); > */ > > #ifndef HZ > -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) > -# define HZ 1000 > -# else > +# if defined(__mips__) || defined(__arm__) > # define HZ 100 > +# else > +# define HZ 1000 > # endif > # ifndef HZ_VM > # define HZ_VM 100 From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 02:31:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58DD5106564A; Thu, 24 Jun 2010 02:31:23 +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 B984D8FC13; Thu, 24 Jun 2010 02:31:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5O2Qbv6001822; Wed, 23 Jun 2010 20:26:37 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 23 Jun 2010 20:26:47 -0600 (MDT) Message-Id: <20100623.202647.867924114552092597.imp@bsdimp.com> To: xcllnt@mac.com From: "M. Warner Losh" In-Reply-To: <3659E546-80A0-4E82-8112-40B093728D81@mac.com> References: <201006232326.o5NNQEtK011793@svn.freebsd.org> <3659E546-80A0-4E82-8112-40B093728D81@mac.com> X-Mailer: Mew version 6.3 on Emacs 22.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, nwhitehorn@freebsd.org Subject: Re: svn commit: r209490 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 02:31:23 -0000 In message: <3659E546-80A0-4E82-8112-40B093728D81@mac.com> Marcel Moolenaar writes: : : On Jun 23, 2010, at 4:26 PM, Nathan Whitehorn wrote: : : > @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); : > */ : > : > #ifndef HZ : > -# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) : > +# if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) : > # define HZ 1000 : > # else : > # define HZ 100 : : Would you mind inverting the #if statement? The common case is : obviously 1KHz, so listing the exceptions (I belief that's only : arm and mips) is more effective... Shouldn't this be defined in some file in ARCH/include instead? Warner From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 02:57:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6730106566B; Thu, 24 Jun 2010 02:57:07 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 178BE8FC13; Thu, 24 Jun 2010 02:57:06 +0000 (UTC) Received: by vws13 with SMTP id 13so1642542vws.13 for ; Wed, 23 Jun 2010 19:57:06 -0700 (PDT) Received: by 10.220.127.3 with SMTP id e3mr4604732vcs.126.1277348226199; Wed, 23 Jun 2010 19:57:06 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.220.191.67 with HTTP; Wed, 23 Jun 2010 19:56:46 -0700 (PDT) In-Reply-To: <20100623.202647.867924114552092597.imp@bsdimp.com> References: <201006232326.o5NNQEtK011793@svn.freebsd.org> <3659E546-80A0-4E82-8112-40B093728D81@mac.com> <20100623.202647.867924114552092597.imp@bsdimp.com> From: Juli Mallett Date: Wed, 23 Jun 2010 19:56:46 -0700 X-Google-Sender-Auth: wHfKWWNsCce2Z7VrO5rNrAfoM4E Message-ID: To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, src-committers@freebsd.org, nwhitehorn@freebsd.org Subject: Re: svn commit: r209490 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 02:57:07 -0000 On Wed, Jun 23, 2010 at 19:26, M. Warner Losh wrote: > : > # =A0 =A0define HZ 1000 > : > # =A0else > : > # =A0 =A0define HZ 100 > > Shouldn't this be defined in some file in ARCH/include instead? Didn't it used to be? I think the problem with doing that is that then someone inevitably writes code that uses HZ instead of the (tunable) hz. Of course, you can hide it behind an obscure #ifdef and even give it an intimidating name. From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 05:05:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07F9E106566B; Thu, 24 Jun 2010 05:05:19 +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 EAD9B8FC14; Thu, 24 Jun 2010 05:05:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O55Ir0086428; Thu, 24 Jun 2010 05:05:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O55I9M086427; Thu, 24 Jun 2010 05:05:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006240505.o5O55I9M086427@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 Jun 2010 05:05: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: r209493 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 05:05:19 -0000 Author: marcel Date: Thu Jun 24 05:05:18 2010 New Revision: 209493 URL: http://svn.freebsd.org/changeset/base/209493 Log: Pass the device_t of the AT PIC driver to atpic_intr() so that we don't have to use a global variable. Pass a NULL frame pointer to the dispatch function just like openpic(4). Modified: head/sys/powerpc/mpc85xx/atpic.c Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Thu Jun 24 00:27:20 2010 (r209492) +++ head/sys/powerpc/mpc85xx/atpic.c Thu Jun 24 05:05:18 2010 (r209493) @@ -82,8 +82,6 @@ static void atpic_mask(device_t, u_int); static void atpic_unmask(device_t, u_int); static uint32_t atpic_id (device_t dev); -static device_t pic8259; - static device_method_t atpic_isa_methods[] = { /* Device interface */ DEVMETHOD(device_identify, atpic_isa_identify), @@ -140,7 +138,7 @@ static void atpic_intr(void *arg) { - atpic_dispatch(pic8259, arg); + atpic_dispatch(arg, NULL); } static void @@ -217,7 +215,7 @@ atpic_isa_attach(device_t dev) goto fail; error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_MISC | INTR_MPSAFE, - NULL, atpic_intr, NULL, &sc->sc_icookie); + NULL, atpic_intr, dev, &sc->sc_icookie); if (error) goto fail; @@ -225,7 +223,6 @@ atpic_isa_attach(device_t dev) atpic_init(sc, ATPIC_MASTER); powerpc_register_pic(dev, 0x10); - pic8259 = dev; return (0); fail: From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 05:17:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8EAE106564A; Thu, 24 Jun 2010 05:17:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C81FF8FC19; Thu, 24 Jun 2010 05:17:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O5HLYA089135; Thu, 24 Jun 2010 05:17:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O5HLEc089133; Thu, 24 Jun 2010 05:17:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201006240517.o5O5HLEc089133@svn.freebsd.org> From: Adrian Chadd Date: Thu, 24 Jun 2010 05:17: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: r209494 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 05:17:21 -0000 Author: adrian Date: Thu Jun 24 05:17:21 2010 New Revision: 209494 URL: http://svn.freebsd.org/changeset/base/209494 Log: Comment about the shared pins I know about. Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Thu Jun 24 05:05:18 2010 (r209493) +++ head/sys/mips/atheros/ar71xxreg.h Thu Jun 24 05:17:21 2010 (r209494) @@ -152,7 +152,9 @@ #define GPIO_FUNC_STEREO_EN (1 << 17) #define GPIO_FUNC_SLIC_EN (1 << 16) #define GPIO_FUNC_SPI_CS1_EN (1 << 15) + /* CS1 is shared with GPIO_1 */ #define GPIO_FUNC_SPI_CS0_EN (1 << 14) + /* CS0 is shared with GPIO_0 */ #define GPIO_FUNC_SPI_EN (1 << 13) #define GPIO_FUNC_UART_EN (1 << 8) #define GPIO_FUNC_USB_OC_EN (1 << 4) From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 05:47:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56913106564A; Thu, 24 Jun 2010 05:47:01 +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 455FF8FC18; Thu, 24 Jun 2010 05:47:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O5l0Kl095683; Thu, 24 Jun 2010 05:47:00 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O5l0oL095681; Thu, 24 Jun 2010 05:47:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006240547.o5O5l0oL095681@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 Jun 2010 05:47: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: r209495 - head/sys/powerpc/booke X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 05:47:01 -0000 Author: marcel Date: Thu Jun 24 05:47:00 2010 New Revision: 209495 URL: http://svn.freebsd.org/changeset/base/209495 Log: Remove debugging printf() -- that is, I assume it was for debugging :-) Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Jun 24 05:17:21 2010 (r209494) +++ head/sys/powerpc/booke/pmap.c Thu Jun 24 05:47:00 2010 (r209495) @@ -1506,8 +1506,6 @@ static void mmu_booke_release(mmu_t mmu, pmap_t pmap) { - printf("mmu_booke_release: s\n"); - KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 05:49:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D9D1065670; Thu, 24 Jun 2010 05:49: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 371B98FC1E; Thu, 24 Jun 2010 05:49:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O5nxx2096349; Thu, 24 Jun 2010 05:49:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O5nxI5096348; Thu, 24 Jun 2010 05:49:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201006240549.o5O5nxI5096348@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 24 Jun 2010 05:49: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: r209496 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 05:49:59 -0000 Author: marcel Date: Thu Jun 24 05:49:58 2010 New Revision: 209496 URL: http://svn.freebsd.org/changeset/base/209496 Log: Assign PCI intline values for ISA interrupts using the new INTR_VEC() macro. Modified: head/sys/powerpc/mpc85xx/pci_ocp.c Modified: head/sys/powerpc/mpc85xx/pci_ocp.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_ocp.c Thu Jun 24 05:47:00 2010 (r209495) +++ head/sys/powerpc/mpc85xx/pci_ocp.c Thu Jun 24 05:49:58 2010 (r209496) @@ -470,11 +470,11 @@ pci_ocp_route_int(struct pci_ocp_softc * devfn = DEVFN(bus, slot, func); if (devfn == sc->sc_devfn_via_ide) - intline = 14; + intline = INTR_VEC(ATPIC_ID, 14); else if (devfn == sc->sc_devfn_via_ide + 1) - intline = 10; + intline = INTR_VEC(ATPIC_ID, 10); else if (devfn == sc->sc_devfn_via_ide + 2) - intline = 10; + intline = INTR_VEC(ATPIC_ID, 10); else { if (intpin != 0) { intline = intpin - 1; From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 05:52:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D158106564A; Thu, 24 Jun 2010 05:52:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3967C8FC1E; Thu, 24 Jun 2010 05:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O5qjKH097020; Thu, 24 Jun 2010 05:52:45 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O5qiia097011; Thu, 24 Jun 2010 05:52:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006240552.o5O5qiia097011@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 24 Jun 2010 05:52:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209497 - in stable/8: sbin/geom/class/part sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 05:52:45 -0000 Author: ae Date: Thu Jun 24 05:52:44 2010 New Revision: 209497 URL: http://svn.freebsd.org/changeset/base/209497 Log: MFC r207094 (by marcel): Implement the resize verb and add support for resizing partitions for all schemes but EBR. MFC r207095 (by marcel): Implement the resize command for resizing partitions. Without new size, the partition in question is resized to fill all available space. Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/geom_part.c stable/8/sbin/geom/class/part/gpart.8 stable/8/sys/geom/part/g_part.c stable/8/sys/geom/part/g_part_apm.c stable/8/sys/geom/part/g_part_bsd.c stable/8/sys/geom/part/g_part_gpt.c stable/8/sys/geom/part/g_part_if.m stable/8/sys/geom/part/g_part_mbr.c stable/8/sys/geom/part/g_part_pc98.c stable/8/sys/geom/part/g_part_vtoc8.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sbin/geom/class/part/geom_part.c Thu Jun 24 05:52:44 2010 (r209497) @@ -147,6 +147,13 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, + { "resize", 0, gpart_issue, { + { 's', "size", autofill, G_TYPE_ASCLBA }, + { 'i', index_param, NULL, G_TYPE_ASCNUM }, + { 'f', "flags", flags, G_TYPE_STRING }, + G_OPT_SENTINEL }, + "geom", NULL + }, G_CMD_SENTINEL }; @@ -257,6 +264,99 @@ fmtattrib(struct gprovider *pp) } static int +gpart_autofill_resize(struct gctl_req *req) +{ + struct gmesh mesh; + struct gclass *cp; + struct ggeom *gp; + struct gprovider *pp; + unsigned long long last, size, start, new_size; + unsigned long long lba, new_lba; + const char *s; + char *val; + int error, idx; + + s = gctl_get_ascii(req, "size"); + if (*s == '*') + new_size = (unsigned long long)atoll(s); + else + return (0); + + s = gctl_get_ascii(req, index_param); + idx = strtol(s, &val, 10); + if (idx < 1 || *s == '\0' || *val != '\0') + errx(EXIT_FAILURE, "invalid partition index"); + + error = geom_gettree(&mesh); + if (error) + return (error); + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + cp = find_class(&mesh, s); + if (cp == NULL) + errx(EXIT_FAILURE, "Class %s not found.", s); + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(cp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + last = atoll(find_geomcfg(gp, "last")); + + LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { + s = find_provcfg(pp, "index"); + if (s == NULL) + continue; + if (atoi(s) == idx) + break; + } + if (pp == NULL) + errx(EXIT_FAILURE, "invalid partition index"); + + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + start = atoll(s) / pp->lg_sectorsize; + } else + start = atoll(s); + s = find_provcfg(pp, "end"); + if (s == NULL) { + s = find_provcfg(pp, "length"); + lba = start + atoll(s) / pp->lg_sectorsize; + } else + lba = atoll(s) + 1; + + if (lba > last) + return (ENOSPC); + size = lba - start; + pp = find_provider(gp, lba); + if (pp == NULL) + new_size = last - start + 1; + else { + s = find_provcfg(pp, "start"); + if (s == NULL) { + s = find_provcfg(pp, "offset"); + new_lba = atoll(s) / pp->lg_sectorsize; + } else + new_lba = atoll(s); + /* Is there any free space between current and + * next providers? + */ + if (new_lba > lba) + new_size = new_lba - start; + else + return (ENOSPC); + } + asprintf(&val, "%llu", new_size); + if (val == NULL) + return (ENOMEM); + gctl_change_param(req, "size", -1, val); + + return (0); +} + +static int gpart_autofill(struct gctl_req *req) { struct gmesh mesh; @@ -271,6 +371,8 @@ gpart_autofill(struct gctl_req *req) int error, has_size, has_start; s = gctl_get_ascii(req, "verb"); + if (strcmp(s, "resize") == 0) + return gpart_autofill_resize(req); if (strcmp(s, "add") != 0) return (0); Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 05:52:44 2010 (r209497) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2010 +.Dd June 24, 2010 .Dt GPART 8 .Os .Sh NAME @@ -123,6 +123,13 @@ utility: .Op Fl t Ar type .Op Fl f Ar flags .Ar geom +.\" ==== RESIZE ==== +.Nm +.Cm resize +.Fl i Ar index +.Op Fl s Ar size +.Op Fl f Ar flags +.Ar geom .\" ==== SET ==== .Nm .Cm set @@ -334,6 +341,32 @@ See the section entitled below for a discussion about its use. .El +.\" ==== RESIZE ==== +.It Cm resize +Resize a partition from geom +.Ar geom +and further identified by the +.Fl i Ar index +option. +New partition size is expressed in logical block +numbers and can be given by the +.Fl s Ar size +option. +If +.Fl s +option is ommited then new size is automatically calculated +to maximum available from given geom +.Ar geom . +.Pp +Additional options include: +.Bl -tag -width 10n +.It Fl f Ar flags +Additional operational flags. +See the section entitled +.Sx "OPERATIONAL FLAGS" +below for a discussion +about its use. +.El .\" ==== SET ==== .It Cm set Set the named attribute on the partition entry. @@ -450,7 +483,7 @@ The scheme-specific types are .Qq Li "!FreeBSD-ZFS" for APM, .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" - for GPT, and 0x0904 for VTOC8. +for GPT, and 0x0904 for VTOC8. .It Cm mbr A partition that is sub-partitioned by a master boot record (MBR). This type is known as Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part.c Thu Jun 24 05:52:44 2010 (r209497) @@ -968,9 +968,85 @@ g_part_ctl_recover(struct gctl_req *req, static int g_part_ctl_resize(struct gctl_req *req, struct g_part_parms *gpp) { - gctl_error(req, "%d verb 'resize'", ENOSYS); - return (ENOSYS); -} + struct g_geom *gp; + struct g_provider *pp; + struct g_part_entry *pe, *entry; + struct g_part_table *table; + struct sbuf *sb; + quad_t end; + int error; + + gp = gpp->gpp_geom; + G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, gp->name)); + g_topology_assert(); + table = gp->softc; + + /* check gpp_index */ + LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { + if (entry->gpe_deleted || entry->gpe_internal) + continue; + if (entry->gpe_index == gpp->gpp_index) + break; + } + if (entry == NULL) { + gctl_error(req, "%d index '%d'", ENOENT, gpp->gpp_index); + return (ENOENT); + } + + /* check gpp_size */ + end = entry->gpe_start + gpp->gpp_size - 1; + if (gpp->gpp_size < 1 || end > table->gpt_last) { + gctl_error(req, "%d size '%jd'", EINVAL, + (intmax_t)gpp->gpp_size); + return (EINVAL); + } + + LIST_FOREACH(pe, &table->gpt_entry, gpe_entry) { + if (pe->gpe_deleted || pe->gpe_internal || pe == entry) + continue; + if (end >= pe->gpe_start && end <= pe->gpe_end) { + gctl_error(req, "%d end '%jd'", ENOSPC, + (intmax_t)end); + return (ENOSPC); + } + if (entry->gpe_start < pe->gpe_start && end > pe->gpe_end) { + gctl_error(req, "%d size '%jd'", ENOSPC, + (intmax_t)gpp->gpp_size); + return (ENOSPC); + } + } + + pp = entry->gpe_pp; + if ((g_debugflags & 16) == 0 && + (pp->acr > 0 || pp->acw > 0 || pp->ace > 0)) { + gctl_error(req, "%d", EBUSY); + return (EBUSY); + } + + error = G_PART_RESIZE(table, entry, gpp); + if (error) { + gctl_error(req, "%d", error); + return (error); + } + + if (!entry->gpe_created) + entry->gpe_modified = 1; + + /* update mediasize of changed provider */ + pp->mediasize = (entry->gpe_end - entry->gpe_start + 1) * + pp->sectorsize; + + /* Provide feedback if so requested. */ + if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { + sb = sbuf_new_auto(); + G_PART_FULLNAME(table, entry, sb, gp->name); + sbuf_cat(sb, " resized\n"); + sbuf_finish(sb); + gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); + sbuf_delete(sb); + } + return (0); +} static int g_part_ctl_setunset(struct gctl_req *req, struct g_part_parms *gpp, @@ -1206,7 +1282,8 @@ g_part_ctlreq(struct gctl_req *req, stru mparms |= G_PART_PARM_GEOM; } else if (!strcmp(verb, "resize")) { ctlreq = G_PART_CTL_RESIZE; - mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX; + mparms |= G_PART_PARM_GEOM | G_PART_PARM_INDEX | + G_PART_PARM_SIZE; } break; case 's': Modified: stable/8/sys/geom/part/g_part_apm.c ============================================================================== --- stable/8/sys/geom/part/g_part_apm.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_apm.c Thu Jun 24 05:52:44 2010 (r209497) @@ -74,6 +74,8 @@ static int g_part_apm_read(struct g_part static const char *g_part_apm_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_apm_write(struct g_part_table *, struct g_consumer *); +static int g_part_apm_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_apm_methods[] = { KOBJMETHOD(g_part_add, g_part_apm_add), @@ -82,6 +84,7 @@ static kobj_method_t g_part_apm_methods[ KOBJMETHOD(g_part_dumpconf, g_part_apm_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_apm_dumpto), KOBJMETHOD(g_part_modify, g_part_apm_modify), + KOBJMETHOD(g_part_resize, g_part_apm_resize), KOBJMETHOD(g_part_name, g_part_apm_name), KOBJMETHOD(g_part_probe, g_part_apm_probe), KOBJMETHOD(g_part_read, g_part_apm_read), @@ -338,6 +341,19 @@ g_part_apm_modify(struct g_part_table *b return (0); } +static int +g_part_apm_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_apm_entry *entry; + + entry = (struct g_part_apm_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + entry->ent.ent_size = gpp->gpp_size; + + return (0); +} + static const char * g_part_apm_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_bsd.c Thu Jun 24 05:52:44 2010 (r209497) @@ -73,6 +73,8 @@ static int g_part_bsd_read(struct g_part static const char *g_part_bsd_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_bsd_write(struct g_part_table *, struct g_consumer *); +static int g_part_bsd_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_bsd_methods[] = { KOBJMETHOD(g_part_add, g_part_bsd_add), @@ -82,6 +84,7 @@ static kobj_method_t g_part_bsd_methods[ KOBJMETHOD(g_part_dumpconf, g_part_bsd_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_bsd_dumpto), KOBJMETHOD(g_part_modify, g_part_bsd_modify), + KOBJMETHOD(g_part_resize, g_part_bsd_resize), KOBJMETHOD(g_part_name, g_part_bsd_name), KOBJMETHOD(g_part_probe, g_part_bsd_probe), KOBJMETHOD(g_part_read, g_part_bsd_read), @@ -296,6 +299,19 @@ g_part_bsd_modify(struct g_part_table *b return (0); } +static int +g_part_bsd_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_bsd_entry *entry; + + entry = (struct g_part_bsd_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + entry->part.p_size = gpp->gpp_size; + + return (0); +} + static const char * g_part_bsd_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_gpt.c Thu Jun 24 05:52:44 2010 (r209497) @@ -103,6 +103,8 @@ static int g_part_gpt_read(struct g_part static const char *g_part_gpt_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_gpt_write(struct g_part_table *, struct g_consumer *); +static int g_part_gpt_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_gpt_methods[] = { KOBJMETHOD(g_part_add, g_part_gpt_add), @@ -112,6 +114,7 @@ static kobj_method_t g_part_gpt_methods[ KOBJMETHOD(g_part_dumpconf, g_part_gpt_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_gpt_dumpto), KOBJMETHOD(g_part_modify, g_part_gpt_modify), + KOBJMETHOD(g_part_resize, g_part_gpt_resize), KOBJMETHOD(g_part_name, g_part_gpt_name), KOBJMETHOD(g_part_probe, g_part_gpt_probe), KOBJMETHOD(g_part_read, g_part_gpt_read), @@ -532,6 +535,19 @@ g_part_gpt_modify(struct g_part_table *b return (0); } +static int +g_part_gpt_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_gpt_entry *entry; + entry = (struct g_part_gpt_entry *)baseentry; + + baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; + entry->ent.ent_lba_end = baseentry->gpe_end; + + return (0); +} + static const char * g_part_gpt_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_if.m ============================================================================== --- stable/8/sys/geom/part/g_part_if.m Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_if.m Thu Jun 24 05:52:44 2010 (r209497) @@ -58,6 +58,13 @@ CODE { { return (0); } + + static int + default_resize(struct g_part_table *t __unused, + struct g_part_entry *e __unused, struct g_part_parms *p __unused) + { + return (ENOSYS); + } }; # add() - scheme specific processing for the add verb. @@ -114,6 +121,13 @@ METHOD int modify { struct g_part_parms *gpp; }; +# resize() - scheme specific processing for the resize verb. +METHOD int resize { + struct g_part_table *table; + struct g_part_entry *entry; + struct g_part_parms *gpp; +} DEFAULT default_resize; + # name() - return the name of the given partition entry. # Typical names are "p1", "s0" or "c". METHOD const char * name { Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_mbr.c Thu Jun 24 05:52:44 2010 (r209497) @@ -76,6 +76,8 @@ static int g_part_mbr_setunset(struct g_ static const char *g_part_mbr_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_mbr_write(struct g_part_table *, struct g_consumer *); +static int g_part_mbr_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_mbr_methods[] = { KOBJMETHOD(g_part_add, g_part_mbr_add), @@ -85,6 +87,7 @@ static kobj_method_t g_part_mbr_methods[ KOBJMETHOD(g_part_dumpconf, g_part_mbr_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_mbr_dumpto), KOBJMETHOD(g_part_modify, g_part_mbr_modify), + KOBJMETHOD(g_part_resize, g_part_mbr_resize), KOBJMETHOD(g_part_name, g_part_mbr_name), KOBJMETHOD(g_part_probe, g_part_mbr_probe), KOBJMETHOD(g_part_read, g_part_mbr_read), @@ -302,6 +305,31 @@ g_part_mbr_modify(struct g_part_table *b return (0); } +static int +g_part_mbr_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_mbr_entry *entry; + uint32_t size, sectors; + + sectors = basetable->gpt_sectors; + size = gpp->gpp_size; + + if (size < sectors) + return (EINVAL); + if (size % sectors) + size = size - (size % sectors); + if (size < sectors) + return (EINVAL); + + entry = (struct g_part_mbr_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + size - 1; + entry->ent.dp_size = size; + mbr_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, + &entry->ent.dp_ehd, &entry->ent.dp_esect); + return (0); +} + static const char * g_part_mbr_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/8/sys/geom/part/g_part_pc98.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_pc98.c Thu Jun 24 05:52:44 2010 (r209497) @@ -77,6 +77,8 @@ static int g_part_pc98_setunset(struct g static const char *g_part_pc98_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_pc98_write(struct g_part_table *, struct g_consumer *); +static int g_part_pc98_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_pc98_methods[] = { KOBJMETHOD(g_part_add, g_part_pc98_add), @@ -86,6 +88,7 @@ static kobj_method_t g_part_pc98_methods KOBJMETHOD(g_part_dumpconf, g_part_pc98_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_pc98_dumpto), KOBJMETHOD(g_part_modify, g_part_pc98_modify), + KOBJMETHOD(g_part_resize, g_part_pc98_resize), KOBJMETHOD(g_part_name, g_part_pc98_name), KOBJMETHOD(g_part_probe, g_part_pc98_probe), KOBJMETHOD(g_part_read, g_part_pc98_read), @@ -308,6 +311,31 @@ g_part_pc98_modify(struct g_part_table * return (0); } +static int +g_part_pc98_resize(struct g_part_table *basetable, + struct g_part_entry *baseentry, struct g_part_parms *gpp) +{ + struct g_part_pc98_entry *entry; + uint32_t size, cyl; + + cyl = basetable->gpt_heads * basetable->gpt_sectors; + size = gpp->gpp_size; + + if (size < cyl) + return (EINVAL); + if (size % cyl) + size = size - (size % cyl); + if (size < cyl) + return (EINVAL); + + entry = (struct g_part_pc98_entry *)baseentry; + baseentry->gpe_end = baseentry->gpe_start + size - 1; + pc98_set_chs(basetable, baseentry->gpe_end, &entry->ent.dp_ecyl, + &entry->ent.dp_ehd, &entry->ent.dp_esect); + + return (0); +} + static const char * g_part_pc98_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) Modified: stable/8/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/8/sys/geom/part/g_part_vtoc8.c Thu Jun 24 05:49:58 2010 (r209496) +++ stable/8/sys/geom/part/g_part_vtoc8.c Thu Jun 24 05:52:44 2010 (r209497) @@ -67,6 +67,8 @@ static int g_part_vtoc8_read(struct g_pa static const char *g_part_vtoc8_type(struct g_part_table *, struct g_part_entry *, char *, size_t); static int g_part_vtoc8_write(struct g_part_table *, struct g_consumer *); +static int g_part_vtoc8_resize(struct g_part_table *, struct g_part_entry *, + struct g_part_parms *); static kobj_method_t g_part_vtoc8_methods[] = { KOBJMETHOD(g_part_add, g_part_vtoc8_add), @@ -75,6 +77,7 @@ static kobj_method_t g_part_vtoc8_method KOBJMETHOD(g_part_dumpconf, g_part_vtoc8_dumpconf), KOBJMETHOD(g_part_dumpto, g_part_vtoc8_dumpto), KOBJMETHOD(g_part_modify, g_part_vtoc8_modify), + KOBJMETHOD(g_part_resize, g_part_vtoc8_resize), KOBJMETHOD(g_part_name, g_part_vtoc8_name), KOBJMETHOD(g_part_probe, g_part_vtoc8_probe), KOBJMETHOD(g_part_read, g_part_vtoc8_read), @@ -296,6 +299,26 @@ g_part_vtoc8_modify(struct g_part_table return (0); } +static int +g_part_vtoc8_resize(struct g_part_table *basetable, + struct g_part_entry *entry, struct g_part_parms *gpp) +{ + struct g_part_vtoc8_table *table; + uint64_t size; + + table = (struct g_part_vtoc8_table *)basetable; + size = gpp->gpp_size; + if (size % table->secpercyl) + size = size - (size % table->secpercyl); + if (size < table->secpercyl) + return (EINVAL); + + entry->gpe_end = entry->gpe_start + size - 1; + be32enc(&table->vtoc.map[entry->gpe_index - 1].nblks, size); + + return (0); +} + static const char * g_part_vtoc8_name(struct g_part_table *table, struct g_part_entry *baseentry, char *buf, size_t bufsz) From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 06:31:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D5C8106566B; Thu, 24 Jun 2010 06:31:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B46E8FC25; Thu, 24 Jun 2010 06:31:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O6VNuI005599; Thu, 24 Jun 2010 06:31:23 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O6VNBr005597; Thu, 24 Jun 2010 06:31:23 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006240631.o5O6VNBr005597@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 24 Jun 2010 06:31:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209498 - stable/8/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 06:31:23 -0000 Author: ae Date: Thu Jun 24 06:31:23 2010 New Revision: 209498 URL: http://svn.freebsd.org/changeset/base/209498 Log: MFC r207096 (by marcel): Add and describe GEOM_PART_EBR. Approved by: mav (mentor) Modified: stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 05:52:44 2010 (r209497) +++ stable/8/sbin/geom/class/part/gpart.8 Thu Jun 24 06:31:23 2010 (r209498) @@ -37,6 +37,7 @@ lines in your kernel configuration file: .Bd -ragged -offset indent .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" +.Cd "options GEOM_PART_EBR" .Cd "options GEOM_PART_GPT" .Cd "options GEOM_PART_MBR" .Cd "options GEOM_PART_PC98" @@ -53,6 +54,10 @@ option adds support for the traditional .Bx disklabel. The +.Dv GEOM_PART_EBR +option adds support for the Extended Boot Record (EBR), +which is used to define a logical partition. +The .Dv GEOM_PART_GPT option adds support for the GUID Partition Table (GPT) found on Intel Itanium computers and Intel-based Macintosh computers. From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 07:43:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D19D1065670; Thu, 24 Jun 2010 07:43:25 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C22D8FC12; Thu, 24 Jun 2010 07:43:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O7hPJu021587; Thu, 24 Jun 2010 07:43:25 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O7hP1H021585; Thu, 24 Jun 2010 07:43:25 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006240743.o5O7hP1H021585@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Jun 2010 07:43: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: r209499 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 07:43:25 -0000 Author: tuexen Date: Thu Jun 24 07:43:25 2010 New Revision: 209499 URL: http://svn.freebsd.org/changeset/base/209499 Log: Fix a bug I introduced in r209470. MFC after: 3 days Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Jun 24 06:31:23 2010 (r209498) +++ head/sys/netinet/sctp_pcb.c Thu Jun 24 07:43:25 2010 (r209499) @@ -1233,7 +1233,7 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(stcb); goto null_return; } - if (!(local && sctp_does_stcb_own_this_addr(stcb, local))) { + if (local && !sctp_does_stcb_own_this_addr(stcb, local)) { SCTP_TCB_UNLOCK(stcb); goto null_return; } @@ -1334,7 +1334,7 @@ sctp_findassociation_ep_addr(struct sctp SCTP_TCB_UNLOCK(stcb); continue; } - if (!(local && sctp_does_stcb_own_this_addr(stcb, local))) { + if (local && !sctp_does_stcb_own_this_addr(stcb, local)) { SCTP_TCB_UNLOCK(stcb); continue; } From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 08:08:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8300C106566B; Thu, 24 Jun 2010 08:08:44 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 703548FC1C; Thu, 24 Jun 2010 08:08:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5O88iOo027197; Thu, 24 Jun 2010 08:08:44 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5O88iMM027187; Thu, 24 Jun 2010 08:08:44 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006240808.o5O88iMM027187@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 24 Jun 2010 08:08: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: r209500 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 08:08:44 -0000 Author: jchandra Date: Thu Jun 24 08:08:43 2010 New Revision: 209500 URL: http://svn.freebsd.org/changeset/base/209500 Log: Merge jmallett@'s n64 work into HEAD - changeset 7 Initial support for n32 and n64 ABIs from http://svn.freebsd.org/base/user/jmallett/octeon Changes are: - syscall, exception and trap support for n32/n64 ABIs - 64-bit address space defines - _jmp_buf for n32/n64 - casts between registers and ptr/int updated to work on n32/n64 Approved by: rrs(mentor), jmallett Modified: head/sys/mips/include/asm.h head/sys/mips/include/cpu.h head/sys/mips/include/setjmp.h head/sys/mips/include/vmparam.h head/sys/mips/mips/exception.S head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/stack_machdep.c head/sys/mips/mips/trap.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/asm.h ============================================================================== --- head/sys/mips/include/asm.h Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/include/asm.h Thu Jun 24 08:08:43 2010 (r209500) @@ -806,10 +806,11 @@ _C_LABEL(x): * 9 S7 * 10 SP * 11 S8 - * 12 signal mask (dependant on magic) - * 13 (con't) + * 12 GP (dependent on ABI) + * 13 signal mask (dependant on magic) * 14 (con't) * 15 (con't) + * 16 (con't) * * The magic number number identifies the jmp_buf and * how the buffer was created as well as providing @@ -834,9 +835,12 @@ _C_LABEL(x): #define _JB_REG_S7 9 #define _JB_REG_SP 10 #define _JB_REG_S8 11 +#if defined(__mips_n32) || defined(__mips_n64) +#define _JB_REG_GP 12 +#endif /* Only valid with the _JB_MAGIC_SETJMP magic */ -#define _JB_SIGMASK 12 +#define _JB_SIGMASK 13 #endif /* !_MACHINE_ASM_H_ */ Modified: head/sys/mips/include/cpu.h ============================================================================== --- head/sys/mips/include/cpu.h Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/include/cpu.h Thu Jun 24 08:08:43 2010 (r209500) @@ -49,7 +49,7 @@ #include -#define MIPS_KSEG0_LARGEST_PHYS 0x20000000 +#define MIPS_KSEG0_LARGEST_PHYS (0x20000000) #define MIPS_PHYS_MASK (0x1fffffff) #define MIPS_PHYS_TO_KSEG0(x) ((uintptr_t)(x) | MIPS_KSEG0_START) @@ -162,11 +162,11 @@ /* * Location of exception vectors. */ -#define RESET_EXC_VEC 0xbfc00000 -#define TLB_MISS_EXC_VEC 0x80000000 -#define XTLB_MISS_EXC_VEC 0x80000080 -#define CACHE_ERR_EXC_VEC 0x80000100 -#define GEN_EXC_VEC 0x80000180 +#define RESET_EXC_VEC ((intptr_t)(int32_t)0xbfc00000) +#define TLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000000) +#define XTLB_MISS_EXC_VEC ((intptr_t)(int32_t)0x80000080) +#define CACHE_ERR_EXC_VEC ((intptr_t)(int32_t)0x80000100) +#define GEN_EXC_VEC ((intptr_t)(int32_t)0x80000180) /* * Coprocessor 0 registers: Modified: head/sys/mips/include/setjmp.h ============================================================================== --- head/sys/mips/include/setjmp.h Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/include/setjmp.h Thu Jun 24 08:08:43 2010 (r209500) @@ -39,7 +39,7 @@ #include -#define _JBLEN 95 /* size, in longs, of a jmp_buf */ +#define _JBLEN 95 /* size, in longs (or long longs), of a jmp_buf */ /* * jmp_buf and sigjmp_buf are encapsulated in different structs to force @@ -49,10 +49,18 @@ #ifndef _LOCORE #ifndef __ASSEMBLER__ #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE +#ifdef __mips_n32 +typedef struct _sigjmp_buf { long long _sjb[_JBLEN + 1]; } sigjmp_buf[1]; +#else typedef struct _sigjmp_buf { long _sjb[_JBLEN + 1]; } sigjmp_buf[1]; #endif +#endif +#ifdef __mips_n32 +typedef struct _jmp_buf { long long _jb[_JBLEN + 1]; } jmp_buf[1]; +#else typedef struct _jmp_buf { long _jb[_JBLEN + 1]; } jmp_buf[1]; +#endif #endif /* __ASSEMBLER__ */ #endif /* _LOCORE */ Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/include/vmparam.h Thu Jun 24 08:08:43 2010 (r209500) @@ -100,11 +100,17 @@ #define VM_MAX_ADDRESS ((vm_offset_t)(intptr_t)(int32_t)0xffffffff) #define VM_MINUSER_ADDRESS ((vm_offset_t)0x00000000) -#define VM_MAXUSER_ADDRESS ((vm_offset_t)0x80000000) #define VM_MAX_MMAP_ADDR VM_MAXUSER_ADDRESS -#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xC0000000) -#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000) +#if defined(__mips_n64) +#define VM_MAXUSER_ADDRESS (VM_MINUSER_ADDRESS + (NPDEPG * NPTEPG * PAGE_SIZE)) +#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xc000000000000000) +#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + (NPDEPG * NPTEPG * PAGE_SIZE)) +#else +#define VM_MAXUSER_ADDRESS ((vm_offset_t)0x80000000) +#define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)0xC0000000) +#define VM_MAX_KERNEL_ADDRESS ((vm_offset_t)0xFFFFC000) +#endif #if 0 #define KERNBASE (VM_MIN_KERNEL_ADDRESS) #else Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/mips/exception.S Thu Jun 24 08:08:43 2010 (r209500) @@ -89,6 +89,15 @@ #define ITLBNOPFIX nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; #define HAZARD_DELAY nop;nop;nop;nop;nop; +/* Pointer size and mask for n64 */ +#if defined(__mips_n64) +#define PTRSHIFT 3 +#define PTRMASK 0xff8 +#else +#define PTRSHIFT 2 +#define PTRMASK 0xffc +#endif + /* *---------------------------------------------------------------------------- * @@ -126,12 +135,12 @@ VECTOR_END(MipsTLBMiss) .set noat MipsDoTLBMiss: bltz k0, 1f #02: k0<0 -> 1f (kernel fault) - PTR_SRL k0, k0, SEGSHIFT - 2 #03: k0=seg offset (almost) + PTR_SRL k0, k0, SEGSHIFT - PTRSHIFT #03: k0=seg offset (almost) GET_CPU_PCPU(k1) PTR_L k1, PC_SEGBASE(k1) beqz k1, 2f #05: make sure segbase is not null - andi k0, k0, 0xffc #06: k0=seg offset (mask 0x3) + andi k0, k0, PTRMASK #06: k0=seg offset PTR_ADDU k1, k0, k1 #07: k1=seg entry address PTR_L k1, 0(k1) #08: k1=seg entry @@ -175,6 +184,9 @@ VECTOR(MipsException, unknown) sll k0, k0, 3 # shift user bit for cause index and k1, k1, CR_EXC_CODE # Mask out the cause bits. or k1, k1, k0 # change index to user table +#if defined(__mips_n64) + PTR_SLL k1, k1, 1 # shift to get 8-byte offset +#endif 1: PTR_LA k0, _C_LABEL(machExceptionTable) # get base of the jump table PTR_ADDU k0, k0, k1 # Get the address of the @@ -798,9 +810,9 @@ NLEAF(MipsTLBInvalidException) beqz k1, 3f nop - PTR_SRL k0, SEGSHIFT - 2 # k0=seg offset (almost) + PTR_SRL k0, SEGSHIFT - PTRSHIFT # k0=seg offset (almost) beq k1, zero, MipsKernGenException # ==0 -- no seg tab - andi k0, k0, 0xffc # k0=seg offset (mask 0x3) + andi k0, k0, PTRMASK # k0=seg offset PTR_ADDU k1, k0, k1 # k1=seg entry address PTR_L k1, 0(k1) # k1=seg entry @@ -960,10 +972,10 @@ NLEAF(MipsTLBMissException) sltu k1, k1, k0 # upper bound of kernel_segmap bnez k1, MipsKernGenException # out of bound lui k1, %hi(kernel_segmap) # k1=hi of segbase - PTR_SRL k0, SEGSHIFT - 2 # k0=seg offset (almost) + PTR_SRL k0, SEGSHIFT - PTRSHIFT # k0=seg offset (almost) PTR_L k1, %lo(kernel_segmap)(k1) # k1=segment tab base beq k1, zero, MipsKernGenException # ==0 -- no seg tab - andi k0, k0, 0xffc # k0=seg offset (mask 0x3) + andi k0, k0, PTRMASK # k0=seg offset PTR_ADDU k1, k0, k1 # k1=seg entry address PTR_L k1, 0(k1) # k1=seg entry MFC0 k0, COP_0_BAD_VADDR # k0=bad address (again) Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/mips/pm_machdep.c Thu Jun 24 08:08:43 2010 (r209500) @@ -140,16 +140,16 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, /* Build the argument list for the signal handler. */ regs->a0 = sig; - regs->a2 = (register_t)&sfp->sf_uc; + regs->a2 = (register_t)(intptr_t)&sfp->sf_uc; if (SIGISMEMBER(psp->ps_siginfo, sig)) { /* Signal handler installed with SA_SIGINFO. */ - regs->a1 = (register_t)&sfp->sf_si; + regs->a1 = (register_t)(intptr_t)&sfp->sf_si; /* sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher; */ /* fill siginfo structure */ sf.sf_si.si_signo = sig; sf.sf_si.si_code = ksi->ksi_code; - sf.sf_si.si_addr = (void*)regs->badvaddr; + sf.sf_si.si_addr = (void*)(intptr_t)regs->badvaddr; } else { /* Old FreeBSD-style arguments. */ regs->a1 = ksi->ksi_code; @@ -172,13 +172,13 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigexit(td, SIGILL); } - regs->pc = (register_t) catcher; - regs->t9 = (register_t) catcher; - regs->sp = (register_t) sfp; + regs->pc = (register_t)(intptr_t)catcher; + regs->t9 = (register_t)(intptr_t)catcher; + regs->sp = (register_t)(intptr_t)sfp; /* * Signal trampoline code is at base of user stack. */ - regs->ra = (register_t) PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->ra = (register_t)(intptr_t)PS_STRINGS - *(p->p_sysent->sv_szsigcode); PROC_LOCK(p); mtx_lock(&psp->ps_mtx); } @@ -231,12 +231,12 @@ sigreturn(struct thread *td, struct sigr if (ucp->uc_mcontext.mc_regs[ZERO] != UCONTEXT_MAGIC) { printf("sigreturn: pid %d, ucp %p\n", td->td_proc->p_pid, ucp); printf(" old sp %p ra %p pc %p\n", - (void *)regs->sp, (void *)regs->ra, (void *)regs->pc); + (void *)(intptr_t)regs->sp, (void *)(intptr_t)regs->ra, (void *)(intptr_t)regs->pc); printf(" new sp %p ra %p pc %p z %p\n", - (void *)ucp->uc_mcontext.mc_regs[SP], - (void *)ucp->uc_mcontext.mc_regs[RA], - (void *)ucp->uc_mcontext.mc_regs[PC], - (void *)ucp->uc_mcontext.mc_regs[ZERO]); + (void *)(intptr_t)ucp->uc_mcontext.mc_regs[SP], + (void *)(intptr_t)ucp->uc_mcontext.mc_regs[RA], + (void *)(intptr_t)ucp->uc_mcontext.mc_regs[PC], + (void *)(intptr_t)ucp->uc_mcontext.mc_regs[ZERO]); return EINVAL; } /* #endif */ @@ -483,12 +483,10 @@ exec_setregs(struct thread *td, struct i td->td_frame->sp = ((register_t) stack) & ~(sizeof(__int64_t) - 1); td->td_frame->pc = imgp->entry_addr & ~3; td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */ -#if 0 -// td->td_frame->sr = SR_KSU_USER | SR_EXL | SR_INT_ENAB; -//? td->td_frame->sr |= idle_mask & ALL_INT_MASK; -#else td->td_frame->sr = SR_KSU_USER | SR_EXL | SR_INT_ENAB | (mips_rd_status() & ALL_INT_MASK); +#if defined(__mips_n32) || defined(__mips_n64) + td->td_frame->sr |= SR_PX; #endif #ifdef TARGET_OCTEON td->td_frame->sr |= MIPS_SR_COP_2_BIT | MIPS32_SR_PX | MIPS_SR_UX | Modified: head/sys/mips/mips/stack_machdep.c ============================================================================== --- head/sys/mips/mips/stack_machdep.c Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/mips/stack_machdep.c Thu Jun 24 08:08:43 2010 (r209500) @@ -43,7 +43,7 @@ static u_register_t stack_register_fetch(u_register_t sp, u_register_t stack_pos) { u_register_t * stack = - ((u_register_t *)sp + stack_pos/sizeof(u_register_t)); + ((u_register_t *)(intptr_t)sp + (size_t)stack_pos/sizeof(u_register_t)); return *stack; } @@ -59,19 +59,22 @@ stack_capture(struct stack *st, u_regist for (;;) { stacksize = 0; - if (pc <= (u_register_t)btext) + if (pc <= (u_register_t)(intptr_t)btext) break; - for (i = pc; i >= (u_register_t)btext; i -= sizeof (insn)) { - bcopy((void *)i, &insn, sizeof insn); + for (i = pc; i >= (u_register_t)(intptr_t)btext; i -= sizeof (insn)) { + bcopy((void *)(intptr_t)i, &insn, sizeof insn); switch (insn.IType.op) { case OP_ADDI: case OP_ADDIU: + case OP_DADDI: + case OP_DADDIU: if (insn.IType.rs != SP || insn.IType.rt != SP) break; stacksize = -(short)insn.IType.imm; break; case OP_SW: + case OP_SD: if (insn.IType.rs != SP || insn.IType.rt != RA) break; ra_stack_pos = (short)insn.IType.imm; @@ -88,13 +91,13 @@ stack_capture(struct stack *st, u_regist break; for (i = pc; !ra; i += sizeof (insn)) { - bcopy((void *)i, &insn, sizeof insn); + bcopy((void *)(intptr_t)i, &insn, sizeof insn); switch (insn.IType.op) { case OP_SPECIAL: if((insn.RType.func == OP_JR)) { - if (ra >= (u_register_t)btext) + if (ra >= (u_register_t)(intptr_t)btext) break; if (insn.RType.rs != RA) break; Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/mips/trap.c Thu Jun 24 08:08:43 2010 (r209500) @@ -625,6 +625,15 @@ dofault: code = locr0->v0; switch (code) { +#if defined(__mips_n32) || defined(__mips_n64) + case SYS___syscall: + /* + * Quads fit in a single register in + * new ABIs. + * + * XXX o64? + */ +#endif case SYS_syscall: /* * Code is first argument, followed by @@ -635,8 +644,16 @@ dofault: args[1] = locr0->a2; args[2] = locr0->a3; nsaved = 3; +#if defined(__mips_n32) || defined(__mips_n64) + args[3] = locr0->t4; + args[4] = locr0->t5; + args[5] = locr0->t6; + args[6] = locr0->t7; + nsaved += 4; +#endif break; +#if defined(__mips_o32) case SYS___syscall: /* * Like syscall, but code is a quad, so as @@ -652,6 +669,7 @@ dofault: args[1] = locr0->a3; nsaved = 2; break; +#endif default: args[0] = locr0->a0; @@ -659,6 +677,13 @@ dofault: args[2] = locr0->a2; args[3] = locr0->a3; nsaved = 4; +#if defined (__mips_n32) || defined(__mips_n64) + args[4] = locr0->t4; + args[5] = locr0->t5; + args[6] = locr0->t6; + args[7] = locr0->t7; + nsaved += 4; +#endif } #ifdef TRAP_DEBUG printf("SYSCALL #%d pid:%u\n", code, p->p_pid); @@ -675,6 +700,15 @@ dofault: nargs = callp->sy_narg; if (nargs > nsaved) { +#if defined(__mips_n32) || defined(__mips_n64) + /* + * XXX + * Is this right for new ABIs? I think the 4 there + * should be 8, size there are 8 registers to skip, + * not 4, but I'm not certain. + */ + printf("SYSCALL #%u pid:%u, nargs > nsaved.\n", code, p->p_pid); +#endif i = copyin((caddr_t)(intptr_t)(locr0->sp + 4 * sizeof(register_t)), (caddr_t)&args[nsaved], (u_int)(nargs - nsaved) * sizeof(register_t)); @@ -688,6 +722,18 @@ dofault: goto done; } } +#ifdef TRAP_DEBUG + for (i = 0; i < nargs; i++) { + printf("args[%d] = %#jx\n", i, (intmax_t)args[i]); + } +#endif +#ifdef SYSCALL_TRACING + printf("%s(", syscallnames[code]); + for (i = 0; i < nargs; i++) { + printf("%s%#jx", i == 0 ? "" : ", ", (intmax_t)args[i]); + } + printf(")\n"); +#endif #ifdef KTRACE if (KTRPOINT(td, KTR_SYSCALL)) ktrsyscall(code, nargs, args); Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Jun 24 07:43:25 2010 (r209499) +++ head/sys/mips/mips/vm_machdep.c Thu Jun 24 08:08:43 2010 (r209500) @@ -141,13 +141,13 @@ cpu_fork(register struct thread *td1,reg if (td1 == PCPU_GET(fpcurthread)) MipsSaveCurFPState(td1); - pcb2->pcb_context[PCB_REG_RA] = (register_t)fork_trampoline; + pcb2->pcb_context[PCB_REG_RA] = (register_t)(intptr_t)fork_trampoline; /* Make sp 64-bit aligned */ pcb2->pcb_context[PCB_REG_SP] = (register_t)(((vm_offset_t)td2->td_pcb & ~(sizeof(__int64_t) - 1)) - CALLFRAME_SIZ); - pcb2->pcb_context[PCB_REG_S0] = (register_t)fork_return; - pcb2->pcb_context[PCB_REG_S1] = (register_t)td2; - pcb2->pcb_context[PCB_REG_S2] = (register_t)td2->td_frame; + pcb2->pcb_context[PCB_REG_S0] = (register_t)(intptr_t)fork_return; + pcb2->pcb_context[PCB_REG_S1] = (register_t)(intptr_t)td2; + pcb2->pcb_context[PCB_REG_S2] = (register_t)(intptr_t)td2->td_frame; pcb2->pcb_context[PCB_REG_SR] = SR_INT_MASK & mips_rd_status(); /* * FREEBSD_DEVELOPERS_FIXME: @@ -178,8 +178,8 @@ cpu_set_fork_handler(struct thread *td, * Note that the trap frame follows the args, so the function * is really called like this: func(arg, frame); */ - td->td_pcb->pcb_context[PCB_REG_S0] = (register_t) func; - td->td_pcb->pcb_context[PCB_REG_S1] = (register_t) arg; + td->td_pcb->pcb_context[PCB_REG_S0] = (register_t)(intptr_t)func; + td->td_pcb->pcb_context[PCB_REG_S1] = (register_t)(intptr_t)arg; } void @@ -254,11 +254,18 @@ cpu_set_syscall_retval(struct thread *td code = locr0->v0; quad_syscall = 0; +#if defined(__mips_o32) + if (code == SYS___syscall) + quad_syscall = 1; +#endif + if (code == SYS_syscall) code = locr0->a0; else if (code == SYS___syscall) { - code = _QUAD_LOWWORD ? locr0->a1 : locr0->a0; - quad_syscall = 1; + if (quad_syscall) + code = _QUAD_LOWWORD ? locr0->a1 : locr0->a0; + else + code = locr0->a0; } switch (error) { @@ -336,13 +343,13 @@ cpu_set_upcall(struct thread *td, struct * Set registers for trampoline to user mode. */ - pcb2->pcb_context[PCB_REG_RA] = (register_t)fork_trampoline; + pcb2->pcb_context[PCB_REG_RA] = (register_t)(intptr_t)fork_trampoline; /* Make sp 64-bit aligned */ pcb2->pcb_context[PCB_REG_SP] = (register_t)(((vm_offset_t)td->td_pcb & ~(sizeof(__int64_t) - 1)) - CALLFRAME_SIZ); - pcb2->pcb_context[PCB_REG_S0] = (register_t)fork_return; - pcb2->pcb_context[PCB_REG_S1] = (register_t)td; - pcb2->pcb_context[PCB_REG_S2] = (register_t)td->td_frame; + pcb2->pcb_context[PCB_REG_S0] = (register_t)(intptr_t)fork_return; + pcb2->pcb_context[PCB_REG_S1] = (register_t)(intptr_t)td; + pcb2->pcb_context[PCB_REG_S2] = (register_t)(intptr_t)td->td_frame; /* Dont set IE bit in SR. sched lock release will take care of it */ pcb2->pcb_context[PCB_REG_SR] = SR_INT_MASK & mips_rd_status(); @@ -385,7 +392,7 @@ cpu_set_upcall_kse(struct thread *td, vo * byte aligned[for compatibility with 64-bit CPUs] * in ``See MIPS Run'' by D. Sweetman, p. 269 * align stack */ - sp = ((register_t)(stack->ss_sp + stack->ss_size) & ~0x7) - + sp = ((register_t)(intptr_t)(stack->ss_sp + stack->ss_size) & ~0x7) - CALLFRAME_SIZ; /* @@ -394,14 +401,14 @@ cpu_set_upcall_kse(struct thread *td, vo */ tf = td->td_frame; bzero(tf, sizeof(struct trapframe)); - tf->sp = (register_t)sp; - tf->pc = (register_t)entry; + tf->sp = sp; + tf->pc = (register_t)(intptr_t)entry; /* * MIPS ABI requires T9 to be the same as PC * in subroutine entry point */ - tf->t9 = (register_t)entry; - tf->a0 = (register_t)arg; + tf->t9 = (register_t)(intptr_t)entry; + tf->a0 = (register_t)(intptr_t)arg; /* * Keep interrupt mask @@ -409,7 +416,7 @@ cpu_set_upcall_kse(struct thread *td, vo tf->sr = SR_KSU_USER | SR_EXL | (SR_INT_MASK & mips_rd_status()) | MIPS_SR_INT_IE; #ifdef TARGET_OCTEON - tf->sr |= MIPS_SR_INT_IE | MIPS_SR_COP_0_BIT | MIPS_SR_UX | + tf->sr |= MIPS_SR_INT_IE | MIPS_SR_COP_0_BIT | MIPS32_SR_PX | MIPS_SR_UX | MIPS_SR_KX; #endif /* tf->sr |= (ALL_INT_MASK & idle_mask) | SR_INT_ENAB; */ @@ -431,7 +438,7 @@ kvtop(void *addr) va = pmap_kextract((vm_offset_t)addr); if (va == 0) panic("kvtop: zero page frame"); - return((int)va); + return((intptr_t)va); } /* @@ -547,10 +554,10 @@ cpu_throw(struct thread *old, struct thr #include #define DB_PRINT_REG(ptr, regname) \ - db_printf(" %-12s 0x%lx\n", #regname, (long)((ptr)->regname)) + db_printf(" %-12s %p\n", #regname, (void *)(intptr_t)((ptr)->regname)) #define DB_PRINT_REG_ARRAY(ptr, arrname, regname) \ - db_printf(" %-12s 0x%lx\n", #regname, (long)((ptr)->arrname[regname])) + db_printf(" %-12s %p\n", #regname, (void *)(intptr_t)((ptr)->arrname[regname])) static void dump_trapframe(struct trapframe *trapframe) From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 10:14:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91C881065688; Thu, 24 Jun 2010 10:14:31 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4878FC18; Thu, 24 Jun 2010 10:14:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OAEVXG057215; Thu, 24 Jun 2010 10:14:31 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OAEV7p057212; Thu, 24 Jun 2010 10:14:31 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006241014.o5OAEV7p057212@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 24 Jun 2010 10:14:31 +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: r209502 - in head/sys: conf mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 10:14:31 -0000 Author: jchandra Date: Thu Jun 24 10:14:31 2010 New Revision: 209502 URL: http://svn.freebsd.org/changeset/base/209502 Log: Add linker script and configuration file for n32 kernel. Approved by: rrs (mentor) Added: head/sys/conf/ldscript.mips.n32 (contents, props changed) head/sys/mips/conf/XLRN32 (contents, props changed) Added: head/sys/conf/ldscript.mips.n32 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/conf/ldscript.mips.n32 Thu Jun 24 10:14:31 2010 (r209502) @@ -0,0 +1,303 @@ +/*- + * Copyright (c) 2001, 2004, 2008, Juniper Networks, Inc. + * 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 Juniper Networks, Inc. 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 JUNIPER NETWORKS 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 JUNIPER NETWORKS 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. + * + * JNPR: ldscript.mips,v 1.3 2006/10/11 06:12:04 + * $FreeBSD$ + */ + +OUTPUT_FORMAT("elf32-ntradbigmips", "elf32-ntradbigmips", + "elf32-ntradlittlemips") + +OUTPUT_ARCH(mips) +ENTRY(_start) +SEARCH_DIR(/usr/lib); +/* Do we need any of these for elf? + __DYNAMIC = 0; +PROVIDE (_DYNAMIC = 0); +*/ +SECTIONS +{ + /* Read-only sections, merged into text segment: */ + . = KERNLOADADDR + SIZEOF_HEADERS; + .text : + { + *(.trap) + *(.text) + *(.text.*) + *(.stub) + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t.*) + } =0x1000000 + .fini : + { + KEEP (*(.fini)) + } =0x1000000 + PROVIDE (__etext = .); + PROVIDE (_etext = .); + PROVIDE (etext = .); + .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) } + .rodata1 : { *(.rodata1) } + .interp : { *(.interp) } + .hash : { *(.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rel.init : { *(.rel.init) } + .rela.init : { *(.rela.init) } + .rel.text : + { + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t.*) + } + .rela.text : + { + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t.*) + } + .rel.fini : { *(.rel.fini) } + .rela.fini : { *(.rela.fini) } + .rel.rodata : + { + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r.*) + } + .rela.rodata : + { + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r.*) + } + .rel.data : + { + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d.*) + } + .rela.data : + { + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d.*) + } + .rel.ctors : { *(.rel.ctors) } + .rela.ctors : { *(.rela.ctors) } + .rel.dtors : { *(.rel.dtors) } + .rela.dtors : { *(.rela.dtors) } + .rel.got : { *(.rel.got) } + .rela.got : { *(.rela.got) } + .rel.sdata : + { + *(.rel.sdata) + *(.rel.sdata.*) + *(.rel.gnu.linkonce.s.*) + } + .rela.sdata : + { + *(.rela.sdata) + *(.rela.sdata.*) + *(.rela.gnu.linkonce.s.*) + } + .rel.sbss : + { + *(.rel.sbss) + *(.rel.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rela.sbss : + { + *(.rela.sbss) + *(.rela.sbss.*) + *(.rel.gnu.linkonce.sb.*) + } + .rel.sdata2 : + { + *(.rel.sdata2) + *(.rel.sdata2.*) + *(.rel.gnu.linkonce.s2.*) + } + .rela.sdata2 : + { + *(.rela.sdata2) + *(.rela.sdata2.*) + *(.rela.gnu.linkonce.s2.*) + } + .rel.sbss2 : + { + *(.rel.sbss2) + *(.rel.sbss2.*) + *(.rel.gnu.linkonce.sb2.*) + } + .rela.sbss2 : + { + *(.rela.sbss2) + *(.rela.sbss2.*) + *(.rela.gnu.linkonce.sb2.*) + } + .rel.bss : + { + *(.rel.bss) + *(.rel.bss.*) + *(.rel.gnu.linkonce.b.*) + } + .rela.bss : + { + *(.rela.bss) + *(.rela.bss.*) + *(.rela.gnu.linkonce.b.*) + } + .rel.plt : { *(.rel.plt) } + .rela.plt : { *(.rela.plt) } + .init : + { + KEEP (*(.init)) + } =0x1000000 + .reginfo : { *(.reginfo) } + .sdata2 : { *(.sdata2) *(.sdata2.*) *(.gnu.linkonce.s2.*) } + .sbss2 : { *(.sbss2) *(.sbss2.*) *(.gnu.linkonce.sb2.*) } + . = ALIGN(0x2000) + (. & (0x2000 - 1)); + .data : + { + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + SORT(CONSTRUCTORS) + } + .data1 : { *(.data1) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } + .ctors : + { + /* gcc uses crtbegin.o to find the start of + the constructors, so we make sure it is + first. Because this is a wildcard, it + doesn't matter if the user does not + actually link against crtbegin.o; the + linker won't look for a file to match a + wildcard. The wildcard also means that it + doesn't matter which directory crtbegin.o + is in. */ + KEEP (*crtbegin.o(.ctors)) + /* We don't want to include the .ctor section from + from the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + } + .dtors : + { + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + } + .plt : { *(.plt) } + _gp = ALIGN(16) + 0x7ff0; + .got : { *(.got.plt) *(.got) } + .dynamic : { *(.dynamic) } + /* We want the small data sections together, so single-instruction offsets + can access them all, and initialized data all before uninitialized, so + we can shorten the on-disk segment size. */ + .sdata : + { + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + } + _edata = .; + PROVIDE (edata = .); + __bss_start = .; + .sbss : + { + PROVIDE (__sbss_start = .); + PROVIDE (___sbss_start = .); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + PROVIDE (__sbss_end = .); + PROVIDE (___sbss_end = .); + } + .bss : + { + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(64 / 8); + } + . = ALIGN(64 / 8); + _end = .; + PROVIDE (end = .); + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + /* SGI/MIPS DWARF 2 extensions */ + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + /* These must appear regardless of . */ +} Added: head/sys/mips/conf/XLRN32 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/XLRN32 Thu Jun 24 10:14:31 2010 (r209502) @@ -0,0 +1,133 @@ +# XLRN32 -- Kernel configuration file for N32 kernel on XLR/XLS +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +machine mips +cpu CPU_MIPS4KC +ident XLR + +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN + +include "../rmi/std.xlr" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions ARCH_FLAGS="-march=mips64 -mabi=n32" +makeoptions LDSCRIPT_NAME=ldscript.mips.n32 + +#profile 2 + +options SCHED_ULE # ULE scheduler +#options VERBOSE_SYSINIT +#options SCHED_4BSD # 4BSD scheduler +options SMP +options PREEMPTION # Enable kernel thread preemption +#options FULL_PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCLIENT +options NFS_ROOT +# +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=rge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:10.1.1.8:/usr/extra/nfsroot\" +# +#options MD_ROOT # MD is a potential root device +#options MD_ROOT_SIZE=27000 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options HZ=1000 +options NO_SWAPPING + +#Debugging options +options KTRACE # ktrace(1) support +options DDB +options KDB +options GDB +options ALT_BREAK_TO_DEBUGGER +#options DEADLKRES #Enable the deadlock resolver +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options KTR # ktr(4) and ktrdump(8) support +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_ENTRIES=131072 +#options MUTEX_DEBUG +#options MUTEX_PROFILING + +device pci +#device ata +#device atadisk +#options XLR_PERFMON # Enable XLR processor activity monitoring +options BREAK_TO_DEBUGGER +#device genclock +device uart +# Pseudo +device loop +device random +device md +device mem +device pty +device bpf + +# Network +device miibus +device rge +device ether +device re +device msk + +device da +device scbus +#device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +options USB_DEBUG # enable debug msgs +#device udbp # USB Double Bulk Pipe devices +#device ugen # Generic +#device uhid # "Human Interface Devices" +device umass # Disks/Mass storage - Requires scbus and da + +#device cfi + +#i2c +# Not yet +#device ic +#device iic +#device iicbb +#device iicbus +#device xlr_rtc +#device xlr_temperature +#device xlr_eeprom + +#crypto +# Not yet +#device cryptodev +#device crypto +#device rmisec +options ISA_MIPS64 +makeoptions KERNLOADADDR=0x80100000 From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 12:07:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C68E1065688; Thu, 24 Jun 2010 12:07:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5708FC17; Thu, 24 Jun 2010 12:07:54 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B339546B51; Thu, 24 Jun 2010 08:07:53 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id EF3088A03C; Thu, 24 Jun 2010 08:07:52 -0400 (EDT) From: John Baldwin To: Juli Mallett Date: Thu, 24 Jun 2010 07:57:23 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201006232326.o5NNQEtK011793@svn.freebsd.org> <20100623.202647.867924114552092597.imp@bsdimp.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201006240757.23510.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 24 Jun 2010 08:07:52 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, xcllnt@mac.com, nwhitehorn@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r209490 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 12:07:54 -0000 On Wednesday 23 June 2010 10:56:46 pm Juli Mallett wrote: > On Wed, Jun 23, 2010 at 19:26, M. Warner Losh wrote: > > > : > # define HZ 1000 > > : > # else > > : > # define HZ 100 > > > > Shouldn't this be defined in some file in ARCH/include instead? Yes, machine/param.h should work just fine. We could leave a default of 1000 via the current #ifndef and just move the non-default settings into MD headers. > Didn't it used to be? I think the problem with doing that is that > then someone inevitably writes code that uses HZ instead of the > (tunable) hz. Of course, you can hide it behind an obscure #ifdef and > even give it an intimidating name. No, it's been in subr_param.c since at least 4.4BSD. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 12:08:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29909106564A; Thu, 24 Jun 2010 12:08:51 +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 F398B8FC18; Thu, 24 Jun 2010 12:08:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OC8oNb082421; Thu, 24 Jun 2010 12:08:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OC8om3082418; Thu, 24 Jun 2010 12:08:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241208.o5OC8om3082418@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 12:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209503 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 12:08:51 -0000 Author: jhb Date: Thu Jun 24 12:08:50 2010 New Revision: 209503 URL: http://svn.freebsd.org/changeset/base/209503 Log: MFC 208391: Assert that the thread passed to sched_bind() and sched_unbind() is curthread as those routines are only supported for curthread currently. Modified: stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Thu Jun 24 10:14:31 2010 (r209502) +++ stable/8/sys/kern/sched_4bsd.c Thu Jun 24 12:08:50 2010 (r209503) @@ -1462,9 +1462,8 @@ sched_bind(struct thread *td, int cpu) { struct td_sched *ts; - THREAD_LOCK_ASSERT(td, MA_OWNED); - KASSERT(TD_IS_RUNNING(td), - ("sched_bind: cannot bind non-running thread")); + THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; @@ -1482,6 +1481,7 @@ void sched_unbind(struct thread* td) { THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); td->td_flags &= ~TDF_BOUND; } Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Thu Jun 24 10:14:31 2010 (r209502) +++ stable/8/sys/kern/sched_ule.c Thu Jun 24 12:08:50 2010 (r209503) @@ -2427,6 +2427,7 @@ sched_bind(struct thread *td, int cpu) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; if (ts->ts_flags & TSF_BOUND) sched_unbind(td); @@ -2448,6 +2449,7 @@ sched_unbind(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); ts = td->td_sched; if ((ts->ts_flags & TSF_BOUND) == 0) return; From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 12:09:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE661065678; Thu, 24 Jun 2010 12:09:13 +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 BF4C88FC22; Thu, 24 Jun 2010 12:09:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OC9CBX082528; Thu, 24 Jun 2010 12:09:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OC9CNm082525; Thu, 24 Jun 2010 12:09:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241209.o5OC9CNm082525@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 12:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209504 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 12:09:14 -0000 Author: jhb Date: Thu Jun 24 12:09:12 2010 New Revision: 209504 URL: http://svn.freebsd.org/changeset/base/209504 Log: MFC 208391: Assert that the thread passed to sched_bind() and sched_unbind() is curthread as those routines are only supported for curthread currently. Modified: stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sched_4bsd.c ============================================================================== --- stable/7/sys/kern/sched_4bsd.c Thu Jun 24 12:08:50 2010 (r209503) +++ stable/7/sys/kern/sched_4bsd.c Thu Jun 24 12:09:12 2010 (r209504) @@ -1345,9 +1345,8 @@ sched_bind(struct thread *td, int cpu) { struct td_sched *ts; - THREAD_LOCK_ASSERT(td, MA_OWNED); - KASSERT(TD_IS_RUNNING(td), - ("sched_bind: cannot bind non-running thread")); + THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; @@ -1365,6 +1364,7 @@ void sched_unbind(struct thread* td) { THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); td->td_flags &= ~TDF_BOUND; } Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Jun 24 12:08:50 2010 (r209503) +++ stable/7/sys/kern/sched_ule.c Thu Jun 24 12:09:12 2010 (r209504) @@ -2574,6 +2574,7 @@ sched_bind(struct thread *td, int cpu) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED); + KASSERT(td == curthread, ("sched_bind: can only bind curthread")); ts = td->td_sched; if (ts->ts_flags & TSF_BOUND) sched_unbind(td); @@ -2597,6 +2598,7 @@ sched_unbind(struct thread *td) struct td_sched *ts; THREAD_LOCK_ASSERT(td, MA_OWNED); + KASSERT(td == curthread, ("sched_unbind: can only bind curthread")); ts = td->td_sched; if ((ts->ts_flags & TSF_BOUND) == 0) return; From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 12:30:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599B71065673; Thu, 24 Jun 2010 12:30:30 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id AA48C8FC16; Thu, 24 Jun 2010 12:30:29 +0000 (UTC) Received: by qwg5 with SMTP id 5so194596qwg.13 for ; Thu, 24 Jun 2010 05:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=/wkHzTURgx+VR4MB/KFQK1Xtqv1Q5/NJRlsBNXS7n3I=; b=SotEQXHaB/DaRKlyZ9cO4z2FpNQdlaPXiE1MZEtwcGx/AZh8PWPYwlvkGquEfYQUmU PmJW9VYyLkbAylFVWblwSDNsGaZ/SWwH5ZgO9PN+jVyHR/BDxF6eNOHjd/jI4Wpe2L7k pItwOGX19uYPiQO8Gd4bWJ6de4JxOrAGAOqEE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XNayCCIwxkABkbGR4PlhjnpkYoT1gBb4xIeFrtMCPWExgl4cu5lTuA3zVvKYLVszQk TChhjtKNEi+cWxJX0mFgmIH18PDr2soQRpRIpH1MAmsxpalHX/bxEKVX3kMNvnMy5DIc cFMUN2XVyXky15PVmS7jEz4p37b5VREvmZV0k= MIME-Version: 1.0 Received: by 10.224.52.8 with SMTP id f8mr6133837qag.122.1277382628817; Thu, 24 Jun 2010 05:30:28 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.235.206 with HTTP; Thu, 24 Jun 2010 05:30:28 -0700 (PDT) In-Reply-To: <201006241208.o5OC8om3082418@svn.freebsd.org> References: <201006241208.o5OC8om3082418@svn.freebsd.org> Date: Thu, 24 Jun 2010 14:30:28 +0200 X-Google-Sender-Auth: r_jTmiyozP_dhJ8QguwcE3bpfTs Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r209503 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 12:30:30 -0000 2010/6/24 John Baldwin : > Author: jhb > Date: Thu Jun 24 12:08:50 2010 > New Revision: 209503 > URL: http://svn.freebsd.org/changeset/base/209503 > > Log: > =C2=A0MFC 208391: > =C2=A0Assert that the thread passed to sched_bind() and sched_unbind() is > =C2=A0curthread as those routines are only supported for curthread curren= tly. In general, I think that possibly sched_bind() and sched_unbind() may loose their argument in the future. Of course, that is a KPI breakage (which may be unconfortable to work with)= . Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 13:11:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFC7B10656C4; Thu, 24 Jun 2010 13:11: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 AE0418FC1F; Thu, 24 Jun 2010 13:11:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ODBCHp096201; Thu, 24 Jun 2010 13:11:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ODBCPH096196; Thu, 24 Jun 2010 13:11:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241311.o5ODBCPH096196@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 13:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209505 - in stable/8/sys: amd64/amd64 ia64/ia64 kern mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:11:13 -0000 Author: jhb Date: Thu Jun 24 13:11:12 2010 New Revision: 209505 URL: http://svn.freebsd.org/changeset/base/209505 Log: MFC 208392: - Adjust the whitespace for the lines that output fields in 'show pcpu' in DDB so that all the fields line up. - Print out the tid of the per-CPU idlethread instead of the pid since the idle process is now shared across all idle threads. Modified: stable/8/sys/amd64/amd64/db_interface.c stable/8/sys/ia64/ia64/db_machdep.c stable/8/sys/kern/subr_pcpu.c stable/8/sys/mips/mips/db_trace.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/db_interface.c ============================================================================== --- stable/8/sys/amd64/amd64/db_interface.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/amd64/amd64/db_interface.c Thu Jun 24 13:11:12 2010 (r209505) @@ -139,11 +139,11 @@ void db_show_mdpcpu(struct pcpu *pc) { - 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); + 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: stable/8/sys/ia64/ia64/db_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/db_machdep.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/ia64/ia64/db_machdep.c Thu Jun 24 13:11:12 2010 (r209505) @@ -579,11 +579,11 @@ db_show_mdpcpu(struct pcpu *pc) { struct pcpu_md *md = &pc->pc_md; - db_printf("MD: vhpt = %#lx\n", md->vhpt); - db_printf("MD: lid = %#lx\n", md->lid); - db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); - db_printf("MD: stats = %p\n", &md->stats); - db_printf("MD: pmap = %p\n", md->current_pmap); + db_printf("MD: vhpt = %#lx\n", md->vhpt); + db_printf("MD: lid = %#lx\n", md->lid); + db_printf("MD: clock = %#lx/%#lx\n", md->clock, md->clockadj); + db_printf("MD: stats = %p\n", &md->stats); + db_printf("MD: pmap = %p\n", md->current_pmap); } void Modified: stable/8/sys/kern/subr_pcpu.c ============================================================================== --- stable/8/sys/kern/subr_pcpu.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/kern/subr_pcpu.c Thu Jun 24 13:11:12 2010 (r209505) @@ -332,7 +332,7 @@ show_pcpu(struct pcpu *pc) struct thread *td; db_printf("cpuid = %d\n", pc->pc_cpuid); - db_printf("dynamic pcpu = %p\n", (void *)pc->pc_dynamic); + db_printf("dynamic pcpu = %p\n", (void *)pc->pc_dynamic); db_printf("curthread = "); td = pc->pc_curthread; if (td != NULL) @@ -351,12 +351,11 @@ show_pcpu(struct pcpu *pc) db_printf("idlethread = "); td = pc->pc_idlethread; if (td != NULL) - db_printf("%p: pid %d \"%s\"\n", td, td->td_proc->p_pid, - td->td_name); + db_printf("%p: tid %d \"%s\"\n", td, td->td_tid, td->td_name); else db_printf("none\n"); db_show_mdpcpu(pc); - + #ifdef VIMAGE db_printf("curvnet = %p\n", pc->pc_curthread->td_vnet); #endif Modified: stable/8/sys/mips/mips/db_trace.c ============================================================================== --- stable/8/sys/mips/mips/db_trace.c Thu Jun 24 12:09:12 2010 (r209504) +++ stable/8/sys/mips/mips/db_trace.c Thu Jun 24 13:11:12 2010 (r209505) @@ -70,8 +70,8 @@ void db_show_mdpcpu(struct pcpu *pc) { - db_printf("ipis = 0x%x\n", pc->pc_pending_ipis); + db_printf("ipis = 0x%x\n", pc->pc_pending_ipis); db_printf("next ASID = %d\n", pc->pc_next_asid); - db_printf("GENID = %d\n", pc->pc_asid_generation); + db_printf("GENID = %d\n", pc->pc_asid_generation); return; } From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 13:17:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD3C01065674; Thu, 24 Jun 2010 13:17:45 +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 BB94C8FC0A; Thu, 24 Jun 2010 13:17:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5ODHjH9097728; Thu, 24 Jun 2010 13:17:45 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5ODHjJl097725; Thu, 24 Jun 2010 13:17:45 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201006241317.o5ODHjJl097725@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jun 2010 13:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209506 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 13:17:46 -0000 Author: jhb Date: Thu Jun 24 13:17:45 2010 New Revision: 209506 URL: http://svn.freebsd.org/changeset/base/209506 Log: MFC 208915,208991: - Use a bit more care when moving I/O APIC interrupts between CPUs. Mask the interrupt followed by a brief delay if it is not currently masked before moving the interrupt. - Move the icu_lock out of ioapic_program_intpin() and into callers. This closes a race where ioapic_program_intpin() could use a stale value of the masked state to compute the masked bit in the register. Modified: stable/8/sys/amd64/amd64/io_apic.c stable/8/sys/i386/i386/io_apic.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/io_apic.c ============================================================================== --- stable/8/sys/amd64/amd64/io_apic.c Thu Jun 24 13:11:12 2010 (r209505) +++ stable/8/sys/amd64/amd64/io_apic.c Thu Jun 24 13:17:45 2010 (r209506) @@ -261,16 +261,15 @@ ioapic_program_intpin(struct ioapic_ints * If a pin is completely invalid or if it is valid but hasn't * been enabled yet, just ensure that the pin is masked. */ + mtx_assert(&icu_lock, MA_OWNED); if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && intpin->io_vector == 0)) { - mtx_lock_spin(&icu_lock); low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); if ((low & IOART_INTMASK) == IOART_INTMCLR) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); - mtx_unlock_spin(&icu_lock); return; } @@ -312,14 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - mtx_lock_spin(&icu_lock); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); - mtx_unlock_spin(&icu_lock); } static int @@ -352,6 +349,19 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (new_vector == 0) return (ENOSPC); + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked && !intpin->io_edgetrigger) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + intpin->io_cpu = apic_id; intpin->io_vector = new_vector; if (isrc->is_handlers > 0) @@ -364,6 +374,8 @@ ioapic_assign_cpu(struct intsrc *isrc, u intpin->io_vector); } ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + /* * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. @@ -399,9 +411,11 @@ ioapic_disable_intr(struct intsrc *isrc) /* Mask this interrupt pin and free its APIC vector. */ vector = intpin->io_vector; apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); intpin->io_masked = 1; intpin->io_vector = 0; ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); } } @@ -443,6 +457,7 @@ ioapic_config_intr(struct intsrc *isrc, * XXX: Should we write to the ELCR if the trigger mode changes for * an EISA IRQ or an ISA IRQ with the ELCR present? */ + mtx_lock_spin(&icu_lock); if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; changed = 0; @@ -464,6 +479,7 @@ ioapic_config_intr(struct intsrc *isrc, } if (changed) ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); return (0); } @@ -473,8 +489,10 @@ ioapic_resume(struct pic *pic) struct ioapic *io = (struct ioapic *)pic; int i; + mtx_lock_spin(&icu_lock); for (i = 0; i < io->io_numintr; i++) ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); } /* Modified: stable/8/sys/i386/i386/io_apic.c ============================================================================== --- stable/8/sys/i386/i386/io_apic.c Thu Jun 24 13:11:12 2010 (r209505) +++ stable/8/sys/i386/i386/io_apic.c Thu Jun 24 13:17:45 2010 (r209506) @@ -261,16 +261,15 @@ ioapic_program_intpin(struct ioapic_ints * If a pin is completely invalid or if it is valid but hasn't * been enabled yet, just ensure that the pin is masked. */ + mtx_assert(&icu_lock, MA_OWNED); if (intpin->io_irq == IRQ_DISABLED || (intpin->io_irq < NUM_IO_INTS && intpin->io_vector == 0)) { - mtx_lock_spin(&icu_lock); low = ioapic_read(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin)); if ((low & IOART_INTMASK) == IOART_INTMCLR) ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low | IOART_INTMSET); - mtx_unlock_spin(&icu_lock); return; } @@ -312,14 +311,12 @@ ioapic_program_intpin(struct ioapic_ints } /* Write the values to the APIC. */ - mtx_lock_spin(&icu_lock); intpin->io_lowreg = low; ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low); value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin)); value &= ~IOART_DEST; value |= high; ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value); - mtx_unlock_spin(&icu_lock); } static int @@ -352,6 +349,19 @@ ioapic_assign_cpu(struct intsrc *isrc, u if (new_vector == 0) return (ENOSPC); + /* + * Mask the old intpin if it is enabled while it is migrated. + * + * At least some level-triggered interrupts seem to need the + * extra DELAY() to avoid being stuck in a non-EOI'd state. + */ + mtx_lock_spin(&icu_lock); + if (!intpin->io_masked && !intpin->io_edgetrigger) { + ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), + intpin->io_lowreg | IOART_INTMSET); + DELAY(100); + } + intpin->io_cpu = apic_id; intpin->io_vector = new_vector; if (isrc->is_handlers > 0) @@ -364,6 +374,8 @@ ioapic_assign_cpu(struct intsrc *isrc, u intpin->io_vector); } ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); + /* * Free the old vector after the new one is established. This is done * to prevent races where we could miss an interrupt. @@ -399,9 +411,11 @@ ioapic_disable_intr(struct intsrc *isrc) /* Mask this interrupt pin and free its APIC vector. */ vector = intpin->io_vector; apic_disable_vector(intpin->io_cpu, vector); + mtx_lock_spin(&icu_lock); intpin->io_masked = 1; intpin->io_vector = 0; ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); apic_free_vector(intpin->io_cpu, vector, intpin->io_irq); } } @@ -443,6 +457,7 @@ ioapic_config_intr(struct intsrc *isrc, * XXX: Should we write to the ELCR if the trigger mode changes for * an EISA IRQ or an ISA IRQ with the ELCR present? */ + mtx_lock_spin(&icu_lock); if (intpin->io_bus == APIC_BUS_EISA) pol = INTR_POLARITY_HIGH; changed = 0; @@ -464,6 +479,7 @@ ioapic_config_intr(struct intsrc *isrc, } if (changed) ioapic_program_intpin(intpin); + mtx_unlock_spin(&icu_lock); return (0); } @@ -473,8 +489,10 @@ ioapic_resume(struct pic *pic) struct ioapic *io = (struct ioapic *)pic; int i; + mtx_lock_spin(&icu_lock); for (i = 0; i < io->io_numintr; i++) ioapic_program_intpin(&io->io_pins[i]); + mtx_unlock_spin(&icu_lock); } /* From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 16:28:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D823106564A; Thu, 24 Jun 2010 16:28:52 +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 6BABE8FC15; Thu, 24 Jun 2010 16:28:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OGSqjs039788; Thu, 24 Jun 2010 16:28:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OGSqCN039787; Thu, 24 Jun 2010 16:28:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006241628.o5OGSqCN039787@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 16:28: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: r209509 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 16:28:52 -0000 Author: imp Date: Thu Jun 24 16:28:52 2010 New Revision: 209509 URL: http://svn.freebsd.org/changeset/base/209509 Log: Merge from TBEMD: Rather than having arch specific code in Makefile.inc1, generalize so that we can control the settings of different options on a per architecutre basis. Reviewed by: arch@ (twice) Added: head/Makefile.mips (contents, props changed) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 24 15:49:33 2010 (r209508) +++ head/Makefile.inc1 Thu Jun 24 16:28:52 2010 (r209509) @@ -30,9 +30,7 @@ .include -.if ${MACHINE_ARCH} == "mips" -MK_RESCUE=no # not yet -.endif +.include # We must do share/info early so that installation of info `dir' # entries works correctly. Do it first since it is less likely to Added: head/Makefile.mips ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Makefile.mips Thu Jun 24 16:28:52 2010 (r209509) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# A bug in binutils prevents rescue from building, so override the user's +# choice. +MK_RESCUE=no From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 16:32:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1DA51065673; Thu, 24 Jun 2010 16:32:20 +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 C1A3E8FC13; Thu, 24 Jun 2010 16:32:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OGWKgP040577; Thu, 24 Jun 2010 16:32:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OGWKBb040575; Thu, 24 Jun 2010 16:32:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006241632.o5OGWKBb040575@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 16:32: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: r209510 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 16:32:20 -0000 Author: imp Date: Thu Jun 24 16:32:20 2010 New Revision: 209510 URL: http://svn.freebsd.org/changeset/base/209510 Log: Merge from tbemd: change the name of the object tree from ${TARGET} to ${TARGET}.${TARGET_ARCH} so we can do both big and little endian builds in the same tree. Reviewed by: arch@ (twice) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 24 16:28:52 2010 (r209509) +++ head/Makefile.inc1 Thu Jun 24 16:32:20 2010 (r209510) @@ -165,7 +165,7 @@ BUILD_ARCH!= uname -p .if ${MACHINE} == ${TARGET} && !defined(CROSS_BUILD_TESTING) OBJTREE= ${MAKEOBJDIRPREFIX} .else -OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET} +OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH} .endif WORLDTMP= ${OBJTREE}${.CURDIR}/tmp # /usr/games added for fortune which depend on strfile From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 17:53:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C16821065673; Thu, 24 Jun 2010 17:53:25 +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 B11248FC08; Thu, 24 Jun 2010 17:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OHrP83058290; Thu, 24 Jun 2010 17:53:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OHrPnU058288; Thu, 24 Jun 2010 17:53:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006241753.o5OHrPnU058288@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 17:53: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: r209511 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 17:53:25 -0000 Author: imp Date: Thu Jun 24 17:53:25 2010 New Revision: 209511 URL: http://svn.freebsd.org/changeset/base/209511 Log: Merge from tbemd: use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the CSU is based on MACHINE_CPUARCH Reviewed by: arch@ (twice) Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 24 16:32:20 2010 (r209510) +++ head/Makefile.inc1 Thu Jun 24 17:53:25 2010 (r209511) @@ -1108,10 +1108,10 @@ _prereq_libs= gnu/lib/libssp/libssp_nons # all shared libraries for ELF. # _startup_libs= gnu/lib/csu -.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf) -_startup_libs+= lib/csu/${MACHINE_ARCH}-elf +.if exists(${.CURDIR}/lib/csu/${MACHINE_CPUARCH}-elf) +_startup_libs+= lib/csu/${MACHINE_CPUARCH}-elf .else -_startup_libs+= lib/csu/${MACHINE_ARCH} +_startup_libs+= lib/csu/${MACHINE_CPUARCH} .endif _startup_libs+= gnu/lib/libgcc _startup_libs+= lib/libc From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 20:20:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B107106566B; Thu, 24 Jun 2010 20:20:04 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id 28A698FC0A; Thu, 24 Jun 2010 20:20:04 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L4J0000ACHFHS00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 Jun 2010 15:20:03 -0500 (CDT) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L4J00JL1CHBKX50@smtpauth3.wiscmail.wisc.edu>; Thu, 24 Jun 2010 15:20:00 -0500 (CDT) Date: Thu, 24 Jun 2010 15:19:59 -0500 From: Nathan Whitehorn In-reply-to: <201006241753.o5OHrPnU058288@svn.freebsd.org> To: Warner Losh Message-id: <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; powerpc64-portbld-freebsd9.0) X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-12, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.24.200915, SenderIP=128.104.160.176 References: <201006241753.o5OHrPnU058288@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209511 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 20:20:04 -0000 On Thu, 24 Jun 2010 17:53:25 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Thu Jun 24 17:53:25 2010 > New Revision: 209511 > URL: http://svn.freebsd.org/changeset/base/209511 > > Log: > Merge from tbemd: > > use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the > CSU is based on MACHINE_CPUARCH > > Reviewed by: arch@ (twice) This is not always true. For example, on powerpc64, the ABI is different enough between powerpc and powerpc64, which share a CPUARCH, that the csu code shares very little. I can work around this with Makefile or preprocessor hacks, of course, but would be it be possible here instead to check for MACHINE_ARCH before falling back to MACHINE_CPUARCH? -Nathan From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 20:45:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83013106566C; Thu, 24 Jun 2010 20:45:18 +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 1D4E28FC0A; Thu, 24 Jun 2010 20:45:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5OKdSGc013419; Thu, 24 Jun 2010 14:39:28 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 24 Jun 2010 14:39:39 -0600 (MDT) Message-Id: <20100624.143939.85384790471796385.imp@bsdimp.com> To: nwhitehorn@freebsd.org From: "M. Warner Losh" In-Reply-To: <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> References: <201006241753.o5OHrPnU058288@svn.freebsd.org> <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> X-Mailer: Mew version 6.3 on Emacs 22.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: r209511 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 20:45:18 -0000 In message: <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> Nathan Whitehorn writes: : On Thu, 24 Jun 2010 17:53:25 +0000 (UTC) : Warner Losh wrote: : : > Author: imp : > Date: Thu Jun 24 17:53:25 2010 : > New Revision: 209511 : > URL: http://svn.freebsd.org/changeset/base/209511 : > : > Log: : > Merge from tbemd: : > : > use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the : > CSU is based on MACHINE_CPUARCH : > : > Reviewed by: arch@ (twice) : : This is not always true. For example, on powerpc64, the ABI is : different enough between powerpc and powerpc64, which share a CPUARCH, : that the csu code shares very little. I can work around this with : Makefile or preprocessor hacks, of course, but would be it be possible : here instead to check for MACHINE_ARCH before falling back to : MACHINE_CPUARCH? I can do the nested search. It won't break mips or arm, since the mipsel or mipseb variant won't exist... Warner From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 20:45:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 803201065673; Thu, 24 Jun 2010 20:45:19 +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 0D4E28FC0C; Thu, 24 Jun 2010 20:45:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5OKfg64013430; Thu, 24 Jun 2010 14:41:42 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 24 Jun 2010 14:41:53 -0600 (MDT) Message-Id: <20100624.144153.705015198875273131.imp@bsdimp.com> To: nwhitehorn@freebsd.org From: "M. Warner Losh" In-Reply-To: <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> References: <201006241753.o5OHrPnU058288@svn.freebsd.org> <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Jun_24_14_41_53_2010_185)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209511 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 20:45:19 -0000 ----Next_Part(Thu_Jun_24_14_41_53_2010_185)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In message: <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> Nathan Whitehorn writes: : On Thu, 24 Jun 2010 17:53:25 +0000 (UTC) : Warner Losh wrote: : : > Author: imp : > Date: Thu Jun 24 17:53:25 2010 : > New Revision: 209511 : > URL: http://svn.freebsd.org/changeset/base/209511 : > : > Log: : > Merge from tbemd: : > : > use MACHINE_CPUARCH instead of MACHINE_CPU since the sources for the : > CSU is based on MACHINE_CPUARCH : > : > Reviewed by: arch@ (twice) : : This is not always true. For example, on powerpc64, the ABI is : different enough between powerpc and powerpc64, which share a CPUARCH, : that the csu code shares very little. I can work around this with : Makefile or preprocessor hacks, of course, but would be it be possible : here instead to check for MACHINE_ARCH before falling back to : MACHINE_CPUARCH? Does this patch do what you are asking? Warner ----Next_Part(Thu_Jun_24_14_41_53_2010_185)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=PP Index: mtree.h =================================================================== --- mtree.h (revision 205300) +++ mtree.h (working copy) @@ -48,6 +48,11 @@ char *sha1digest; /* SHA-1 digest */ char *sha256digest; /* SHA-256 digest */ char *rmd160digest; /* RIPEMD160 digest */ + char *sha384digest; /* SHA384 digest */ + char *sha512digest; /* SHA512 digest */ + char *tags; /* tags, comma delimited, + * also with leading and + * trailing commas */ char *slink; /* symbolic link reference */ uid_t st_uid; /* uid */ gid_t st_gid; /* gid */ Index: spec.c =================================================================== --- spec.c (revision 205300) +++ spec.c (working copy) @@ -37,12 +37,14 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -51,19 +53,261 @@ int lineno; /* Current spec line number. */ -static void set(char *, NODE *); -static void unset(char *, NODE *); +static void addchild(NODE *, NODE *); +static void replacenode(NODE *, NODE *); +static void set(char *, NODE *); +static void unset(char *, NODE *); +static int nodecmp(const NODE *, const NODE *); +#define REPLACEPTR(x,v) do { if ((x)) free((x)); (x) = (v); } while (0) + +#define mtree_Sflag 0 /* kludge */ + +static u_int +nodetoino(u_int type) +{ + + switch (type) { + case F_BLOCK: + return S_IFBLK; + case F_CHAR: + return S_IFCHR; + case F_DIR: + return S_IFDIR; + case F_FIFO: + return S_IFIFO; + case F_FILE: + return S_IFREG; + case F_LINK: + return S_IFLNK; +#ifdef S_IFSOCK + case F_SOCK: + return S_IFSOCK; +#endif + default: + printf("unknown type %d", type); + abort(); + } + /* NOTREACHED */ +} + +static const char * +nodetype(u_int type) +{ + + return (inotype(nodetoino(type))); +} + +static void +mtree_err(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwarnx(fmt, ap); + va_end(ap); +#if 0 + if (mtree_lineno) + warnx("failed at line %lu of the specification", + (u_long) mtree_lineno); +#endif + exit(1); + /* NOTREACHED */ +} + +static void +replacenode(NODE *cur, NODE *new) +{ + +#define REPLACE(x) cur->x = new->x +#define REPLACESTR(x) REPLACEPTR(cur->x,new->x) + + if (cur->type != new->type) { +#if 0 + if (mtree_Mflag) { + /* + * merge entries with different types; we + * don't want children retained in this case. + */ + REPLACE(type); + free_nodes(cur->child); + cur->child = NULL; + } else { +#endif + mtree_err( + "existing entry for `%s', type `%s'" + " does not match type `%s'", + cur->name, nodetype(cur->type), + nodetype(new->type)); +#if 0 + } +#endif + } + + REPLACE(st_size); + REPLACE(st_mtimespec); + REPLACESTR(slink); + if (cur->slink != NULL) { + if ((cur->slink = strdup(new->slink)) == NULL) + mtree_err("memory allocation error"); + if (strunvis(cur->slink, new->slink) == -1) + mtree_err("strunvis failed on `%s'", new->slink); + free(new->slink); + } + REPLACE(st_uid); + REPLACE(st_gid); + REPLACE(st_mode); +// REPLACE(st_rdev); + REPLACE(st_flags); + REPLACE(st_nlink); + REPLACE(cksum); + REPLACESTR(md5digest); + REPLACESTR(rmd160digest); + REPLACESTR(sha1digest); + REPLACESTR(sha256digest); + REPLACESTR(sha384digest); + REPLACESTR(sha512digest); + REPLACESTR(tags); +// REPLACE(lineno); + REPLACE(flags); + free(new); +} + +/* + * addchild -- + * Add the centry node as a child of the pathparent node. If + * centry is a duplicate, call replacenode(). If centry is not + * a duplicate, insert it into the linked list referenced by + * pathparent->child. Keep the list sorted if Sflag is set. + */ +static void +addchild(NODE *pathparent, NODE *centry) +{ + NODE *samename; /* node with the same name as centry */ + NODE *replacepos; /* if non-NULL, centry should replace this node */ + NODE *insertpos; /* if non-NULL, centry should be inserted + * after this node */ + NODE *cur; /* for stepping through the list */ + NODE *last; /* the last node in the list */ + int cmp; + + samename = NULL; + replacepos = NULL; + insertpos = NULL; + last = NULL; + cur = pathparent->child; + if (cur == NULL) { + /* centry is pathparent's first and only child node so far */ + pathparent->child = centry; + return; + } + + /* + * pathparent already has at least one other child, so add the + * centry node to the list. + * + * We first scan through the list looking for an existing node + * with the same name (setting samename), and also looking + * for the correct position to replace or insert the new node + * (setting replacepos and/or insertpos). + */ + for (; cur != NULL; last = cur, cur = cur->next) { + if (strcmp(centry->name, cur->name) == 0) { + samename = cur; + } + if (mtree_Sflag) { + cmp = nodecmp(centry, cur); + if (cmp == 0) { + replacepos = cur; + } else if (cmp > 0) { + insertpos = cur; + } + } + } + if (! mtree_Sflag) { + if (samename != NULL) { + /* replace node with same name */ + replacepos = samename; + } else { + /* add new node at end of list */ + insertpos = last; + } + } + + if (samename != NULL) { + /* + * We found a node with the same name above. Call + * replacenode(), which will either exit with an error, + * or replace the information in the samename node and + * free the information in the centry node. + */ + replacenode(samename, centry); + if (samename == replacepos) { + /* The just-replaced node was in the correct position */ + return; + } + if (samename == insertpos || samename->prev == insertpos) { + /* + * We thought the new node should be just before + * or just after the replaced node, but that would + * be equivalent to just retaining the replaced node. + */ + return; + } + + /* + * The just-replaced node is in the wrong position in + * the list. This can happen if sort order depends on + * criteria other than the node name. + * + * Make centry point to the just-replaced node. Unlink + * the just-replaced node from the list, and allow it to + * be insterted in the correct position later. + */ + centry = samename; + if (centry->prev) + centry->prev->next = centry->next; + else { + /* centry->next is the new head of the list */ + pathparent->child = centry->next; + assert(centry->next != NULL); + } + if (centry->next) + centry->next->prev = centry->prev; + centry->prev = NULL; + centry->next = NULL; + } + + if (insertpos == NULL) { + /* insert centry at the beginning of the list */ + pathparent->child->prev = centry; + centry->next = pathparent->child; + centry->prev = NULL; + pathparent->child = centry; + } else { + /* insert centry into the list just after insertpos */ + centry->next = insertpos->next; + insertpos->next = centry; + centry->prev = insertpos; + if (centry->next) + centry->next->prev = centry; + } + return; +} + NODE * mtree_readspec(FILE *fi) { - NODE *centry, *last; - char *p; + NODE *centry, *last, *pathparent, *cur; + char *p, *e, *next; NODE ginfo, *root; int c_cur, c_next; - char buf[2048]; + char buf[2048], *tname; + size_t tnamelen; centry = last = root = NULL; + tname = NULL; + tnamelen = 0; bzero(&ginfo, sizeof(ginfo)); c_cur = c_next = 0; for (lineno = 1; fgets(buf, sizeof(buf), fi); @@ -100,29 +344,30 @@ continue; } +#if 1 /* Grab file name, "$", "set", or "unset". */ + next = buf; + while ((p = strsep(&next, " \t")) != NULL && *p == '\0') + continue; + if (p == NULL) + mtree_err("missing field"); +#else + /* Grab file name, "$", "set", or "unset". */ if ((p = strtok(p, "\n\t ")) == NULL) errx(1, "line %d: missing field", lineno); +#endif - if (p[0] == '/') - switch(p[1]) { - case 's': - if (strcmp(p + 1, "set")) - break; - set(NULL, &ginfo); - continue; - case 'u': - if (strcmp(p + 1, "unset")) - break; - unset(NULL, &ginfo); - continue; - } + if (p[0] == '/') { + if (strcmp(p + 1, "set") == 0) + set(next, &ginfo); + else if (strcmp(p + 1, "unset") == 0) + unset(next, &ginfo); + else + mtree_err("invalid specification `%s'", p); + continue; + } - if (index(p, '/')) - errx(1, "line %d: slash character in file name", - lineno); - - if (!strcmp(p, "..")) { + if (strcmp(p, "..") == 0) { /* Don't go up, if haven't gone down. */ if (!root) goto noparent; @@ -137,6 +382,33 @@ noparent: errx(1, "line %d: no parent node", lineno); } + /* XXX investigate the NetBSD strvis extentions */ + + pathparent = NULL; + if (strchr(p, '/') != NULL) { + cur = root; + for (; (e = strchr(p, '/')) != NULL; p = e+1) { + if (p == e) + continue; /* handle // */ + *e = '\0'; + if (strcmp(p, ".") != 0) { + while (cur && + strcmp(cur->name, p) != 0) { + cur = cur->next; + } + } + if (cur == NULL || cur->type != F_DIR) { + mtree_err("%s: %s", tname, + "missing directory in specification"); + } + *e = '/'; + pathparent = cur; + cur = cur->child; + } + if (*p == '\0') + mtree_err("%s: empty leaf element", tname); + } + if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL) errx(1, "calloc"); *centry = ginfo; @@ -147,16 +419,45 @@ errx(1, "filename %s is ill-encoded", p); set(NULL, centry); - if (!root) { + if (root == NULL) { + /* + * empty tree + */ + if (strcmp(centry->name, ".") != 0 || + centry->type != F_DIR) + mtree_err( + "root node must be the directory `.'"); last = root = centry; root->parent = root; + } else if (pathparent != NULL) { + /* + * full path entry; add or replace + */ + centry->parent = pathparent; + addchild(pathparent, centry); + last = centry; + } else if (strcmp(centry->name, ".") == 0) { + /* + * duplicate "." entry; always replace + */ + replacenode(root, centry); } else if (last->type == F_DIR && !(last->flags & F_DONE)) { + /* + * new relative child in current dir; + * add or replace + */ centry->parent = last; - last = last->child = centry; + addchild(last, centry); + last = centry; } else { + /* + * new relative child in parent dir + * (after encountering ".." entry); + * add or replace + */ centry->parent = last->parent; - centry->prev = last; - last = last->next = centry; + addchild(last->parent, centry); + last = centry; } } return (root); @@ -321,3 +622,23 @@ while ((p = strtok(t, "\n\t "))) ip->flags &= ~parsekey(p, NULL); } +/* + * nodecmp -- + * used as a comparison function by addchild() to control the order + * in which entries appear within a list of sibling nodes. We make + * directories sort after non-directories, but otherwise sort in + * strcmp() order. + * + * Keep this in sync with dcmp() in create.c. + */ +static int +nodecmp(const NODE *a, const NODE *b) +{ + + if ((a->type & F_DIR) != 0) { + if ((b->type & F_DIR) == 0) + return 1; + } else if ((b->type & F_DIR) != 0) + return -1; + return strcmp(a->name, b->name); +} ----Next_Part(Thu_Jun_24_14_41_53_2010_185)---- From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 21:16:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CFDD106567A; Thu, 24 Jun 2010 21:16:09 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from argol.doit.wisc.edu (argol.doit.wisc.edu [144.92.197.212]) by mx1.freebsd.org (Postfix) with ESMTP id F10C18FC16; Thu, 24 Jun 2010 21:16:08 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth3.wiscmail.wisc.edu by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L4J00506F2W4G00@smtpauth3.wiscmail.wisc.edu>; Thu, 24 Jun 2010 16:16:08 -0500 (CDT) Received: from anacreon.physics.wisc.edu (anacreon.physics.wisc.edu [128.104.160.176]) by smtpauth3.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L4J0041XF2T7S10@smtpauth3.wiscmail.wisc.edu>; Thu, 24 Jun 2010 16:16:05 -0500 (CDT) Date: Thu, 24 Jun 2010 16:16:05 -0500 From: Nathan Whitehorn In-reply-to: <20100624.144153.705015198875273131.imp@bsdimp.com> To: "M. Warner Losh" Message-id: <20100624161605.5b7c4b1a@anacreon.physics.wisc.edu> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; powerpc64-portbld-freebsd9.0) X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.160.176 X-Spam-PmxInfo: Server=avs-13, Version=5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.6.24.210614, SenderIP=128.104.160.176 References: <201006241753.o5OHrPnU058288@svn.freebsd.org> <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> <20100624.144153.705015198875273131.imp@bsdimp.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209511 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 21:16:09 -0000 On Thu, 24 Jun 2010 14:41:53 -0600 (MDT) "M. Warner Losh" wrote: > In message: <20100624151959.6b00bfdd@anacreon.physics.wisc.edu> > Nathan Whitehorn writes: > : On Thu, 24 Jun 2010 17:53:25 +0000 (UTC) > : Warner Losh wrote: > : > : > Author: imp > : > Date: Thu Jun 24 17:53:25 2010 > : > New Revision: 209511 > : > URL: http://svn.freebsd.org/changeset/base/209511 > : > > : > Log: > : > Merge from tbemd: > : > > : > use MACHINE_CPUARCH instead of MACHINE_CPU since the sources > for the : > CSU is based on MACHINE_CPUARCH > : > > : > Reviewed by: arch@ (twice) > : > : This is not always true. For example, on powerpc64, the ABI is > : different enough between powerpc and powerpc64, which share a > CPUARCH, : that the csu code shares very little. I can work around > this with : Makefile or preprocessor hacks, of course, but would be > it be possible : here instead to check for MACHINE_ARCH before > falling back to : MACHINE_CPUARCH? > > Does this patch do what you are asking? Are you sure you attached the right patch? -Nathan From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 21:17:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1E9106567A; Thu, 24 Jun 2010 21:17:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD56B8FC0C; Thu, 24 Jun 2010 21:17:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OLHwhq003356; Thu, 24 Jun 2010 21:17:58 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OLHwfI003355; Thu, 24 Jun 2010 21:17:58 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201006242117.o5OLHwfI003355@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 24 Jun 2010 21:17: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: r209512 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 21:17:58 -0000 Author: gnn Date: Thu Jun 24 21:17:58 2010 New Revision: 209512 URL: http://svn.freebsd.org/changeset/base/209512 Log: Make sure that all the exposed counters and variables are actually being updated. Pointed out by: jfv Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Thu Jun 24 17:53:25 2010 (r209511) +++ head/sys/dev/e1000/if_igb.c Thu Jun 24 21:17:58 2010 (r209512) @@ -4814,6 +4814,18 @@ igb_update_stats_counters(struct adapter /* Tx Errors */ ifp->if_oerrors = adapter->stats.ecol + adapter->stats.latecol + adapter->watchdog_events; + + /* Driver specific counters */ + adapter->device_control = E1000_READ_REG(&adapter->hw, E1000_CTRL); + adapter->rx_control = E1000_READ_REG(&adapter->hw, E1000_RCTL); + adapter->int_mask = E1000_READ_REG(&adapter->hw, E1000_IMS); + adapter->eint_mask = E1000_READ_REG(&adapter->hw, E1000_EIMS); + adapter->packet_buf_alloc_tx = ((E1000_READ_REG(&adapter->hw, E1000_PBA) + & 0xffff0000) >> 16); + + adapter->packet_buf_alloc_rx = (E1000_READ_REG(&adapter->hw, E1000_PBA) + & 0xffff); + } @@ -4897,6 +4909,11 @@ igb_add_hw_stats(struct adapter *adapter } for (int i = 0; i < adapter->num_queues; i++, rxr++) { + snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); + queue_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, namebuf, + CTLFLAG_RD, NULL, "Queue Name"); + queue_list = SYSCTL_CHILDREN(queue_node); + struct lro_ctrl *lro = &rxr->lro; snprintf(namebuf, QUEUE_NAME_LEN, "queue%d", i); From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 22:21:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57331106566C; Thu, 24 Jun 2010 22:21:48 +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 417BA8FC14; Thu, 24 Jun 2010 22:21:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OMLmEa017498; Thu, 24 Jun 2010 22:21:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OMLljr017477; Thu, 24 Jun 2010 22:21:47 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006242221.o5OMLljr017477@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 22:21: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: r209513 - in head: etc/mtree usr.sbin usr.sbin/pc-sysinstall usr.sbin/pc-sysinstall/backend usr.sbin/pc-sysinstall/backend-partmanager usr.sbin/pc-sysinstall/backend-query usr.sbin/pc-s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 22:21:48 -0000 Author: imp Date: Thu Jun 24 22:21:47 2010 New Revision: 209513 URL: http://svn.freebsd.org/changeset/base/209513 Log: Bring in Kris Moore's pc-sysinstall shell script from PC-BSD. This shell script is the back end logic necessary for an installer. It contains both query routines to allow a front-end installer to present reasonable choices to the user and also action routines which allow the front end installer to put a FreeBSD distribution onto a disk. It supports installing onto the usual suspects, as well as advanced features like Mirroring, ZFS, Encryprion and GPT labels. While this is only the back-end of the installer, it can do unattended scripted installations. In PC-BSD's world view, all installations are scripted and all the front-end does is write the script. As such, it is useful in its own right. This has been extensively tested over the past several releases of PC-BSD. However, differences between that environment and FreeBSD suggest there will be a period of shake-out while those differences are discovered and corrected. A text-based front-end is in the works. For the GUI-based front-end, you can use the PC-BSD distribution. Kris' BSDcan paper on pc-sysinstall is linked off his talk on the BSDcan site: http://www.bsdcan.org/2010/schedule/events/173.en.html The man page is written by Josh Paetzel, and I wrote the Makefiles for the FreeBSD integration. Kris wrote the rest. This represents version r7010 in the PC-BSD repo. http://svn.pcbsd.org/pcbsd/current/pc-sysinstall Submitted by: kris@ Sponsored by: iX Systems Added: head/usr.sbin/pc-sysinstall/ head/usr.sbin/pc-sysinstall/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend/ head/usr.sbin/pc-sysinstall/backend-partmanager/ head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/ head/usr.sbin/pc-sysinstall/backend-query/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/list-components.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/query-langs.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/setup-ssh-keys.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/test-live.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/test-netup.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-disk.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-localize.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-networking.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-newfs.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-parse.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-unmount.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-upgrade.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions-users.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/functions.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/parseconfig.sh (contents, props changed) head/usr.sbin/pc-sysinstall/backend/startautoinstall.sh (contents, props changed) head/usr.sbin/pc-sysinstall/conf/ head/usr.sbin/pc-sysinstall/conf/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/conf/avail-langs (contents, props changed) head/usr.sbin/pc-sysinstall/conf/exclude-from-upgrade (contents, props changed) head/usr.sbin/pc-sysinstall/conf/licenses/ head/usr.sbin/pc-sysinstall/conf/licenses/bsd-en.txt (contents, props changed) head/usr.sbin/pc-sysinstall/conf/licenses/intel-en.txt (contents, props changed) head/usr.sbin/pc-sysinstall/conf/licenses/nvidia-en.txt (contents, props changed) head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf (contents, props changed) head/usr.sbin/pc-sysinstall/doc/ head/usr.sbin/pc-sysinstall/doc/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-disk-list (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-disk-size (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-index (contents, props changed) head/usr.sbin/pc-sysinstall/doc/help-start-autoinstall (contents, props changed) head/usr.sbin/pc-sysinstall/examples/ head/usr.sbin/pc-sysinstall/examples/Makefile (contents, props changed) head/usr.sbin/pc-sysinstall/examples/README (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pc-autoinstall.conf (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.fbsd-netinstall (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.geli (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.gmirror (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.netinstall (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.restore (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.rsync (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.upgrade (contents, props changed) head/usr.sbin/pc-sysinstall/examples/pcinstall.cfg.zfs (contents, props changed) head/usr.sbin/pc-sysinstall/pc-sysinstall/ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 (contents, props changed) head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh (contents, props changed) Modified: head/etc/mtree/BSD.usr.dist head/usr.sbin/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Jun 24 21:17:58 2010 (r209512) +++ head/etc/mtree/BSD.usr.dist Thu Jun 24 22:21:47 2010 (r209513) @@ -261,6 +261,8 @@ .. nwclient .. + pc-sysinstall + .. perfmon .. pf @@ -1226,6 +1228,20 @@ .. .. .. + pc-sysinstall + backend + .. + backend-partmanager + .. + backend-query + .. + conf + license + .. + .. + doc + .. + .. security .. sendmail Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Thu Jun 24 21:17:58 2010 (r209512) +++ head/usr.sbin/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -125,6 +125,7 @@ SUBDIR= ${_ac} \ ${_ntp} \ ${_nvram} \ ${_ofwdump} \ + pc-sysinstall \ pciconf \ periodic \ ${_pkg_install} \ Added: head/usr.sbin/pc-sysinstall/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,5 @@ +# $FreeBSD$ +SUBDIR=backend backend-partmanager backend-query conf doc examples +SUBDIR+=pc-sysinstall + +.include Added: head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +FILES= create-part.sh delete-part.sh + +FILESDIR=${SHAREDIR}/pc-sysinstall/backend-partmanager +NO_OBJ= + +.include Added: head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,92 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh + +if [ -z "${1}" ] ; then + echo "Error: No disk specified!" + exit 1 +fi + +if [ -z "${2}" ] ; then + echo "Error: No size specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] ; then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" +MB="${2}" + +TOTALBLOCKS="`expr $MB \* 2048`" + + +# Lets figure out what number this slice will be +LASTSLICE="`fdisk -s /dev/${DISK} 2>/dev/null | grep -v ${DISK} | grep ':' | tail -n 1 | cut -d ':' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +if [ -z "${LASTSLICE}" ] ; then + LASTSLICE="1" +else + LASTSLICE="`expr $LASTSLICE + 1`" +fi + +if [ ${LASTSLICE} -gt "4" ] ; then + echo "Error: FreeBSD MBR setups can only have a max of 4 slices" + exit 1 +fi + + +SLICENUM="${LASTSLICE}" + +# Lets get the starting block +if [ "${SLICENUM}" = "1" ] ; then + STARTBLOCK="63" +else + # Lets figure out where the prior slice ends + checkslice="`expr ${SLICENUM} - 1`" + + # Get starting block of this slice + fdisk -s /dev/${DISK} | grep -v "${DISK}:" | grep "${checkslice}:" | tr -s " " >${TMPDIR}/pfdisk + pstartblock="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 3`" + psize="`cat ${TMPDIR}/pfdisk | cut -d ' ' -f 4`" + STARTBLOCK="`expr ${pstartblock} + ${psize}`" +fi + + +# If this is an empty disk, see if we need to create a new MBR scheme for it +gpart show ${DISK} >/dev/null 2>/dev/null +if [ "$?" != "0" -a "${SLICENUM}" = "1" ] ; then + gpart create -s mbr ${DISK} +fi + +gpart add -b ${STARTBLOCK} -s ${TOTALBLOCKS} -t freebsd -i ${SLICENUM} ${DISK} +exit "$?" Added: head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,89 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Delete a specified partition, takes effect immediately +######################################################## + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No partition specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Partition /dev/${1} does not exist!" + exit 1 +fi + +PARTITION="${1}" + +# First lets figure out the partition number for the given device +################################################################## + +# Get the number of characters in this dev +CHARS="`echo $PARTITION | wc -c`" + +PARTINDEX="" + +# Lets read through backwards until we get the part number +while +z=1 +do + CHARS=`expr $CHARS - 1` + LAST_CHAR=`echo "${PARTITION}" | cut -c $CHARS` + echo "${LAST_CHAR}" | grep "^[0-9]$" >/dev/null 2>/dev/null + if [ "$?" = "0" ] ; then + PARTINDEX="${LAST_CHAR}${PARTINDEX}" + else + break + fi +done + +# Now get current disk we are working on +CHARS=`expr $CHARS - 1` +DISK="`echo $PARTITION | cut -c 1-${CHARS}`" + +# Make sure we have a valid disk name still +if [ ! -e "/dev/${DISK}" ] ; then + echo "Error: Disk: ${DISK} doesnt exist!" + exit 1 +fi + +echo "Running: gpart delete -i ${PARTINDEX} ${DISK}" +gpart delete -i ${PARTINDEX} ${DISK} >/dev/null 2>/dev/null + +# Check if this was the last partition and destroy the disk geom if so +get_disk_partitions "${DISK}" +if [ -z "${VAL}" ] ; then + gpart destroy ${DISK} +fi + +exit "$?" Added: head/usr.sbin/pc-sysinstall/backend-query/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/Makefile Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,13 @@ +# $FreeBSD$ + +FILES= detect-laptop.sh detect-nics.sh detect-vmware.sh disk-info.sh \ + disk-list.sh disk-part.sh enable-net.sh list-components.sh \ + list-rsync-backups.sh list-tzones.sh query-langs.sh send-logs.sh \ + setup-ssh-keys.sh sys-mem.sh test-live.sh test-netup.sh \ + update-part-list.sh xkeyboard-layouts.sh xkeyboard-models.sh \ + xkeyboard-variants.sh + +FILESDIR=${SHAREDIR}/pc-sysinstall/backend-query +NO_OBJ= + +.include Added: head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,33 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +dmesgLine=`dmesg | grep "acpi_acad0"` +if test "${dmesgLine}" = ""; then + echo "laptop: NO" +else + echo "laptop: YES" +fi Added: head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,41 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +rm /tmp/netCards 2>/dev/null +touch /tmp/netCards + +config="`ifconfig -l`" + +for i in $config +do + echo "${i}" | grep -e "lo0" -e "^fwe" -e "^fwip" -e "lo1" -e "^plip" -e "^pfsync" -e "^pflog" -e "^tun" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + IDENT="<`dmesg | grep ^${i} | grep -v "miibus" | grep '<' | cut -d '<' -f 2 | cut -d '>' -f 1 | head -1`>" + echo "${i}: $IDENT" + fi +done Added: head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,36 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +pciconf -lv | grep -i vmware >/dev/null 2>/dev/null +if [ "$?" = "0" ] +then + echo "vmware: YES" + exit 0 +else + echo "vmware: NO" + exit 1 +fi Added: head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,68 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No disk specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" + +get_disk_cyl "${DISK}" +CYLS="${VAL}" + +get_disk_heads "${DISK}" +HEADS="${VAL}" + +get_disk_sectors "${DISK}" +SECS="${VAL}" + +echo "cylinders=${CYLS}" +echo "heads=${HEADS}" +echo "sectors=${SECS}" + +# Now get the disks size in MB +KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +MB=$(convert_byte_to_megabyte ${KB}) +echo "size=$MB" + +# Now get the Controller Type +CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`" +echo "type=$CTYPE" Added: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,60 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Create our device listing +SYSDISK=$(sysctl -n kern.disks) + +# Now loop through these devices, and list the disk drives +for i in ${SYSDISK} +do + + # Get the current device + DEV="${i}" + + # Make sure we don't find any cd devices + case "${DEV}" in + acd[0-9]*|cd[0-9]*|scd[0-9]*) continue ;; + esac + + # Check the dmesg output for some more info about this device + NEWLINE=$(dmesg | sed -n "s/^$DEV: .*<\(.*\)>.*$/ <\1>/p" | head -n 1) + if [ -z "$NEWLINE" ]; then + NEWLINE=" " + fi + + # Save the disk list + if [ ! -z "$DLIST" ] + then + DLIST="\n${DLIST}" + fi + + DLIST="${DEV}:${NEWLINE}${DLIST}" + +done + +# Echo out the found line +echo -e "$DLIST" | sort Added: head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/disk-part.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,119 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Query a disk for partitions and display them +############################# + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/backend/functions-disk.sh + +if [ -z "${1}" ] +then + echo "Error: No disk specified!" + exit 1 +fi + +if [ ! -e "/dev/${1}" ] +then + echo "Error: Disk /dev/${1} does not exist!" + exit 1 +fi + +DISK="${1}" + +# Now get the disks size in MB +KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`" +MB=$(convert_byte_to_megabyte ${KB}) +TOTALSIZE="$MB" +TOTALB="`diskinfo -v ${1} | grep 'in sectors' | tr -s '\t' ' ' | cut -d ' ' -f 2`" + + + +gpart show ${1} >/dev/null 2>/dev/null +if [ "$?" != "0" ] ; then + # No partitions on this disk, display entire disk size and exit + echo "${1}-freemb: ${TOTALSIZE}" + echo "${1}-freeblocks: ${TOTALB}" + exit +fi + +# Display if this is GPT or MBR formatted +gpart show ${1} | grep "GPT" >/dev/null 2>/dev/null +if [ "$?" = "0" ] ; then + echo "${1}-format: GPT" + TYPE="GPT" +else + echo "${1}-format: MBR" + TYPE="MBR" +fi + +# Set some search flags +PART="0" +EXTENDED="0" +START="0" +SIZEB="0" + +# Get a listing of partitions on this disk +get_disk_partitions "${DISK}" +PARTS="${VAL}" +for curpart in $PARTS +do + + # First get the sysid / label for this partition + if [ "$TYPE" = "MBR" ] ; then + get_partition_sysid_mbr "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + get_partition_label_mbr "${DISK}" "${curpart}" + echo "${curpart}-label: ${VAL}" + else + get_partition_label_gpt "${DISK}" "${curpart}" + echo "${curpart}-sysid: ${VAL}" + echo "${curpart}-label: ${VAL}" + fi + + # Now get the startblock, blocksize and MB size of this partition + + get_partition_startblock "${DISK}" "${curpart}" + START="${VAL}" + echo "${curpart}-blockstart: ${START}" + + get_partition_blocksize "${DISK}" "${curpart}" + SIZEB="${VAL}" + echo "${curpart}-blocksize: ${SIZEB}" + + SIZEMB=$(convert_blocks_to_megabyte ${SIZEB}) + echo "${curpart}-sizemb: ${SIZEMB}" + +done + + +# Now calculate any free space +LASTB="`expr $SIZEB + $START`" +FREEB="`expr $TOTALB - $LASTB`" +FREEMB="`expr ${FREEB} / 2048`" +echo "${1}-freemb: $FREEMB" +echo "${1}-freeblocks: $FREEB" Added: head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/enable-net.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,65 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Script which enables networking with specified options +########################################################################### + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/conf/pc-sysinstall.conf +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + + +NIC="$1" +IP="$2" +NETMASK="$3" +DNS="$4" +GATEWAY="$5" +MIRRORFETCH="$6" + +if [ -z "${NIC}" ] +then + echo "ERROR: Usage enable-net " + exit 150 +fi + +if [ "$NIC" = "AUTO-DHCP" ] +then + enable_auto_dhcp +else + echo "Enabling NIC: $NIC" + ifconfig ${NIC} ${IP} ${NETMASK} + + echo "nameserver ${DNS}" >/etc/resolv.conf + + route add default ${GATE} +fi + +case ${MIRRORFETCH} in + ON|on|yes|YES) fetch -o /tmp/mirrors-list.txt ${MIRRORLIST} >/dev/null 2>/dev/null;; + *) ;; +esac Added: head/usr.sbin/pc-sysinstall/backend-query/list-components.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/list-components.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,54 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Script which lists the available components for this release +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +echo "Available Components:" + +cd ${COMPDIR} +for i in `ls -d *` +do + if [ -e "${i}/component.cfg" -a -e "${i}/install.sh" -a -e "${i}/distfiles" ] + then + NAME="`grep 'name:' ${i}/component.cfg | cut -d ':' -f 2`" + DESC="`grep 'description:' ${i}/component.cfg | cut -d ':' -f 2`" + TYPE="`grep 'type:' ${i}/component.cfg | cut -d ':' -f 2`" + echo " " + echo "name: ${i}" + echo "desc:${DESC}" + echo "type:${TYPE}" + if [ -e "${i}/component.png" ] + then + echo "icon: ${COMPDIR}/${i}/component.png" + fi + fi + +done + Added: head/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,70 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Script which lists the backups present on a server +########################################################################### + +. ${PROGDIR}/backend/functions.sh + +SSHUSER=$1 +SSHHOST=$2 +SSHPORT=$3 + +if [ -z "${SSHHOST}" -o -z "${SSHPORT}" ] +then + echo "ERROR: Usage list-rsync-backups.sh " + exit 150 +fi + +# Look for full-system backups, needs at minimum a kernel to be bootable +FINDCMD="find . -type d -maxdepth 6 -name 'kernel' | grep '/boot/kernel'" + +# Get a listing of the number of full backups saved +OLDBACKUPS=`ssh -o 'BatchMode=yes' -p ${SSHPORT} ${SSHUSER}@${SSHHOST} "${FINDCMD}"` +if [ "$?" = "0" ] +then + for i in ${OLDBACKUPS} + do + BACKPATH="`echo ${i} | sed 's|/boot/.*||g' | sed 's|^./||g'`" + if [ -z "${BACKLIST}" ] + then + BACKLIST="${BACKPATH}" + else + BACKLIST="${BACKLIST}:${BACKPATH}" + fi + done + + if [ -z "${BACKLIST}" ] + then + echo "NONE" + else + echo "$BACKLIST" + fi + +else + echo "FAILED" +fi Added: head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,43 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +rm ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +# Backend script which lists all the available timezones for front-ends to display +while read line +do + echo "$line" | grep "^#" >/dev/null 2>/dev/null + if [ "$?" != "0" ] + then + echo "$line" | tr -s "\t" ":" | cut -d ":" -f 3-4 >>${TMPDIR}/.tzonetmp + fi +done < /usr/share/zoneinfo/zone.tab + +sort ${TMPDIR}/.tzonetmp +rm -f ${TMPDIR}/.tzonetmp >/dev/null 2>/dev/null + +exit 0 Added: head/usr.sbin/pc-sysinstall/backend-query/query-langs.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/query-langs.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,32 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +FOUND="0" + +cat ${PROGDIR}/conf/avail-langs + +exit 0 Added: head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/backend-query/send-logs.sh Thu Jun 24 22:21:47 2010 (r209513) @@ -0,0 +1,83 @@ +#!/bin/sh +#- +# Copyright (c) 2010 iX Systems, Inc. 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$ + +# Script which creates a gzipped log and optionally mails it to the specified address +############################################################################ + +. ${PROGDIR}/backend/functions.sh +. ${PROGDIR}/conf/pc-sysinstall.conf +. ${BACKEND}/functions-networking.sh +. ${BACKEND}/functions-parse.sh + +# Bring up all NICS under DHCP +enable_auto_dhcp + +MAILTO="$1" +MAILRESULT="0" + +# Set the location of our compressed log +TMPLOG="/tmp/pc-sysinstall.log" + +echo "# PC-SYSINSTALL LOG" >${TMPLOG} +cat ${LOGOUT} >> ${TMPLOG} + +# Check if we have a GUI generated install cfg +if [ -e "/tmp/sys-install.cfg" ] +then + echo "" >>${TMPLOG} + echo "# PC-SYSINSTALL CFG " >>${TMPLOG} + cat /tmp/sys-install.cfg >> ${TMPLOG} +fi + +# Save dmesg output +echo "" >>${TMPLOG} +echo "# DMESG OUTPUT " >>${TMPLOG} +dmesg >> ${TMPLOG} + +# Get gpart info on all disks +for i in `${PROGDIR}/pc-sysinstall disk-list | cut -d ':' -f 1` +do + echo "" >>${TMPLOG} + echo "# DISK INFO $i " >>${TMPLOG} + ls /dev/${i}* >>${TMPLOG} + gpart show ${i} >> ${TMPLOG} +done + +# Show Mounted volumes +echo "" >>${TMPLOG} +echo "# MOUNT OUTPUT " >>${TMPLOG} +mount >> ${TMPLOG} + +echo "Log file saved to ${TMPLOG}" +echo "Warning: This file will be lost once the system is rebooted." + +echo "Do you wish to view this logfile now? (Y/N)" +read tmp *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 22:29:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8662B1065670; Thu, 24 Jun 2010 22:29:36 +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 75C3C8FC17; Thu, 24 Jun 2010 22:29:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OMTavx019232; Thu, 24 Jun 2010 22:29:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OMTa3I019230; Thu, 24 Jun 2010 22:29:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006242229.o5OMTa3I019230@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 22:29: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: r209514 - head/usr.sbin/pc-sysinstall/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 22:29:36 -0000 Author: imp Date: Thu Jun 24 22:29:36 2010 New Revision: 209514 URL: http://svn.freebsd.org/changeset/base/209514 Log: Remove the license files that svn made me remove at the last second, doh! Modified: head/usr.sbin/pc-sysinstall/conf/Makefile Modified: head/usr.sbin/pc-sysinstall/conf/Makefile ============================================================================== --- head/usr.sbin/pc-sysinstall/conf/Makefile Thu Jun 24 22:21:47 2010 (r209513) +++ head/usr.sbin/pc-sysinstall/conf/Makefile Thu Jun 24 22:29:36 2010 (r209514) @@ -5,8 +5,7 @@ NO_OBJ= FILESGROUPS= CONF LICENSE CONF= exclude-from-upgrade pc-sysinstall.conf avail-langs CONFDIR= ${SHAREDIR}/pc-sysinstall/conf -LICENSE= licenses/bsd-uk.txt licenses/bsd-en.txt licenses/intel-en.txt \ - licenses/bsd-be.txt licenses/bsd-ru.txt licenses/nvidia-en.txt +LICENSE= licenses/bsd-en.txt licenses/intel-en.txt licenses/nvidia-en.txt LICENSEDIR= ${SHAREDIR}/pc-sysinstall/conf/license .include From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 22:33:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E88D4106566B; Thu, 24 Jun 2010 22:33:03 +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 D79D58FC0C; Thu, 24 Jun 2010 22:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OMX3Yg020066; Thu, 24 Jun 2010 22:33:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OMX32Y020065; Thu, 24 Jun 2010 22:33:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006242233.o5OMX32Y020065@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 22:33: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: r209515 - head/usr.sbin/pc-sysinstall/pc-sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 22:33:04 -0000 Author: imp Date: Thu Jun 24 22:33:03 2010 New Revision: 209515 URL: http://svn.freebsd.org/changeset/base/209515 Log: Makefile overlooked in r2095137 Added: head/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile (contents, props changed) Added: head/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/Makefile Thu Jun 24 22:33:03 2010 (r209515) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SCRIPTS=pc-sysinstall.sh +MAN= pc-sysinstall.8 + +.include From owner-svn-src-all@FreeBSD.ORG Thu Jun 24 22:47:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62DF7106564A; Thu, 24 Jun 2010 22:47: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 5233B8FC18; Thu, 24 Jun 2010 22:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5OMloXO023417; Thu, 24 Jun 2010 22:47:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5OMloEX023415; Thu, 24 Jun 2010 22:47:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006242247.o5OMloEX023415@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jun 2010 22:47: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: r209518 - head/usr.sbin/pc-sysinstall/pc-sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jun 2010 22:47:50 -0000 Author: imp Date: Thu Jun 24 22:47:50 2010 New Revision: 209518 URL: http://svn.freebsd.org/changeset/base/209518 Log: Fix a stray PC-BSDism, on FreeBSD, we install these things into /usr/share Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh ============================================================================== --- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Thu Jun 24 22:47:09 2010 (r209517) +++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh Thu Jun 24 22:47:50 2010 (r209518) @@ -36,7 +36,7 @@ # User-editable configuration variables # Set this to the program location -PROGDIR="/PCBSD/pc-sysinstall" +PROGDIR="/usr/share/pc-sysinstall" export PROGDIR # Set this to the components location From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 02:36:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B28851065673; Fri, 25 Jun 2010 02:36:46 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2242E8FC17; Fri, 25 Jun 2010 02:36:45 +0000 (UTC) Received: by qyk10 with SMTP id 10so696329qyk.13 for ; Thu, 24 Jun 2010 19:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=lTr4Ov1yq633qtIQsNoP4Uvl4jSc3fLAULzi11k0Yyk=; b=S0moH3uMvr1G8NGge2fNt/cmJ8do5SWk06PoaU0B7rqNyM668/D3dZqWjip8o6hDsB AtzVgU3jGUCDcN02NvouFuqPDXtXZgjWvhR8Cxje78efkLEI6gq1D6J90cgkpL60jH4z 8Pse01/LFpeoGUNV5/gjro36Dl68ZAGPGewzM= 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=T8GbW6P7zXumsxsERLS7OoAFraJSP/oe9zmfuMg9quLC8IjbDkNW8GohvDFdFEIO08 5CRaj0DJhuT1w7Eiz/zuJW5V0nhFnn+fv6meEYefbpflGc6LQC0jgG2svXRhWwhIwTTX 2tY4f8kGMjOA1qZO2W/m1MrS8dcnhIzDTKsrw= MIME-Version: 1.0 Received: by 10.224.48.85 with SMTP id q21mr4012562qaf.144.1277433404818; Thu, 24 Jun 2010 19:36:44 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Thu, 24 Jun 2010 19:36:44 -0700 (PDT) In-Reply-To: <201006242221.o5OMLljr017477@svn.freebsd.org> References: <201006242221.o5OMLljr017477@svn.freebsd.org> Date: Thu, 24 Jun 2010 19:36:44 -0700 Message-ID: From: Garrett Cooper To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209513 - in head: etc/mtree usr.sbin usr.sbin/pc-sysinstall usr.sbin/pc-sysinstall/backend usr.sbin/pc-sysinstall/backend-partmanager usr.sbin/pc-sysinstall/backend-query usr.sbin/pc-s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 02:36:46 -0000 On Thu, Jun 24, 2010 at 3:21 PM, Warner Losh wrote: > Author: imp > Date: Thu Jun 24 22:21:47 2010 > New Revision: 209513 > URL: http://svn.freebsd.org/changeset/base/209513 > > Log: > =A0Bring in Kris Moore's pc-sysinstall shell script from PC-BSD. =A0This > =A0shell script is the back end logic necessary for an installer. =A0It > =A0contains both query routines to allow a front-end installer to present > =A0reasonable choices to the user and also action routines which allow > =A0the front end installer to put a FreeBSD distribution onto a disk. =A0= It > =A0supports installing onto the usual suspects, as well as advanced > =A0features like Mirroring, ZFS, Encryprion and GPT labels. > > =A0While this is only the back-end of the installer, it can do unattended > =A0scripted installations. =A0In PC-BSD's world view, all installations a= re > =A0scripted and all the front-end does is write the script. =A0As such, i= t > =A0is useful in its own right. > > =A0This has been extensively tested over the past several releases of > =A0PC-BSD. =A0However, differences between that environment and FreeBSD > =A0suggest there will be a period of shake-out while those differences > =A0are discovered and corrected. > > =A0A text-based front-end is in the works. =A0For the GUI-based front-end= , > =A0you can use the PC-BSD distribution. > > =A0Kris' BSDcan paper on pc-sysinstall is linked off his talk on the > =A0BSDcan site: > =A0 =A0 =A0 =A0http://www.bsdcan.org/2010/schedule/events/173.en.html > > =A0The man page is written by Josh Paetzel, and I wrote the Makefiles for > =A0the FreeBSD integration. =A0Kris wrote the rest. > > =A0This represents version r7010 in the PC-BSD repo. > =A0http://svn.pcbsd.org/pcbsd/current/pc-sysinstall > > =A0Submitted by: kris@ > =A0Sponsored by: iX Systems Maybe now would be a good time to introduce build tunables for adding/removing pc-sysinstall and/or sysinstall, like pkg_install has? Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 03:32:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D27D51065674; Fri, 25 Jun 2010 03:32:49 +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 7467A8FC20; Fri, 25 Jun 2010 03:32:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o5P3TGYk015980; Thu, 24 Jun 2010 21:29:16 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 24 Jun 2010 21:29:27 -0600 (MDT) Message-Id: <20100624.212927.80504374683140299.imp@bsdimp.com> To: yanefbsd@gmail.com From: "M. Warner Losh" In-Reply-To: References: <201006242221.o5OMLljr017477@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209513 - in head: etc/mtree usr.sbin usr.sbin/pc-sysinstall usr.sbin/pc-sysinstall/backend usr.sbin/pc-sysinstall/backend-partmanager usr.sbin/pc-sysinstall/backend-query usr.sbin/pc-s... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 03:32:49 -0000 In message: Garrett Cooper writes: : On Thu, Jun 24, 2010 at 3:21 PM, Warner Losh wrote:= : > Author: imp : > Date: Thu Jun 24 22:21:47 2010 : > New Revision: 209513 : > URL: http://svn.freebsd.org/changeset/base/209513 : > : > Log: : > =A0Bring in Kris Moore's pc-sysinstall shell script from PC-BSD. =A0= This : > =A0shell script is the back end logic necessary for an installer. =A0= It : > =A0contains both query routines to allow a front-end installer to p= resent : > =A0reasonable choices to the user and also action routines which al= low : > =A0the front end installer to put a FreeBSD distribution onto a dis= k. =A0It : > =A0supports installing onto the usual suspects, as well as advanced= : > =A0features like Mirroring, ZFS, Encryprion and GPT labels. : > : > =A0While this is only the back-end of the installer, it can do unat= tended : > =A0scripted installations. =A0In PC-BSD's world view, all installat= ions are : > =A0scripted and all the front-end does is write the script. =A0As s= uch, it : > =A0is useful in its own right. : > : > =A0This has been extensively tested over the past several releases = of : > =A0PC-BSD. =A0However, differences between that environment and Fre= eBSD : > =A0suggest there will be a period of shake-out while those differen= ces : > =A0are discovered and corrected. : > : > =A0A text-based front-end is in the works. =A0For the GUI-based fro= nt-end, : > =A0you can use the PC-BSD distribution. : > : > =A0Kris' BSDcan paper on pc-sysinstall is linked off his talk on th= e : > =A0BSDcan site: : > =A0 =A0 =A0 =A0http://www.bsdcan.org/2010/schedule/events/173.en.ht= ml : > : > =A0The man page is written by Josh Paetzel, and I wrote the Makefil= es for : > =A0the FreeBSD integration. =A0Kris wrote the rest. : > : > =A0This represents version r7010 in the PC-BSD repo. : > =A0http://svn.pcbsd.org/pcbsd/current/pc-sysinstall : > : > =A0Submitted by: kris@ : > =A0Sponsored by: iX Systems : = : Maybe now would be a good time to introduce build tunables for : adding/removing pc-sysinstall and/or sysinstall, like pkg_install has= ? I think that would be somewhat premature. Warner From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 05:07:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D933E1065674; Fri, 25 Jun 2010 05:07:42 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C81A58FC14; Fri, 25 Jun 2010 05:07:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5P57ghJ006807; Fri, 25 Jun 2010 05:07:42 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5P57ge1006804; Fri, 25 Jun 2010 05:07:42 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006250507.o5P57ge1006804@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 25 Jun 2010 05:07: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: r209520 - head/gnu/usr.bin/binutils/ld X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 05:07:42 -0000 Author: jchandra Date: Fri Jun 25 05:07:42 2010 New Revision: 209520 URL: http://svn.freebsd.org/changeset/base/209520 Log: Add an alignment of 8 for sections in the n32 ABI. The default alignment of of 4 causes _end to be word aligned, which will be returned by sbrk. malloc(3), when compiled for n32, expects sbrk to return an 8-byte aligned value. Approved by: rrs (mentor) Modified: head/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh head/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh Modified: head/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh ============================================================================== --- head/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh Fri Jun 25 01:03:10 2010 (r209519) +++ head/gnu/usr.bin/binutils/ld/elf32btsmipn32_fbsd.sh Fri Jun 25 05:07:42 2010 (r209520) @@ -2,3 +2,4 @@ . ${srcdir}/emulparams/elf32btsmipn32.sh . ${srcdir}/emulparams/elf_fbsd.sh GENERATE_PIE_SCRIPT=yes +ALIGNMENT=8 Modified: head/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh ============================================================================== --- head/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh Fri Jun 25 01:03:10 2010 (r209519) +++ head/gnu/usr.bin/binutils/ld/elf32ltsmipn32_fbsd.sh Fri Jun 25 05:07:42 2010 (r209520) @@ -2,3 +2,4 @@ . ${srcdir}/emulparams/elf32ltsmipn32.sh . ${srcdir}/emulparams/elf_fbsd.sh GENERATE_PIE_SCRIPT=yes +ALIGNMENT=8 From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 05:36:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0601106566C; Fri, 25 Jun 2010 05:36:36 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58EDC8FC17; Fri, 25 Jun 2010 05:36:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5P5aaqa013181; Fri, 25 Jun 2010 05:36:36 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5P5aagT013178; Fri, 25 Jun 2010 05:36:36 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201006250536.o5P5aagT013178@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 25 Jun 2010 05:36: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: r209521 - head/lib/libc/mips/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 05:36:36 -0000 Author: jchandra Date: Fri Jun 25 05:36:36 2010 New Revision: 209521 URL: http://svn.freebsd.org/changeset/base/209521 Log: use PTR_WORD for __curbrk and minbrk instead of .word, the new version wil support all ABIs. Approved by: rrs (mentor) Modified: head/lib/libc/mips/sys/brk.S head/lib/libc/mips/sys/sbrk.S Modified: head/lib/libc/mips/sys/brk.S ============================================================================== --- head/lib/libc/mips/sys/brk.S Fri Jun 25 05:07:42 2010 (r209520) +++ head/lib/libc/mips/sys/brk.S Fri Jun 25 05:36:36 2010 (r209521) @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); .data _C_LABEL(minbrk): - .word _C_LABEL(_end) + PTR_WORD _C_LABEL(_end) .text LEAF(__sys_brk) Modified: head/lib/libc/mips/sys/sbrk.S ============================================================================== --- head/lib/libc/mips/sys/sbrk.S Fri Jun 25 05:07:42 2010 (r209520) +++ head/lib/libc/mips/sys/sbrk.S Fri Jun 25 05:36:36 2010 (r209521) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); .data _C_LABEL(__curbrk): - .word _C_LABEL(_end) + PTR_WORD _C_LABEL(_end) .text LEAF(__sys_sbrk) From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 08:53:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DAFF1065678; Fri, 25 Jun 2010 08:53:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BCB18FC15; Fri, 25 Jun 2010 08:53:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5P8rpPs056435; Fri, 25 Jun 2010 08:53:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5P8rptS056432; Fri, 25 Jun 2010 08:53:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201006250853.o5P8rptS056432@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 25 Jun 2010 08:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209522 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 08:53:52 -0000 Author: ae Date: Fri Jun 25 08:53:51 2010 New Revision: 209522 URL: http://svn.freebsd.org/changeset/base/209522 Log: MFC r200539 (by rpaulo): Add Microsoft and NetBSD partition types handling. Approved by: kib (mentor) Modified: stable/8/sys/geom/part/g_part.c stable/8/sys/geom/part/g_part.h stable/8/sys/geom/part/g_part_gpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Fri Jun 25 05:36:36 2010 (r209521) +++ stable/8/sys/geom/part/g_part.c Fri Jun 25 08:53:51 2010 (r209522) @@ -87,6 +87,16 @@ struct g_part_alias_list { { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, { "linux-raid", G_PART_ALIAS_LINUX_RAID }, { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, + { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA }, + { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA }, + { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA }, + { "ms-reserved", G_PART_ALIAS_MS_RESERVED }, + { "netbsd-ccd", G_PART_ALIAS_NETBSD_CCD }, + { "netbsd-cgd", G_PART_ALIAS_NETBSD_CGD }, + { "netbsd-ffs", G_PART_ALIAS_NETBSD_FFS }, + { "netbsd-lfs", G_PART_ALIAS_NETBSD_LFS }, + { "netbsd-raid", G_PART_ALIAS_NETBSD_RAID }, + { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, { "mbr", G_PART_ALIAS_MBR } }; Modified: stable/8/sys/geom/part/g_part.h ============================================================================== --- stable/8/sys/geom/part/g_part.h Fri Jun 25 05:36:36 2010 (r209521) +++ stable/8/sys/geom/part/g_part.h Fri Jun 25 08:53:51 2010 (r209522) @@ -55,6 +55,16 @@ enum g_part_alias { G_PART_ALIAS_LINUX_LVM, /* A Linux LVM partition entry. */ G_PART_ALIAS_LINUX_RAID, /* A Linux RAID partition entry. */ G_PART_ALIAS_LINUX_SWAP, /* A Linux swap partition entry. */ + G_PART_ALIAS_MS_BASIC_DATA, /* A Microsoft Data part. entry. */ + G_PART_ALIAS_MS_LDM_DATA, /* A Microsoft LDM Data part. entry. */ + G_PART_ALIAS_MS_LDM_METADATA, /* A Microsoft LDM Metadata entry. */ + G_PART_ALIAS_MS_RESERVED, /* A Microsoft Reserved part. entry. */ + G_PART_ALIAS_NETBSD_CCD, /* A NetBSD CCD partition entry. */ + G_PART_ALIAS_NETBSD_CGD, /* A NetBSD CGD partition entry. */ + G_PART_ALIAS_NETBSD_FFS, /* A NetBSD FFS partition entry. */ + G_PART_ALIAS_NETBSD_RAID, /* A NetBSD RAID partition entry. */ + G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ + G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: stable/8/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/8/sys/geom/part/g_part_gpt.c Fri Jun 25 05:36:36 2010 (r209521) +++ stable/8/sys/geom/part/g_part_gpt.c Fri Jun 25 08:53:51 2010 (r209522) @@ -152,6 +152,16 @@ static struct uuid gpt_uuid_linux_data = static struct uuid gpt_uuid_linux_lvm = GPT_ENT_TYPE_LINUX_LVM; static struct uuid gpt_uuid_linux_raid = GPT_ENT_TYPE_LINUX_RAID; static struct uuid gpt_uuid_linux_swap = GPT_ENT_TYPE_LINUX_SWAP; +static struct uuid gpt_uuid_ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static struct uuid gpt_uuid_ms_reserved = GPT_ENT_TYPE_MS_RESERVED; +static struct uuid gpt_uuid_ms_ldm_data = GPT_ENT_TYPE_MS_LDM_DATA; +static struct uuid gpt_uuid_ms_ldm_metadata = GPT_ENT_TYPE_MS_LDM_METADATA; +static struct uuid gpt_uuid_netbsd_ccd = GPT_ENT_TYPE_NETBSD_CCD; +static struct uuid gpt_uuid_netbsd_cgd = GPT_ENT_TYPE_NETBSD_CGD; +static struct uuid gpt_uuid_netbsd_ffs = GPT_ENT_TYPE_NETBSD_FFS; +static struct uuid gpt_uuid_netbsd_lfs = GPT_ENT_TYPE_NETBSD_LFS; +static struct uuid gpt_uuid_netbsd_raid = GPT_ENT_TYPE_NETBSD_RAID; +static struct uuid gpt_uuid_netbsd_swap = GPT_ENT_TYPE_NETBSD_SWAP; static struct uuid gpt_uuid_mbr = GPT_ENT_TYPE_MBR; static struct uuid gpt_uuid_unused = GPT_ENT_TYPE_UNUSED; @@ -178,6 +188,17 @@ static struct g_part_uuid_alias { { &gpt_uuid_linux_raid, G_PART_ALIAS_LINUX_RAID }, { &gpt_uuid_linux_swap, G_PART_ALIAS_LINUX_SWAP }, { &gpt_uuid_mbr, G_PART_ALIAS_MBR }, + { &gpt_uuid_ms_basic_data, G_PART_ALIAS_MS_BASIC_DATA }, + { &gpt_uuid_ms_ldm_data, G_PART_ALIAS_MS_LDM_DATA }, + { &gpt_uuid_ms_ldm_metadata, G_PART_ALIAS_MS_LDM_METADATA }, + { &gpt_uuid_ms_reserved, G_PART_ALIAS_MS_RESERVED }, + { &gpt_uuid_netbsd_ccd, G_PART_ALIAS_NETBSD_CCD }, + { &gpt_uuid_netbsd_cgd, G_PART_ALIAS_NETBSD_CGD }, + { &gpt_uuid_netbsd_ffs, G_PART_ALIAS_NETBSD_FFS }, + { &gpt_uuid_netbsd_lfs, G_PART_ALIAS_NETBSD_LFS }, + { &gpt_uuid_netbsd_raid, G_PART_ALIAS_NETBSD_RAID }, + { &gpt_uuid_netbsd_swap, G_PART_ALIAS_NETBSD_SWAP }, + { NULL, 0 } }; From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 15:32:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA81C106566B; Fri, 25 Jun 2010 15:32:46 +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 C64AC8FC13; Fri, 25 Jun 2010 15:32:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5PFWkpd045678; Fri, 25 Jun 2010 15:32:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5PFWkmi045670; Fri, 25 Jun 2010 15:32:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006251532.o5PFWkmi045670@svn.freebsd.org> From: Rui Paulo Date: Fri, 25 Jun 2010 15:32: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: r209523 - in head: share/man/man4 sys/conf sys/dev/acpi_support sys/i386/conf sys/modules/acpi sys/modules/acpi/aibs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 15:32:47 -0000 Author: rpaulo Date: Fri Jun 25 15:32:46 2010 New Revision: 209523 URL: http://svn.freebsd.org/changeset/base/209523 Log: Import the acpi_aibs(4) driver written by Constantine A. Murenin. It has more features than acpi_aiboost(4) and it will eventually replace acpi_aiboost(4). Submitted by: Constantine A. Murenin Reviewed by: freebsd-acpi, imp MFC after: 1 month Added: head/share/man/man4/aibs.4 (contents, props changed) head/sys/dev/acpi_support/atk0110.c (contents, props changed) head/sys/modules/acpi/aibs/ head/sys/modules/acpi/aibs/Makefile (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/acpi/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Jun 25 08:53:51 2010 (r209522) +++ head/share/man/man4/Makefile Fri Jun 25 15:32:46 2010 (r209523) @@ -26,6 +26,7 @@ MAN= aac.4 \ ahc.4 \ ahci.4 \ ahd.4 \ + ${_aibs.4} \ aio.4 \ alc.4 \ ale.4 \ @@ -633,6 +634,7 @@ _acpi_panasonic.4=acpi_panasonic.4 _acpi_sony.4= acpi_sony.4 _acpi_toshiba.4=acpi_toshiba.4 _acpi_wmi.4= acpi_wmi.4 +_aibs.4= aibs.4 _amdsbwd.4= amdsbwd.4 _amdsmb.4= amdsmb.4 _amdtemp.4= amdtemp.4 Added: head/share/man/man4/aibs.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/aibs.4 Fri Jun 25 15:32:46 2010 (r209523) @@ -0,0 +1,209 @@ +.\" $FreeBSD$ +.\" $NetBSD: aibs.4,v 1.2 2010/02/09 05:37:25 cnst Exp $ +.\" $OpenBSD: aibs.4,v 1.4 2009/07/30 06:30:45 jmc Exp $ +.\" +.\" Copyright (c) 2009/2010 Constantine A. Murenin +.\" +.\" 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. +.\" +.Dd April 4, 2010 +.Dt AIBS 4 +.Os +.Sh NAME +.Nm aibs +.Nd "ASUSTeK AI Booster ACPI ATK0110 voltage, temperature and fan sensor" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device acpi" +.Cd "device aibs" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following lines in +.Xr loader.conf 5 : +.Bd -literal -offset indent +acpi_load="YES" +aibs_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the voltage, temperature and fan sensors +available through the +.Tn ATK0110 +.Tn ASOC +.Tn ACPI +device +on +.Tn ASUSTeK +motherboards. +The number of sensors of each type, +as well as the description of each sensor, +varies according to the motherboard. +.Pp +The driver supports an arbitrary set of sensors, +provides descriptions regarding what each sensor is used for, +and reports the current values as well as +the supposed range specifications of each sensor's input +as defined by the motherboard manufacturer through +.Tn ACPI . +.Pp +The range specifications are as follows: +.Bl -bullet +.It +Voltage sensors have a lower and an upper range specification. +.It +Temperature sensors have two upper specifications. +.It +Fan sensors may either have only the lower specification, +or, depending on the +.Tn DSDT , +one lower and one upper specification. +.El +.Pp +Sensor readings and the range specifications are made available through the +.Xr sysctl 3 +interface, +and can be monitored with +.Xr sysctl 8 . +For example, on an ASUS V3-P5G965 barebone: +.Bd -literal -offset indent +> sysctl dev.aibs.0.{volt,temp,fan} +dev.aibs.0.volt.0: 1192 850 1600 +dev.aibs.0.volt.1: 3312 2970 3630 +dev.aibs.0.volt.2: 5017 4500 5500 +dev.aibs.0.volt.3: 12302 10200 13800 +dev.aibs.0.temp.0: 28.0C 80.0C 95.0C +dev.aibs.0.temp.1: 55.0C 60.0C 95.0C +dev.aibs.0.fan.0: 878 600 7200 +dev.aibs.0.fan.1: 0 700 7200 +.Pp +> sysctl -d dev.aibs.0.{volt,temp,fan} +dev.aibs.0.volt: +dev.aibs.0.volt.0: Vcore Voltage +dev.aibs.0.volt.1: +3.3 Voltage +dev.aibs.0.volt.2: +5 Voltage +dev.aibs.0.volt.3: +12 Voltage +dev.aibs.0.temp: +dev.aibs.0.temp.0: CPU Temperature +dev.aibs.0.temp.1: MB Temperature +dev.aibs.0.fan: +dev.aibs.0.fan.0: CPU FAN Speed +dev.aibs.0.fan.1: CHASSIS FAN Speed +.Ed +.Pp +Generally, sensors provided by the +.Nm +driver may also be supported by certain other drivers or utilities +that access the +.Tn ISA / +.Tn LPC +or +.Tn I2C / +.Tn SMBus +devices directly. +The precise collection of +.Nm +sensors is comprised of the sensors +specifically utilised in the motherboard +design, which may be supported through +a combination of one or more physical hardware monitoring chips. +.Pp +The +.Nm +driver, however, provides the following advantages +when compared to the native hardware monitoring drivers or other utilities: +.Bl -bullet +.It +Sensor values from +.Nm +are expected to be more reliable. +For example, voltage sensors in many hardware monitoring chips +can only sense voltage from 0 to 2 or 4 volts, and the excessive +voltage is removed by the resistors, which may vary with the motherboard +and with the voltage that is being sensed. +In +.Nm , +the required resistor factors are provided by +the motherboard manufacturer through +.Tn ACPI ; +in the native drivers, the resistor factors +are encoded into the driver based on the chip manufacturer's recommendations. +In essence, sensor values from +.Nm +are very likely to be identical to the readings from the +Hardware Monitor screen in the BIOS. +.It +Sensor descriptions from +.Nm +are more likely to match the markings on the motherboard. +.It +Sensor range specifications are supported by +.Nm . +The range specification is reported +for each individual sensor as suggested by the motherboard manufacturer. +For example, the threshold for the CPU temperature sensor is likely +to be significantly higher than that for the chassis temperature sensor. +.It +Support for newer chips in +.Nm . +Newer chips may miss a native driver, +but should be supported through +.Nm +regardless. +.El +.Sh SEE ALSO +.Xr sysctl 3 , +.Xr acpi 4 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Ox 4.7 , +.Dx 2.5 , +.Nx 6.0 +and +.Fx 9.0 . +.Pp +An earlier version of the driver, +.Nm acpi_aiboost , +first appeared in +.Fx 7.0 +and +.Nx 5.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written for +.Ox , +.Dx , +.Nx +and +.Fx +by +.An Constantine A. Murenin Aq cnst@FreeBSD.org , +Raouf Boutaba Research Group, +David R. Cheriton School of Computer Science, +University of Waterloo. +.Pp +An earlier version of the driver, named +.Nm acpi_aiboost , +was written for +.Fx +by +.An Takanori Watanabe . Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Jun 25 08:53:51 2010 (r209522) +++ head/sys/conf/files Fri Jun 25 15:32:46 2010 (r209523) @@ -436,6 +436,7 @@ dev/acpi_support/acpi_ibm.c optional acp dev/acpi_support/acpi_panasonic.c optional acpi_panasonic acpi dev/acpi_support/acpi_sony.c optional acpi_sony acpi dev/acpi_support/acpi_toshiba.c optional acpi_toshiba acpi +dev/acpi_support/atk0110.c optional aibs acpi dev/acpica/Osd/OsdDebug.c optional acpi dev/acpica/Osd/OsdHardware.c optional acpi dev/acpica/Osd/OsdInterrupt.c optional acpi Added: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/acpi_support/atk0110.c Fri Jun 25 15:32:46 2010 (r209523) @@ -0,0 +1,358 @@ +/* $NetBSD: atk0110.c,v 1.4 2010/02/11 06:54:57 cnst Exp $ */ +/* $OpenBSD: atk0110.c,v 1.1 2009/07/23 01:38:16 cnst Exp $ */ + +/* + * Copyright (c) 2009, 2010 Constantine A. Murenin + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +/* + * ASUSTeK AI Booster (ACPI ASOC ATK0110). + * + * This code was originally written for OpenBSD after the techniques + * described in the Linux's asus_atk0110.c and FreeBSD's Takanori Watanabe's + * acpi_aiboost.c were verified to be accurate on the actual hardware kindly + * provided by Sam Fourman Jr. It was subsequently ported from OpenBSD to + * DragonFly BSD, to NetBSD's sysmon_envsys(9) and to FreeBSD's sysctl(9). + * + * -- Constantine A. Murenin + */ + +#define _COMPONENT ACPI_OEM +ACPI_MODULE_NAME("aibs"); +ACPI_SERIAL_DECL(aibs, "aibs"); + +#define AIBS_MORE_SENSORS +#define AIBS_VERBOSE + +enum aibs_type { + AIBS_VOLT, + AIBS_TEMP, + AIBS_FAN +}; + +struct aibs_sensor { + ACPI_INTEGER v; + ACPI_INTEGER i; + ACPI_INTEGER l; + ACPI_INTEGER h; + enum aibs_type t; +}; + +struct aibs_softc { + struct device *sc_dev; + ACPI_HANDLE sc_ah; + + struct aibs_sensor *sc_asens_volt; + struct aibs_sensor *sc_asens_temp; + struct aibs_sensor *sc_asens_fan; +}; + +static int aibs_probe(device_t); +static int aibs_attach(device_t); +static int aibs_detach(device_t); +static int aibs_sysctl(SYSCTL_HANDLER_ARGS); + +static void aibs_attach_sif(struct aibs_softc *, enum aibs_type); + +static device_method_t aibs_methods[] = { + DEVMETHOD(device_probe, aibs_probe), + DEVMETHOD(device_attach, aibs_attach), + DEVMETHOD(device_detach, aibs_detach), + { NULL, NULL } +}; + +static driver_t aibs_driver = { + "aibs", + aibs_methods, + sizeof(struct aibs_softc) +}; + +static devclass_t aibs_devclass; + +DRIVER_MODULE(aibs, acpi, aibs_driver, aibs_devclass, NULL, NULL); + + +static char* aibs_hids[] = { + "ATK0110", + NULL +}; + +static int +aibs_probe(device_t dev) +{ + if (acpi_disabled("aibs") || + ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids) == NULL) + return ENXIO; + + device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)"); + return 0; +} + +static int +aibs_attach(device_t dev) +{ + struct aibs_softc *sc = device_get_softc(dev); + + sc->sc_dev = dev; + sc->sc_ah = acpi_get_handle(dev); + + aibs_attach_sif(sc, AIBS_VOLT); + aibs_attach_sif(sc, AIBS_TEMP); + aibs_attach_sif(sc, AIBS_FAN); + + return 0; +} + +static void +aibs_attach_sif(struct aibs_softc *sc, enum aibs_type st) +{ + ACPI_STATUS s; + ACPI_BUFFER b; + ACPI_OBJECT *bp, *o; + int i, n; + const char *node; + char name[] = "?SIF"; + struct aibs_sensor *as; + struct sysctl_oid *so; + + switch (st) { + case AIBS_VOLT: + node = "volt"; + name[0] = 'V'; + break; + case AIBS_TEMP: + node = "temp"; + name[0] = 'T'; + break; + case AIBS_FAN: + node = "fan"; + name[0] = 'F'; + break; + default: + return; + } + + b.Length = ACPI_ALLOCATE_BUFFER; + s = AcpiEvaluateObjectTyped(sc->sc_ah, name, NULL, &b, + ACPI_TYPE_PACKAGE); + if (ACPI_FAILURE(s)) { + device_printf(sc->sc_dev, "%s not found\n", name); + return; + } + + bp = b.Pointer; + o = bp->Package.Elements; + if (o[0].Type != ACPI_TYPE_INTEGER) { + device_printf(sc->sc_dev, "%s[0]: invalid type\n", name); + AcpiOsFree(b.Pointer); + return; + } + + n = o[0].Integer.Value; + if (bp->Package.Count - 1 < n) { + device_printf(sc->sc_dev, "%s: invalid package\n", name); + AcpiOsFree(b.Pointer); + return; + } else if (bp->Package.Count - 1 > n) { + int on = n; + +#ifdef AIBS_MORE_SENSORS + n = bp->Package.Count - 1; +#endif + device_printf(sc->sc_dev, "%s: malformed package: %i/%i" + ", assume %i\n", name, on, bp->Package.Count - 1, n); + } + if (n < 1) { + device_printf(sc->sc_dev, "%s: no members in the package\n", + name); + AcpiOsFree(b.Pointer); + return; + } + + as = malloc(sizeof(*as) * n, M_DEVBUF, M_NOWAIT | M_ZERO); + if (as == NULL) { + device_printf(sc->sc_dev, "%s: malloc fail\n", name); + AcpiOsFree(b.Pointer); + return; + } + switch (st) { + case AIBS_VOLT: + sc->sc_asens_volt = as; + break; + case AIBS_TEMP: + sc->sc_asens_temp = as; + break; + case AIBS_FAN: + sc->sc_asens_fan = as; + break; + } + + /* sysctl subtree for sensors of this type */ + so = SYSCTL_ADD_NODE(device_get_sysctl_ctx(sc->sc_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->sc_dev)), st, + node, CTLFLAG_RD, NULL, NULL); + + for (i = 0, o++; i < n; i++, o++) { + ACPI_OBJECT *oi; + char si[3]; + const char *desc; + + /* acpica5 automatically evaluates the referenced package */ + if (o[0].Type != ACPI_TYPE_PACKAGE) { + device_printf(sc->sc_dev, + "%s: %i: not a package: %i type\n", + name, i, o[0].Type); + continue; + } + oi = o[0].Package.Elements; + if (o[0].Package.Count != 5 || + oi[0].Type != ACPI_TYPE_INTEGER || + oi[1].Type != ACPI_TYPE_STRING || + oi[2].Type != ACPI_TYPE_INTEGER || + oi[3].Type != ACPI_TYPE_INTEGER || + oi[4].Type != ACPI_TYPE_INTEGER) { + device_printf(sc->sc_dev, + "%s: %i: invalid package\n", + name, i); + continue; + } + as[i].i = oi[0].Integer.Value; + desc = oi[1].String.Pointer; + as[i].l = oi[2].Integer.Value; + as[i].h = oi[3].Integer.Value; + as[i].t = st; +#ifdef AIBS_VERBOSE + device_printf(sc->sc_dev, "%c%i: " + "0x%08"PRIx64" %20s %5"PRIi64" / %5"PRIi64" " + "0x%"PRIx64"\n", + name[0], i, + as[i].i, desc, (int64_t)as[i].l, (int64_t)as[i].h, + oi[4].Integer.Value); +#endif + snprintf(si, sizeof(si), "%i", i); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->sc_dev), + SYSCTL_CHILDREN(so), i, si, CTLTYPE_OPAQUE | CTLFLAG_RD, + sc, st, aibs_sysctl, st == AIBS_TEMP ? "IK" : "I", desc); + } + + AcpiOsFree(b.Pointer); +} + +static int +aibs_detach(device_t dev) +{ + struct aibs_softc *sc = device_get_softc(dev); + + if (sc->sc_asens_volt != NULL) + free(sc->sc_asens_volt, M_DEVBUF); + if (sc->sc_asens_temp != NULL) + free(sc->sc_asens_temp, M_DEVBUF); + if (sc->sc_asens_fan != NULL) + free(sc->sc_asens_fan, M_DEVBUF); + return 0; +} + +#ifdef AIBS_VERBOSE +#define ddevice_printf(x...) device_printf(x) +#else +#define ddevice_printf(x...) +#endif + +static int +aibs_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct aibs_softc *sc = arg1; + enum aibs_type st = arg2; + int i = oidp->oid_number; + ACPI_STATUS rs; + ACPI_OBJECT p, *bp; + ACPI_OBJECT_LIST mp; + ACPI_BUFFER b; + char *name; + struct aibs_sensor *as; + ACPI_INTEGER v, l, h; + int so[3]; + + switch (st) { + case AIBS_VOLT: + name = "RVLT"; + as = sc->sc_asens_volt; + break; + case AIBS_TEMP: + name = "RTMP"; + as = sc->sc_asens_temp; + break; + case AIBS_FAN: + name = "RFAN"; + as = sc->sc_asens_fan; + break; + default: + return ENOENT; + } + if (as == NULL) + return ENOENT; + l = as[i].l; + h = as[i].h; + p.Type = ACPI_TYPE_INTEGER; + p.Integer.Value = as[i].i; + mp.Count = 1; + mp.Pointer = &p; + b.Length = ACPI_ALLOCATE_BUFFER; + ACPI_SERIAL_BEGIN(aibs); + rs = AcpiEvaluateObjectTyped(sc->sc_ah, name, &mp, &b, + ACPI_TYPE_INTEGER); + if (ACPI_FAILURE(rs)) { + ddevice_printf(sc->sc_dev, + "%s: %i: evaluation failed\n", + name, i); + ACPI_SERIAL_END(aibs); + return EIO; + } + bp = b.Pointer; + v = bp->Integer.Value; + AcpiOsFree(b.Pointer); + ACPI_SERIAL_END(aibs); + + switch (st) { + case AIBS_VOLT: + break; + case AIBS_TEMP: + v += 2732; + l += 2732; + h += 2732; + break; + case AIBS_FAN: + break; + } + so[0] = v; + so[1] = l; + so[2] = h; + return sysctl_handle_opaque(oidp, &so, sizeof(so), req); +} Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Jun 25 08:53:51 2010 (r209522) +++ head/sys/i386/conf/NOTES Fri Jun 25 15:32:46 2010 (r209523) @@ -512,6 +512,9 @@ device acpi_video # ACPI Docking Station device acpi_dock +# ACPI ASOC ATK0110 ASUSTeK AI Booster (voltage, temperature and fan sensors) +device aibs + # The cpufreq(4) driver provides support for non-ACPI CPU frequency control device cpufreq Modified: head/sys/modules/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/Makefile Fri Jun 25 08:53:51 2010 (r209522) +++ head/sys/modules/acpi/Makefile Fri Jun 25 15:32:46 2010 (r209523) @@ -6,6 +6,6 @@ SUBDIR= acpi SUBDIR+= acpi_aiboost acpi_asus acpi_fujitsu acpi_hp acpi_ibm \ acpi_panasonic acpi_sony acpi_toshiba acpi_video \ - acpi_dock acpi_wmi + acpi_dock acpi_wmi aibs .include Added: head/sys/modules/acpi/aibs/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/acpi/aibs/Makefile Fri Jun 25 15:32:46 2010 (r209523) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/acpi_support + +KMOD= aibs +SRCS= atk0110.c +SRCS+= opt_acpi.h acpi_if.h bus_if.h device_if.h +SRCS+= opt_ddb.h + +.include From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 15:35:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BC841065674; Fri, 25 Jun 2010 15:35:26 +0000 (UTC) (envelope-from rpaulo@lavabit.com) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id EB29B8FC1A; Fri, 25 Jun 2010 15:35:25 +0000 (UTC) Received: from e.earth.lavabit.com (e.earth.lavabit.com [192.168.111.14]) by karen.lavabit.com (Postfix) with ESMTP id B4FA818F3C9; Fri, 25 Jun 2010 10:35:20 -0500 (CDT) Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by lavabit.com with ESMTP id UOBOQIA1UMOA; Fri, 25 Jun 2010 10:35:18 -0500 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=EueMVW+VFNvHGaQwys6i/DBboMmV06AqMr1TTJw2Nx98oqKLMOntuB/CjGh1Ur9oYPl1XpEg+7KB5gsY7KDcjmAhexHT2HerMlyq3PJAll6/fi9H3YQo9vLxWtR1ZV2sfeijYECh8TTqwFFUtI9GMlS1t2TUWxbXaUEu6ybFw8s=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1081) From: Rui Paulo In-Reply-To: <201006251532.o5PFWkmi045670@svn.freebsd.org> Date: Fri, 25 Jun 2010 16:35:15 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201006251532.o5PFWkmi045670@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.1081) Cc: Subject: Re: svn commit: r209523 - in head: share/man/man4 sys/conf sys/dev/acpi_support sys/i386/conf sys/modules/acpi sys/modules/acpi/aibs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 15:35:26 -0000 On 25 Jun 2010, at 16:32, Rui Paulo wrote: > Author: rpaulo > Date: Fri Jun 25 15:32:46 2010 > New Revision: 209523 > URL: http://svn.freebsd.org/changeset/base/209523 > > Log: > Import the acpi_aibs(4) driver written by Constantine A. Murenin. > It has more features than acpi_aiboost(4) and it will eventually replace > acpi_aiboost(4). > > Submitted by: Constantine A. Murenin > Reviewed by: freebsd-acpi, imp > MFC after: 1 month I plan to remove acpi_aiboost(4) in 1 month. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 21:26:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D9141065672; Fri, 25 Jun 2010 21:26:34 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AFE38FC13; Fri, 25 Jun 2010 21:26:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5PLQYkB023552; Fri, 25 Jun 2010 21:26:34 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5PLQYwb023543; Fri, 25 Jun 2010 21:26:34 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201006252126.o5PLQYwb023543@svn.freebsd.org> From: Qing Li Date: Fri, 25 Jun 2010 21:26:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209524 - in releng/8.1/sys: net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 21:26:34 -0000 Author: qingli Date: Fri Jun 25 21:26:34 2010 New Revision: 209524 URL: http://svn.freebsd.org/changeset/base/209524 Log: MFC r208553 This patch fixes the problem where proxy ARP entries cannot be added over the if_ng interface. Approved by: re (bz) Modified: releng/8.1/sys/net/if.c releng/8.1/sys/net/if_var.h releng/8.1/sys/net/route.c releng/8.1/sys/net/rtsock.c releng/8.1/sys/netinet/in.c releng/8.1/sys/netinet/in_pcb.c releng/8.1/sys/netinet/ip_options.c releng/8.1/sys/netinet/ip_output.c Directory Properties: releng/8.1/sys/ (props changed) releng/8.1/sys/amd64/include/xen/ (props changed) releng/8.1/sys/cddl/contrib/opensolaris/ (props changed) releng/8.1/sys/contrib/dev/acpica/ (props changed) releng/8.1/sys/contrib/pf/ (props changed) releng/8.1/sys/dev/ixgbe/ (props changed) releng/8.1/sys/dev/xen/xenpci/ (props changed) releng/8.1/sys/geom/sched/ (props changed) Modified: releng/8.1/sys/net/if.c ============================================================================== --- releng/8.1/sys/net/if.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/net/if.c Fri Jun 25 21:26:34 2010 (r209524) @@ -1636,7 +1636,7 @@ done: * is most specific found. */ struct ifaddr * -ifa_ifwithnet(struct sockaddr *addr) +ifa_ifwithnet(struct sockaddr *addr, int ignore_ptp) { struct ifnet *ifp; struct ifaddr *ifa; @@ -1668,7 +1668,8 @@ ifa_ifwithnet(struct sockaddr *addr) if (ifa->ifa_addr->sa_family != af) next: continue; - if (af == AF_INET && ifp->if_flags & IFF_POINTOPOINT) { + if (af == AF_INET && + ifp->if_flags & IFF_POINTOPOINT && !ignore_ptp) { /* * This is a bit broken as it doesn't * take into account that the remote end may Modified: releng/8.1/sys/net/if_var.h ============================================================================== --- releng/8.1/sys/net/if_var.h Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/net/if_var.h Fri Jun 25 21:26:34 2010 (r209524) @@ -875,7 +875,7 @@ struct ifaddr *ifa_ifwithaddr(struct soc int ifa_ifwithaddr_check(struct sockaddr *); struct ifaddr *ifa_ifwithbroadaddr(struct sockaddr *); struct ifaddr *ifa_ifwithdstaddr(struct sockaddr *); -struct ifaddr *ifa_ifwithnet(struct sockaddr *); +struct ifaddr *ifa_ifwithnet(struct sockaddr *, int); struct ifaddr *ifa_ifwithroute(int, struct sockaddr *, struct sockaddr *); struct ifaddr *ifa_ifwithroute_fib(int, struct sockaddr *, struct sockaddr *, u_int); Modified: releng/8.1/sys/net/route.c ============================================================================== --- releng/8.1/sys/net/route.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/net/route.c Fri Jun 25 21:26:34 2010 (r209524) @@ -519,7 +519,7 @@ rtredirect_fib(struct sockaddr *dst, } /* verify the gateway is directly reachable */ - if ((ifa = ifa_ifwithnet(gateway)) == NULL) { + if ((ifa = ifa_ifwithnet(gateway, 0)) == NULL) { error = ENETUNREACH; goto out; } @@ -686,7 +686,7 @@ ifa_ifwithroute_fib(int flags, struct so ifa = ifa_ifwithdstaddr(gateway); } if (ifa == NULL) - ifa = ifa_ifwithnet(gateway); + ifa = ifa_ifwithnet(gateway, 0); if (ifa == NULL) { struct rtentry *rt = rtalloc1_fib(gateway, 0, RTF_RNH_LOCKED, fibnum); if (rt == NULL) @@ -797,7 +797,7 @@ rt_getifa_fib(struct rt_addrinfo *info, */ if (info->rti_ifp == NULL && ifpaddr != NULL && ifpaddr->sa_family == AF_LINK && - (ifa = ifa_ifwithnet(ifpaddr)) != NULL) { + (ifa = ifa_ifwithnet(ifpaddr, 0)) != NULL) { info->rti_ifp = ifa->ifa_ifp; ifa_free(ifa); } Modified: releng/8.1/sys/net/rtsock.c ============================================================================== --- releng/8.1/sys/net/rtsock.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/net/rtsock.c Fri Jun 25 21:26:34 2010 (r209524) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -673,12 +674,22 @@ route_output(struct mbuf *m, struct sock * another search to retrieve the prefix route of * the local end point of the PPP link. */ - if ((rtm->rtm_flags & RTF_ANNOUNCE) && - (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { + if (rtm->rtm_flags & RTF_ANNOUNCE) { struct sockaddr laddr; - rt_maskedcopy(rt->rt_ifa->ifa_addr, - &laddr, - rt->rt_ifa->ifa_netmask); + + if (rt->rt_ifp != NULL && + rt->rt_ifp->if_type == IFT_PROPVIRTUAL) { + struct ifaddr *ifa; + + ifa = ifa_ifwithnet(info.rti_info[RTAX_DST], 1); + if (ifa != NULL) + rt_maskedcopy(ifa->ifa_addr, + &laddr, + ifa->ifa_netmask); + } else + rt_maskedcopy(rt->rt_ifa->ifa_addr, + &laddr, + rt->rt_ifa->ifa_netmask); /* * refactor rt and no lock operation necessary */ Modified: releng/8.1/sys/netinet/in.c ============================================================================== --- releng/8.1/sys/netinet/in.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/netinet/in.c Fri Jun 25 21:26:34 2010 (r209524) @@ -1379,8 +1379,9 @@ in_lltable_rtcheck(struct ifnet *ifp, u_ /* XXX rtalloc1 should take a const param */ rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || - ((rt->rt_ifp != ifp) && !(flags & LLE_PUB))) { + if (rt == NULL || (!(flags & LLE_PUB) && + ((rt->rt_flags & RTF_GATEWAY) || + (rt->rt_ifp != ifp)))) { #ifdef DIAGNOSTIC log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); Modified: releng/8.1/sys/netinet/in_pcb.c ============================================================================== --- releng/8.1/sys/netinet/in_pcb.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/netinet/in_pcb.c Fri Jun 25 21:26:34 2010 (r209524) @@ -590,7 +590,7 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithdstaddr((struct sockaddr *)sin)); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin)); + ia = ifatoia(ifa_ifwithnet((struct sockaddr *)sin, 0)); if (ia == NULL) { error = ENETUNREACH; goto done; @@ -707,7 +707,7 @@ in_pcbladdr(struct inpcb *inp, struct in ia = ifatoia(ifa_ifwithdstaddr(sintosa(&sain))); if (ia == NULL) - ia = ifatoia(ifa_ifwithnet(sintosa(&sain))); + ia = ifatoia(ifa_ifwithnet(sintosa(&sain), 0)); if (ia == NULL) ia = ifatoia(ifa_ifwithaddr(sintosa(&sain))); Modified: releng/8.1/sys/netinet/ip_options.c ============================================================================== --- releng/8.1/sys/netinet/ip_options.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/netinet/ip_options.c Fri Jun 25 21:26:34 2010 (r209524) @@ -230,7 +230,7 @@ dropit: #define INA struct in_ifaddr * #define SA struct sockaddr * if ((ia = (INA)ifa_ifwithdstaddr((SA)&ipaddr)) == NULL) - ia = (INA)ifa_ifwithnet((SA)&ipaddr); + ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0); } else /* XXX MRT 0 for routing */ ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m)); Modified: releng/8.1/sys/netinet/ip_output.c ============================================================================== --- releng/8.1/sys/netinet/ip_output.c Fri Jun 25 15:32:46 2010 (r209523) +++ releng/8.1/sys/netinet/ip_output.c Fri Jun 25 21:26:34 2010 (r209524) @@ -247,7 +247,7 @@ again: isbroadcast = 1; } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && - (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) { + (ia = ifatoia(ifa_ifwithnet(sintosa(dst), 0))) == NULL) { IPSTAT_INC(ips_noroute); error = ENETUNREACH; goto bad; From owner-svn-src-all@FreeBSD.ORG Fri Jun 25 22:35:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 527F8106566B; Fri, 25 Jun 2010 22:35:20 +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 271838FC14; Fri, 25 Jun 2010 22:35:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5PMZKB1038850; Fri, 25 Jun 2010 22:35:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5PMZK1A038846; Fri, 25 Jun 2010 22:35:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201006252235.o5PMZK1A038846@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Jun 2010 22:35: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: r209527 - in head/usr.sbin/pc-sysinstall: backend backend-partmanager backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jun 2010 22:35:20 -0000 Author: imp Date: Fri Jun 25 22:35:19 2010 New Revision: 209527 URL: http://svn.freebsd.org/changeset/base/209527 Log: We need to install the shell scripts as executables rather than as data files in the backend* trees. Submitted by: John Hixon Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile head/usr.sbin/pc-sysinstall/backend-query/Makefile head/usr.sbin/pc-sysinstall/backend/Makefile Modified: head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile Fri Jun 25 22:26:27 2010 (r209526) +++ head/usr.sbin/pc-sysinstall/backend-partmanager/Makefile Fri Jun 25 22:35:19 2010 (r209527) @@ -1,7 +1,7 @@ # $FreeBSD$ FILES= create-part.sh delete-part.sh - +FILESMODE= ${BINMODE} FILESDIR=${SHAREDIR}/pc-sysinstall/backend-partmanager NO_OBJ= Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile ============================================================================== --- head/usr.sbin/pc-sysinstall/backend-query/Makefile Fri Jun 25 22:26:27 2010 (r209526) +++ head/usr.sbin/pc-sysinstall/backend-query/Makefile Fri Jun 25 22:35:19 2010 (r209527) @@ -6,7 +6,7 @@ FILES= detect-laptop.sh detect-nics.sh d setup-ssh-keys.sh sys-mem.sh test-live.sh test-netup.sh \ update-part-list.sh xkeyboard-layouts.sh xkeyboard-models.sh \ xkeyboard-variants.sh - +FILESMODE= ${BINMODE} FILESDIR=${SHAREDIR}/pc-sysinstall/backend-query NO_OBJ= Modified: head/usr.sbin/pc-sysinstall/backend/Makefile ============================================================================== --- head/usr.sbin/pc-sysinstall/backend/Makefile Fri Jun 25 22:26:27 2010 (r209526) +++ head/usr.sbin/pc-sysinstall/backend/Makefile Fri Jun 25 22:35:19 2010 (r209527) @@ -7,7 +7,7 @@ FILES= functions-bsdlabel.sh functions-c functions-newfs.sh functions-parse.sh functions-runcommands.sh \ functions-unmount.sh functions-upgrade.sh functions-users.sh \ functions.sh parseconfig.sh startautoinstall.sh - +FILESMODE= ${BINMODE} FILESDIR=${SHAREDIR}/pc-sysinstall/backend NO_OBJ= From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 07:02:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0D4106566B; Sat, 26 Jun 2010 07:02:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D723F8FC14; Sat, 26 Jun 2010 07:02:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5Q72VWP057185; Sat, 26 Jun 2010 07:02:31 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5Q72V0T057183; Sat, 26 Jun 2010 07:02:31 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201006260702.o5Q72V0T057183@svn.freebsd.org> From: Doug Barton Date: Sat, 26 Jun 2010 07:02:31 +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: r209531 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 07:02:32 -0000 Author: dougb Date: Sat Jun 26 07:02:31 2010 New Revision: 209531 URL: http://svn.freebsd.org/changeset/base/209531 Log: Taken from actual police videos ... Modified: head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Sat Jun 26 03:15:19 2010 (r209530) +++ head/games/fortune/datfiles/fortunes-o.real Sat Jun 26 07:02:31 2010 (r209531) @@ -12433,6 +12433,39 @@ And sure enough she'll take you home and (chorus) -- Crosby, Stills, Nash, "Fair Game" % +Taken from actual police car videos: + +(15) Relax! The handcuffs are tight because they're new. They'll + stretch out after you wear them awhile. +(14) Take your hands off the car and I'll make your birth certificate + a worthless document. +(13) If you run you'll only go to jail tired. +(12) Can you run faster than 1200 feet per second? In case you didn't + know that's the average speed of a 9 mm bullet fired from my gun. +(11) So you don't know how fast you were going. I guess that means I + can write anything I want on the ticket, huh? +(10) Yes, sir, you can talk to the shift supervisor, but I don't think + it will help. Oh, did I mention that I AM the shift supervisor? +(9) Warning? You want a warning? OK, I'm warning you not to do that + again or I'll give you another ticket. +(8) The answer to this last question will determine whether you are + drunk or not. Is Mickey Mouse a cat or a dog? +% +Taken from actual police car videos: + +(7) Fair? You want me to be fair? Listen, fair is a place where you + go to ride on rides, eat cotton candy, and step in monkey poop. +(6) Yeah, we have a quota. Two more tickets and my wife gets a toaster + oven. +(5) No, sir, we don't have quotas anymore. We used to have quotas but + now we're allowed to write as many tickets as we want. +(4) Just how big were those two beers? +(3) In God we trust, all others we run through CPIC/NCIC. +(2) I'm glad to hear the Chief of Police is a good personal friend of + yours. At least you know someone who can post your bail. +(1) You didn't think we gave pretty women tickets? + You're right, we don't -- sign here. +% Taoism: Shit Happens. Confucianism: Confucius say, "Shit Happens". Buddhism: If shit happens, it isn't really shit. From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 13:20:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D9F6106566B; Sat, 26 Jun 2010 13:20:41 +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 12F1E8FC19; Sat, 26 Jun 2010 13:20:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QDKem4041503; Sat, 26 Jun 2010 13:20:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QDKeiS041502; Sat, 26 Jun 2010 13:20:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006261320.o5QDKeiS041502@svn.freebsd.org> From: Rui Paulo Date: Sat, 26 Jun 2010 13:20: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: r209536 - in head/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 13:20:41 -0000 Author: rpaulo Date: Sat Jun 26 13:20:40 2010 New Revision: 209536 URL: http://svn.freebsd.org/changeset/base/209536 Log: Add NTFS partition type to GEOM_MBR. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Sat Jun 26 08:34:22 2010 (r209535) +++ head/sys/geom/part/g_part.c Sat Jun 26 13:20:40 2010 (r209536) @@ -91,6 +91,7 @@ struct g_part_alias_list { { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA }, { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA }, { "ms-reserved", G_PART_ALIAS_MS_RESERVED }, + { "ntfs", G_PART_ALIAS_MS_NTFS }, { "netbsd-ccd", G_PART_ALIAS_NETBSD_CCD }, { "netbsd-cgd", G_PART_ALIAS_NETBSD_CGD }, { "netbsd-ffs", G_PART_ALIAS_NETBSD_FFS }, Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Sat Jun 26 08:34:22 2010 (r209535) +++ head/sys/geom/part/g_part.h Sat Jun 26 13:20:40 2010 (r209536) @@ -59,6 +59,7 @@ enum g_part_alias { G_PART_ALIAS_MS_LDM_DATA, /* A Microsoft LDM Data part. entry. */ G_PART_ALIAS_MS_LDM_METADATA, /* A Microsoft LDM Metadata entry. */ G_PART_ALIAS_MS_RESERVED, /* A Microsoft Reserved part. entry. */ + G_PART_ALIAS_MS_NTFS, /* A Microsoft NTFS partition entry */ G_PART_ALIAS_NETBSD_CCD, /* A NetBSD CCD partition entry. */ G_PART_ALIAS_NETBSD_CGD, /* A NetBSD CGD partition entry. */ G_PART_ALIAS_NETBSD_FFS, /* A NetBSD FFS partition entry. */ Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sat Jun 26 08:34:22 2010 (r209535) +++ head/sys/geom/part/g_part_mbr.c Sat Jun 26 13:20:40 2010 (r209536) @@ -127,6 +127,11 @@ mbr_parse_type(const char *type, u_char *dp_typ = DOSPTYP_386BSD; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_MS_NTFS); + if (!strcasecmp(type, alias)) { + *dp_typ = DOSPTYP_NTFS; + return (0); + } return (EINVAL); } @@ -509,9 +514,14 @@ g_part_mbr_type(struct g_part_table *bas entry = (struct g_part_mbr_entry *)baseentry; type = entry->ent.dp_typ; - if (type == DOSPTYP_386BSD) + switch (type) { + case DOSPTYP_386BSD: return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); - snprintf(buf, bufsz, "!%d", type); + case DOSPTYP_NTFS: + return (g_part_alias_name(G_PART_ALIAS_MS_NTFS)); + default: + snprintf(buf, bufsz, "!%d", type); + } return (buf); } Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Sat Jun 26 08:34:22 2010 (r209535) +++ head/sys/sys/diskmbr.h Sat Jun 26 13:20:40 2010 (r209536) @@ -49,6 +49,7 @@ #define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ #define DOSPTYP_EXT 5 /* DOS extended partition */ #define DOSPTYP_EXTLBA 15 /* DOS extended partition */ +#define DOSPTYP_NTFS 0x07 /* NTFS partition */ struct dos_partition { unsigned char dp_flag; /* bootstrap flags */ From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 14:42:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF0A4106566B; Sat, 26 Jun 2010 14:42:07 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 838B68FC14; Sat, 26 Jun 2010 14:42:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QEg7LK059416; Sat, 26 Jun 2010 14:42:07 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QEg7vF059413; Sat, 26 Jun 2010 14:42:07 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201006261442.o5QEg7vF059413@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 26 Jun 2010 14:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209537 - in stable/7: sbin/mount share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 14:42:07 -0000 Author: jilles Date: Sat Jun 26 14:42:07 2010 New Revision: 209537 URL: http://svn.freebsd.org/changeset/base/209537 Log: MFC r208647,r208654: Clarify devfs manpages slightly. mount(8): add xref to devfs(5) devfs(5): change example to something more likely to be useful (it is not necessary to mount a devfs on /dev manually, but for chroots/jails it is often needed), mention since when devfs is preferred to device nodes on ufs and when device nodes on ufs stopped working PR: 146600 Modified: stable/7/sbin/mount/mount.8 stable/7/share/man/man5/devfs.5 Directory Properties: stable/7/sbin/mount/ (props changed) stable/7/sbin/mount/mount_fs.c (props changed) stable/7/share/man/man5/ (props changed) Modified: stable/7/sbin/mount/mount.8 ============================================================================== --- stable/7/sbin/mount/mount.8 Sat Jun 26 13:20:40 2010 (r209536) +++ stable/7/sbin/mount/mount.8 Sat Jun 26 14:42:07 2010 (r209537) @@ -507,6 +507,7 @@ support for a particular file system mig .Xr nmount 2 , .Xr acl 3 , .Xr mac 4 , +.Xr devfs 5 , .Xr ext2fs 5 , .Xr fstab 5 , .Xr procfs 5 , Modified: stable/7/share/man/man5/devfs.5 ============================================================================== --- stable/7/share/man/man5/devfs.5 Sat Jun 26 13:20:40 2010 (r209536) +++ stable/7/share/man/man5/devfs.5 Sat Jun 26 14:42:07 2010 (r209537) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 1996 +.Dd May 30, 2010 .Dt DEVFS 5 .Os .Sh NAME @@ -80,9 +80,9 @@ mount point. To mount a .Nm volume located on -.Pa /dev : +.Pa /mychroot/dev : .Pp -.Dl "mount -t devfs devfs /dev" +.Dl "mount -t devfs devfs /mychroot/dev" .Sh SEE ALSO .Xr devfs 8 , .Xr mount 8 @@ -91,6 +91,10 @@ The .Nm file system first appeared in .Fx 2.0 . +It became the preferred method for accessing devices in +.Fx 5.0 +and the only method in +.Fx 6.0 . The .Nm manual page first appeared in From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 14:55:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C78EB1065670; Sat, 26 Jun 2010 14:55:53 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B68128FC1E; Sat, 26 Jun 2010 14:55:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QEtr8b062477; Sat, 26 Jun 2010 14:55:53 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QEtrNt062475; Sat, 26 Jun 2010 14:55:53 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201006261455.o5QEtrNt062475@svn.freebsd.org> From: Ken Smith Date: Sat, 26 Jun 2010 14:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209538 - releng/8.1/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 14:55:53 -0000 Author: kensmith Date: Sat Jun 26 14:55:53 2010 New Revision: 209538 URL: http://svn.freebsd.org/changeset/base/209538 Log: Ready to proceed with 8.1-RC2. Approved by: re (implicit) Modified: releng/8.1/sys/conf/newvers.sh Modified: releng/8.1/sys/conf/newvers.sh ============================================================================== --- releng/8.1/sys/conf/newvers.sh Sat Jun 26 14:42:07 2010 (r209537) +++ releng/8.1/sys/conf/newvers.sh Sat Jun 26 14:55:53 2010 (r209538) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.1" -BRANCH="RC1" +BRANCH="RC2" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 18:13:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F427106566B; Sat, 26 Jun 2010 18:13:44 +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 745A18FC15; Sat, 26 Jun 2010 18:13:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QIDi8c011781; Sat, 26 Jun 2010 18:13:44 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QIDi0Q011780; Sat, 26 Jun 2010 18:13:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006261813.o5QIDi0Q011780@svn.freebsd.org> From: Rui Paulo Date: Sat, 26 Jun 2010 18:13: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: r209539 - head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 18:13:44 -0000 Author: rpaulo Date: Sat Jun 26 18:13:44 2010 New Revision: 209539 URL: http://svn.freebsd.org/changeset/base/209539 Log: Set svn:executable property so we can run the DTrace test suite. Modified: Directory Properties: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 19:26:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D49C1065670; Sat, 26 Jun 2010 19:26:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8B88FC08; Sat, 26 Jun 2010 19:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QJQKFu034080; Sat, 26 Jun 2010 19:26:20 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QJQKVR034078; Sat, 26 Jun 2010 19:26:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201006261926.o5QJQKVR034078@svn.freebsd.org> From: Michael Tuexen Date: Sat, 26 Jun 2010 19:26: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: r209540 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 19:26:20 -0000 Author: tuexen Date: Sat Jun 26 19:26:20 2010 New Revision: 209540 URL: http://svn.freebsd.org/changeset/base/209540 Log: * Do not dereference a NULL pointer when calling an SCTP send syscall not providing a destination address and using ktrace. * Do not copy out kernel memory when providing sinfo for sctp_recvmsg(). Both bug where reported by Valentin Nechayev. The first bug results in a kernel panic. MFC after: 3 days. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Sat Jun 26 18:13:44 2010 (r209539) +++ head/sys/kern/uipc_syscalls.c Sat Jun 26 19:26:20 2010 (r209540) @@ -2409,7 +2409,7 @@ sctp_generic_sendmsg (td, uap) if (error) goto sctp_bad; #ifdef KTRACE - if (KTRPOINT(td, KTR_STRUCT)) + if (to && (KTRPOINT(td, KTR_STRUCT))) ktrsockaddr(to); #endif @@ -2523,7 +2523,7 @@ sctp_generic_sendmsg_iov(td, uap) if (error) goto sctp_bad1; #ifdef KTRACE - if (KTRPOINT(td, KTR_STRUCT)) + if (to && (KTRPOINT(td, KTR_STRUCT))) ktrsockaddr(to); #endif @@ -2677,6 +2677,7 @@ sctp_generic_recvmsg(td, uap) if (KTRPOINT(td, KTR_GENIO)) ktruio = cloneuio(&auio); #endif /* KTRACE */ + memset(&sinfo, 0, sizeof(struct sctp_sndrcvinfo)); CURVNET_SET(so->so_vnet); error = sctp_sorecvmsg(so, &auio, (struct mbuf **)NULL, fromsa, fromlen, &msg_flags, From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 20:59:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0D711065670; Sat, 26 Jun 2010 20:59:11 +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 BFABD8FC0A; Sat, 26 Jun 2010 20:59:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QKxBKI062749; Sat, 26 Jun 2010 20:59:11 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QKxBNa062748; Sat, 26 Jun 2010 20:59:11 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201006262059.o5QKxBNa062748@svn.freebsd.org> From: Rui Paulo Date: Sat, 26 Jun 2010 20:59: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: r209541 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 20:59:11 -0000 Author: rpaulo Date: Sat Jun 26 20:59:10 2010 New Revision: 209541 URL: http://svn.freebsd.org/changeset/base/209541 Log: Fix the AR_SREV_MERLIN_20_OR_LATER() check. Submitted by: Alex Kozlov MFC after: 2 weeks Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sat Jun 26 19:26:20 2010 (r209540) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sat Jun 26 20:59:10 2010 (r209541) @@ -612,7 +612,7 @@ AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_MERLIN_20) #define AR_SREV_MERLIN_20_OR_LATER(_ah) \ (AR_SREV_MERLIN_20(_ah) || \ - AH_PRIVATE((_ah))->ah_macVersion > AR_XSREV_VERSION_MERLIN) + AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_MERLIN_20) #define AR_SREV_KITE(_ah) \ (AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_KITE) From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 21:44:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2285106566B; Sat, 26 Jun 2010 21:44:05 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 915798FC26; Sat, 26 Jun 2010 21:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QLi5Rs076624; Sat, 26 Jun 2010 21:44:05 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QLi5tF076622; Sat, 26 Jun 2010 21:44:05 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006262144.o5QLi5tF076622@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Jun 2010 21:44: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: r209542 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 21:44:05 -0000 Author: pjd Date: Sat Jun 26 21:44:05 2010 New Revision: 209542 URL: http://svn.freebsd.org/changeset/base/209542 Log: Just like in case of setgroups(2), for getgroups(2) also advice including sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS definitions. Modified: head/lib/libc/sys/getgroups.2 Modified: head/lib/libc/sys/getgroups.2 ============================================================================== --- head/lib/libc/sys/getgroups.2 Sat Jun 26 20:59:10 2010 (r209541) +++ head/lib/libc/sys/getgroups.2 Sat Jun 26 21:44:05 2010 (r209542) @@ -37,7 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h +.In sys/param.h .In unistd.h .Ft int .Fn getgroups "int gidsetlen" "gid_t *gidset" From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 21:44:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96191065675; Sat, 26 Jun 2010 21:44:45 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5ED58FC22; Sat, 26 Jun 2010 21:44:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QLijUl076878; Sat, 26 Jun 2010 21:44:45 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QLij2M076876; Sat, 26 Jun 2010 21:44:45 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201006262144.o5QLij2M076876@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 26 Jun 2010 21:44: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: r209543 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 21:44:45 -0000 Author: pjd Date: Sat Jun 26 21:44:45 2010 New Revision: 209543 URL: http://svn.freebsd.org/changeset/base/209543 Log: Correct arguments order. Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Jun 26 21:44:05 2010 (r209542) +++ head/sys/kern/vfs_vnops.c Sat Jun 26 21:44:45 2010 (r209543) @@ -506,8 +506,8 @@ vn_read(fp, uio, active_cred, flags, td) struct file *fp; struct uio *uio; struct ucred *active_cred; - struct thread *td; int flags; + struct thread *td; { struct vnode *vp; int error, ioflag; @@ -572,8 +572,8 @@ vn_write(fp, uio, active_cred, flags, td struct file *fp; struct uio *uio; struct ucred *active_cred; - struct thread *td; int flags; + struct thread *td; { struct vnode *vp; struct mount *mp; From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 21:50:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A39EC106564A; Sat, 26 Jun 2010 21:50:14 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1D6218FC08; Sat, 26 Jun 2010 21:50:13 +0000 (UTC) Received: by qwg5 with SMTP id 5so1307887qwg.13 for ; Sat, 26 Jun 2010 14:50:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=e2i1VyzQrp+za4CA7mKN5RejWlfoaVsd26JS61m1QjM=; b=A6DHX8KRlmJMfRMxjDm78oJ5emKjKhMyQefAd8/tytNxTgsp1TIqqov7C85reSWG/8 bV1I+NM+TVEPbE1f0twmuGEx9a0leGL8q1eEnD8Ptwx3ZonTpLVOA0FO0Ggui+fjjnc8 KQ3ZTUIr/O3JyUY2NDOeyLYw2DAhgoXs75JwQ= 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=hV4GyT5xqPKN2CwvZagzfyvEiqydCXrhyyGYuOEd1SRmn6ndmci+Vz/l3J5v+gqnLN jUMprjV5LDFc+4dhrHtkddpcobTU1Phjc1URCaY6y/i3moAVNDi1hbpnBA341b992TtW RkaHLiYqGLmyLf7DSwzw+g0CqwC24Pvla5VLg= MIME-Version: 1.0 Received: by 10.229.186.142 with SMTP id cs14mr1487818qcb.10.1277589013457; Sat, 26 Jun 2010 14:50:13 -0700 (PDT) Received: by 10.229.80.75 with HTTP; Sat, 26 Jun 2010 14:50:13 -0700 (PDT) In-Reply-To: <201006262144.o5QLi5tF076622@svn.freebsd.org> References: <201006262144.o5QLi5tF076622@svn.freebsd.org> Date: Sat, 26 Jun 2010 14:50:13 -0700 Message-ID: From: Garrett Cooper To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r209542 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 21:50:14 -0000 On Sat, Jun 26, 2010 at 2:44 PM, Pawel Jakub Dawidek wrot= e: > Author: pjd > Date: Sat Jun 26 21:44:05 2010 > New Revision: 209542 > URL: http://svn.freebsd.org/changeset/base/209542 > > Log: > =A0Just like in case of setgroups(2), for getgroups(2) also advice includ= ing > =A0sys/param.h instead of sys/types.h so we get NGROUPS_MAX and NGROUPS > =A0definitions. > > Modified: > =A0head/lib/libc/sys/getgroups.2 > > Modified: head/lib/libc/sys/getgroups.2 > =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/lib/libc/sys/getgroups.2 =A0 =A0 =A0 Sat Jun 26 20:59:10 2010 = =A0 =A0 =A0 =A0(r209541) > +++ head/lib/libc/sys/getgroups.2 =A0 =A0 =A0 Sat Jun 26 21:44:05 2010 = =A0 =A0 =A0 =A0(r209542) > @@ -37,7 +37,7 @@ > =A0.Sh LIBRARY > =A0.Lb libc > =A0.Sh SYNOPSIS > -.In sys/types.h > +.In sys/param.h > =A0.In unistd.h > =A0.Ft int > =A0.Fn getgroups "int gidsetlen" "gid_t *gidset" Hmmm... looks like our copy of getgroups(2) is not POSIX compliant then :/ : http://www.opengroup.org/onlinepubs/000095399/functions/getgroups= .html . Why not just use sysconf like the POSIX page suggests (which is portable)? Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Sat Jun 26 22:04:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA493106566B; Sat, 26 Jun 2010 22:04:52 +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 A891A8FC17; Sat, 26 Jun 2010 22:04:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5QM4qJs083141; Sat, 26 Jun 2010 22:04:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5QM4qLD083139; Sat, 26 Jun 2010 22:04:52 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201006262204.o5QM4qLD083139@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 26 Jun 2010 22:04: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: r209544 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2010 22:04:52 -0000 Author: nwhitehorn Date: Sat Jun 26 22:04:52 2010 New Revision: 209544 URL: http://svn.freebsd.org/changeset/base/209544 Log: Ignore versioned dependencies on shared objects to which we do not link. This fixes an error with files like this created by GNU ld under certain circumstances. Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Sat Jun 26 21:44:45 2010 (r209543) +++ head/libexec/rtld-elf/rtld.c Sat Jun 26 22:04:52 2010 (r209544) @@ -3443,9 +3443,13 @@ locate_dependency(const Obj_Entry *obj, if (object_match_name(needed->obj, name)) return needed->obj; } - _rtld_error("%s: Unexpected inconsistency: dependency %s not found", - obj->path, name); - die(); + + /* + * GNU LD sometimes refers to version dependencies on objects to which + * it does not actually link. Treat this as a non-fatal error, and + * ignore this dependency. + */ + return NULL; } static int @@ -3567,6 +3571,9 @@ rtld_verify_object_versions(Obj_Entry *o vn = obj->verneed; while (vn != NULL) { depobj = locate_dependency(obj, obj->strtab + vn->vn_file); + if (depobj == NULL) + break; + vna = (const Elf_Vernaux *) ((char *)vn + vn->vn_aux); for (;;) { if (check_object_provided_version(obj, depobj, vna))