From owner-svn-src-head@FreeBSD.ORG Sun Jun 20 00:34:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 01:54:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 02:21:53 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 04:14:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 06:52:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 08:03:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 08:27:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 08:48:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 09:40:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 12:52:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 13:35:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 16:56:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Sun Jun 20 21:33:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@FreeBSD.ORG Mon Jun 21 08:24:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 09:51:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 09:55:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 11:12:56 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 12:50:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 17:22:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 17:33:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 18:01:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 18:19:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 18:30:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 18:47:50 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 19:05:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 19:44:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 19:53:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 19:58:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:08:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:09:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:15:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:27:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:28:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:33:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:34:23 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:35:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:36:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 20:46:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 21:06:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 21:12:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 21:15:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 21:27:23 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Mon Jun 21 23:27:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@FreeBSD.ORG Tue Jun 22 00:26:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 07:31:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 08:12:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 08:22:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 08:28:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 10:45:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 10:46:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 16:10:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 16:20:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 19:42:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 20:52:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 20:57:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 21:01:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 21:03:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 21:06:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 21:08:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 21:13:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Tue Jun 22 21:16:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@FreeBSD.ORG Wed Jun 23 03:59:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 04:42:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 05:43:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 10:40:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 11:12:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 11:21:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 12:17:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 14:06:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 14:11:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 14:19:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 14:28:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 15:19:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 17:20:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 19:29:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 19:42:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 20:44:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 22:25:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 22:33:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 23:16:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 23:26:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 23:32:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Wed Jun 23 23:34:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@FreeBSD.ORG Thu Jun 24 00:27:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 00:36:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 02:31:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 02:57:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 05:05:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 05:17:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 05:47:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 05:49:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 07:43:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 08:08:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 10:14:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 12:07:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 16:28:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 16:32:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 17:53:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 20:20:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 20:45:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 20:45:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 21:16:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 21:17:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 22:21:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 22:29:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 22:33:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Thu Jun 24 22:47:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@FreeBSD.ORG Fri Jun 25 02:36:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 25 03:32:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 25 05:07:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 25 05:36:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 25 15:32:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 25 15:35:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Fri Jun 25 22:35:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@FreeBSD.ORG Sat Jun 26 07:02:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 13:20:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 18:13:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 19:26:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 20:59:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 21:44:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 21:44:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 21:50:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@FreeBSD.ORG Sat Jun 26 22:04:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 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-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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))