From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 00:01:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA2B5885 for ; Sun, 8 Dec 2013 00:01:20 +0000 (UTC) Received: from mail-ea0-f179.google.com (mail-ea0-f179.google.com [209.85.215.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D75D1303 for ; Sun, 8 Dec 2013 00:01:19 +0000 (UTC) Received: by mail-ea0-f179.google.com with SMTP id r15so918296ead.10 for ; Sat, 07 Dec 2013 16:01:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-type:content-transfer-encoding:subject:from:date:to :message-id; bh=Z0kvPdw/s3qtO35txmYg2aXdrBrSkSvinpcPkJqZJMs=; b=DrKMX+iRhLOFgQngrQcdTettIlgHoJlY+hJ7NeVyPWH8gYkNQQQzLP59Nm6XOSwSsW XEoa7+NuTFpq7gBXM2CYnjhd1511XeXZ4B3gB/dm+ogm21GkgrIm8yZbgqqlideT0HIt g7iifwLNOMOl+c4kWaff7IQKzU1dTHJqnbCqwy8DEa6Geq4mxxT/4cex7rLZAo13KjBg RQOfNy8Ui0+QLfJLJsIibCxt5BlNIaOTw1BvbfsWzpopfnB8jBpl+rTQ5EoL5RRGT7sR l9eNwRTCcbpsdWPNxOlPgG0ocOiWB1E85ti04TDJwAx2SoznooyYR+uz+EWKXf73bFGO fScg== X-Gm-Message-State: ALoCoQmvF5OIgTWSRsMDSTWiGC6/sLDuQSrA24bSOS8DisOwdOe739n3fyKuqA8exD+YOzRijPx3 X-Received: by 10.15.108.73 with SMTP id cc49mr1126880eeb.93.1386460872424; Sat, 07 Dec 2013 16:01:12 -0800 (PST) Received: from [100.80.225.11] ([37.73.230.125]) by mx.google.com with ESMTPSA id v1sm11465236eef.9.2013.12.07.16.01.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 07 Dec 2013 16:01:11 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <52A3A8DE.9090907@FreeBSD.org> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken From: Aleksandr Rybalko Date: Sun, 08 Dec 2013 01:59:54 +0200 To: Andreas Tobler , Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 00:01:21 -0000 Andreas Tobler написав(ла): >On 05.12.13 23:38, Aleksandr Rybalko wrote: >> Author: ray >> Date: Thu Dec 5 22:38:53 2013 >> New Revision: 259016 >> URL: http://svnweb.freebsd.org/changeset/base/259016 >> >> Log: >> Merge VT(9) project (a.k.a. newcons). >> >> Reviewed by: nwhitehorn >> MFC_to_10_after: re approval >> >> Sponsored by: The FreeBSD Foundation > >Great! Thanks, gives a new look & feel on the console :) >Have it running on amd64/i386 and PowerMac(32/64-bit). >The only thing I need to figure is the mapping of the AltGr or in Mac >world, the alt key mapping. Iow, the third level mapping of the keys. >e.g. the @ here is on altgr-2... > >Again, thanks! >Andreas Hello Andreas, I'm glad to fix that, but I've to understand how it is should work :-) Thanks! WBW ------ Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 00:04:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FEE88EF; Sun, 8 Dec 2013 00:04:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BD921315; Sun, 8 Dec 2013 00:04:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB804PUp090503; Sun, 8 Dec 2013 00:04:25 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB804PPr090496; Sun, 8 Dec 2013 00:04:25 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312080004.rB804PPr090496@svn.freebsd.org> From: Peter Wemm Date: Sun, 8 Dec 2013 00:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259086 - in vendor/nvi/dist: cl common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 00:04:26 -0000 Author: peter Date: Sun Dec 8 00:04:25 2013 New Revision: 259086 URL: http://svnweb.freebsd.org/changeset/base/259086 Log: Import nvi2 as of c80f493, including: Fix cleanup multikey mappgs (FreeBSD bin/182463) Modified: vendor/nvi/dist/cl/cl_term.c vendor/nvi/dist/common/key.c vendor/nvi/dist/common/key.h Modified: vendor/nvi/dist/cl/cl_term.c ============================================================================== --- vendor/nvi/dist/cl/cl_term.c Sat Dec 7 23:11:12 2013 (r259085) +++ vendor/nvi/dist/cl/cl_term.c Sun Dec 8 00:04:25 2013 (r259086) @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: cl_term.c,v 10.33 2012/04/21 23:51:46 zy Exp $"; +static const char sccsid[] = "$Id: cl_term.c,v 10.34 2013/12/07 16:21:14 wjenkner Exp $"; #endif /* not lint */ #include @@ -187,14 +187,18 @@ cl_term_init(SCR *sp) int cl_term_end(GS *gp) { - SEQ *qp, *nqp; + SEQ *qp, *nqp, *pre_qp = NULL; /* Delete screen specific mappings. */ SLIST_FOREACH_SAFE(qp, gp->seqq, q, nqp) if (F_ISSET(qp, SEQ_SCREEN)) { - SLIST_REMOVE_HEAD(gp->seqq, q); + if (qp == SLIST_FIRST(gp->seqq)) + SLIST_REMOVE_HEAD(gp->seqq, q); + else + SLIST_REMOVE_AFTER(pre_qp, q); (void)seq_free(qp); - } + } else + pre_qp = qp; return (0); } Modified: vendor/nvi/dist/common/key.c ============================================================================== --- vendor/nvi/dist/common/key.c Sat Dec 7 23:11:12 2013 (r259085) +++ vendor/nvi/dist/common/key.c Sun Dec 8 00:04:25 2013 (r259086) @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: key.c,v 10.53 2013/03/11 01:20:53 yamt Exp $"; +static const char sccsid[] = "$Id: key.c,v 10.54 2013/11/13 12:15:27 zy Exp $"; #endif /* not lint */ #include @@ -272,7 +272,7 @@ v_key_name( * The code prints non-printable wide characters in 4 or 5 digits * Unicode escape sequences, so only supports plane 0 to 15. */ - if (ISPRINT(ach)) + if (CAN_PRINT(sp, ach)) goto done; nopr: if (iscntrl(ch) && (ch < 0x20 || ch == 0x7f)) { sp->cname[0] = '^'; Modified: vendor/nvi/dist/common/key.h ============================================================================== --- vendor/nvi/dist/common/key.h Sat Dec 7 23:11:12 2013 (r259085) +++ vendor/nvi/dist/common/key.h Sun Dec 8 00:04:25 2013 (r259086) @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: key.h,v 10.55 2012/10/07 01:31:17 zy Exp $ + * $Id: key.h,v 10.56 2013/11/13 12:15:27 zy Exp $ */ #include "multibyte.h" @@ -23,8 +23,9 @@ #define INPUT2INT5(sp,cw,n,nlen,w,wlen) \ sp->conv.input2int(sp, n, nlen, &(cw), &wlen, &w) #define CONST +#define INTISWIDE(c) (wctob(c) == EOF) #define CHAR_WIDTH(sp, ch) wcwidth(ch) -#define INTISWIDE(c) (wctob(c) == EOF) +#define CAN_PRINT(sp, ch) (CHAR_WIDTH(sp, ch) > 0) #else #define FILE2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) @@ -36,9 +37,10 @@ (n = w, nlen = wlen, 0) #define INPUT2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) -#define CONST const -#define INTISWIDE(c) 0 +#define CONST const +#define INTISWIDE(c) 0 #define CHAR_WIDTH(sp, ch) 1 +#define CAN_PRINT(sp, ch) isprint(ch) #endif #define FILE2INT(sp,n,nlen,w,wlen) \ FILE2INT5(sp,sp->cw,n,nlen,w,wlen) From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 00:05:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDEE6B8A; Sun, 8 Dec 2013 00:05:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B24AB1334; Sun, 8 Dec 2013 00:05:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB805VIb090730; Sun, 8 Dec 2013 00:05:31 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB805Vfu090729; Sun, 8 Dec 2013 00:05:31 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312080005.rB805Vfu090729@svn.freebsd.org> From: Peter Wemm Date: Sun, 8 Dec 2013 00:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259087 - vendor/nvi/2.1.2-c80f493b0382d3c X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 00:05:31 -0000 Author: peter Date: Sun Dec 8 00:05:31 2013 New Revision: 259087 URL: http://svnweb.freebsd.org/changeset/base/259087 Log: Tag nvi2 import 2.1.2-c80f493b0382d3c Added: vendor/nvi/2.1.2-c80f493b0382d3c/ - copied from r259086, vendor/nvi/dist/ From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 00:08:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09001CD1; Sun, 8 Dec 2013 00:08:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E994D134F; Sun, 8 Dec 2013 00:08:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB808333091178; Sun, 8 Dec 2013 00:08:03 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8083FA091175; Sun, 8 Dec 2013 00:08:03 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312080008.rB8083FA091175@svn.freebsd.org> From: Peter Wemm Date: Sun, 8 Dec 2013 00:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259088 - in head/contrib/nvi: cl common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 00:08:04 -0000 Author: peter Date: Sun Dec 8 00:08:03 2013 New Revision: 259088 URL: http://svnweb.freebsd.org/changeset/base/259088 Log: Vendor import nvi-2.1.2-c80f493b038 a multikey mapping fix PR: bin/182463 Modified: head/contrib/nvi/cl/cl_term.c head/contrib/nvi/common/key.c head/contrib/nvi/common/key.h Directory Properties: head/contrib/nvi/ (props changed) Modified: head/contrib/nvi/cl/cl_term.c ============================================================================== --- head/contrib/nvi/cl/cl_term.c Sun Dec 8 00:05:31 2013 (r259087) +++ head/contrib/nvi/cl/cl_term.c Sun Dec 8 00:08:03 2013 (r259088) @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: cl_term.c,v 10.33 2012/04/21 23:51:46 zy Exp $"; +static const char sccsid[] = "$Id: cl_term.c,v 10.34 2013/12/07 16:21:14 wjenkner Exp $"; #endif /* not lint */ #include @@ -187,14 +187,18 @@ cl_term_init(SCR *sp) int cl_term_end(GS *gp) { - SEQ *qp, *nqp; + SEQ *qp, *nqp, *pre_qp = NULL; /* Delete screen specific mappings. */ SLIST_FOREACH_SAFE(qp, gp->seqq, q, nqp) if (F_ISSET(qp, SEQ_SCREEN)) { - SLIST_REMOVE_HEAD(gp->seqq, q); + if (qp == SLIST_FIRST(gp->seqq)) + SLIST_REMOVE_HEAD(gp->seqq, q); + else + SLIST_REMOVE_AFTER(pre_qp, q); (void)seq_free(qp); - } + } else + pre_qp = qp; return (0); } Modified: head/contrib/nvi/common/key.c ============================================================================== --- head/contrib/nvi/common/key.c Sun Dec 8 00:05:31 2013 (r259087) +++ head/contrib/nvi/common/key.c Sun Dec 8 00:08:03 2013 (r259088) @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: key.c,v 10.53 2013/03/11 01:20:53 yamt Exp $"; +static const char sccsid[] = "$Id: key.c,v 10.54 2013/11/13 12:15:27 zy Exp $"; #endif /* not lint */ #include @@ -272,7 +272,7 @@ v_key_name( * The code prints non-printable wide characters in 4 or 5 digits * Unicode escape sequences, so only supports plane 0 to 15. */ - if (ISPRINT(ach)) + if (CAN_PRINT(sp, ach)) goto done; nopr: if (iscntrl(ch) && (ch < 0x20 || ch == 0x7f)) { sp->cname[0] = '^'; Modified: head/contrib/nvi/common/key.h ============================================================================== --- head/contrib/nvi/common/key.h Sun Dec 8 00:05:31 2013 (r259087) +++ head/contrib/nvi/common/key.h Sun Dec 8 00:08:03 2013 (r259088) @@ -6,7 +6,7 @@ * * See the LICENSE file for redistribution information. * - * $Id: key.h,v 10.55 2012/10/07 01:31:17 zy Exp $ + * $Id: key.h,v 10.56 2013/11/13 12:15:27 zy Exp $ */ #include "multibyte.h" @@ -23,8 +23,9 @@ #define INPUT2INT5(sp,cw,n,nlen,w,wlen) \ sp->conv.input2int(sp, n, nlen, &(cw), &wlen, &w) #define CONST +#define INTISWIDE(c) (wctob(c) == EOF) #define CHAR_WIDTH(sp, ch) wcwidth(ch) -#define INTISWIDE(c) (wctob(c) == EOF) +#define CAN_PRINT(sp, ch) (CHAR_WIDTH(sp, ch) > 0) #else #define FILE2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) @@ -36,9 +37,10 @@ (n = w, nlen = wlen, 0) #define INPUT2INT5(sp,buf,n,nlen,w,wlen) \ (w = n, wlen = nlen, 0) -#define CONST const -#define INTISWIDE(c) 0 +#define CONST const +#define INTISWIDE(c) 0 #define CHAR_WIDTH(sp, ch) 1 +#define CAN_PRINT(sp, ch) isprint(ch) #endif #define FILE2INT(sp,n,nlen,w,wlen) \ FILE2INT5(sp,sp->cw,n,nlen,w,wlen) From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 00:16:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9440FFDC for ; Sun, 8 Dec 2013 00:16:57 +0000 (UTC) Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2730913B9 for ; Sun, 8 Dec 2013 00:16:56 +0000 (UTC) Received: by mail-ee0-f51.google.com with SMTP id b15so913520eek.38 for ; Sat, 07 Dec 2013 16:16:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-type:content-transfer-encoding:subject:from:date:to:cc :message-id; bh=gv/01Rl02xcC9MOIR7yuUYIA13GpHdk2AGPInEXybBA=; b=YmmW6/ieo0ItG/TTOkg/akdlr34f+5kG1uKeCFDurxGuQNHth/j1HKo4YoBFCwIIvi A80FqpnkYLT806ZkJvo4vAaRhQtL4lv+b3RgeEf611gyTBHZXbWFquuOr6k89LcUxumb IhN/vrLKR6wT50NedTE27aoFBgYmmA4COhDF2PXcD7tY9iEupZxyWFz99uZRX+W3kd7L XF39mXehAc5LGvDK+tGsVcosxV23C8dOPODAglICozSyOYwEgPSXvTpfoKkYuWqy2L4s RExhZp8Odq8JDQO+sxII5wxx6oNb7U87Fo0l5vyCi9opMtpYv+pc/LVojErj6D65HsSI 58Kg== X-Gm-Message-State: ALoCoQlJzKMQDPMIZc5ziBi7pyij1bwhQF6ObIshLmLfPDW1zsZLEQHiTrMoWq6S4NsPoBpt0FHO X-Received: by 10.15.45.135 with SMTP id b7mr1138970eew.88.1386461417313; Sat, 07 Dec 2013 16:10:17 -0800 (PST) Received: from [100.80.225.11] ([37.73.230.125]) by mx.google.com with ESMTPSA id g47sm11491277eeo.19.2013.12.07.16.10.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 07 Dec 2013 16:10:16 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <20131207153150.GN59496@kib.kiev.ua> References: <201312071524.rB7FOhWn008164@svn.freebsd.org> <20131207153150.GN59496@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: svn commit: r259071 - head/sys/conf From: Aleksandr Rybalko Date: Sun, 08 Dec 2013 02:10:02 +0200 To: Konstantin Belousov , Aleksandr Rybalko Message-ID: <357833a7-3088-4013-9376-89dfa9ca90fb@email.android.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 00:16:57 -0000 Konstantin Belousov написав(ла): >On Sat, Dec 07, 2013 at 03:24:43PM +0000, Aleksandr Rybalko wrote: >> Author: ray >> Date: Sat Dec 7 15:24:43 2013 >> New Revision: 259071 >> URL: http://svnweb.freebsd.org/changeset/base/259071 >> >> Log: >> Include dev/fb/fb_if.m in build always, without it kms modules >complain about >> lack of fb_getinfo_desc symbol. >> >> Submitted by: dumbbell >> >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/sys/conf/files >> >> Modified: head/sys/conf/files >> >============================================================================== >> --- head/sys/conf/files Sat Dec 7 13:11:50 2013 (r259070) >> +++ head/sys/conf/files Sat Dec 7 15:24:43 2013 (r259071) >> @@ -1397,7 +1397,7 @@ dev/ex/if_ex_pccard.c optional ex pccar >> dev/exca/exca.c optional cbb >> dev/fatm/if_fatm.c optional fatm pci >> dev/fb/fbd.c optional fbd | vt >> -dev/fb/fb_if.m optional fbd | vt >> +dev/fb/fb_if.m standard >> dev/fb/splash.c optional splash >> dev/fdt/fdt_common.c optional fdt >> dev/fdt/fdt_ic_if.m optional fdt > >As a tangentially related, I noted that logo_freebsd.c is compiled >in unconditional. Is it required, can it be made an option ? > >Also, is it possible to make the mouse cursor an option, same as it >was in syscons with SC_NO_CUTPASTE ? Hi Konstantin, Yeah, no problem for both questions. Working on that. Thanks a lot! WBW ------ Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 00:59:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71F066B6; Sun, 8 Dec 2013 00:59:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E5C115B9; Sun, 8 Dec 2013 00:59:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB80x5YF008669; Sun, 8 Dec 2013 00:59:05 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB80x50a008668; Sun, 8 Dec 2013 00:59:05 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312080059.rB80x50a008668@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Dec 2013 00:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259089 - head/sbin/mount_nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 00:59:05 -0000 Author: rmacklem Date: Sun Dec 8 00:59:04 2013 New Revision: 259089 URL: http://svnweb.freebsd.org/changeset/base/259089 Log: Document the noncontigwr NFS mount option. This is a content change. MFC after: 3 weeks Modified: head/sbin/mount_nfs/mount_nfs.8 Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Sun Dec 8 00:08:03 2013 (r259088) +++ head/sbin/mount_nfs/mount_nfs.8 Sun Dec 8 00:59:04 2013 (r259089) @@ -28,7 +28,7 @@ .\" @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd July 8, 2013 +.Dd December 7, 2013 .Dt MOUNT_NFS 8 .Os .Sh NAME @@ -257,6 +257,19 @@ servers on the client. Note that this option will only be honored when performing the initial mount, it will be silently ignored if used while updating the mount options. +.It Cm noncontigwr +This mount option allows the NFS client to +combine non-contiguous byte ranges being written +such that the dirty byte range becomes a superset of the bytes +that are dirty. +This reduces the number of writes significantly for software +builds. +The merging of byte ranges isn't done if the file has been file +locked, since most applications modifying a file from multiple +clients will use file locking. +As such, this option could result in a corrupted file for the +rare case of an application modifying the file from multiple +clients concurrently without using file locking. .It Cm principal For the RPCSEC_GSS security flavors, such as krb5, krb5i and krb5p, this option sets the name of the host based principal name expected From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 02:48:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6215F3AC; Sun, 8 Dec 2013 02:48:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E23A1A59; Sun, 8 Dec 2013 02:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB82m7lg047648; Sun, 8 Dec 2013 02:48:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB82m7HY047647; Sun, 8 Dec 2013 02:48:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312080248.rB82m7HY047647@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Dec 2013 02:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259090 - stable/9/sys/arm/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 02:48:07 -0000 Author: imp Date: Sun Dec 8 02:48:06 2013 New Revision: 259090 URL: http://svnweb.freebsd.org/changeset/base/259090 Log: 4096 is 4MB, and macb doesn't even come close to working, so don't say it is an altenative. It hasn't worked in quite some time. The die hards can still try to use macb in the tree if they want... Modified: stable/9/sys/arm/conf/SAM9G20EK Modified: stable/9/sys/arm/conf/SAM9G20EK ============================================================================== --- stable/9/sys/arm/conf/SAM9G20EK Sun Dec 8 00:59:04 2013 (r259089) +++ stable/9/sys/arm/conf/SAM9G20EK Sun Dec 8 02:48:06 2013 (r259090) @@ -37,18 +37,18 @@ options FFS #Berkeley Fast Filesystem #options UFS_ACL #Support for access control lists #options UFS_DIRHASH #Improve performance on big directories #options MD_ROOT #MD is a potential root device -#options MD_ROOT_SIZE=4096 # 3MB ram disk +#options MD_ROOT_SIZE=4096 #4MB ram disk options NFSCL #New Network Filesystem Client -#options NFSD #New Network Filesystem Server -#options NFSLOCKD #Network Lock Manager -#options NFS_ROOT #NFS usable as /, requires NFSCL -#options BOOTP_NFSROOT -#options BOOTP -#options BOOTP_NFSV3 -#options BOOTP_WIRED_TO=ate0 -#options BOOTP_COMPAT +options NFSD #New Network Filesystem Server +options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCL +options BOOTP_NFSROOT +options BOOTP +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=ate0 +options BOOTP_COMPAT -options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" +#options ROOTDEVNAME=\"ufs:/dev/mmcsd0s1a\" options ALT_BREAK_TO_DEBUGGER @@ -86,7 +86,6 @@ device uart # Serial Ports # Ethernet device ate # Ethernet Driver -#device macb # Alternate Ethernet driver device mii option AT91_ATE_USE_RMII From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 02:54:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84B50611; Sun, 8 Dec 2013 02:54:05 +0000 (UTC) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 312B71AC2; Sun, 8 Dec 2013 02:54:04 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id EB8141A5541; Sun, 8 Dec 2013 13:53:55 +1100 (EST) Date: Sun, 8 Dec 2013 13:53:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits Subject: Re: svn commit: r259080 - in head/sys: dev/iicbus geom/cache geom/journal In-Reply-To: <201312071955.rB7JtYNH001792@svn.freebsd.org> Message-ID: <20131208123144.U883@besplex.bde.org> References: <201312071955.rB7JtYNH001792@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=YYGEuWhf c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=3HaF-T8NxwoA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=ssdoF7uQumEA:10 a=-y4LA6a5D9EZghm1e9kA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 02:54:05 -0000 On Sat, 7 Dec 2013, Justin Hibbits wrote: > Log: > Fix some integer signs. These unsigned integers should all be signed. > > Found by: clang (powerpc64) Unsigned integers are indeed used excessively. They should only be used if values larger than INT_MAX need to be represented, but values larger than UINT_MAX need not be represented. This is a very small target (just 1 more bit). > Modified: head/sys/dev/iicbus/max6690.c > ============================================================================== > --- head/sys/dev/iicbus/max6690.c Sat Dec 7 19:39:38 2013 (r259079) > +++ head/sys/dev/iicbus/max6690.c Sat Dec 7 19:55:34 2013 (r259080) > @@ -362,7 +362,7 @@ max6690_sensor_sysctl(SYSCTL_HANDLER_ARG > struct max6690_softc *sc; > struct max6690_sensor *sens; > int error; > - unsigned int temp; > + int temp; > > dev = arg1; > sc = device_get_softc(dev); > This fixes one style bug (non-use of the BSD spelling u_int) but adds another (int declarations not grouped together). > Modified: head/sys/geom/cache/g_cache.c > ============================================================================== > --- head/sys/geom/cache/g_cache.c Sat Dec 7 19:39:38 2013 (r259079) > +++ head/sys/geom/cache/g_cache.c Sat Dec 7 19:55:34 2013 (r259080) > @@ -67,7 +67,7 @@ static u_int g_cache_used_hi = 20; > static int > sysctl_handle_pct(SYSCTL_HANDLER_ARGS) > { > - u_int val = *(u_int *)arg1; > + int val; > int error; > > error = sysctl_handle_int(oidp, &val, 0, req); > This adds the larger non-style bug that val is used uninitialized. Compilers should warn about this. This results in stack garbage being copied out instead of the "old" value. sysctl_handle_u_int() doesn't exist, so sysctl_handle_int() os often abused to handle u_int's and worse (sometimes "opaque" types, where it usually works accidentally if the type is 32 bits, and sometimes even works accidentally if the type is larger). clang seems to be complaining about this abuse. Why does it only complain here? Ah, maybe it is not smart enough to complain about this, but is just complaining about the (val < 0) range check. This adds 2 (lexical) style bugs: - the int declarations are not grouped together This misses fixing nearby bogus unsigned variables. The cast for these is more bogus than before. Indeed, the whole function is horrible, and this change is sort of backwards since it gives a sign mismatch with the underlying variables: % static u_int g_cache_used_lo = 5; % static u_int g_cache_used_hi = 20; Example of excessive use of unsigned types. These variables only need to handle percentages between 0 and 100. % static int Style bug (missing blank line); % sysctl_handle_pct(SYSCTL_HANDLER_ARGS) % { % u_int val = *(u_int *)arg1; This is the old version. It has another style bug (initialization in declaration). The initialization wouldn't have been lost so easily if it had been in the correct place. But the type was correct, since it is bug-for-bug constent with the underlying variables. % int error; % % error = sysctl_handle_int(oidp, &val, 0, req); sysctl_handle_int() was abused to handle the u_int (arg1 points to one of the above 2 variables). % if (error || !req->newptr) % return (error); 2 style bugs (2 boolean comparisions of non-booleans). Strict KNF doesn't even use the ! operator to test booleansl; it uses an explicit " == 0" test for this, though it sometimes doesn't write out "!= 0" for the reverse test. % if (val < 0 || val > 100) % return (EINVAL); The first test in this is redundant, This is apparently what clang was complaining about. The warning for that can be fixed by removing the test. However, I don't like this fix. It depends on the type being unsigned. The code becomes more fragile, and would break if the type were changed to the correct one (signed). % if ((arg1 == &g_cache_used_lo && val > g_cache_used_hi) || % (arg1 == &g_cache_used_hi && g_cache_used_lo > val)) % return (EINVAL); % *(u_int *)arg1 = val; There are only 2 variables handled by this function, so we use arg1 to set the correct one. However, the previous statement has decided which of the variables is being set, and we could use that to set it. Or better, convert arg1 from void * to u_int * up front, and use that throughout instead of several casts of arg1. % return (0); % } % SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_lo, CTLTYPE_UINT|CTLFLAG_RW, Style bugs: - missing blank line. This is intentional for grouping the function with its variables, as above, but still ugly. - missing spaces around binary operator '|'. This bug is too common for this operator, and for CTLFLAG*. But the spaces are even more needed for '|' than for '+' or '*', since '|' looks more like an alphanumeric character. % &g_cache_used_lo, 0, sysctl_handle_pct, "IU", ""); % SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_hi, CTLTYPE_UINT|CTLFLAG_RW, % &g_cache_used_hi, 0, sysctl_handle_pct, "IU", ""); Style bugs: - non-KNF continuation indent. This bug is too common for SYSCTL*(), although someone once did a fairly global sweep to fix it for them. - no description. This sysctl is over-engineered. A simple SYSCTL_UINT() is enough. There are many more-critical sysctls that don't have any range checking. The fix is not to bloat the kernel by adding range checking to them all. With several thousand sysctls, the range checking code could easily be over-engineered enough to double the size of an already massively bloated kernel. OTOH, there may still be runtime errors from sloppy caclulations using the percentage variables. The calculations are of the form (x * pct / 100) and not the more robust but fuzzier (x / 100 * pct). pct will normally be promoted to the type of x in these expressions (often to 64 bits, and then overflow is far off). Overflow is only affected by pct being unsigned if x is int or shorter. > Modified: head/sys/geom/journal/g_journal.c > ============================================================================== > --- head/sys/geom/journal/g_journal.c Sat Dec 7 19:39:38 2013 (r259079) > +++ head/sys/geom/journal/g_journal.c Sat Dec 7 19:55:34 2013 (r259080) > @@ -168,7 +168,7 @@ SYSCTL_UINT(_kern_geom_journal_cache, OI > static int > g_journal_cache_switch_sysctl(SYSCTL_HANDLER_ARGS) > { > - u_int cswitch; > + int cswitch; > int error; > > cswitch = g_journal_cache_switch; > 2 style bugs (int variables not grouped; int variables not sorted). This sysctl is missing most of the style bugs discussed above: - the transfer variable cswitch is not initialized in its declaration. Its initialization didn't get deleted. - the comparisons of the non-booleans are non-boolean. - the percentage variable is used in the robust way (x / 100 * pct). - the SYSCTL()s use KNF continuation indentation - there are spaces around the binary operator '|' - the SYSCTL()s have descriptions. This leaves mainly type errors (excessive use of unsigned variables). There is a different inconsistency: the u_int g_journal_cache_switch has formatting data "I" instead of "IU". Both will work due to the range checking and assumptions that the machine is not exotic, but there is no reason to not to use a consistent format. Another common style bug/API design error visible here is using sysctl_handle_int() on generic variables. You have to know that the variable type is int to use it or u_int, int32_t or uint32_t to abuse it. The width of the variable is in the sysctl data and is usually correct. sysctl_handle_opaque() is usable on generic variables but doesn't work so well (it prevents type checking and has more locking overheads). When sysctl_handle_int() is used, the width in the sysctl data should be used to detect size mismatches. It is used, but there are bugs in the error handling for this (something like ignoring size mismatches for short i/o's in only 1 direction). Bruce From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 03:02:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03C20934; Sun, 8 Dec 2013 03:02:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3C8D1CB8; Sun, 8 Dec 2013 03:02:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB832j9g055783; Sun, 8 Dec 2013 03:02:45 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB832iiM055772; Sun, 8 Dec 2013 03:02:44 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312080302.rB832iiM055772@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 8 Dec 2013 03:02:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259092 - in head/contrib/gcc: . cp doc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 03:02:46 -0000 Author: pfg Date: Sun Dec 8 03:02:44 2013 New Revision: 259092 URL: http://svnweb.freebsd.org/changeset/base/259092 Log: gcc: new fvisibility-ms-compat option Obtained from: gcc 4.3 (rev. 126088; GPLv2) MFC after: 3 weeks Modified: head/contrib/gcc/ChangeLog.gcc43 head/contrib/gcc/c.opt head/contrib/gcc/cp/ChangeLog.gcc43 head/contrib/gcc/cp/decl.c head/contrib/gcc/cp/decl2.c head/contrib/gcc/doc/invoke.texi Modified: head/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/ChangeLog.gcc43 Sun Dec 8 02:48:10 2013 (r259091) +++ head/contrib/gcc/ChangeLog.gcc43 Sun Dec 8 03:02:44 2013 (r259092) @@ -45,6 +45,12 @@ * flags.h (force_align_functions_log): Delete. * toplev.c (force_align_functions_log): Delete. +2007-06-28 Geoffrey Keating (r126088) + + * doc/invoke.texi (C++ Dialect Options): Document + fvisibility-ms-compat. + * c.opt (fvisibility-ms-compat): New. + 2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 Modified: head/contrib/gcc/c.opt ============================================================================== --- head/contrib/gcc/c.opt Sun Dec 8 02:48:10 2013 (r259091) +++ head/contrib/gcc/c.opt Sun Dec 8 03:02:44 2013 (r259092) @@ -741,6 +741,10 @@ fvisibility-inlines-hidden C++ ObjC++ Marks all inlined methods as having hidden visibility +fvisibility-ms-compat +C++ ObjC++ Var(flag_visibility_ms_compat) +Changes visibility to match Microsoft Visual Studio by default + fvtable-gc C++ ObjC++ Discard unused virtual functions Modified: head/contrib/gcc/cp/ChangeLog.gcc43 ============================================================================== --- head/contrib/gcc/cp/ChangeLog.gcc43 Sun Dec 8 02:48:10 2013 (r259091) +++ head/contrib/gcc/cp/ChangeLog.gcc43 Sun Dec 8 03:02:44 2013 (r259092) @@ -7,6 +7,13 @@ * typeck.c (cxx_alignof_expr): When alignof is used on a plain FUNCTION_DECL, return its alignment. +2007-06-28 Geoffrey Keating (r126088) + + * decl2.c (determine_visibility): Implement + flag_visibility_ms_compat effect on type info. + * decl.c (cxx_init_decl_processing): Implement + global effect of flag_visibility_ms_compat. + 2007-06-28 Geoffrey Keating (r126080) * decl2.c (start_objects): Mark constructor-runnning function Modified: head/contrib/gcc/cp/decl.c ============================================================================== --- head/contrib/gcc/cp/decl.c Sun Dec 8 02:48:10 2013 (r259091) +++ head/contrib/gcc/cp/decl.c Sun Dec 8 03:02:44 2013 (r259092) @@ -3157,6 +3157,9 @@ cxx_init_decl_processing (void) } if (flag_inline_functions) flag_inline_trees = 2; + + if (flag_visibility_ms_compat) + default_visibility = VISIBILITY_HIDDEN; /* Initially, C. */ current_lang_name = lang_name_c; Modified: head/contrib/gcc/cp/decl2.c ============================================================================== --- head/contrib/gcc/cp/decl2.c Sun Dec 8 02:48:10 2013 (r259091) +++ head/contrib/gcc/cp/decl2.c Sun Dec 8 03:02:44 2013 (r259092) @@ -1726,6 +1726,19 @@ determine_visibility (tree decl) but have no TEMPLATE_INFO, so don't try to check it. */ use_template = 0; } + else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl) + && flag_visibility_ms_compat) + { + /* Under -fvisibility-ms-compat, types are visible by default, + even though their contents aren't. */ + tree underlying_type = TREE_TYPE (DECL_NAME (decl)); + int underlying_vis = type_visibility (underlying_type); + if (underlying_vis == VISIBILITY_ANON + || CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type)) + constrain_visibility (decl, underlying_vis); + else + DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT; + } else if (TREE_CODE (decl) == VAR_DECL && DECL_TINFO_P (decl)) { /* tinfo visibility is based on the type it's for. */ Modified: head/contrib/gcc/doc/invoke.texi ============================================================================== --- head/contrib/gcc/doc/invoke.texi Sun Dec 8 02:48:10 2013 (r259091) +++ head/contrib/gcc/doc/invoke.texi Sun Dec 8 03:02:44 2013 (r259092) @@ -186,6 +186,7 @@ in the following sections. -frepo -fno-rtti -fstats -ftemplate-depth-@var{n} @gol -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol -fno-default-inline -fvisibility-inlines-hidden @gol +-fvisibility-ms-compat @gol -Wabi -Wctor-dtor-privacy @gol -Wnon-virtual-dtor -Wreorder @gol -Weffc++ -Wno-deprecated -Wstrict-null-sentinel @gol @@ -1626,6 +1627,40 @@ Explicitly instantiated inline methods a as their linkage might otherwise cross a shared library boundary. @xref{Template Instantiation}. +@item -fvisibility-ms-compat +@opindex fvisibility-ms-compat +This flag attempts to use visibility settings to make GCC's C++ +linkage model compatible with that of Microsoft Visual Studio. + +The flag makes these changes to GCC's linkage model: + +@enumerate +@item +It sets the default visibility to @code{hidden}, like +@option{-fvisibility=hidden}. + +@item +Types, but not their members, are not hidden by default. + +@item +The One Definition Rule is relaxed for types without explicit +visibility specifications which are defined in more than one different +shared object: those declarations are permitted if they would have +been permitted when this option was not used. +@end enumerate + +In new code it is better to use @option{-fvisibility=hidden} and +export those classes which are intended to be externally visible. +Unfortunately it is possible for code to rely, perhaps accidentally, +on the Visual Studio behaviour. + +Among the consequences of these changes are that static data members +of the same type with the same name but defined in different shared +objects will be different, so changing one will not change the other; +and that pointers to function members defined in different shared +objects may not compare equal. When this flag is given, it is a +violation of the ODR to define types with the same name differently. + @item -fno-weak @opindex fno-weak Do not use weak symbol support, even if it is provided by the linker. From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 03:49:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8ED8723B; Sun, 8 Dec 2013 03:49:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A35D1EB3; Sun, 8 Dec 2013 03:49:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB83nkX7070670; Sun, 8 Dec 2013 03:49:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB83nkhC070669; Sun, 8 Dec 2013 03:49:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312080349.rB83nkhC070669@svn.freebsd.org> From: Warner Losh Date: Sun, 8 Dec 2013 03:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259093 - stable/9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 03:49:46 -0000 Author: imp Date: Sun Dec 8 03:49:45 2013 New Revision: 259093 URL: http://svnweb.freebsd.org/changeset/base/259093 Log: MFC: r246881 | ian | 2013-02-16 13:43:16 -0700 (Sat, 16 Feb 2013) | 4 lines In _bus_dmamap_addseg(), the return value must be zero for error, or the size actually added to the segment (possibly smaller than the requested size if boundary crossings had to be avoided). This fixes NFS root on Atmel platforms, and likely others. Modified: stable/9/sys/arm/arm/busdma_machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/9/sys/arm/arm/busdma_machdep.c Sun Dec 8 03:02:44 2013 (r259092) +++ stable/9/sys/arm/arm/busdma_machdep.c Sun Dec 8 03:49:45 2013 (r259093) @@ -913,7 +913,7 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b dr = _bus_dma_inrange(dmat->ranges, dmat->_nranges, curaddr); if (dr == NULL) - return (EINVAL); + return (0); /* * In a valid DMA range. Translate the physical * memory address to an address in the DMA window. @@ -935,12 +935,12 @@ _bus_dmamap_addseg(bus_dma_tag_t dmat, b segs[seg].ds_len += sgsize; } else { if (++seg >= dmat->nsegments) - return (EFBIG); + return (0); segs[seg].ds_addr = curaddr; segs[seg].ds_len = sgsize; } *segp = seg; - return (0); + return (sgsize); } /* From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 05:39:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BEE4B16; Sun, 8 Dec 2013 05:39:55 +0000 (UTC) Received: from mail-bk0-x234.google.com (mail-bk0-x234.google.com [IPv6:2a00:1450:4008:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8241361; Sun, 8 Dec 2013 05:39:54 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id u14so877947bkz.25 for ; Sat, 07 Dec 2013 21:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=yiOH7KYEwFjHH+2LQIQO6j1IjErubz4pkQZNc5H985o=; b=YfufWuq8fwaBHa63BDH2lzBIp40CMFTaVLkaj1StaK5IqJMCoMrDhfYcswlNFlrmU6 kXTrHSK8d1ZLvFpkEh25XDoxffcIBiV9b8TlMeRoxJvucOnPJYNFg1E+iQvQH11oJxqv sicqfle0I7tfenU8jffaAGJSkfqpK+pZ90EufVbI0bFVsFI3NcDY35fV3EUKjdrJQdP0 2qsVeRLB5SOL//VUDqvY4Kwr3yvgK/tYDWPjUyJ84TT5I7F6u/oAEaBB7sTCnh3JNHCW rLOo6PvITeAcrAWhNZE+/d2xp8bgpk+0K1fAZxMk8Tjc+oIxWweJUZDqyaWZywrwYtYe nECw== MIME-Version: 1.0 X-Received: by 10.204.26.69 with SMTP id d5mr1185959bkc.47.1386481192380; Sat, 07 Dec 2013 21:39:52 -0800 (PST) Sender: chmeeedalf@gmail.com Received: by 10.205.90.136 with HTTP; Sat, 7 Dec 2013 21:39:52 -0800 (PST) Received: by 10.205.90.136 with HTTP; Sat, 7 Dec 2013 21:39:52 -0800 (PST) In-Reply-To: <20131208123144.U883@besplex.bde.org> References: <201312071955.rB7JtYNH001792@svn.freebsd.org> <20131208123144.U883@besplex.bde.org> Date: Sat, 7 Dec 2013 21:39:52 -0800 X-Google-Sender-Auth: tDGC97VU5SzD06P7kp5onp4wcVM Message-ID: Subject: Re: svn commit: r259080 - in head/sys: dev/iicbus geom/cache geom/journal From: Justin Hibbits To: Bruce Evans Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 05:39:55 -0000 On Dec 7, 2013 6:54 PM, "Bruce Evans" wrote: > > On Sat, 7 Dec 2013, Justin Hibbits wrote: > >> Log: >> Fix some integer signs. These unsigned integers should all be signed. >> >> Found by: clang (powerpc64) > > > Unsigned integers are indeed used excessively. They should only be used > if values larger than INT_MAX need to be represented, but values larger > than UINT_MAX need not be represented. This is a very small target > (just 1 more bit). > > >> Modified: head/sys/dev/iicbus/max6690.c >> ============================================================================== >> --- head/sys/dev/iicbus/max6690.c Sat Dec 7 19:39:38 2013 (r259079) >> +++ head/sys/dev/iicbus/max6690.c Sat Dec 7 19:55:34 2013 (r259080) >> @@ -362,7 +362,7 @@ max6690_sensor_sysctl(SYSCTL_HANDLER_ARG >> struct max6690_softc *sc; >> struct max6690_sensor *sens; >> int error; >> - unsigned int temp; >> + int temp; >> >> dev = arg1; >> sc = device_get_softc(dev); >> > > This fixes one style bug (non-use of the BSD spelling u_int) but adds > another (int declarations not grouped together). > > >> Modified: head/sys/geom/cache/g_cache.c >> ============================================================================== >> --- head/sys/geom/cache/g_cache.c Sat Dec 7 19:39:38 2013 (r259079) >> +++ head/sys/geom/cache/g_cache.c Sat Dec 7 19:55:34 2013 (r259080) >> @@ -67,7 +67,7 @@ static u_int g_cache_used_hi = 20; >> static int >> sysctl_handle_pct(SYSCTL_HANDLER_ARGS) >> { >> - u_int val = *(u_int *)arg1; >> + int val; >> int error; >> >> error = sysctl_handle_int(oidp, &val, 0, req); >> > > This adds the larger non-style bug that val is used uninitialized. > Compilers should warn about this. This results in stack garbage > being copied out instead of the "old" value. > Sorry, I missed that. I will fix it tonight when I get home. Very much a pointy hat to me. > sysctl_handle_u_int() doesn't exist, so sysctl_handle_int() os often > abused to handle u_int's and worse (sometimes "opaque" types, where > it usually works accidentally if the type is 32 bits, and sometimes > even works accidentally if the type is larger). clang seems to be > complaining about this abuse. Why does it only complain here? Ah, > maybe it is not smart enough to complain about this, but is just > complaining about the (val < 0) range check. > > This adds 2 (lexical) style bugs: > - the int declarations are not grouped together > > This misses fixing nearby bogus unsigned variables. The cast for these > is more bogus than before. Indeed, the whole function is horrible, and > this change is sort of backwards since it gives a sign mismatch with > the underlying variables: > > % static u_int g_cache_used_lo = 5; > > % static u_int g_cache_used_hi = 20; > > Example of excessive use of unsigned types. These variables only need > to handle percentages between 0 and 100. Only purpose was to fix the clang warning. I will look at this though. > > % static int > > Style bug (missing blank line); > > % sysctl_handle_pct(SYSCTL_HANDLER_ARGS) > % { > % u_int val = *(u_int *)arg1; > > This is the old version. It has another style bug (initialization in > declaration). The initialization wouldn't have been lost so easily > if it had been in the correct place. > > But the type was correct, since it is bug-for-bug constent with the > underlying variables. > > % int error; > % % error = sysctl_handle_int(oidp, &val, 0, req); > > sysctl_handle_int() was abused to handle the u_int (arg1 points to > one of the above 2 variables). > > % if (error || !req->newptr) > % return (error); > > 2 style bugs (2 boolean comparisions of non-booleans). Strict KNF doesn't > even use the ! operator to test booleansl; it uses an explicit " == 0" > test for this, though it sometimes doesn't write out "!= 0" for the reverse > test. > > % if (val < 0 || val > 100) > % return (EINVAL); > > The first test in this is redundant, This is apparently what clang was > complaining about. The warning for that can be fixed by removing the > test. However, I don't like this fix. It depends on the type being > unsigned. The code becomes more fragile, and would break if the type > were changed to the correct one (signed). > > % if ((arg1 == &g_cache_used_lo && val > g_cache_used_hi) || > % (arg1 == &g_cache_used_hi && g_cache_used_lo > val)) > % return (EINVAL); > % *(u_int *)arg1 = val; > > There are only 2 variables handled by this function, so we use arg1 to set the correct one. However, the previous statement has decided > which of the variables is being set, and we could use that to set it. > Or better, convert arg1 from void * to u_int * up front, and use that > throughout instead of several casts of arg1. > > % return (0); > % } > % SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_lo, CTLTYPE_UINT|CTLFLAG_RW, > > Style bugs: > - missing blank line. This is intentional for grouping the function with > its variables, as above, but still ugly. > - missing spaces around binary operator '|'. This bug is too common for > this operator, and for CTLFLAG*. But the spaces are even more needed > for '|' than for '+' or '*', since '|' looks more like an alphanumeric > character. > > % &g_cache_used_lo, 0, sysctl_handle_pct, "IU", ""); > % SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_hi, CTLTYPE_UINT|CTLFLAG_RW, > % &g_cache_used_hi, 0, sysctl_handle_pct, "IU", ""); > > Style bugs: > - non-KNF continuation indent. This bug is too common for SYSCTL*(), > although someone once did a fairly global sweep to fix it for them. > - no description. > > This sysctl is over-engineered. A simple SYSCTL_UINT() is enough. > There are many more-critical sysctls that don't have any range checking. > The fix is not to bloat the kernel by adding range checking to them > all. With several thousand sysctls, the range checking code could > easily be over-engineered enough to double the size of an already > massively bloated kernel. OTOH, there may still be runtime errors > from sloppy caclulations using the percentage variables. The > calculations are of the form (x * pct / 100) and not the more robust > but fuzzier (x / 100 * pct). pct will normally be promoted to the > type of x in these expressions (often to 64 bits, and then overflow > is far off). Overflow is only affected by pct being unsigned if x is > int or shorter. > > >> Modified: head/sys/geom/journal/g_journal.c >> ============================================================================== >> --- head/sys/geom/journal/g_journal.c Sat Dec 7 19:39:38 2013 (r259079) >> +++ head/sys/geom/journal/g_journal.c Sat Dec 7 19:55:34 2013 (r259080) >> @@ -168,7 +168,7 @@ SYSCTL_UINT(_kern_geom_journal_cache, OI >> static int >> g_journal_cache_switch_sysctl(SYSCTL_HANDLER_ARGS) >> { >> - u_int cswitch; >> + int cswitch; >> int error; >> >> cswitch = g_journal_cache_switch; >> > > 2 style bugs (int variables not grouped; int variables not sorted). > > This sysctl is missing most of the style bugs discussed above: > - the transfer variable cswitch is not initialized in its declaration. > Its initialization didn't get deleted. > - the comparisons of the non-booleans are non-boolean. > - the percentage variable is used in the robust way (x / 100 * pct). > - the SYSCTL()s use KNF continuation indentation > - there are spaces around the binary operator '|' > - the SYSCTL()s have descriptions. > > This leaves mainly type errors (excessive use of unsigned variables). > There is a different inconsistency: the u_int g_journal_cache_switch > has formatting data "I" instead of "IU". Both will work due to the > range checking and assumptions that the machine is not exotic, but there > is no reason to not to use a consistent format. > > Another common style bug/API design error visible here is using > sysctl_handle_int() on generic variables. You have to know that the > variable type is int to use it or u_int, int32_t or uint32_t to abuse > it. The width of the variable is in the sysctl data and is usually > correct. sysctl_handle_opaque() is usable on generic variables but > doesn't work so well (it prevents type checking and has more locking > overheads). When sysctl_handle_int() is used, the width in the sysctl > data should be used to detect size mismatches. It is used, but there > are bugs in the error handling for this (something like ignoring size > mismatches for short i/o's in only 1 direction). > > Bruce I will fix all the bugs I introduced tonight or tomorrow. The rest I will either look at or file for later. Sorry for the breakage. -Justin From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 05:55:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79D1FDA8; Sun, 8 Dec 2013 05:55:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64C60147D; Sun, 8 Dec 2013 05:55:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB85tutj016980; Sun, 8 Dec 2013 05:55:56 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB85tu8W016979; Sun, 8 Dec 2013 05:55:56 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312080555.rB85tu8W016979@svn.freebsd.org> From: Peter Wemm Date: Sun, 8 Dec 2013 05:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259094 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 05:55:56 -0000 Author: peter Date: Sun Dec 8 05:55:55 2013 New Revision: 259094 URL: http://svnweb.freebsd.org/changeset/base/259094 Log: Rev 256256 had an undocumented side effect of breaking existing behavior for ipv6 jails. Among the harmful side effects included putting a route to an entire /64 onto an interface even if you were in a smaller network - eg: /80. This broke the freebsd.org cluster hosted at ISC which has /80 networks. Modified: head/etc/rc.d/jail Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sun Dec 8 03:49:45 2013 (r259093) +++ head/etc/rc.d/jail Sun Dec 8 05:55:55 2013 (r259094) @@ -319,8 +319,8 @@ jail_extract_address() _mask=${_mask:-/32} elif [ "${_type}" = "inet6" ]; then - # In case _maske is not set for IPv6, use /64. - _mask=${_mask:-/64} + # In case _maske is not set for IPv6, use /128. + _mask=${_mask:-/128} fi } From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 06:52:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A5AA3A3; Sun, 8 Dec 2013 06:52:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5601799; Sun, 8 Dec 2013 06:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB86qMOJ037334; Sun, 8 Dec 2013 06:52:22 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB86qMvs037333; Sun, 8 Dec 2013 06:52:22 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312080652.rB86qMvs037333@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 8 Dec 2013 06:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259095 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 06:52:23 -0000 Author: hselasky Date: Sun Dec 8 06:52:22 2013 New Revision: 259095 URL: http://svnweb.freebsd.org/changeset/base/259095 Log: Fix typos. Found by: remko Modified: head/sys/dev/usb/controller/usb_controller.c Modified: head/sys/dev/usb/controller/usb_controller.c ============================================================================== --- head/sys/dev/usb/controller/usb_controller.c Sun Dec 8 05:55:55 2013 (r259094) +++ head/sys/dev/usb/controller/usb_controller.c Sun Dec 8 06:52:22 2013 (r259095) @@ -441,7 +441,7 @@ usb_bus_detach(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_suspend * - * This function is used to suspend the USB contoller. + * This function is used to suspend the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_suspend(struct usb_proc_msg *pm) @@ -498,7 +498,7 @@ usb_bus_suspend(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_resume * - * This function is used to resume the USB contoller. + * This function is used to resume the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_resume(struct usb_proc_msg *pm) @@ -561,7 +561,7 @@ usb_bus_resume(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_reset * - * This function is used to reset the USB contoller. + * This function is used to reset the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_reset(struct usb_proc_msg *pm) @@ -583,7 +583,7 @@ usb_bus_reset(struct usb_proc_msg *pm) /*------------------------------------------------------------------------* * usb_bus_shutdown * - * This function is used to shutdown the USB contoller. + * This function is used to shutdown the USB controller. *------------------------------------------------------------------------*/ static void usb_bus_shutdown(struct usb_proc_msg *pm) From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 09:34:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB3DC478; Sun, 8 Dec 2013 09:34:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6AE31684; Sun, 8 Dec 2013 09:34:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB89YuXV095258; Sun, 8 Dec 2013 09:34:56 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB89YuAD095256; Sun, 8 Dec 2013 09:34:56 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312080934.rB89YuAD095256@svn.freebsd.org> From: Justin Hibbits Date: Sun, 8 Dec 2013 09:34:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259096 - in head/sys/geom: cache journal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 09:34:57 -0000 Author: jhibbits Date: Sun Dec 8 09:34:56 2013 New Revision: 259096 URL: http://svnweb.freebsd.org/changeset/base/259096 Log: Partially revert r259080. bde@ pointed out that there are a lot more style bugs going on in here than can be fixed, and I introduced some of my own. Rather than fix the whole host of them, back out my bugs. Found by: bde X-MFC with: r259080 Modified: head/sys/geom/cache/g_cache.c head/sys/geom/journal/g_journal.c Modified: head/sys/geom/cache/g_cache.c ============================================================================== --- head/sys/geom/cache/g_cache.c Sun Dec 8 06:52:22 2013 (r259095) +++ head/sys/geom/cache/g_cache.c Sun Dec 8 09:34:56 2013 (r259096) @@ -67,7 +67,7 @@ static u_int g_cache_used_hi = 20; static int sysctl_handle_pct(SYSCTL_HANDLER_ARGS) { - int val; + u_int val = *(u_int *)arg1; int error; error = sysctl_handle_int(oidp, &val, 0, req); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Sun Dec 8 06:52:22 2013 (r259095) +++ head/sys/geom/journal/g_journal.c Sun Dec 8 09:34:56 2013 (r259096) @@ -168,7 +168,7 @@ SYSCTL_UINT(_kern_geom_journal_cache, OI static int g_journal_cache_switch_sysctl(SYSCTL_HANDLER_ARGS) { - int cswitch; + u_int cswitch; int error; cswitch = g_journal_cache_switch; From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 09:36:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C4E25C4; Sun, 8 Dec 2013 09:36:20 +0000 (UTC) Received: from mail-pd0-x22b.google.com (mail-pd0-x22b.google.com [IPv6:2607:f8b0:400e:c02::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C8A21691; Sun, 8 Dec 2013 09:36:20 +0000 (UTC) Received: by mail-pd0-f171.google.com with SMTP id z10so3423837pdj.16 for ; Sun, 08 Dec 2013 01:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=UatvS/2IR+fy6XLXHua3Zid/YipF2AWCdKyzQ26WgMU=; b=fEs5kv4iLGXHI1yQ4+BXO4LK7IzN6w2ewwll7RykFBPzndQvRi6nUsNN3D+gIH8QTb zj7Xn1NznJ2Pjj38+J86qs/l4BEa7ZrMdXEP2KXcALaw3rr/0WLmTUHWXwnA5iNZeLsK LEvN2FwY0FWnPADwwb5C7rhmJKFpwu4BQHCiEa6L+EPNL5D3qeQfJfumboeoAyWZ1d77 yf95uPhI//yCVAfXn1qBSiaMP97Z5kgK6k7fSnwB/Vdgh3fYMybOvmKqSIOYmNG/FXM+ bIjbCECcGrOUU0l5n0lgQH6vaDrRUkrhPu+xjmRw+GZ5eULOCTWKQ/HX4MIwaKuG3caw xW9Q== X-Received: by 10.66.221.199 with SMTP id qg7mr14488223pac.13.1386495379607; Sun, 08 Dec 2013 01:36:19 -0800 (PST) Received: from zhabar.gateway.2wire.net (76-253-2-5.lightspeed.sntcca.sbcglobal.net. [76.253.2.5]) by mx.google.com with ESMTPSA id gh3sm9840028pbb.2.2013.12.08.01.36.18 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Sun, 08 Dec 2013 01:36:19 -0800 (PST) Date: Sun, 8 Dec 2013 01:36:14 -0800 From: Justin Hibbits To: Bruce Evans Subject: Re: svn commit: r259080 - in head/sys: dev/iicbus geom/cache geom/journal Message-ID: <20131208013614.6dc63ef9@zhabar.gateway.2wire.net> In-Reply-To: <20131208123144.U883@besplex.bde.org> References: <201312071955.rB7JtYNH001792@svn.freebsd.org> <20131208123144.U883@besplex.bde.org> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.19; powerpc64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 09:36:20 -0000 On Sun, 8 Dec 2013 13:53:30 +1100 (EST) Bruce Evans wrote: > On Sat, 7 Dec 2013, Justin Hibbits wrote: > > > Log: > > Fix some integer signs. These unsigned integers should all be > > signed. > > > > Found by: clang (powerpc64) > > Unsigned integers are indeed used excessively. They should only be > used if values larger than INT_MAX need to be represented, but values > larger than UINT_MAX need not be represented. This is a very small > target (just 1 more bit). > > > Modified: head/sys/dev/iicbus/max6690.c > > ============================================================================== > > --- head/sys/dev/iicbus/max6690.c Sat Dec 7 19:39:38 > > 2013 (r259079) +++ head/sys/dev/iicbus/max6690.c Sat > > Dec 7 19:55:34 2013 (r259080) @@ -362,7 +362,7 @@ > > max6690_sensor_sysctl(SYSCTL_HANDLER_ARG struct max6690_softc *sc; > > struct max6690_sensor *sens; > > int error; > > - unsigned int temp; > > + int temp; > > > > dev = arg1; > > sc = device_get_softc(dev); > > > > This fixes one style bug (non-use of the BSD spelling u_int) but adds > another (int declarations not grouped together). > > > Modified: head/sys/geom/cache/g_cache.c > > ============================================================================== > > --- head/sys/geom/cache/g_cache.c Sat Dec 7 19:39:38 > > 2013 (r259079) +++ head/sys/geom/cache/g_cache.c Sat > > Dec 7 19:55:34 2013 (r259080) @@ -67,7 +67,7 @@ static > > u_int g_cache_used_hi = 20; static int > > sysctl_handle_pct(SYSCTL_HANDLER_ARGS) > > { > > - u_int val = *(u_int *)arg1; > > + int val; > > int error; > > > > error = sysctl_handle_int(oidp, &val, 0, req); > > > > This adds the larger non-style bug that val is used uninitialized. > Compilers should warn about this. This results in stack garbage > being copied out instead of the "old" value. > > sysctl_handle_u_int() doesn't exist, so sysctl_handle_int() os often > abused to handle u_int's and worse (sometimes "opaque" types, where > it usually works accidentally if the type is 32 bits, and sometimes > even works accidentally if the type is larger). clang seems to be > complaining about this abuse. Why does it only complain here? Ah, > maybe it is not smart enough to complain about this, but is just > complaining about the (val < 0) range check. > > This adds 2 (lexical) style bugs: > - the int declarations are not grouped together > > This misses fixing nearby bogus unsigned variables. The cast for > these is more bogus than before. Indeed, the whole function is > horrible, and this change is sort of backwards since it gives a sign > mismatch with the underlying variables: > > % static u_int g_cache_used_lo = 5; > % static u_int g_cache_used_hi = 20; > > Example of excessive use of unsigned types. These variables only need > to handle percentages between 0 and 100. > > % static int > > Style bug (missing blank line); > > % sysctl_handle_pct(SYSCTL_HANDLER_ARGS) > % { > % u_int val = *(u_int *)arg1; > > This is the old version. It has another style bug (initialization in > declaration). The initialization wouldn't have been lost so easily > if it had been in the correct place. > > But the type was correct, since it is bug-for-bug constent with the > underlying variables. > > % int error; > % > % error = sysctl_handle_int(oidp, &val, 0, req); > > sysctl_handle_int() was abused to handle the u_int (arg1 points to > one of the above 2 variables). > > % if (error || !req->newptr) > % return (error); > > 2 style bugs (2 boolean comparisions of non-booleans). Strict KNF > doesn't even use the ! operator to test booleansl; it uses an > explicit " == 0" test for this, though it sometimes doesn't write out > "!= 0" for the reverse test. > > % if (val < 0 || val > 100) > % return (EINVAL); > > The first test in this is redundant, This is apparently what clang > was complaining about. The warning for that can be fixed by removing > the test. However, I don't like this fix. It depends on the type > being unsigned. The code becomes more fragile, and would break if > the type were changed to the correct one (signed). > > % if ((arg1 == &g_cache_used_lo && val > g_cache_used_hi) || > % (arg1 == &g_cache_used_hi && g_cache_used_lo > val)) > % return (EINVAL); > % *(u_int *)arg1 = val; > > There are only 2 variables handled by this function, so we use arg1 > to set the correct one. However, the previous statement has decided > which of the variables is being set, and we could use that to set it. > Or better, convert arg1 from void * to u_int * up front, and use that > throughout instead of several casts of arg1. > > % return (0); > % } > % SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_lo, > CTLTYPE_UINT|CTLFLAG_RW, > > Style bugs: > - missing blank line. This is intentional for grouping the function > with its variables, as above, but still ugly. > - missing spaces around binary operator '|'. This bug is too common > for this operator, and for CTLFLAG*. But the spaces are even more > needed for '|' than for '+' or '*', since '|' looks more like an > alphanumeric character. > > % &g_cache_used_lo, 0, sysctl_handle_pct, "IU", ""); > % SYSCTL_PROC(_kern_geom_cache, OID_AUTO, used_hi, > CTLTYPE_UINT|CTLFLAG_RW, % &g_cache_used_hi, 0, > sysctl_handle_pct, "IU", ""); > > Style bugs: > - non-KNF continuation indent. This bug is too common for SYSCTL*(), > although someone once did a fairly global sweep to fix it for them. > - no description. > > This sysctl is over-engineered. A simple SYSCTL_UINT() is enough. > There are many more-critical sysctls that don't have any range > checking. The fix is not to bloat the kernel by adding range checking > to them all. With several thousand sysctls, the range checking code > could easily be over-engineered enough to double the size of an > already massively bloated kernel. OTOH, there may still be runtime > errors from sloppy caclulations using the percentage variables. The > calculations are of the form (x * pct / 100) and not the more robust > but fuzzier (x / 100 * pct). pct will normally be promoted to the > type of x in these expressions (often to 64 bits, and then overflow > is far off). Overflow is only affected by pct being unsigned if x is > int or shorter. > > > Modified: head/sys/geom/journal/g_journal.c > > ============================================================================== > > --- head/sys/geom/journal/g_journal.c Sat Dec 7 19:39:38 > > 2013 (r259079) +++ head/sys/geom/journal/g_journal.c > > Sat Dec 7 19:55:34 2013 (r259080) @@ -168,7 +168,7 @@ > > SYSCTL_UINT(_kern_geom_journal_cache, OI static int > > g_journal_cache_switch_sysctl(SYSCTL_HANDLER_ARGS) > > { > > - u_int cswitch; > > + int cswitch; > > int error; > > > > cswitch = g_journal_cache_switch; > > > > 2 style bugs (int variables not grouped; int variables not sorted). > > This sysctl is missing most of the style bugs discussed above: > - the transfer variable cswitch is not initialized in its declaration. > Its initialization didn't get deleted. > - the comparisons of the non-booleans are non-boolean. > - the percentage variable is used in the robust way (x / 100 * pct). > - the SYSCTL()s use KNF continuation indentation > - there are spaces around the binary operator '|' > - the SYSCTL()s have descriptions. > > This leaves mainly type errors (excessive use of unsigned variables). > There is a different inconsistency: the u_int g_journal_cache_switch > has formatting data "I" instead of "IU". Both will work due to the > range checking and assumptions that the machine is not exotic, but > there is no reason to not to use a consistent format. > > Another common style bug/API design error visible here is using > sysctl_handle_int() on generic variables. You have to know that the > variable type is int to use it or u_int, int32_t or uint32_t to abuse > it. The width of the variable is in the sysctl data and is usually > correct. sysctl_handle_opaque() is usable on generic variables but > doesn't work so well (it prevents type checking and has more locking > overheads). When sysctl_handle_int() is used, the width in the sysctl > data should be used to detect size mismatches. It is used, but there > are bugs in the error handling for this (something like ignoring size > mismatches for short i/o's in only 1 direction). > > Bruce I just reverted these two changes in r259096. Rather than fix what I did and change the rest of the files, I'm leaving them for another day, and reverted my changes so they're at least back to the working order from before. - Justin From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 13:46:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB580FE4; Sun, 8 Dec 2013 13:46:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9739E13AB; Sun, 8 Dec 2013 13:46:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8DkRFQ086574; Sun, 8 Dec 2013 13:46:27 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8DkR0t086573; Sun, 8 Dec 2013 13:46:27 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201312081346.rB8DkR0t086573@svn.freebsd.org> From: Luiz Otavio O Souza Date: Sun, 8 Dec 2013 13:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259099 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 13:46:27 -0000 Author: loos Date: Sun Dec 8 13:46:27 2013 New Revision: 259099 URL: http://svnweb.freebsd.org/changeset/base/259099 Log: Similar to r255816, fix the math for the DELAY() calculation. It was off by a really small amount because of the higher timer resolution. Approved by: adrian (mentor) Verified on: BBB Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c Modified: head/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 8 11:13:37 2013 (r259098) +++ head/sys/arm/ti/am335x/am335x_dmtimer.c Sun Dec 8 13:46:27 2013 (r259099) @@ -359,7 +359,7 @@ DELAY(int usec) } /* Get the number of times to count */ - counts = usec * ((am335x_dmtimer_tc.tc_frequency / 1000000) + 1); + counts = usec * (am335x_dmtimer_tc.tc_frequency / 1000000) + 1; first = am335x_dmtimer_tc_read_4(DMTIMER_TCRR); From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 13:56:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 41EEC390; Sun, 8 Dec 2013 13:56:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9C3147D; Sun, 8 Dec 2013 13:56:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8DuRLR090021; Sun, 8 Dec 2013 13:56:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8DuQ4e090020; Sun, 8 Dec 2013 13:56:26 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312081356.rB8DuQ4e090020@svn.freebsd.org> From: Dimitry Andric Date: Sun, 8 Dec 2013 13:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259100 - head/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 13:56:27 -0000 Author: dim Date: Sun Dec 8 13:56:26 2013 New Revision: 259100 URL: http://svnweb.freebsd.org/changeset/base/259100 Log: Pull in r196658 from upstream clang trunk: CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. [LLVM] PR18098. This should fix clang "Broken module found, compilation aborted" errors when building the qt4-based dvbcut port. Reported by: se MFC after: 3 days Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Modified: head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Sun Dec 8 13:46:27 2013 (r259099) +++ head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Sun Dec 8 13:56:26 2013 (r259100) @@ -454,10 +454,9 @@ void CodeGenVTables::EmitThunk(GlobalDec } else { // Normal thunk body generation. CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk); + if (UseAvailableExternallyLinkage) + ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } - - if (UseAvailableExternallyLinkage) - ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD, From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 14:21:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF67073; Sun, 8 Dec 2013 14:21:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0DC16F9; Sun, 8 Dec 2013 14:21:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8ELsvb001077; Sun, 8 Dec 2013 14:21:54 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8ELsTt001076; Sun, 8 Dec 2013 14:21:54 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312081421.rB8ELsTt001076@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 8 Dec 2013 14:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259101 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 14:21:54 -0000 Author: dumbbell Date: Sun Dec 8 14:21:54 2013 New Revision: 259101 URL: http://svnweb.freebsd.org/changeset/base/259101 Log: drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes This fixes radeon_agp_init() and gtt_size is now correct. However, this is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't implemented yet. Submitted by: tijl@ Modified: head/sys/dev/drm2/radeon/radeon_agp.c Modified: head/sys/dev/drm2/radeon/radeon_agp.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_agp.c Sun Dec 8 13:56:26 2013 (r259100) +++ head/sys/dev/drm2/radeon/radeon_agp.c Sun Dec 8 14:21:54 2013 (r259101) @@ -153,11 +153,11 @@ int radeon_agp_init(struct radeon_device return ret; } - if (rdev->ddev->agp->info.ai_aperture_size < 32) { + if ((rdev->ddev->agp->info.ai_aperture_size >> 20) < 32) { drm_agp_release(rdev->ddev); dev_warn(rdev->dev, "AGP aperture too small (%zuM) " "need at least 32M, disabling AGP\n", - rdev->ddev->agp->info.ai_aperture_size); + rdev->ddev->agp->info.ai_aperture_size >> 20); return -EINVAL; } @@ -246,7 +246,7 @@ int radeon_agp_init(struct radeon_device } rdev->mc.agp_base = rdev->ddev->agp->info.ai_aperture_base; - rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size << 20; + rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size; rdev->mc.gtt_start = rdev->mc.agp_base; rdev->mc.gtt_end = rdev->mc.gtt_start + rdev->mc.gtt_size - 1; dev_info(rdev->dev, "GTT: %juM 0x%08jX - 0x%08jX\n", From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 15:25:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B32E5CE1; Sun, 8 Dec 2013 15:25:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9F5BD1A4C; Sun, 8 Dec 2013 15:25:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8FPJso023253; Sun, 8 Dec 2013 15:25:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8FPJK0023252; Sun, 8 Dec 2013 15:25:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201312081525.rB8FPJK0023252@svn.freebsd.org> From: Marius Strobl Date: Sun, 8 Dec 2013 15:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259102 - head/sys/sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 15:25:19 -0000 Author: marius Date: Sun Dec 8 15:25:19 2013 New Revision: 259102 URL: http://svnweb.freebsd.org/changeset/base/259102 Log: Restore a vital comment nuked in r259016. Modified: head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Sun Dec 8 14:21:54 2013 (r259101) +++ head/sys/sparc64/sparc64/machdep.c Sun Dec 8 15:25:19 2013 (r259102) @@ -553,6 +553,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * trigger a fatal reset error or worse things further down the road. * XXX it should be possible to use this solely instead of writing * %tba in cpu_setregs(). Doing so causes a hang however. + * + * NB: the low-level console drivers require a working DELAY() and + * some compiler optimizations may cause the curthread accesses of + * mutex(9) to be factored out even if the latter aren't actually + * called. Both of these require PCPU_REG to be set. However, we + * can't set PCPU_REG without also taking over the trap table or the + * firmware will overwrite it. */ sun4u_set_traptable(tl0_base); From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 15:36:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B1BFFAC; Sun, 8 Dec 2013 15:36:23 +0000 (UTC) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01E7B1ACD; Sun, 8 Dec 2013 15:36:22 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.7/8.14.7/ALCHEMY.FRANKEN.DE) with ESMTP id rB8FaKAR077487; Sun, 8 Dec 2013 16:36:21 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.7/8.14.7/Submit) id rB8FaKGY077486; Sun, 8 Dec 2013 16:36:20 +0100 (CET) (envelope-from marius) Date: Sun, 8 Dec 2013 16:36:20 +0100 From: Marius Strobl To: Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-ID: <20131208153620.GA21278@alchemy.franken.de> References: <201312052238.rB5McsVN020719@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312052238.rB5McsVN020719@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 15:36:23 -0000 On Thu, Dec 05, 2013 at 10:38:54PM +0000, Aleksandr Rybalko wrote: > Author: ray > Date: Thu Dec 5 22:38:53 2013 > New Revision: 259016 > URL: http://svnweb.freebsd.org/changeset/base/259016 > > Log: > Merge VT(9) project (a.k.a. newcons). > > Reviewed by: nwhitehorn > MFC_to_10_after: re approval Have you addressed any of the points raised in: http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045887.html to get VT(9) at least en par with syscons(4) regarding being able to use a hardware cursor, allowing different low-level console drivers to compete for the same hardware etc. in the meantime? Marius From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 17:47:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDDA17EE; Sun, 8 Dec 2013 17:47:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C14101269; Sun, 8 Dec 2013 17:47:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8HlcoS074479; Sun, 8 Dec 2013 17:47:38 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8Hlc0d074476; Sun, 8 Dec 2013 17:47:38 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312081747.rB8Hlc0d074476@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 8 Dec 2013 17:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259103 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 17:47:39 -0000 Author: np Date: Sun Dec 8 17:47:37 2013 New Revision: 259103 URL: http://svnweb.freebsd.org/changeset/base/259103 Log: cxgbe(4): save a copy of the RSS map for each port for the driver's use. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sun Dec 8 15:25:19 2013 (r259102) +++ head/sys/dev/cxgbe/adapter.h Sun Dec 8 17:47:37 2013 (r259103) @@ -200,6 +200,7 @@ struct port_info { unsigned long flags; int if_flags; + uint16_t *rss; uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Dec 8 15:25:19 2013 (r259102) +++ head/sys/dev/cxgbe/t4_main.c Sun Dec 8 17:47:37 2013 (r259103) @@ -3157,7 +3157,7 @@ port_full_init(struct port_info *pi) struct ifnet *ifp = pi->ifp; uint16_t *rss; struct sge_rxq *rxq; - int rc, i; + int rc, i, j; ASSERT_SYNCHRONIZED_OP(sc); KASSERT((pi->flags & PORT_INIT_DONE) == 0, @@ -3174,21 +3174,25 @@ port_full_init(struct port_info *pi) goto done; /* error message displayed already */ /* - * Setup RSS for this port. + * Setup RSS for this port. Save a copy of the RSS table for later use. */ - rss = malloc(pi->nrxq * sizeof (*rss), M_CXGBE, - M_ZERO | M_WAITOK); - for_each_rxq(pi, i, rxq) { - rss[i] = rxq->iq.abs_id; + rss = malloc(pi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK); + for (i = 0; i < pi->rss_size;) { + for_each_rxq(pi, j, rxq) { + rss[i++] = rxq->iq.abs_id; + if (i == pi->rss_size) + break; + } } - rc = -t4_config_rss_range(sc, sc->mbox, pi->viid, 0, - pi->rss_size, rss, pi->nrxq); - free(rss, M_CXGBE); + + rc = -t4_config_rss_range(sc, sc->mbox, pi->viid, 0, pi->rss_size, rss, + pi->rss_size); if (rc != 0) { if_printf(ifp, "rss_config failed: %d\n", rc); goto done; } + pi->rss = rss; pi->flags |= PORT_INIT_DONE; done: if (rc != 0) @@ -3237,6 +3241,7 @@ port_full_uninit(struct port_info *pi) quiesce_fl(sc, &ofld_rxq->fl); } #endif + free(pi->rss, M_CXGBE); } t4_teardown_port_queues(pi); Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sun Dec 8 15:25:19 2013 (r259102) +++ head/sys/dev/cxgbe/t4_sge.c Sun Dec 8 17:47:37 2013 (r259103) @@ -1678,7 +1678,7 @@ t4_eth_rx(struct sge_iq *iq, const struc m0->m_pkthdr.rcvif = ifp; m0->m_flags |= M_FLOWID; - m0->m_pkthdr.flowid = rss->hash_val; + m0->m_pkthdr.flowid = be32toh(rss->hash_val); if (cpl->csum_calc && !cpl->err_vec) { if (ifp->if_capenable & IFCAP_RXCSUM && From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 18:48:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0FF084D; Sun, 8 Dec 2013 18:48:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCE14165B; Sun, 8 Dec 2013 18:48:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8Im7Ls096183; Sun, 8 Dec 2013 18:48:07 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8Im7o7096182; Sun, 8 Dec 2013 18:48:07 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312081848.rB8Im7o7096182@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sun, 8 Dec 2013 18:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259104 - head/sys/dev/drm2/radeon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 18:48:07 -0000 Author: dumbbell Date: Sun Dec 8 18:48:07 2013 New Revision: 259104 URL: http://svnweb.freebsd.org/changeset/base/259104 Log: drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSD The code was unmodified compared to Linux and returned the amount of received bytes from the i2c bus. This led to non-working i2c bus and failure to eg. read monitor's EDID, if connected to DisplayPort. MFC after: 3 days Tested by: Mikaël Urankar Modified: head/sys/dev/drm2/radeon/atombios_dp.c Modified: head/sys/dev/drm2/radeon/atombios_dp.c ============================================================================== --- head/sys/dev/drm2/radeon/atombios_dp.c Sun Dec 8 17:47:37 2013 (r259103) +++ head/sys/dev/drm2/radeon/atombios_dp.c Sun Dec 8 18:48:07 2013 (r259104) @@ -272,7 +272,7 @@ int radeon_dp_i2c_aux_ch(device_t dev, i case AUX_I2C_REPLY_ACK: if (mode == MODE_I2C_READ) *read_byte = reply[0]; - return ret; + return (0); /* Return ret on Linux. */ case AUX_I2C_REPLY_NACK: DRM_DEBUG_KMS("aux_i2c nack\n"); return -EREMOTEIO; From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 19:32:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADCA5AB4; Sun, 8 Dec 2013 19:32:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 99FB21919; Sun, 8 Dec 2013 19:32:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8JWTFO015413; Sun, 8 Dec 2013 19:32:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8JWTXt015412; Sun, 8 Dec 2013 19:32:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312081932.rB8JWTXt015412@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 Dec 2013 19:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259106 - head/sbin/casperd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 19:32:29 -0000 Author: pjd Date: Sun Dec 8 19:32:29 2013 New Revision: 259106 URL: http://svnweb.freebsd.org/changeset/base/259106 Log: Some improvements to the casperd manual page. Submitted by: emaste Modified: head/sbin/casperd/casperd.8 Modified: head/sbin/casperd/casperd.8 ============================================================================== --- head/sbin/casperd/casperd.8 Sun Dec 8 19:20:50 2013 (r259105) +++ head/sbin/casperd/casperd.8 Sun Dec 8 19:32:29 2013 (r259106) @@ -43,15 +43,15 @@ .Sh DESCRIPTION The .Nm -daemon provides various services in capability-like fashion to programs -running in capability mode sandbox. +daemon hosts various services that can be accessed through +libcapsicum's capabilities by programs running in sandboxes. For example it is prohibited to send UDP packets to arbitrary destinations when operating in capability mode, which makes DNS resolution impossible. To make it possible the .Nm -daemon provides +daemon provides the .Nm system.dns -service that allows to proxy DNS resolution requests through dedicated, +service that proxies DNS resolution requests through a dedicated, non-sandboxed process provided by .Nm . .Pp @@ -80,15 +80,15 @@ stored. The default location is .Pa /var/run/casperd.pid . .It Fl S Ar sockpath -Specify alternative location of a +Specify alternative location of the .Xr unix 4 -domain socket that can be used to connect to the +domain socket used to connect to the .Nm daemon. The default location is .Pa /var/run/casper . .It Fl v -Print or log verbose/debugging informations. +Print or log verbose/debugging information. This option can be specified multiple times to raise the verbosity level. .El From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 20:07:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B70F833; Sun, 8 Dec 2013 20:07:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4E0501B18; Sun, 8 Dec 2013 20:07:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8K73Os028107; Sun, 8 Dec 2013 20:07:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8K72G3028102; Sun, 8 Dec 2013 20:07:02 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201312082007.rB8K72G3028102@svn.freebsd.org> From: Alan Cox Date: Sun, 8 Dec 2013 20:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259107 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 20:07:03 -0000 Author: alc Date: Sun Dec 8 20:07:02 2013 New Revision: 259107 URL: http://svnweb.freebsd.org/changeset/base/259107 Log: Eliminate a redundant parameter to vm_radix_replace(). Improve the wording of the comment describing vm_radix_replace(). Reviewed by: attilio MFC after: 6 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_page.c head/sys/vm/vm_radix.c head/sys/vm/vm_radix.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 8 19:32:29 2013 (r259106) +++ head/sys/vm/vm_page.c Sun Dec 8 20:07:02 2013 (r259107) @@ -1200,7 +1200,7 @@ vm_page_replace(vm_page_t mnew, vm_objec mnew->object = object; mnew->pindex = pindex; - mold = vm_radix_replace(&object->rtree, mnew, pindex); + mold = vm_radix_replace(&object->rtree, mnew); KASSERT(mold->queue == PQ_NONE, ("vm_page_replace: mold is on a paging queue")); Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Sun Dec 8 19:32:29 2013 (r259106) +++ head/sys/vm/vm_radix.c Sun Dec 8 20:07:02 2013 (r259107) @@ -788,20 +788,18 @@ vm_radix_reclaim_allnodes(struct vm_radi } /* - * Replace an existing page into the trie with another one. - * Panics if the replacing page is not present or if the new page has an - * invalid key. + * Replace an existing page in the trie with another one. + * Panics if there is not an old page in the trie at the new page's index. */ vm_page_t -vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage, vm_pindex_t index) +vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage) { struct vm_radix_node *rnode; vm_page_t m; + vm_pindex_t index; int slot; - KASSERT(newpage->pindex == index, ("%s: newpage index invalid", - __func__)); - + index = newpage->pindex; rnode = vm_radix_getroot(rtree); if (rnode == NULL) panic("%s: replacing page on an empty trie", __func__); Modified: head/sys/vm/vm_radix.h ============================================================================== --- head/sys/vm/vm_radix.h Sun Dec 8 19:32:29 2013 (r259106) +++ head/sys/vm/vm_radix.h Sun Dec 8 20:07:02 2013 (r259107) @@ -43,8 +43,7 @@ vm_page_t vm_radix_lookup_ge(struct vm_r vm_page_t vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index); void vm_radix_reclaim_allnodes(struct vm_radix *rtree); void vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index); -vm_page_t vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage, - vm_pindex_t index); +vm_page_t vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage); #endif /* _KERNEL */ #endif /* !_VM_RADIX_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 20:09:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D6B597B for ; Sun, 8 Dec 2013 20:09:17 +0000 (UTC) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D8791B23 for ; Sun, 8 Dec 2013 20:09:16 +0000 (UTC) Received: by mail-pb0-f49.google.com with SMTP id jt11so4029582pbb.8 for ; Sun, 08 Dec 2013 12:09:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=NSGmaDTLRiRicDVaMwAkA2jkGNHbqmwC3z7j7bK6vOQ=; b=UyvCTDgtjQ6em7tbskJonJSRWWsoeU5+7cyYoljjkm66/VgSuni0ikrQShjEEvDhXK lcsyr0Bdpdxz5H2i/9yZE3QaqAM3oUzE+NJSEZxsseUlaHQ2YKsDTt8PQVoeubHQj/Le y0pZ7K3SpTIGOLsXhIHxONi5Q4uMJlGPgosMaCshEe2cc3OmIz5+Pk4rlb6Sv7nGrWOS uoOP7b+ffm5pE/5eN6RRZSl+XnDW4fNSgg3TMX6Bacx8zyzw7k3yC+h9Lxdll6JbIxkM +B1ar6dqYGbDfx8FUcy9AIbO+u5cKfad59cq5MlC3eJGDU0EG1yFLvjRcklEEVWuxOPr oQGw== X-Gm-Message-State: ALoCoQkENg5azENhQZIeXNHksqfOfiqLHkvwKo54E7UW8U9LKfGApjlkEuEoOEp4/MJAbQTmMbtJ X-Received: by 10.68.240.36 with SMTP id vx4mr16887069pbc.140.1386533349822; Sun, 08 Dec 2013 12:09:09 -0800 (PST) Received: from [192.168.2.123] (99-74-169-43.lightspeed.sntcca.sbcglobal.net. [99.74.169.43]) by mx.google.com with ESMTPSA id gv10sm12787425pbd.0.2013.12.08.12.09.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 08 Dec 2013 12:09:08 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r259058 - head/usr.bin/bc From: Tim Kientzle In-Reply-To: <20131207170419.124ea16e.trhodes@FreeBSD.org> Date: Sun, 8 Dec 2013 12:08:13 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <9747EB0E-E798-4436-8969-A5B88765FADA@kientzle.com> References: <201312070627.rB76RtGr022954@svn.freebsd.org> <20131207170419.124ea16e.trhodes@FreeBSD.org> To: Tom Rhodes X-Mailer: Apple Mail (2.1822) Cc: svn-src-head@FreeBSD.org, delphij@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 20:09:17 -0000 On Dec 7, 2013, at 2:04 PM, Tom Rhodes wrote: > On Sat, 7 Dec 2013 01:44:19 -0500 > Eitan Adler wrote: >=20 >> On Sat, Dec 7, 2013 at 1:27 AM, Xin LI wrote: >>> Author: delphij >>> Date: Sat Dec 7 06:27:54 2013 >>> New Revision: 259058 >>> URL: http://svnweb.freebsd.org/changeset/base/259058 >>>=20 >>> Log: >>> Remove mention of the compatibility option 'q', which is >>> intentionally undocumented and its only purpose is that >>> we do not bail out when used as a drop-in replacement of >>> a different implementation. >>=20 >> As I mentioned in the reply to the PR this change goes in the wrong = direction. >>=20 >> We should instead document -q as a compatibility option. >> Undocumented flags, even as NOPS, are bugs. >=20 > It should be documented as a do-nothing option. It should be documented in the manpage as a do-nothing option. It should not be included in Usage. Tim From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 20:43:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39A29647; Sun, 8 Dec 2013 20:43:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 263911E72; Sun, 8 Dec 2013 20:43:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8Kh2J2042111; Sun, 8 Dec 2013 20:43:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8Kh2l1042110; Sun, 8 Dec 2013 20:43:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312082043.rB8Kh2l1042110@svn.freebsd.org> From: Alexander Motin Date: Sun, 8 Dec 2013 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259108 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 20:43:02 -0000 Author: mav Date: Sun Dec 8 20:43:01 2013 New Revision: 259108 URL: http://svnweb.freebsd.org/changeset/base/259108 Log: When comparing device IDs, make sure that they have the same type (like NAA assigned) and identify the same entity (like device or port). Otherwise there can be false positives since at least some models of Seagate disks use same IDs for the whole device and one of its ports. MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Sun Dec 8 20:07:02 2013 (r259107) +++ head/sys/cam/scsi/scsi_all.c Sun Dec 8 20:43:01 2013 (r259108) @@ -6509,7 +6509,11 @@ scsi_devid_match(uint8_t *lhs, size_t lh while (rhs_id <= rhs_last && (rhs_id->identifier + rhs_id->length) <= rhs_end) { - if (rhs_id->length == lhs_id->length + if ((rhs_id->id_type & + (SVPD_ID_ASSOC_MASK | SVPD_ID_TYPE_MASK)) == + (lhs_id->id_type & + (SVPD_ID_ASSOC_MASK | SVPD_ID_TYPE_MASK)) + && rhs_id->length == lhs_id->length && memcmp(rhs_id->identifier, lhs_id->identifier, rhs_id->length) == 0) return (0); From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 21:45:20 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6381F4C0; Sun, 8 Dec 2013 21:45:20 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CCA671212; Sun, 8 Dec 2013 21:45:19 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rB8Lj9PJ091536; Sun, 8 Dec 2013 22:45:14 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52A4E865.6080602@FreeBSD.org> Date: Sun, 08 Dec 2013 22:45:09 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Aleksandr Rybalko , Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> In-Reply-To: <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 21:45:20 -0000 Hi Aleksandr, On 08.12.13 00:59, Aleksandr Rybalko wrote: > Andreas Tobler написав(ла): >> On 05.12.13 23:38, Aleksandr Rybalko wrote: >>> Author: ray >>> Date: Thu Dec 5 22:38:53 2013 >>> New Revision: 259016 >>> URL: http://svnweb.freebsd.org/changeset/base/259016 >>> >>> Log: >>> Merge VT(9) project (a.k.a. newcons). >>> >>> Reviewed by: nwhitehorn >>> MFC_to_10_after: re approval >>> >>> Sponsored by: The FreeBSD Foundation >> >> Great! Thanks, gives a new look & feel on the console :) >> Have it running on amd64/i386 and PowerMac(32/64-bit). >> The only thing I need to figure is the mapping of the AltGr or in Mac >> world, the alt key mapping. Iow, the third level mapping of the keys. >> e.g. the @ here is on altgr-2... >> >> Again, thanks! >> Andreas > > I'm glad to fix that, but I've to understand how it is should work :-) Hehe :) So do I. I was playing a bit while comparing to syscons.c And with the below diff I'm able to get what I want. At least when I press RALT (Altgr) I get the third symbol printed on my keyboard. I have a couple of Thinkpads here where I play with. (The PowerMac's are currently to loud) For example, on the '2' I have the '"' as the second symbol and the '@' as third symbol. Yeah, these are european keyboards.... Now I do not prepend the 0x1b and then my RALT behaves as used to, at least for me. I do not know the fine details but LALT and RALT are different. What do you think, others? For me this is a really important thing since all the 'special' keys are not accesible w/o the 'hack' below. If I want the pipe (|), or writing code ({}, [], ...) I have to remote login to get the characters I need. But I guess I do not need to explain that ;) TIA, Andreas Index: vt_core.c =================================================================== --- vt_core.c (revision 259095) +++ vt_core.c (working copy) @@ -408,6 +408,7 @@ } else { switch (c & ~RELKEY) { case (SPCLKEY | RALT): + break; case (SPCLKEY | LALT): vd->vd_kbstate |= ALKED; } From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 21:59:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 603C08B7; Sun, 8 Dec 2013 21:59:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B62D12A4; Sun, 8 Dec 2013 21:59:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8LxlZG067741; Sun, 8 Dec 2013 21:59:47 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8Lxkpp067739; Sun, 8 Dec 2013 21:59:46 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312082159.rB8Lxkpp067739@svn.freebsd.org> From: Peter Wemm Date: Sun, 8 Dec 2013 21:59:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259109 - in head/sys: conf opencrypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 21:59:47 -0000 Author: peter Date: Sun Dec 8 21:59:46 2013 New Revision: 259109 URL: http://svnweb.freebsd.org/changeset/base/259109 Log: Fix build with 'crypto' and 'zfs' in the same kernel. This was the path of least pain I could find. Added: head/sys/opencrypto/cryptodeflate.c - copied unchanged from r259108, head/sys/opencrypto/deflate.c Deleted: head/sys/opencrypto/deflate.c Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Dec 8 20:43:01 2013 (r259108) +++ head/sys/conf/files Sun Dec 8 21:59:46 2013 (r259109) @@ -3728,7 +3728,7 @@ opencrypto/crypto.c optional crypto opencrypto/cryptodev.c optional cryptodev opencrypto/cryptodev_if.m optional crypto opencrypto/cryptosoft.c optional crypto -opencrypto/deflate.c optional crypto +opencrypto/cryptodeflate.c optional crypto opencrypto/rmd160.c optional crypto | ipsec opencrypto/skipjack.c optional crypto opencrypto/xform.c optional crypto Copied: head/sys/opencrypto/cryptodeflate.c (from r259108, head/sys/opencrypto/deflate.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/opencrypto/cryptodeflate.c Sun Dec 8 21:59:46 2013 (r259109, copy of r259108, head/sys/opencrypto/deflate.c) @@ -0,0 +1,263 @@ +/* $OpenBSD: deflate.c,v 1.3 2001/08/20 02:45:22 hugh Exp $ */ + +/*- + * Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org) + * + * 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. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * 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. + */ + +/* + * This file contains a wrapper around the deflate algo compression + * functions using the zlib library (see net/zlib.{c,h}) + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +SDT_PROVIDER_DECLARE(opencrypto); +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, + "int", "u_int32_t"); +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, + "int", "int", "int", "int", "int"); +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, + "int", "u_int32_t"); + +int window_inflate = -1 * MAX_WBITS; +int window_deflate = -12; + +/* + * This function takes a block of data and (de)compress it using the deflate + * algorithm + */ + +u_int32_t +deflate_global(data, size, decomp, out) + u_int8_t *data; + u_int32_t size; + int decomp; + u_int8_t **out; +{ + /* decomp indicates whether we compress (0) or decompress (1) */ + + z_stream zbuf; + u_int8_t *output; + u_int32_t count, result; + int error, i; + struct deflate_buf *bufh, *bufp; + + SDT_PROBE2(opencrypto, deflate, deflate_global, entry, decomp, size); + + bufh = bufp = NULL; + if (!decomp) { + i = 1; + } else { + /* + * Choose a buffer with 4x the size of the input buffer + * for the size of the output buffer in the case of + * decompression. If it's not sufficient, it will need to be + * updated while the decompression is going on. + */ + i = 4; + } + /* + * Make sure we do have enough output space. Repeated calls to + * deflate need at least 6 bytes of output buffer space to avoid + * repeated markers. We will always provide at least 16 bytes. + */ + while ((size * i) < 16) + i++; + + bufh = bufp = malloc(sizeof(*bufp) + (size_t)(size * i), + M_CRYPTO_DATA, M_NOWAIT); + if (bufp == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); + goto bad2; + } + bufp->next = NULL; + bufp->size = size * i; + + bzero(&zbuf, sizeof(z_stream)); + zbuf.zalloc = z_alloc; + zbuf.zfree = z_free; + zbuf.opaque = Z_NULL; + zbuf.next_in = data; /* Data that is going to be processed. */ + zbuf.avail_in = size; /* Total length of data to be processed. */ + zbuf.next_out = bufp->data; + zbuf.avail_out = bufp->size; + + error = decomp ? inflateInit2(&zbuf, window_inflate) : + deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD, + window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY); + if (error != Z_OK) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__); + goto bad; + } + + for (;;) { + error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) : + deflate(&zbuf, Z_FINISH); + if (error != Z_OK && error != Z_STREAM_END) { + /* + * Unfortunately we are limited to 5 arguments, + * thus use two probes. + */ + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); + goto bad; + } + SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, iter, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); + if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) { + /* Done. */ + break; + } else if (!decomp && error == Z_STREAM_END) { + /* Done. */ + break; + } else if (zbuf.avail_out == 0) { + struct deflate_buf *p; + + /* We need more output space for another iteration. */ + p = malloc(sizeof(*p) + (size_t)(size * i), + M_CRYPTO_DATA, M_NOWAIT); + if (p == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, + bad, decomp, 0, __LINE__); + goto bad; + } + p->next = NULL; + p->size = size * i; + bufp->next = p; + bufp = p; + zbuf.next_out = bufp->data; + zbuf.avail_out = bufp->size; + } else { + /* Unexpect result. */ + /* + * Unfortunately we are limited to 5 arguments, + * thus, again, use two probes. + */ + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.avail_in, zbuf.avail_out); + SDT_PROBE5(opencrypto, deflate, deflate_global, bad, + decomp, error, __LINE__, + zbuf.state->dummy, zbuf.total_out); + goto bad; + } + } + + result = count = zbuf.total_out; + + *out = malloc(result, M_CRYPTO_DATA, M_NOWAIT); + if (*out == NULL) { + SDT_PROBE3(opencrypto, deflate, deflate_global, bad, + decomp, 0, __LINE__); + goto bad; + } + if (decomp) + inflateEnd(&zbuf); + else + deflateEnd(&zbuf); + output = *out; + for (bufp = bufh; bufp != NULL; ) { + if (count > bufp->size) { + struct deflate_buf *p; + + bcopy(bufp->data, *out, bufp->size); + *out += bufp->size; + count -= bufp->size; + p = bufp; + bufp = bufp->next; + free(p, M_CRYPTO_DATA); + } else { + /* It should be the last buffer. */ + bcopy(bufp->data, *out, count); + *out += count; + free(bufp, M_CRYPTO_DATA); + bufp = NULL; + count = 0; + } + } + *out = output; + SDT_PROBE2(opencrypto, deflate, deflate_global, return, decomp, result); + return result; + +bad: + if (decomp) + inflateEnd(&zbuf); + else + deflateEnd(&zbuf); + for (bufp = bufh; bufp != NULL; ) { + struct deflate_buf *p; + + p = bufp; + bufp = bufp->next; + free(p, M_CRYPTO_DATA); + } +bad2: + *out = NULL; + return 0; +} + +void * +z_alloc(nil, type, size) + void *nil; + u_int type, size; +{ + void *ptr; + + ptr = malloc(type *size, M_CRYPTO_DATA, M_NOWAIT); + return ptr; +} + +void +z_free(nil, ptr) + void *nil, *ptr; +{ + free(ptr, M_CRYPTO_DATA); +} From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 22:49:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3394253; Sun, 8 Dec 2013 22:49:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3ACF15C2; Sun, 8 Dec 2013 22:49:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8MnDjA086351; Sun, 8 Dec 2013 22:49:13 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8MnD37086348; Sun, 8 Dec 2013 22:49:13 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312082249.rB8MnD37086348@svn.freebsd.org> From: Aleksandr Rybalko Date: Sun, 8 Dec 2013 22:49:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259110 - in head/sys: conf dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 22:49:13 -0000 Author: ray Date: Sun Dec 8 22:49:12 2013 New Revision: 259110 URL: http://svnweb.freebsd.org/changeset/base/259110 Log: o Build syscons(9)'s splash support if both sc and splash are enabled. o Include opt_splash.h for vt(9) to know when splash device is enabled. o Build logo_freebsd.c only if splash and vt are enabled. o Include opt_compat.h to know when we have to respect compatibility. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Dec 8 21:59:46 2013 (r259109) +++ head/sys/conf/files Sun Dec 8 22:49:12 2013 (r259110) @@ -1398,7 +1398,7 @@ dev/exca/exca.c optional cbb dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard -dev/fb/splash.c optional splash +dev/fb/splash.c optional sc splash dev/fdt/fdt_common.c optional fdt dev/fdt/fdt_ic_if.m optional fdt dev/fdt/fdt_pci.c optional fdt pci @@ -2468,7 +2468,7 @@ dev/vt/font/vt_font_default.c optional v dev/vt/font/vt_mouse_cursor.c optional vt dev/vt/hw/fb/vt_fb.c optional vt dev/vt/hw/vga/vga.c optional vt vt_vga -dev/vt/logo/logo_freebsd.c optional vt +dev/vt/logo/logo_freebsd.c optional vt splash dev/vt/vt_buf.c optional vt dev/vt/vt_consolectl.c optional vt dev/vt/vt_core.c optional vt Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Sun Dec 8 21:59:46 2013 (r259109) +++ head/sys/dev/vt/vt.h Sun Dec 8 22:49:12 2013 (r259110) @@ -46,7 +46,9 @@ #include #include +#include "opt_compat.h" #include "opt_syscons.h" +#include "opt_splash.h" #ifndef VT_MAXWINDOWS #ifdef MAXCONS Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Dec 8 21:59:46 2013 (r259109) +++ head/sys/dev/vt/vt_core.c Sun Dec 8 22:49:12 2013 (r259110) @@ -794,6 +794,7 @@ vtterm_done(struct terminal *tm) } } +#ifdef DEV_SPLASH static void vtterm_splash(struct vt_device *vd) { @@ -813,6 +814,7 @@ vtterm_splash(struct vt_device *vd) vd->vd_flags |= VDF_SPLASH; } } +#endif static void vtterm_cnprobe(struct terminal *tm, struct consdev *cp) @@ -845,7 +847,9 @@ vtterm_cnprobe(struct terminal *tm, stru vt_winsize(vd, vw->vw_font, &wsz); terminal_set_winsize(tm, &wsz); +#ifdef DEV_SPLASH vtterm_splash(vd); +#endif vd->vd_flags |= VDF_INITIALIZED; main_vd = vd; @@ -1788,8 +1792,10 @@ vt_allocate(struct vt_driver *drv, void /* Refill settings with new sizes. */ vt_resize(vd); +#ifdef DEV_SPLASH if (vd->vd_flags & VDF_SPLASH) vtterm_splash(vd); +#endif if (vd->vd_curwindow != NULL) callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); From owner-svn-src-all@FreeBSD.ORG Sun Dec 8 23:24:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0904B6F; Sun, 8 Dec 2013 23:24:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C149181E; Sun, 8 Dec 2013 23:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB8NOWfP000719; Sun, 8 Dec 2013 23:24:32 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB8NOWLk000718; Sun, 8 Dec 2013 23:24:32 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312082324.rB8NOWLk000718@svn.freebsd.org> From: Dimitry Andric Date: Sun, 8 Dec 2013 23:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259111 - head/contrib/gcc/config/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Dec 2013 23:24:32 -0000 Author: dim Date: Sun Dec 8 23:24:32 2013 New Revision: 259111 URL: http://svnweb.freebsd.org/changeset/base/259111 Log: Use correct casts in gcc's emmintrin.h for the first arguments of the following builtin functions: * __builtin_ia32_pslldi128() takes __v4si instead of __v8hi * __builtin_ia32_psllqi128() takes __v2di instead of __v8hi * __builtin_ia32_psradi128() takes __v4si instead of __v8hi This should fix the following errors when building the LINT kernel with gcc: sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of '__builtin_ia32_psradi128' sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of '__builtin_ia32_pslldi128' MFC after: 3 days Modified: head/contrib/gcc/config/i386/emmintrin.h Modified: head/contrib/gcc/config/i386/emmintrin.h ============================================================================== --- head/contrib/gcc/config/i386/emmintrin.h Sun Dec 8 22:49:12 2013 (r259110) +++ head/contrib/gcc/config/i386/emmintrin.h Sun Dec 8 23:24:32 2013 (r259111) @@ -1126,9 +1126,9 @@ _mm_slli_epi64 (__m128i __A, int __B) #define _mm_slli_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) #define _mm_slli_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_pslldi128 ((__v4si)(__A), __B)) #define _mm_slli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psllqi128 ((__v2di)(__A), __B)) #endif #if 0 @@ -1147,7 +1147,7 @@ _mm_srai_epi32 (__m128i __A, int __B) #define _mm_srai_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) #define _mm_srai_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psradi128 ((__v4si)(__A), __B)) #endif #if 0 From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 01:30:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C53C8AE; Mon, 9 Dec 2013 01:30:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB81F14A1; Mon, 9 Dec 2013 01:30:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB91UKMf045153; Mon, 9 Dec 2013 01:30:20 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB91UK5L045152; Mon, 9 Dec 2013 01:30:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312090130.rB91UK5L045152@svn.freebsd.org> From: Devin Teske Date: Mon, 9 Dec 2013 01:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259113 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 01:30:21 -0000 Author: dteske Date: Mon Dec 9 01:30:20 2013 New Revision: 259113 URL: http://svnweb.freebsd.org/changeset/base/259113 Log: Fix failed attempt to send pkg(8) stderr to /dev/null MFC after: 3 days Modified: head/usr.sbin/bsdconfig/share/common.subr Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Sun Dec 8 23:41:35 2013 (r259112) +++ head/usr.sbin/bsdconfig/share/common.subr Mon Dec 9 01:30:20 2013 (r259113) @@ -64,8 +64,8 @@ export UNAME_M="$( uname -m )" # Machine export UNAME_R="$( uname -r )" # Release Level (i.e. X.Y-RELEASE) if [ ! "${PKG_ABI+set}" ]; then export PKG_ABI="$( - ASSUME_ALWAYS_YES=1 pkg -vv | - awk '$1=="ABI"{print $3;exit}' 2> /dev/null + ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null | + awk '$1=="ABI"{print $3;exit}' )" fi From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 02:06:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F13BD62; Mon, 9 Dec 2013 02:06:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EE6F016C6; Mon, 9 Dec 2013 02:06:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB926qY2058828; Mon, 9 Dec 2013 02:06:52 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB926q8K058827; Mon, 9 Dec 2013 02:06:52 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201312090206.rB926q8K058827@svn.freebsd.org> From: Alfred Perlstein Date: Mon, 9 Dec 2013 02:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259114 - head/sys/modules/crypto X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 02:06:53 -0000 Author: alfred Date: Mon Dec 9 02:06:52 2013 New Revision: 259114 URL: http://svnweb.freebsd.org/changeset/base/259114 Log: Chase down cryptodeflate.c change from r259109. Modified: head/sys/modules/crypto/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon Dec 9 01:30:20 2013 (r259113) +++ head/sys/modules/crypto/Makefile Mon Dec 9 02:06:52 2013 (r259114) @@ -11,7 +11,7 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c -SRCS += cast.c deflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c +SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 03:38:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0AFDAF2; Mon, 9 Dec 2013 03:38:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DC0521DEB; Mon, 9 Dec 2013 03:38:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB93cIux093836; Mon, 9 Dec 2013 03:38:18 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB93cIww093835; Mon, 9 Dec 2013 03:38:18 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312090338.rB93cIww093835@svn.freebsd.org> From: Devin Teske Date: Mon, 9 Dec 2013 03:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259115 - head/usr.sbin/bsdinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 03:38:19 -0000 Author: dteske Date: Mon Dec 9 03:38:18 2013 New Revision: 259115 URL: http://svnweb.freebsd.org/changeset/base/259115 Log: Forgot to utilize feature added in SVN r257782 to prevent truncating /tmp/bsdinstall_log each time we exec a module. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/bsdinstall Modified: head/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- head/usr.sbin/bsdinstall/bsdinstall Mon Dec 9 02:06:52 2013 (r259114) +++ head/usr.sbin/bsdinstall/bsdinstall Mon Dec 9 03:38:18 2013 (r259115) @@ -33,6 +33,7 @@ # re-processing of flags (all children log to the parent's log file). # export DEBUG_SELF_INITIALIZE= +export DEBUG_INITIALIZE_FILE= BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 03:40:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8470AC40; Mon, 9 Dec 2013 03:40:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63C061DFB; Mon, 9 Dec 2013 03:40:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB93e3tE094109; Mon, 9 Dec 2013 03:40:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB93e2T3094102; Mon, 9 Dec 2013 03:40:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312090340.rB93e2T3094102@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Dec 2013 03:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259116 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 03:40:03 -0000 Author: adrian Date: Mon Dec 9 03:40:02 2013 New Revision: 259116 URL: http://svnweb.freebsd.org/changeset/base/259116 Log: Add some initial support for the Intel 6235. Tested: * Intel 5100 * Intel 6235 Obtained from: mav, others Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwn_chip_cfg.h head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Dec 9 03:38:18 2013 (r259115) +++ head/sys/dev/iwn/if_iwn.c Mon Dec 9 03:40:02 2013 (r259116) @@ -124,15 +124,8 @@ static const struct iwn_ident iwn_ident_ { 0x8086, IWN_DID_5x50_2, "Intel WiMAX/WiFi Link 5350" }, { 0x8086, IWN_DID_5x50_3, "Intel WiMAX/WiFi Link 5150" }, { 0x8086, IWN_DID_5x50_4, "Intel WiMAX/WiFi Link 5150" }, - /* - * These currently don't function; the firmware crashes during - * the startup calibration request. - */ -#if 0 { 0x8086, IWN_DID_6035_1, "Intel Centrino Advanced 6235" }, - /* XXX TODO: figure out which ID this one is? */ { 0x8086, IWN_DID_6035_2, "Intel Centrino Advanced 6235" }, -#endif { 0, 0, NULL } }; @@ -837,8 +830,8 @@ iwn_config_specific(struct iwn_softc *sc case IWN_SDID_6035_3: case IWN_SDID_6035_4: sc->fwname = "iwn6000g2bfw"; - sc->limits = &iwn6000_sensitivity_limits; - sc->base_params = &iwn_6000g2b_base_params; + sc->limits = &iwn6235_sensitivity_limits; + sc->base_params = &iwn_6235_base_params; break; default: device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id :" @@ -5815,7 +5808,7 @@ iwn_send_sensitivity(struct iwn_softc *s cmd.energy_cck = htole16(calib->energy_cck); /* Barker modulation: use default values. */ cmd.corr_barker = htole16(190); - cmd.corr_barker_mrc = htole16(390); + cmd.corr_barker_mrc = htole16(sc->limits->barker_mrc); DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: set sensitivity %d/%d/%d/%d/%d/%d/%d\n", __func__, @@ -6648,7 +6641,7 @@ iwn_auth(struct iwn_softc *sc, struct ie sc->rxon->ofdm_mask = 0; } else { /* Assume 802.11b/g. */ - sc->rxon->cck_mask = 0x0f; + sc->rxon->cck_mask = 0x03; sc->rxon->ofdm_mask = 0x15; } DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n", Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h ============================================================================== --- head/sys/dev/iwn/if_iwn_chip_cfg.h Mon Dec 9 03:38:18 2013 (r259115) +++ head/sys/dev/iwn/if_iwn_chip_cfg.h Mon Dec 9 03:40:02 2013 (r259116) @@ -359,6 +359,34 @@ static const struct iwn_base_params iwn_ .bt_mode = IWN_BT_ADVANCED, .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; + +/* + * 6235 series NICs. + */ +static const struct iwn_base_params iwn_6235_base_params = { + .pll_cfg_val = 0, + .max_ll_items = IWN_OTP_MAX_LL_ITEMS_6x00, + .shadow_ram_support = true, + .shadow_reg_enable = true, + .bt_session_2 = false, + .bt_sco_disable = true, + .additional_nic_config = true, + .regulatory_bands = iwn6000_regulatory_bands, + .enhanced_TX_power = true, + .calib_need = + (IWN_FLG_NEED_PHY_CALIB_DC + | IWN_FLG_NEED_PHY_CALIB_LO + | IWN_FLG_NEED_PHY_CALIB_TX_IQ + | IWN_FLG_NEED_PHY_CALIB_BASE_BAND + | IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), + .support_hostap = false, + .no_multi_vaps = true, + /* XXX 1x2? This NIC is 2x2, right? */ + .additional_gp_drv_bit = IWN_GP_DRIVER_6050_1X2, + .bt_mode = IWN_BT_ADVANCED, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, +}; + static const struct iwn_base_params iwn_5x50_base_params = { .pll_cfg_val = IWN_ANA_PLL_INIT, .max_ll_items = IWN_OTP_MAX_LL_ITEMS_6x00, Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Mon Dec 9 03:38:18 2013 (r259115) +++ head/sys/dev/iwn/if_iwnreg.h Mon Dec 9 03:40:02 2013 (r259116) @@ -2001,6 +2001,7 @@ struct iwn_sensitivity_limits { uint32_t min_energy_cck; uint32_t energy_cck; uint32_t energy_ofdm; + uint32_t barker_mrc; }; /* @@ -2015,7 +2016,8 @@ static const struct iwn_sensitivity_limi 200, 400, 97, 100, - 100 + 100, + 390 }; static const struct iwn_sensitivity_limits iwn5000_sensitivity_limits = { @@ -2027,7 +2029,8 @@ static const struct iwn_sensitivity_limi 170, 400, 95, 95, - 95 + 95, + 390 }; static const struct iwn_sensitivity_limits iwn5150_sensitivity_limits = { @@ -2039,7 +2042,8 @@ static const struct iwn_sensitivity_limi 170, 400, 95, 95, - 95 + 95, + 390, }; static const struct iwn_sensitivity_limits iwn1000_sensitivity_limits = { @@ -2051,7 +2055,8 @@ static const struct iwn_sensitivity_limi 170, 400, 95, 95, - 95 + 95, + 390, }; static const struct iwn_sensitivity_limits iwn6000_sensitivity_limits = { @@ -2063,9 +2068,24 @@ static const struct iwn_sensitivity_limi 160, 310, 97, 97, - 100 + 100, + 390 }; +static const struct iwn_sensitivity_limits iwn6235_sensitivity_limits = { + 105, 110, + 192, 232, + 80, 145, + 128, 232, + 125, 175, + 160, 310, + 100, + 110, + 110, + 336 +}; + + /* Get value from linux kernel 3.2.+ in Drivers/net/wireless/iwlwifi/iwl-2000.c*/ static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = { 105,110, From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 04:26:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFA80982; Mon, 9 Dec 2013 04:26:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A89CC10D9; Mon, 9 Dec 2013 04:26:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB94QrAO012278; Mon, 9 Dec 2013 04:26:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB94QowN012257; Mon, 9 Dec 2013 04:26:50 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201312090426.rB94QowN012257@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Dec 2013 04:26:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259117 - head/include/rpcsvc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 04:26:53 -0000 Author: hrs Date: Mon Dec 9 04:26:50 2013 New Revision: 259117 URL: http://svnweb.freebsd.org/changeset/base/259117 Log: Replace Sun RPC license with a 3-clause BSD license. This license change was approved in 2010 by Wim Coekaerts, Senior Vice President, Linux and Virtualization at Oracle Corporation. Modified: head/include/rpcsvc/bootparam_prot.x head/include/rpcsvc/key_prot.x head/include/rpcsvc/klm_prot.x head/include/rpcsvc/mount.x head/include/rpcsvc/nfs_prot.x head/include/rpcsvc/nis.x head/include/rpcsvc/nis_callback.x head/include/rpcsvc/nis_object.x head/include/rpcsvc/nis_tags.h head/include/rpcsvc/rex.x head/include/rpcsvc/rnusers.x head/include/rpcsvc/rstat.x head/include/rpcsvc/sm_inter.x head/include/rpcsvc/spray.x head/include/rpcsvc/yp.x head/include/rpcsvc/yppasswd.x Modified: head/include/rpcsvc/bootparam_prot.x ============================================================================== --- head/include/rpcsvc/bootparam_prot.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/bootparam_prot.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/key_prot.x ============================================================================== --- head/include/rpcsvc/key_prot.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/key_prot.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -%/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user. +%/*- +% * Copyright (c) 2010, Oracle America, Inc. % * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +% * Redistribution and use in source and binary forms, with or without +% * modification, are permitted provided that the following conditions are +% * met: % * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. +% * * Redistributions of source code must retain the above copyright +% * notice, this list of conditions and the following disclaimer. +% * * 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. +% * * Neither the name of the "Oracle America, Inc." nor the names of its +% * contributors may be used to endorse or promote products derived +% * from this software without specific prior written permission. % * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. -% * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. -% * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 +% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% * COPYRIGHT HOLDER 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. % */ /* * Key server protocol definition Modified: head/include/rpcsvc/klm_prot.x ============================================================================== --- head/include/rpcsvc/klm_prot.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/klm_prot.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/mount.x ============================================================================== --- head/include/rpcsvc/mount.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/mount.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/nfs_prot.x ============================================================================== --- head/include/rpcsvc/nfs_prot.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/nfs_prot.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ #ifndef RPC_HDR Modified: head/include/rpcsvc/nis.x ============================================================================== --- head/include/rpcsvc/nis.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/nis.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,31 +1,32 @@ -%/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user or with the express written consent of -% * Sun Microsystems, Inc. -% * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. -% * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. +%/*- +% * Copyright (c) 2010, Oracle America, Inc. % * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. +% * Redistribution and use in source and binary forms, with or without +% * modification, are permitted provided that the following conditions are +% * met: % * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. +% * * Redistributions of source code must retain the above copyright +% * notice, this list of conditions and the following disclaimer. +% * * 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. +% * * Neither the name of the "Oracle America, Inc." nor the names of its +% * contributors may be used to endorse or promote products derived +% * from this software without specific prior written permission. % * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 +% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% * COPYRIGHT HOLDER 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. % */ #ifndef RPC_HDR Modified: head/include/rpcsvc/nis_callback.x ============================================================================== --- head/include/rpcsvc/nis_callback.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/nis_callback.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,31 +1,32 @@ -%/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user or with the express written consent of -% * Sun Microsystems, Inc. +%/*- +% * Copyright (c) 2010, Oracle America, Inc. % * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +% * Redistribution and use in source and binary forms, with or without +% * modification, are permitted provided that the following conditions are +% * met: % * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. +% * * Redistributions of source code must retain the above copyright +% * notice, this list of conditions and the following disclaimer. +% * * 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. +% * * Neither the name of the "Oracle America, Inc." nor the names of its +% * contributors may be used to endorse or promote products derived +% * from this software without specific prior written permission. % * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. -% * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. -% * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 +% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% * COPYRIGHT HOLDER 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. % */ /* Modified: head/include/rpcsvc/nis_object.x ============================================================================== --- head/include/rpcsvc/nis_object.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/nis_object.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,31 +1,32 @@ -%/* -% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for -% * unrestricted use provided that this legend is included on all tape -% * media and as a part of the software program in whole or part. Users -% * may copy or modify Sun RPC without charge, but are not authorized -% * to license or distribute it to anyone else except as part of a product or -% * program developed by the user or with the express written consent of -% * Sun Microsystems, Inc. +%/*- +% * Copyright (c) 2010, Oracle America, Inc. % * -% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE -% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR -% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +% * Redistribution and use in source and binary forms, with or without +% * modification, are permitted provided that the following conditions are +% * met: % * -% * Sun RPC is provided with no support and without any obligation on the -% * part of Sun Microsystems, Inc. to assist in its use, correction, -% * modification or enhancement. +% * * Redistributions of source code must retain the above copyright +% * notice, this list of conditions and the following disclaimer. +% * * 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. +% * * Neither the name of the "Oracle America, Inc." nor the names of its +% * contributors may be used to endorse or promote products derived +% * from this software without specific prior written permission. % * -% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE -% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC -% * OR ANY PART THEREOF. -% * -% * In no event will Sun Microsystems, Inc. be liable for any lost revenue -% * or profits or other special, indirect and consequential damages, even if -% * Sun has been advised of the possibility of such damages. -% * -% * Sun Microsystems, Inc. -% * 2550 Garcia Avenue -% * Mountain View, California 94043 +% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +% * COPYRIGHT HOLDER 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. % */ /* @@ -35,6 +36,7 @@ * All Rights Reserved. */ +/* $FreeBSD$ */ /* From: %#pragma ident "@(#)nis_object.x 1.10 94/05/03 SMI" */ #if RPC_HDR Modified: head/include/rpcsvc/nis_tags.h ============================================================================== --- head/include/rpcsvc/nis_tags.h Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/nis_tags.h Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* @@ -41,6 +43,7 @@ #ifndef _RPCSVC_NIS_TAGS_H #define _RPCSVC_NIS_TAGS_H +/* $FreeBSD$ */ /* From: #pragma ident "@(#)nis_tags.h 1.10 94/05/03 SMI" */ /* from file: zns_tags.h 1.7 Copyright (c) 1990 Sun Microsystems */ Modified: head/include/rpcsvc/rex.x ============================================================================== --- head/include/rpcsvc/rex.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/rex.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/rnusers.x ============================================================================== --- head/include/rpcsvc/rnusers.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/rnusers.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/rstat.x ============================================================================== --- head/include/rpcsvc/rstat.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/rstat.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/sm_inter.x ============================================================================== --- head/include/rpcsvc/sm_inter.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/sm_inter.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,33 +1,35 @@ /* @(#)sm_inter.x 2.2 88/08/01 4.0 RPCSRC */ /* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/spray.x ============================================================================== --- head/include/rpcsvc/spray.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/spray.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/yp.x ============================================================================== --- head/include/rpcsvc/yp.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/yp.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,32 +1,34 @@ /* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* Modified: head/include/rpcsvc/yppasswd.x ============================================================================== --- head/include/rpcsvc/yppasswd.x Mon Dec 9 03:40:02 2013 (r259116) +++ head/include/rpcsvc/yppasswd.x Mon Dec 9 04:26:50 2013 (r259117) @@ -1,30 +1,32 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 05:01:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B115FF6; Mon, 9 Dec 2013 05:01:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 356F312C1; Mon, 9 Dec 2013 05:01:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB951e61025868; Mon, 9 Dec 2013 05:01:40 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB951c2L025859; Mon, 9 Dec 2013 05:01:38 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201312090501.rB951c2L025859@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Dec 2013 05:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259118 - head/lib/libc/xdr X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 05:01:40 -0000 Author: hrs Date: Mon Dec 9 05:01:38 2013 New Revision: 259118 URL: http://svnweb.freebsd.org/changeset/base/259118 Log: Replace Sun RPC license with a 3-clause BSD license. This license change was approved in 2010 by Wim Coekaerts, Senior Vice President, Linux and Virtualization at Oracle Corporation. Modified: head/lib/libc/xdr/xdr.c head/lib/libc/xdr/xdr_array.c head/lib/libc/xdr/xdr_float.c head/lib/libc/xdr/xdr_mem.c head/lib/libc/xdr/xdr_rec.c head/lib/libc/xdr/xdr_reference.c head/lib/libc/xdr/xdr_sizeof.c head/lib/libc/xdr/xdr_stdio.c Modified: head/lib/libc/xdr/xdr.c ============================================================================== --- head/lib/libc/xdr/xdr.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr.c,v 1.22 2000/07/06 03:10:35 christos Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +/*- + * Copyright (c) 2010, Oracle America, Inc. * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); /* * xdr.c, Generic XDR routines implementation. * - * Copyright (C) 1986, Sun Microsystems, Inc. - * * These are the "generic" xdr routines used to serialize and de-serialize * most common data items. See xdr.h for more info on the interface to * xdr. Modified: head/lib/libc/xdr/xdr_array.c ============================================================================== --- head/lib/libc/xdr/xdr_array.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_array.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr_array.c,v 1.12 2000/01/22 22:19:18 mycroft Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. +/*- + * Copyright (c) 2010, Oracle America, Inc. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); /* * xdr_array.c, Generic XDR routines impelmentation. * - * Copyright (C) 1984, Sun Microsystems, Inc. - * * These are the "non-trivial" xdr primitives used to serialize and de-serialize * arrays. See xdr.h for more info on the interface to xdr. */ Modified: head/lib/libc/xdr/xdr_float.c ============================================================================== --- head/lib/libc/xdr/xdr_float.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_float.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr_float.c,v 1.23 2000/07/17 04:59:51 matt Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +/*- + * Copyright (c) 2010, Oracle America, Inc. * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); /* * xdr_float.c, Generic XDR routines implementation. * - * Copyright (C) 1984, Sun Microsystems, Inc. - * * These are the "floating point" xdr routines used to (de)serialize * most common data items. See xdr.h for more info on the interface to * xdr. Modified: head/lib/libc/xdr/xdr_mem.c ============================================================================== --- head/lib/libc/xdr/xdr_mem.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_mem.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr_mem.c,v 1.15 2000/01/22 22:19:18 mycroft Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +/*- + * Copyright (c) 2010, Oracle America, Inc. * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); /* * xdr_mem.h, XDR implementation using memory buffers. * - * Copyright (C) 1984, Sun Microsystems, Inc. - * * If you have some data to be interpreted as external data representation * or to be converted to external data representation in a memory buffer, * then this is the package for you. Modified: head/lib/libc/xdr/xdr_rec.c ============================================================================== --- head/lib/libc/xdr/xdr_rec.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_rec.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr_rec.c,v 1.18 2000/07/06 03:10:35 christos Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. +/*- + * Copyright (c) 2010, Oracle America, Inc. * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, Inc." nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -40,8 +42,6 @@ __FBSDID("$FreeBSD$"); * xdr_rec.c, Implements TCP/IP based XDR streams with a "record marking" * layer above tcp (for rpc's use). * - * Copyright (C) 1984, Sun Microsystems, Inc. - * * These routines interface XDRSTREAMS to a tcp/ip connection. * There is a record marking layer between the xdr stream * and the tcp transport level. A record is composed on one or more Modified: head/lib/libc/xdr/xdr_reference.c ============================================================================== --- head/lib/libc/xdr/xdr_reference.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_reference.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr_reference.c,v 1.13 2000/01/22 22:19:18 mycroft Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); /* * xdr_reference.c, Generic XDR routines impelmentation. * - * Copyright (C) 1987, Sun Microsystems, Inc. - * * These are the "non-trivial" xdr primitives used to serialize and de-serialize * "pointers". See xdr.h for more info on the interface to xdr. */ Modified: head/lib/libc/xdr/xdr_sizeof.c ============================================================================== --- head/lib/libc/xdr/xdr_sizeof.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_sizeof.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,36 +1,36 @@ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 +/*- + * Copyright (c) 2010, Oracle America, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ /* * xdr_sizeof.c * - * Copyright 1990 Sun Microsystems, Inc. - * * General purpose routine to see how much space something will use * when serialized using XDR. */ Modified: head/lib/libc/xdr/xdr_stdio.c ============================================================================== --- head/lib/libc/xdr/xdr_stdio.c Mon Dec 9 04:26:50 2013 (r259117) +++ head/lib/libc/xdr/xdr_stdio.c Mon Dec 9 05:01:38 2013 (r259118) @@ -1,32 +1,34 @@ /* $NetBSD: xdr_stdio.c,v 1.14 2000/01/22 22:19:19 mycroft Exp $ */ -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. +/*- + * Copyright (c) 2010, Oracle America, Inc. * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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. + * * Neither the name of the "Oracle America, 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 THE COPYRIGHT HOLDERS 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 + * COPYRIGHT HOLDER 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. */ #if defined(LIBC_SCCS) && !defined(lint) @@ -39,8 +41,6 @@ __FBSDID("$FreeBSD$"); /* * xdr_stdio.c, XDR implementation on standard i/o file. * - * Copyright (C) 1984, Sun Microsystems, Inc. - * * This set of routines implements a XDR on a stdio stream. * XDR_ENCODE serializes onto the stream, XDR_DECODE de-serializes * from the stream. From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 07:14:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEA1159F; Mon, 9 Dec 2013 07:14:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE9611AAE; Mon, 9 Dec 2013 07:14:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB97ExMU073314; Mon, 9 Dec 2013 07:14:59 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB97ExFe073313; Mon, 9 Dec 2013 07:14:59 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201312090714.rB97ExFe073313@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 9 Dec 2013 07:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259121 - head/sys/arm/rockchip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 07:15:00 -0000 Author: ganbold (doc committer) Date: Mon Dec 9 07:14:59 2013 New Revision: 259121 URL: http://svnweb.freebsd.org/changeset/base/259121 Log: Add gpio parse routines according to sys/boot/fdt/dts/bindings-gpio.txt. Reviewed by: stas@ Modified: head/sys/arm/rockchip/rk30xx_gpio.c Modified: head/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_gpio.c Mon Dec 9 07:00:39 2013 (r259120) +++ head/sys/arm/rockchip/rk30xx_gpio.c Mon Dec 9 07:14:59 2013 (r259121) @@ -86,6 +86,26 @@ struct rk30_gpio_softc { struct gpio_pin sc_gpio_pins[RK30_GPIO_PINS]; }; +static struct rk30_gpio_softc *rk30_gpio_sc = NULL; + +typedef int (*gpios_phandler_t)(phandle_t, pcell_t *, int); + +struct gpio_ctrl_entry { + const char *compat; + gpios_phandler_t handler; +}; + +int rk30_gpios_prop_handle(phandle_t ctrl, pcell_t *gpios, int len); +int platform_gpio_init(void); + +struct gpio_ctrl_entry gpio_controllers[] = { + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { "rockchip,rk30xx-gpio", &rk30_gpios_prop_handle }, + { NULL, NULL } +}; + #define RK30_GPIO_LOCK(_sc) mtx_lock(&_sc->sc_mtx) #define RK30_GPIO_UNLOCK(_sc) mtx_unlock(&_sc->sc_mtx) #define RK30_GPIO_LOCK_ASSERT(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED) @@ -436,6 +456,9 @@ rk30_gpio_attach(device_t dev) int i, rid; phandle_t gpio; + if (rk30_gpio_sc) + return (ENXIO); + sc->sc_dev = dev; mtx_init(&sc->sc_mtx, "rk30 gpio", "gpio", MTX_DEF); @@ -480,6 +503,11 @@ rk30_gpio_attach(device_t dev) device_add_child(dev, "gpioc", device_get_unit(dev)); device_add_child(dev, "gpiobus", device_get_unit(dev)); + + rk30_gpio_sc = sc; + + platform_gpio_init(); + return (bus_generic_attach(dev)); fail: @@ -525,3 +553,121 @@ static driver_t rk30_gpio_driver = { }; DRIVER_MODULE(rk30_gpio, simplebus, rk30_gpio_driver, rk30_gpio_devclass, 0, 0); + +int +rk30_gpios_prop_handle(phandle_t ctrl, pcell_t *gpios, int len) +{ + struct rk30_gpio_softc *sc; + pcell_t gpio_cells; + int inc, t, tuples, tuple_size; + int dir, flags, pin, i; + u_long gpio_ctrl, size; + + sc = rk30_gpio_sc; + if (sc == NULL) + return ENXIO; + + if (OF_getprop(ctrl, "#gpio-cells", &gpio_cells, sizeof(pcell_t)) < 0) + return (ENXIO); + + gpio_cells = fdt32_to_cpu(gpio_cells); + if (gpio_cells != 2) + return (ENXIO); + + tuple_size = gpio_cells * sizeof(pcell_t) + sizeof(phandle_t); + tuples = len / tuple_size; + + if (fdt_regsize(ctrl, &gpio_ctrl, &size)) + return (ENXIO); + + /* + * Skip controller reference, since controller's phandle is given + * explicitly (in a function argument). + */ + inc = sizeof(ihandle_t) / sizeof(pcell_t); + gpios += inc; + for (t = 0; t < tuples; t++) { + pin = fdt32_to_cpu(gpios[0]); + dir = fdt32_to_cpu(gpios[1]); + flags = fdt32_to_cpu(gpios[2]); + + for (i = 0; i < sc->sc_gpio_npins; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= sc->sc_gpio_npins) + return (EINVAL); + + rk30_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags); + + if (dir == 1) { + /* Input. */ + rk30_gpio_pin_set(sc->sc_dev, pin, RK30_GPIO_INPUT); + } else { + /* Output. */ + rk30_gpio_pin_set(sc->sc_dev, pin, RK30_GPIO_OUTPUT); + } + gpios += gpio_cells + inc; + } + + return (0); +} + +#define MAX_PINS_PER_NODE 5 +#define GPIOS_PROP_CELLS 4 + +int +platform_gpio_init(void) +{ + phandle_t child, parent, root, ctrl; + pcell_t gpios[MAX_PINS_PER_NODE * GPIOS_PROP_CELLS]; + struct gpio_ctrl_entry *e; + int len, rv; + + root = OF_finddevice("/"); + len = 0; + parent = root; + + /* Traverse through entire tree to find nodes with 'gpios' prop */ + for (child = OF_child(parent); child != 0; child = OF_peer(child)) { + + /* Find a 'leaf'. Start the search from this node. */ + while (OF_child(child)) { + parent = child; + child = OF_child(child); + } + if ((len = OF_getproplen(child, "gpios")) > 0) { + + if (len > sizeof(gpios)) + return (ENXIO); + + /* Get 'gpios' property. */ + OF_getprop(child, "gpios", &gpios, len); + + e = (struct gpio_ctrl_entry *)&gpio_controllers; + + /* Find and call a handler. */ + for (; e->compat; e++) { + /* + * First cell of 'gpios' property should + * contain a ref. to a node defining GPIO + * controller. + */ + ctrl = OF_xref_phandle(fdt32_to_cpu(gpios[0])); + + if (fdt_is_compatible(ctrl, e->compat)) + /* Call a handler. */ + if ((rv = e->handler(ctrl, + (pcell_t *)&gpios, len))) + return (rv); + } + } + + if (OF_peer(child) == 0) { + /* No more siblings. */ + child = parent; + parent = OF_parent(child); + } + } + return (0); +} From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 07:15:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3964B8CF; Mon, 9 Dec 2013 07:15:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25E761AD0; Mon, 9 Dec 2013 07:15:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB97FlQR073497; Mon, 9 Dec 2013 07:15:47 GMT (envelope-from ganbold@svn.freebsd.org) Received: (from ganbold@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB97FlBZ073496; Mon, 9 Dec 2013 07:15:47 GMT (envelope-from ganbold@svn.freebsd.org) Message-Id: <201312090715.rB97FlBZ073496@svn.freebsd.org> From: Ganbold Tsagaankhuu Date: Mon, 9 Dec 2013 07:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259122 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 07:15:47 -0000 Author: ganbold (doc committer) Date: Mon Dec 9 07:15:46 2013 New Revision: 259122 URL: http://svnweb.freebsd.org/changeset/base/259122 Log: Add gpio config for usb1 in dts. That way it gives power to other usb hub via gpio at boot time. Reviewed by: stas@ Modified: head/sys/boot/fdt/dts/rk3188.dtsi Modified: head/sys/boot/fdt/dts/rk3188.dtsi ============================================================================== --- head/sys/boot/fdt/dts/rk3188.dtsi Mon Dec 9 07:14:59 2013 (r259121) +++ head/sys/boot/fdt/dts/rk3188.dtsi Mon Dec 9 07:15:46 2013 (r259122) @@ -174,6 +174,7 @@ interrupt-parent = <&GIC>; #address-cells = <1>; #size-cells = <0>; + gpios = <&gpio0 3 2 2>; }; uart0: serial@10124000 { From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 07:26:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A434B6B; Mon, 9 Dec 2013 07:26:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 766601C8D; Mon, 9 Dec 2013 07:26:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB97QuKv077111; Mon, 9 Dec 2013 07:26:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB97QuVA077110; Mon, 9 Dec 2013 07:26:56 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312090726.rB97QuVA077110@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 9 Dec 2013 07:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259123 - head/sys/modules/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 07:26:56 -0000 Author: hselasky Date: Mon Dec 9 07:26:55 2013 New Revision: 259123 URL: http://svnweb.freebsd.org/changeset/base/259123 Log: Make it easier to test build the USB code having the debug flags set without having to build the complete kernel. MFC after: 2 weeks Modified: head/sys/modules/usb/Makefile Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Mon Dec 9 07:15:46 2013 (r259122) +++ head/sys/modules/usb/Makefile Mon Dec 9 07:26:55 2013 (r259123) @@ -27,6 +27,18 @@ .include +# +# Check for common USB debug flags to pass when building the USB +# modules in this directory: +# +.if defined(USB_DEBUG) +MAKE+=" DEBUG_FLAGS+=-DUSB_DEBUG" +.endif + +.if defined(USB_DEBUG) && defined(USB_REQ_DEBUG) +MAKE+=" DEBUG_FLAGS+=-DUSB_REQ_DEBUG" +.endif + # Modules that include binary-only blobs of microcode should be selectable by # MK_SOURCELESS_UCODE option (see below). From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 08:51:50 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5118EECE; Mon, 9 Dec 2013 08:51:50 +0000 (UTC) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1139F129A; Mon, 9 Dec 2013 08:51:48 +0000 (UTC) Received: from alph.d.allbsd.org (p2106-ipbf2009funabasi.chiba.ocn.ne.jp [114.146.169.106]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id rB98pTs1084555 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Dec 2013 17:51:39 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.d.allbsd.org (8.14.7/8.14.5) with ESMTP id rB98pSDb068697; Mon, 9 Dec 2013 17:51:28 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 09 Dec 2013 17:51:19 +0900 (JST) Message-Id: <20131209.175119.597284254662875353.hrs@allbsd.org> To: peter@FreeBSD.org Subject: Re: svn commit: r259094 - head/etc/rc.d From: Hiroki Sato In-Reply-To: <201312080555.rB85tu8W016979@svn.freebsd.org> References: <201312080555.rB85tu8W016979@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Dec__9_17_51_19_2013_503)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Mon, 09 Dec 2013 17:51:40 +0900 (JST) X-Spam-Status: No, score=-94.3 required=13.0 tests=CONTENT_TYPE_PRESENT, RCVD_IN_PBL,RCVD_IN_RP_RNBL,SPF_SOFTFAIL,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 08:51:50 -0000 ----Security_Multipart(Mon_Dec__9_17_51_19_2013_503)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Peter, Peter Wemm wrote in <201312080555.rB85tu8W016979@svn.freebsd.org>: pe> Author: peter pe> Date: Sun Dec 8 05:55:55 2013 pe> New Revision: 259094 pe> URL: http://svnweb.freebsd.org/changeset/base/259094 pe> pe> Log: pe> Rev 256256 had an undocumented side effect of breaking existing behavior pe> for ipv6 jails. pe> pe> Among the harmful side effects included putting a route to an entire /64 pe> onto an interface even if you were in a smaller network - eg: /80. pe> This broke the freebsd.org cluster hosted at ISC which has /80 networks. pe> pe> Modified: pe> head/etc/rc.d/jail The reason why it was changed is that I think an IPv6 GUA with no prefix length information should always be interpret as a /64 because the other tools like ifconfig do so. IPv6 is designed to always use a correct prefix length and avoid using a /128 for aliases. Is there a problem with specifying a /80 address to ip6.addr if a box is on a /80 network? I know many people are using 2001:db8::1/80 + 2001:db8::2/128 on the same interface similar to 192.168.0.1/24 + 192.168.0.2/32. It certainly works, but the both should be /80.... -- Hiroki ----Security_Multipart(Mon_Dec__9_17_51_19_2013_503)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (FreeBSD) iEYEABECAAYFAlKlhIcACgkQTyzT2CeTzy3wRgCbBu4WPPvfOg8c/bWpaYPug2e7 ne4AnjdqYfniXkm3rFTjj4ySHGUX/aTo =vPFj -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Dec__9_17_51_19_2013_503)---- From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 11:33:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21AF8D7; Mon, 9 Dec 2013 11:33:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 016A311B3; Mon, 9 Dec 2013 11:33:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9BXj9a068146; Mon, 9 Dec 2013 11:33:45 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9BXjjp068145; Mon, 9 Dec 2013 11:33:45 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201312091133.rB9BXjjp068145@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 9 Dec 2013 11:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259125 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 11:33:46 -0000 Author: loos Date: Mon Dec 9 11:33:45 2013 New Revision: 259125 URL: http://svnweb.freebsd.org/changeset/base/259125 Log: Fix a few typos on the scm (control module) pin mux definitions. Approved by: adrian (mentor) Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c Modified: head/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_scm_padconf.c Mon Dec 9 08:39:33 2013 (r259124) +++ head/sys/arm/ti/am335x/am335x_scm_padconf.c Mon Dec 9 11:33:45 2013 (r259125) @@ -170,8 +170,8 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x948, "MDIO", 0, 7, "mdio_data", "timer6", "uart5_rxd", "uart3_ctsn", "mmc0_sdcd","mmc1_cmd", "mmc2_cmd","gpio0_0"), _PIN(0x94c, "MDC", 1, 7, "mdio_clk", "timer5", "uart5_txd", "uart3_rtsn", "mmc0_sdwp", "mmc1_clk", "mmc2_clk", "gpio0_1"), _PIN(0x950, "SPI0_SCLK", 2, 7, "spi0_sclk", "uart2_rxd", "I2C2_SDA", "ehrpwm0A", "pr1_uart0_cts_n", "pr1_edio_sof", "EMU2", "gpio0_2"), - _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "i2C2_SCL", "ehrpwm0B", "pr1_uart0_rts_n", "pr1_edio_latch_in", "EMU3", "gpio0_3"), - _PIN(0x958, "SPIO_D1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), + _PIN(0x954, "SPI0_D0", 3, 7, "spi0_d0", "uart2_txd", "I2C2_SCL", "ehrpwm0B", "pr1_uart0_rts_n", "pr1_edio_latch_in", "EMU3", "gpio0_3"), + _PIN(0x958, "SPI0_D1", 4, 7, "spi0_d1", "mmc1_sdwp", "I2C1_SDA", "ehrpwm0_tripzone_input", "pr1_uart0_rxd", "pr1_edio_data_in0", "pr1_edio_data_out0", "gpio0_4"), _PIN(0x95c, "SPI0_CS0", 5, 7, "spi0_cs0", "mmc2_sdwp", "I2C1_SCL", "ehrpwm0_synci", "pr1_uart0_txd", "pr1_edio_data_in1", "pr1_edio_data_out1", "gpio0_5"), _PIN(0x960, "SPI0_CS1", 6, 7, "spi0_cs1", "uart3_rxd", "eCAP1_in_PWM1_out", "mcc0_pow", "xdm_event_intr2", "mmc0_sdcd", "EMU4", "gpio0_6"), _PIN(0x964, "ECAP0_IN_PWM0_OUT",7, 7, "eCAP0_in_PWM0_out", "uart3_txd", "spi1_cs1", "pr1_ecap0_ecap_capin_apwm_o", "spi1_sclk", "mmc0_sdwp", "xdma_event_intr2", "gpio0_7"), @@ -180,7 +180,7 @@ const struct ti_scm_padconf ti_padconf_d _PIN(0x970, "UART0_rxd", 42, 7, "uart0_rxd", "spi1_cs0", "dcan0_tx", "I2C2_SDA", "eCAP2_in_PWM2_out", "pr1_pru1_pru_r30_14", "pr1_pru1_pru_r31_14", "gpio1_10"), _PIN(0x974, "UART0_txd", 43, 7, "uart0_txd", "spi1_cs1", "dcan0_rx", "I2C2_SCL", "eCAP1_in_PWM1_out", "pr1_pru1_pru_r30_15", "pr1_pru1_pru_r31_15", "gpio1_11"), _PIN(0x978, "UART1_CTSn", 12, 7, "uart1_ctsn", "timer6_mux1", "dcan0_tx", "I2C2_SDA", "spi1_cs0", "pr1_uart0_cts_n", "pr1_edc_latch0_in", "gpio0_12"), - _PIN(0x97c, "UART1_RTSn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n ", "pr1_edc_latch1_in", "gpio0_13"), + _PIN(0x97c, "UART1_RTSn", 13, 7, "uart1_rtsn", "timer5_mux1", "dcan0_rx", "I2C2_SCL", "spi1_cs1", "pr1_uart0_rts_n", "pr1_edc_latch1_in", "gpio0_13"), _PIN(0x980, "UART1_RXD", 14, 7, "uart1_rxd", "mmc1_sdwp", "dcan1_tx", "I2C1_SDA", NULL, "pr1_uart0_rxd", "pr1_pru1_pru_r31_16", "gpio0_14"), _PIN(0x984, "UART1_TXD", 15, 7, "uart1_txd", "mmc2_sdwp", "dcan1_rx", "I2C1_SCL", NULL, "pr1_uart0_txd", "pr1_pru0_pru_r31_16", "gpio0_15"), _PIN(0x988, "I2C0_SDA", 101, 7, "I2C0_SDA", "timer4", "uart2_ctsn", "eCAP2_in_PWM2_out", NULL, NULL, NULL, "gpio3_5"), From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 11:51:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8070C99A; Mon, 9 Dec 2013 11:51:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B75C12ED; Mon, 9 Dec 2013 11:51:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9BpIXq075340; Mon, 9 Dec 2013 11:51:18 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9BpIOJ075339; Mon, 9 Dec 2013 11:51:18 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201312091151.rB9BpIOJ075339@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 9 Dec 2013 11:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259126 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 11:51:18 -0000 Author: loos Date: Mon Dec 9 11:51:17 2013 New Revision: 259126 URL: http://svnweb.freebsd.org/changeset/base/259126 Log: Activate the device before attempt to access any of its registers. Without this change we may end up with a panic (Fatal kernel mode data abort: 'External Non-Linefetch Abort (S)') as described in http://e2e.ti.com/support/arm/sitara_arm/f/791/t/276862.aspx. It is now possible to bring up I2C1 and I2C2 on BBB. Approved by: adrian (mentor) Modified: head/sys/arm/ti/ti_i2c.c Modified: head/sys/arm/ti/ti_i2c.c ============================================================================== --- head/sys/arm/ti/ti_i2c.c Mon Dec 9 11:33:45 2013 (r259125) +++ head/sys/arm/ti/ti_i2c.c Mon Dec 9 11:51:17 2013 (r259126) @@ -1076,20 +1076,20 @@ ti_i2c_attach(device_t dev) goto out; } - /* XXXOMAP3: FIXME get proper revision here */ - /* First read the version number of the I2C module */ - sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REVNB_HI) & 0xff; - - device_printf(dev, "I2C revision %d.%d\n", sc->sc_rev >> 4, - sc->sc_rev & 0xf); - - /* Activate the H/W */ + /* First we _must_ activate the H/W */ err = ti_i2c_activate(dev); if (err) { device_printf(dev, "ti_i2c_activate failed\n"); goto out; } + /* XXXOMAP3: FIXME get proper revision here */ + /* Read the version number of the I2C module */ + sc->sc_rev = ti_i2c_read_2(sc, I2C_REG_REVNB_HI) & 0xff; + + device_printf(dev, "I2C revision %d.%d\n", sc->sc_rev >> 4, + sc->sc_rev & 0xf); + /* activate the interrupt */ err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ti_i2c_intr, sc, &sc->sc_irq_h); From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 12:01:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8F04D95; Mon, 9 Dec 2013 12:01:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A493013BA; Mon, 9 Dec 2013 12:01:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9C1Hbj079034; Mon, 9 Dec 2013 12:01:17 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9C1HhH079033; Mon, 9 Dec 2013 12:01:17 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201312091201.rB9C1HhH079033@svn.freebsd.org> From: Luiz Otavio O Souza Date: Mon, 9 Dec 2013 12:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259127 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 12:01:17 -0000 Author: loos Date: Mon Dec 9 12:01:17 2013 New Revision: 259127 URL: http://svnweb.freebsd.org/changeset/base/259127 Log: Bring the RPi I2C driver in line with ti_i2c. Make it treat any slave address as a 7-bit address. Approved by: adrian (mentor) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Dec 9 11:51:17 2013 (r259126) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Dec 9 12:01:17 2013 (r259127) @@ -404,7 +404,7 @@ bcm_bsc_transfer(device_t dev, struct ii for (i = 0; i < nmsgs; i++) { /* Write the slave address. */ - BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, (msgs[i].slave >> 1) & 0x7f); + BCM_BSC_WRITE(sc, BCM_BSC_SLAVE, msgs[i].slave); /* Write the data length. */ BCM_BSC_WRITE(sc, BCM_BSC_DLEN, msgs[i].len); From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 13:44:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA2072C5; Mon, 9 Dec 2013 13:44:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB45E1AD7; Mon, 9 Dec 2013 13:44:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9Di7wF023310; Mon, 9 Dec 2013 13:44:07 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9Di7Lt023309; Mon, 9 Dec 2013 13:44:07 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312091344.rB9Di7Lt023309@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Dec 2013 13:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259128 - in releng/10.0: . contrib/ipfilter contrib/top share/man/man4 share/mk sys/amd64/include sys/contrib/dev/acpica sys/contrib/ipfilter/netinet sys/dev/fdt sys/x86/include X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 13:44:07 -0000 Author: gjb Date: Mon Dec 9 13:44:07 2013 New Revision: 259128 URL: http://svnweb.freebsd.org/changeset/base/259128 Log: Remove svn:mergeinfo from the releng/10.0 branch. After branch creation from stable/10, the stable/10 branch mergeinfo was moved to the root of the branch. Since there have not been any merges from stable/10 to releng/10.0 yet, we do not need to track any of the existing mergeinfo here. Merges to releng/10.0 should now be done to the root of the branch. For future branches during the release cycle, unless otherwise noted, this change will be done as part of the stable/ and releng/ branch creation. Discussed with: peter Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: Directory Properties: releng/10.0/ (props changed) releng/10.0/MAINTAINERS (props changed) releng/10.0/Makefile.inc1 (props changed) releng/10.0/ObsoleteFiles.inc (props changed) releng/10.0/UPDATING (props changed) releng/10.0/bin/df/ (props changed) releng/10.0/bin/freebsd-version/ (props changed) releng/10.0/cddl/ (props changed) releng/10.0/cddl/contrib/opensolaris/ (props changed) releng/10.0/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) releng/10.0/cddl/contrib/opensolaris/cmd/zfs/ (props changed) releng/10.0/cddl/contrib/opensolaris/lib/libzfs/ (props changed) releng/10.0/contrib/apr/ (props changed) releng/10.0/contrib/apr-util/ (props changed) releng/10.0/contrib/atf/ (props changed) releng/10.0/contrib/binutils/ (props changed) releng/10.0/contrib/bmake/ (props changed) releng/10.0/contrib/byacc/ (props changed) releng/10.0/contrib/bzip2/ (props changed) releng/10.0/contrib/com_err/ (props changed) releng/10.0/contrib/compiler-rt/ (props changed) releng/10.0/contrib/dialog/ (props changed) releng/10.0/contrib/dtc/ (props changed) releng/10.0/contrib/ee/ (props changed) releng/10.0/contrib/expat/ (props changed) releng/10.0/contrib/file/ (props changed) releng/10.0/contrib/gcc/ (props changed) releng/10.0/contrib/gdb/ (props changed) releng/10.0/contrib/gdtoa/ (props changed) releng/10.0/contrib/groff/ (props changed) releng/10.0/contrib/ipfilter/ (props changed) releng/10.0/contrib/ipfilter/ml_ipl.c (props changed) releng/10.0/contrib/ipfilter/mlfk_ipl.c (props changed) releng/10.0/contrib/ipfilter/mlh_rule.c (props changed) releng/10.0/contrib/ipfilter/mli_ipl.c (props changed) releng/10.0/contrib/ipfilter/mln_ipl.c (props changed) releng/10.0/contrib/ipfilter/mls_ipl.c (props changed) releng/10.0/contrib/ldns/ (props changed) releng/10.0/contrib/less/ (props changed) releng/10.0/contrib/libarchive/ (props changed) releng/10.0/contrib/libarchive/cpio/ (props changed) releng/10.0/contrib/libarchive/libarchive/ (props changed) releng/10.0/contrib/libarchive/libarchive_fe/ (props changed) releng/10.0/contrib/libarchive/tar/ (props changed) releng/10.0/contrib/libc++/ (props changed) releng/10.0/contrib/libc-vis/ (props changed) releng/10.0/contrib/libcxxrt/ (props changed) releng/10.0/contrib/libexecinfo/ (props changed) releng/10.0/contrib/libpcap/ (props changed) releng/10.0/contrib/libstdc++/ (props changed) releng/10.0/contrib/llvm/ (props changed) releng/10.0/contrib/llvm/tools/clang/ (props changed) releng/10.0/contrib/mtree/ (props changed) releng/10.0/contrib/ncurses/ (props changed) releng/10.0/contrib/netcat/ (props changed) releng/10.0/contrib/ntp/ (props changed) releng/10.0/contrib/nvi/ (props changed) releng/10.0/contrib/one-true-awk/ (props changed) releng/10.0/contrib/openbsm/ (props changed) releng/10.0/contrib/openpam/ (props changed) releng/10.0/contrib/openresolv/ (props changed) releng/10.0/contrib/pf/ (props changed) releng/10.0/contrib/sendmail/ (props changed) releng/10.0/contrib/serf/ (props changed) releng/10.0/contrib/smbfs/ (props changed) releng/10.0/contrib/subversion/ (props changed) releng/10.0/contrib/tcpdump/ (props changed) releng/10.0/contrib/tcsh/ (props changed) releng/10.0/contrib/tnftp/ (props changed) releng/10.0/contrib/top/ (props changed) releng/10.0/contrib/top/install-sh (props changed) releng/10.0/contrib/tzcode/stdtime/ (props changed) releng/10.0/contrib/tzcode/zic/ (props changed) releng/10.0/contrib/tzdata/ (props changed) releng/10.0/contrib/unbound/ (props changed) releng/10.0/contrib/wpa/ (props changed) releng/10.0/contrib/xz/ (props changed) releng/10.0/crypto/heimdal/ (props changed) releng/10.0/crypto/openssh/ (props changed) releng/10.0/crypto/openssl/ (props changed) releng/10.0/etc/ (props changed) releng/10.0/etc/rc.d/ (props changed) releng/10.0/gnu/lib/ (props changed) releng/10.0/gnu/usr.bin/binutils/ (props changed) releng/10.0/gnu/usr.bin/cc/cc_tools/ (props changed) releng/10.0/gnu/usr.bin/gdb/ (props changed) releng/10.0/include/ (props changed) releng/10.0/lib/ (props changed) releng/10.0/lib/libc/ (props changed) releng/10.0/lib/libc/stdtime/ (props changed) releng/10.0/lib/libc_nonshared/ (props changed) releng/10.0/lib/libfetch/ (props changed) releng/10.0/lib/libiconv_modules/ (props changed) releng/10.0/lib/libsmb/ (props changed) releng/10.0/lib/libthr/ (props changed) releng/10.0/lib/libutil/ (props changed) releng/10.0/lib/libvmmapi/ (props changed) releng/10.0/lib/libyaml/ (props changed) releng/10.0/lib/libz/ (props changed) releng/10.0/release/ (props changed) releng/10.0/release/doc/ (props changed) releng/10.0/sbin/ (props changed) releng/10.0/sbin/camcontrol/ (props changed) releng/10.0/sbin/dumpon/ (props changed) releng/10.0/sbin/hastd/ (props changed) releng/10.0/sbin/ifconfig/ (props changed) releng/10.0/sbin/ipfw/ (props changed) releng/10.0/sbin/nvmecontrol/ (props changed) releng/10.0/share/ (props changed) releng/10.0/share/examples/bhyve/ (props changed) releng/10.0/share/i18n/csmapper/JIS/ (props changed) releng/10.0/share/i18n/esdb/EUC/ (props changed) releng/10.0/share/man/ (props changed) releng/10.0/share/man/man4/ (props changed) releng/10.0/share/man/man4/bhyve.4 (props changed) releng/10.0/share/man/man5/ (props changed) releng/10.0/share/man/man7/ (props changed) releng/10.0/share/man/man8/ (props changed) releng/10.0/share/misc/ (props changed) releng/10.0/share/mk/ (props changed) releng/10.0/share/mk/bsd.arch.inc.mk (props changed) releng/10.0/share/syscons/ (props changed) releng/10.0/share/zoneinfo/ (props changed) releng/10.0/sys/ (props changed) releng/10.0/sys/amd64/include/vmm.h (props changed) releng/10.0/sys/amd64/include/vmm_dev.h (props changed) releng/10.0/sys/amd64/include/vmm_instruction_emul.h (props changed) releng/10.0/sys/amd64/include/xen/ (props changed) releng/10.0/sys/amd64/vmm/ (props changed) releng/10.0/sys/boot/ (props changed) releng/10.0/sys/boot/i386/efi/ (props changed) releng/10.0/sys/boot/ia64/efi/ (props changed) releng/10.0/sys/boot/ia64/ski/ (props changed) releng/10.0/sys/boot/powerpc/boot1.chrp/ (props changed) releng/10.0/sys/boot/powerpc/ofw/ (props changed) releng/10.0/sys/cddl/contrib/opensolaris/ (props changed) releng/10.0/sys/conf/ (props changed) releng/10.0/sys/contrib/dev/acpica/ (props changed) releng/10.0/sys/contrib/dev/acpica/changes.txt (props changed) releng/10.0/sys/contrib/dev/acpica/common/ (props changed) releng/10.0/sys/contrib/dev/acpica/compiler/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/debugger/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/disassembler/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/dispatcher/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/events/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/executer/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/hardware/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/namespace/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/parser/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/resources/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/tables/ (props changed) releng/10.0/sys/contrib/dev/acpica/components/utilities/ (props changed) releng/10.0/sys/contrib/dev/acpica/include/ (props changed) releng/10.0/sys/contrib/dev/acpica/os_specific/ (props changed) releng/10.0/sys/contrib/ipfilter/ (props changed) releng/10.0/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c (props changed) releng/10.0/sys/contrib/ipfilter/netinet/ip_raudio_pxy.c (props changed) releng/10.0/sys/contrib/libfdt/ (props changed) releng/10.0/sys/contrib/octeon-sdk/ (props changed) releng/10.0/sys/contrib/x86emu/ (props changed) releng/10.0/sys/dev/bvm/ (props changed) releng/10.0/sys/dev/fdt/fdt_ic_if.m (props changed) releng/10.0/sys/dev/hyperv/ (props changed) releng/10.0/sys/modules/hyperv/ (props changed) releng/10.0/sys/modules/vmm/ (props changed) releng/10.0/sys/x86/include/acpica_machdep.h (props changed) releng/10.0/tools/ (props changed) releng/10.0/tools/build/ (props changed) releng/10.0/tools/build/options/ (props changed) releng/10.0/tools/tools/atsectl/ (props changed) releng/10.0/usr.bin/calendar/ (props changed) releng/10.0/usr.bin/csup/ (props changed) releng/10.0/usr.bin/iscsictl/ (props changed) releng/10.0/usr.bin/procstat/ (props changed) releng/10.0/usr.sbin/ (props changed) releng/10.0/usr.sbin/bhyve/ (props changed) releng/10.0/usr.sbin/bhyvectl/ (props changed) releng/10.0/usr.sbin/bhyveload/ (props changed) releng/10.0/usr.sbin/bsdconfig/ (props changed) releng/10.0/usr.sbin/bsdinstall/ (props changed) releng/10.0/usr.sbin/ctladm/ (props changed) releng/10.0/usr.sbin/ctld/ (props changed) releng/10.0/usr.sbin/freebsd-update/ (props changed) releng/10.0/usr.sbin/jail/ (props changed) releng/10.0/usr.sbin/mergemaster/ (props changed) releng/10.0/usr.sbin/mount_smbfs/ (props changed) releng/10.0/usr.sbin/ndiscvt/ (props changed) releng/10.0/usr.sbin/pkg/ (props changed) releng/10.0/usr.sbin/rtadvctl/ (props changed) releng/10.0/usr.sbin/rtadvd/ (props changed) releng/10.0/usr.sbin/rtsold/ (props changed) releng/10.0/usr.sbin/zic/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 15:01:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD457FCA; Mon, 9 Dec 2013 15:01:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A88F11166; Mon, 9 Dec 2013 15:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9F1Z5C053012; Mon, 9 Dec 2013 15:01:35 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9F1YOJ053006; Mon, 9 Dec 2013 15:01:34 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312091501.rB9F1YOJ053006@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 9 Dec 2013 15:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259129 - in head/sys/dev/vt: . font X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 15:01:35 -0000 Author: ray Date: Mon Dec 9 15:01:34 2013 New Revision: 259129 URL: http://svnweb.freebsd.org/changeset/base/259129 Log: Respect SC_NO_CUTPASTE option. It disable mouse cursor and cut/paste support for vt(9). Note: /dev/sysmouse not affected. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/font/vt_mouse_cursor.c head/sys/dev/vt/vt.h head/sys/dev/vt/vt_buf.c head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_sysmouse.c Modified: head/sys/dev/vt/font/vt_mouse_cursor.c ============================================================================== --- head/sys/dev/vt/font/vt_mouse_cursor.c Mon Dec 9 13:44:07 2013 (r259128) +++ head/sys/dev/vt/font/vt_mouse_cursor.c Mon Dec 9 15:01:34 2013 (r259129) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#ifndef SC_NO_CUTPASTE struct mouse_cursor vt_default_mouse_pointer = { .map = { 0x00, /* "__ " */ @@ -66,3 +67,4 @@ struct mouse_cursor vt_default_mouse_poi .w = 8, .h = 13, }; +#endif Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Mon Dec 9 13:44:07 2013 (r259128) +++ head/sys/dev/vt/vt.h Mon Dec 9 15:01:34 2013 (r259129) @@ -181,15 +181,17 @@ void vtbuf_init(struct vt_buf *, const t void vtbuf_grow(struct vt_buf *, const term_pos_t *, int); void vtbuf_putchar(struct vt_buf *, const term_pos_t *, term_char_t); void vtbuf_cursor_position(struct vt_buf *, const term_pos_t *); -void vtbuf_mouse_cursor_position(struct vt_buf *vb, int col, int row); -void vtbuf_cursor_visibility(struct vt_buf *, int); void vtbuf_scroll_mode(struct vt_buf *vb, int yes); void vtbuf_undirty(struct vt_buf *, term_rect_t *, struct vt_bufmask *); void vtbuf_sethistory_size(struct vt_buf *, int); -int vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row); int vtbuf_iscursor(struct vt_buf *vb, int row, int col); +void vtbuf_cursor_visibility(struct vt_buf *, int); +#ifndef SC_NO_CUTPASTE +void vtbuf_mouse_cursor_position(struct vt_buf *vb, int col, int row); +int vtbuf_set_mark(struct vt_buf *vb, int type, int col, int row); int vtbuf_get_marked_len(struct vt_buf *vb); void vtbuf_extract_marked(struct vt_buf *vb, term_char_t *buf, int sz); +#endif #define VTB_MARK_NONE 0 #define VTB_MARK_END 1 @@ -389,12 +391,14 @@ struct vt_font { unsigned int vf_refcount; }; +#ifndef SC_NO_CUTPASTE struct mouse_cursor { uint8_t map[64 * 64 / 8]; uint8_t mask[64 * 64 / 8]; uint8_t w; uint8_t h; }; +#endif const uint8_t *vtfont_lookup(const struct vt_font *vf, term_char_t c); struct vt_font *vtfont_ref(struct vt_font *vf); @@ -403,8 +407,10 @@ int vtfont_load(vfnt_t *f, struct vt_f /* Sysmouse. */ void sysmouse_process_event(mouse_info_t *mi); +#ifndef SC_NO_CUTPASTE void vt_mouse_event(int type, int x, int y, int event, int cnt); void vt_mouse_state(int show); +#endif #define VT_MOUSE_SHOW 1 #define VT_MOUSE_HIDE 0 Modified: head/sys/dev/vt/vt_buf.c ============================================================================== --- head/sys/dev/vt/vt_buf.c Mon Dec 9 13:44:07 2013 (r259128) +++ head/sys/dev/vt/vt_buf.c Mon Dec 9 15:01:34 2013 (r259129) @@ -135,6 +135,7 @@ vthistory_getpos(const struct vt_buf *vb *offset = vb->vb_roffset; } +#ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */ /* Translate current view row number to history row. */ static int vtbuf_wth(struct vt_buf *vb, int row) @@ -142,6 +143,7 @@ vtbuf_wth(struct vt_buf *vb, int row) return ((vb->vb_roffset + row) % vb->vb_history_size); } +#endif /* Translate history row to current view row number. */ static int @@ -531,6 +533,7 @@ vtbuf_cursor_position(struct vt_buf *vb, } } +#ifndef SC_NO_CUTPASTE void vtbuf_mouse_cursor_position(struct vt_buf *vb, int col, int row) { @@ -691,6 +694,7 @@ vtbuf_set_mark(struct vt_buf *vb, int ty vtbuf_flush_mark(vb); return (1); } +#endif void vtbuf_cursor_visibility(struct vt_buf *vb, int yes) Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Dec 9 13:44:07 2013 (r259128) +++ head/sys/dev/vt/vt_core.c Mon Dec 9 15:01:34 2013 (r259129) @@ -127,7 +127,9 @@ extern unsigned char vt_logo_image[]; /* Font. */ extern struct vt_font vt_font_default; +#ifndef SC_NO_CUTPASTE extern struct mouse_cursor vt_default_mouse_pointer; +#endif static int signal_vt_rel(struct vt_window *); static int signal_vt_acq(struct vt_window *); @@ -689,12 +691,14 @@ vt_flush(struct vt_device *vd) struct vt_window *vw = vd->vd_curwindow; struct vt_font *vf = vw->vw_font; struct vt_bufmask tmask; - struct mouse_cursor *m; unsigned int row, col; term_rect_t tarea; term_pos_t size; term_char_t *r; +#ifndef SC_NO_CUTPASTE + struct mouse_cursor *m; int bpl, h, w; +#endif if (vd->vd_flags & VDF_SPLASH || vw->vw_flags & VWF_BUSY) return; @@ -711,11 +715,13 @@ vt_flush(struct vt_device *vd) vd->vd_flags &= ~VDF_INVALID; } +#ifndef SC_NO_CUTPASTE if ((vw->vw_flags & VWF_MOUSE_HIDE) == 0) { /* Mark last mouse position as dirty to erase. */ vtbuf_mouse_cursor_position(&vw->vw_buf, vd->vd_mdirtyx, vd->vd_mdirtyy); } +#endif for (row = tarea.tr_begin.tp_row; row < tarea.tr_end.tp_row; row++) { if (!VTBUF_DIRTYROW(&tmask, row)) @@ -731,6 +737,7 @@ vt_flush(struct vt_device *vd) } } +#ifndef SC_NO_CUTPASTE /* Mouse disabled. */ if (vw->vw_flags & VWF_MOUSE_HIDE) return; @@ -759,6 +766,7 @@ vt_flush(struct vt_device *vd) vd->vd_mdirtyx = vd->vd_mx / vf->vf_width; vd->vd_mdirtyy = vd->vd_my / vf->vf_height; } +#endif } static void @@ -1106,6 +1114,7 @@ finish_vt_acq(struct vt_window *vw) return (EINVAL); } +#ifndef SC_NO_CUTPASTE void vt_mouse_event(int type, int x, int y, int event, int cnt) { @@ -1265,6 +1274,7 @@ vt_mouse_state(int show) break; } } +#endif static int vtterm_ioctl(struct terminal *tm, u_long cmd, caddr_t data, Modified: head/sys/dev/vt/vt_sysmouse.c ============================================================================== --- head/sys/dev/vt/vt_sysmouse.c Mon Dec 9 13:44:07 2013 (r259128) +++ head/sys/dev/vt/vt_sysmouse.c Mon Dec 9 15:01:34 2013 (r259129) @@ -190,9 +190,11 @@ sysmouse_process_event(mouse_info_t *mi) sysmouse_buf_store(buf); +#ifndef SC_NO_CUTPASTE mtx_unlock(&sysmouse_lock); vt_mouse_event(mi->operation, x, y, mi->u.event.id, mi->u.event.value); return; +#endif done: mtx_unlock(&sysmouse_lock); } @@ -345,7 +347,9 @@ sysmouse_ioctl(struct cdev *dev, u_long return (EINVAL); sysmouse_level = level; +#ifndef SC_NO_CUTPASTE vt_mouse_state((level == 0)?VT_MOUSE_SHOW:VT_MOUSE_HIDE); +#endif return (0); } case MOUSE_SETMODE: { @@ -358,8 +362,10 @@ sysmouse_ioctl(struct cdev *dev, u_long case 0: case 1: sysmouse_level = mode->level; +#ifndef SC_NO_CUTPASTE vt_mouse_state((mode->level == 0)?VT_MOUSE_SHOW: VT_MOUSE_HIDE); +#endif break; default: return (EINVAL); From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 15:28:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66A73A52; Mon, 9 Dec 2013 15:28:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5292F1322; Mon, 9 Dec 2013 15:28:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9FSZ9Z061524; Mon, 9 Dec 2013 15:28:35 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9FSYFE061522; Mon, 9 Dec 2013 15:28:34 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312091528.rB9FSYFE061522@svn.freebsd.org> From: Aleksandr Rybalko Date: Mon, 9 Dec 2013 15:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259130 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 15:28:35 -0000 Author: ray Date: Mon Dec 9 15:28:34 2013 New Revision: 259130 URL: http://svnweb.freebsd.org/changeset/base/259130 Log: o Compat options have to be defined before sys/ioccom.h included, so move inclusion of right after sys/param.h. o Only vt_core module use compat options, move it from common header to module. Reported by: Larry Rosenman ler at lerctr dot org Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Mon Dec 9 15:01:34 2013 (r259129) +++ head/sys/dev/vt/vt.h Mon Dec 9 15:28:34 2013 (r259130) @@ -46,7 +46,6 @@ #include #include -#include "opt_compat.h" #include "opt_syscons.h" #include "opt_splash.h" Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Dec 9 15:01:34 2013 (r259129) +++ head/sys/dev/vt/vt_core.c Mon Dec 9 15:28:34 2013 (r259130) @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); #include + +#include "opt_compat.h" + #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 15:39:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FA67242; Mon, 9 Dec 2013 15:39:17 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id CF1831454; Mon, 9 Dec 2013 15:39:16 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id E9300C493D; Mon, 9 Dec 2013 17:39:15 +0200 (EET) Date: Mon, 9 Dec 2013 17:39:52 +0200 From: Aleksandr Rybalko To: Marius Strobl Subject: Re: svn commit: r259102 - head/sys/sparc64/sparc64 Message-Id: <20131209173952.d6e3d3fb0fb5c9e84bc41bfb@ddteam.net> In-Reply-To: <201312081525.rB8FPJK0023252@svn.freebsd.org> References: <201312081525.rB8FPJK0023252@svn.freebsd.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 15:39:17 -0000 On Sun, 8 Dec 2013 15:25:19 +0000 (UTC) Marius Strobl wrote: > Author: marius > Date: Sun Dec 8 15:25:19 2013 > New Revision: 259102 > URL: http://svnweb.freebsd.org/changeset/base/259102 > > Log: > Restore a vital comment nuked in r259016. > > Modified: > head/sys/sparc64/sparc64/machdep.c > > Modified: head/sys/sparc64/sparc64/machdep.c > ============================================================================== > --- head/sys/sparc64/sparc64/machdep.c Sun Dec 8 14:21:54 2013 (r259101) > +++ head/sys/sparc64/sparc64/machdep.c Sun Dec 8 15:25:19 2013 (r259102) > @@ -553,6 +553,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l > * trigger a fatal reset error or worse things further down the road. > * XXX it should be possible to use this solely instead of writing > * %tba in cpu_setregs(). Doing so causes a hang however. > + * > + * NB: the low-level console drivers require a working DELAY() and > + * some compiler optimizations may cause the curthread accesses of > + * mutex(9) to be factored out even if the latter aren't actually > + * called. Both of these require PCPU_REG to be set. However, we > + * can't set PCPU_REG without also taking over the trap table or the > + * firmware will overwrite it. > */ > sun4u_set_traptable(tl0_base); > Oh, I'm sorry. It was old fix. Seems it here since 2009. Thanks. WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 18:52:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B62F38CE; Mon, 9 Dec 2013 18:52:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A22DD1554; Mon, 9 Dec 2013 18:52:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9IqLvJ038414; Mon, 9 Dec 2013 18:52:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9IqLp1038413; Mon, 9 Dec 2013 18:52:21 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201312091852.rB9IqLp1038413@svn.freebsd.org> From: Xin LI Date: Mon, 9 Dec 2013 18:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259131 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 18:52:21 -0000 Author: delphij Date: Mon Dec 9 18:52:21 2013 New Revision: 259131 URL: http://svnweb.freebsd.org/changeset/base/259131 Log: Don't panic when we get ZPOOL_STATUS_NON_NATIVE_ASHIFT while listing importable pools. MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Dec 9 15:28:34 2013 (r259130) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Dec 9 18:52:21 2013 (r259131) @@ -1702,6 +1702,12 @@ show_import(nvlist_t *config) "resilvered.\n")); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + (void) printf(gettext("status: One or more devices were " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + break; + default: /* * No other status can be seen when importing pools. From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 18:57:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF41CDA7; Mon, 9 Dec 2013 18:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D50D315DB; Mon, 9 Dec 2013 18:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9IvKYL039119; Mon, 9 Dec 2013 18:57:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9IvKqo039117; Mon, 9 Dec 2013 18:57:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312091857.rB9IvKqo039117@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Dec 2013 18:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259132 - head/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 18:57:21 -0000 Author: eadler Date: Mon Dec 9 18:57:20 2013 New Revision: 259132 URL: http://svnweb.freebsd.org/changeset/base/259132 Log: Per the resolution of POSIX bug 0000779 (note 0002050) add support for using 'i' as a case insensitive flag. PR: standards/184641 Requested by: David A. Wheeler MFC After: 1 week Modified: head/usr.bin/sed/compile.c head/usr.bin/sed/sed.1 Modified: head/usr.bin/sed/compile.c ============================================================================== --- head/usr.bin/sed/compile.c Mon Dec 9 18:52:21 2013 (r259131) +++ head/usr.bin/sed/compile.c Mon Dec 9 18:57:20 2013 (r259132) @@ -582,6 +582,7 @@ compile_flags(char *p, struct s_subst *s case 'p': s->p = 1; break; + case 'i': case 'I': s->icase = 1; break; Modified: head/usr.bin/sed/sed.1 ============================================================================== --- head/usr.bin/sed/sed.1 Mon Dec 9 18:52:21 2013 (r259131) +++ head/usr.bin/sed/sed.1 Mon Dec 9 18:57:20 2013 (r259132) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd May 24, 2009 +.Dd December 9, 2013 .Dt SED 1 .Os .Sh NAME @@ -196,7 +196,7 @@ option was specified); a context address that consists of a regular expression preceded and followed by a delimiter. The closing delimiter can also optionally be followed by the -.Dq I +.Dq i character, to indicate that the regular expression is to be matched in a case-insensitive way. .El @@ -507,7 +507,7 @@ Append the pattern space to if a replacement was made. If the replacement string is identical to that which it replaces, it is still considered to have been a replacement. -.It I +.It i or I Match the regular expression in a case-insensitive way. .El .Pp From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 19:13:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E0BE4B5; Mon, 9 Dec 2013 19:13:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC9717B1; Mon, 9 Dec 2013 19:13:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9JDHA7046279; Mon, 9 Dec 2013 19:13:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9JDHpP046277; Mon, 9 Dec 2013 19:13:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312091913.rB9JDHpP046277@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Dec 2013 19:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259133 - head/tools/regression/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 19:13:17 -0000 Author: eadler Date: Mon Dec 9 19:13:16 2013 New Revision: 259133 URL: http://svnweb.freebsd.org/changeset/base/259133 Log: Add regression test for recently added 'i' flag in r259132. PR: standards/184641 Added: head/tools/regression/usr.bin/sed/regress.icase4.out - copied unchanged from r259132, head/tools/regression/usr.bin/sed/regress.icase2.out Modified: head/tools/regression/usr.bin/sed/regress.sh Copied: head/tools/regression/usr.bin/sed/regress.icase4.out (from r259132, head/tools/regression/usr.bin/sed/regress.icase2.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/sed/regress.icase4.out Mon Dec 9 19:13:16 2013 (r259133, copy of r259132, head/tools/regression/usr.bin/sed/regress.icase2.out) @@ -0,0 +1,4 @@ +input +data +for validation +of Foo(1) Modified: head/tools/regression/usr.bin/sed/regress.sh ============================================================================== --- head/tools/regression/usr.bin/sed/regress.sh Mon Dec 9 18:57:20 2013 (r259132) +++ head/tools/regression/usr.bin/sed/regress.sh Mon Dec 9 19:13:16 2013 (r259133) @@ -66,6 +66,7 @@ REGRESSION_TEST_FREEFORM(`inplace5', `in REGRESSION_TEST(`icase1', `sed /SED/Id < regress.in') REGRESSION_TEST(`icase2', `sed s/SED/Foo/I < regress.in') REGRESSION_TEST(`icase3', `sed s/SED/Foo/ < regress.in') +REGRESSION_TEST(`icase4', `sed s/SED/Foo/i < regress.in') REGRESSION_TEST(`hanoi', `echo ":abcd: : :" | sed -f hanoi.sed') REGRESSION_TEST(`math', `echo "4+7*3+2^7/3" | sed -f math.sed') From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 19:31:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3B8F26D; Mon, 9 Dec 2013 19:31:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DE4FA194D; Mon, 9 Dec 2013 19:31:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9JVVYO054081; Mon, 9 Dec 2013 19:31:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9JVUFO054072; Mon, 9 Dec 2013 19:31:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312091931.rB9JVUFO054072@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Dec 2013 19:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259134 - in head: tools/regression/usr.sbin/etcupdate usr.sbin/etcupdate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 19:31:32 -0000 Author: jhb Date: Mon Dec 9 19:31:30 2013 New Revision: 259134 URL: http://svnweb.freebsd.org/changeset/base/259134 Log: - Refresh /etc/localtime after each update using tzsetup -r. - Regenerate /var/db/services.db when /etc/services changes. MFC after: 1 week Added: head/tools/regression/usr.sbin/etcupdate/tzsetup.sh (contents, props changed) Modified: head/tools/regression/usr.sbin/etcupdate/preworld.sh head/tools/regression/usr.sbin/etcupdate/tests.sh head/usr.sbin/etcupdate/etcupdate.8 head/usr.sbin/etcupdate/etcupdate.sh Modified: head/tools/regression/usr.sbin/etcupdate/preworld.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/preworld.sh Mon Dec 9 19:13:16 2013 (r259133) +++ head/tools/regression/usr.sbin/etcupdate/preworld.sh Mon Dec 9 19:31:30 2013 (r259134) @@ -66,7 +66,7 @@ TEST=$WORKDIR/test build_trees() { - # Populate trees with pre-world files and an additional file + # Populate trees with pre-world files and additional files # that should not be touched. rm -rf $SRC $OLD $TEST $CONFLICTS @@ -126,6 +126,7 @@ polkit:*:562: haldaemon:*:560: EOF rm $TEST/etc/inetd.conf + touch $TEST/etc/localtime # Copy the "old" source tree to the new source tree and # make upstream modifications. Modified: head/tools/regression/usr.sbin/etcupdate/tests.sh ============================================================================== --- head/tools/regression/usr.sbin/etcupdate/tests.sh Mon Dec 9 19:13:16 2013 (r259133) +++ head/tools/regression/usr.sbin/etcupdate/tests.sh Mon Dec 9 19:31:30 2013 (r259134) @@ -628,6 +628,24 @@ root: someone@example.com MAILER-DAEMON: postmaster postmaster: root EOF + + # - Verify that updating an unmodified /etc/services builds + # /var/db/services.db. + cat > $OLD/etc/services < $NEW/etc/services < $WORKDIR/correct.out < +# 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$ + +# Various regression tests for the tzsetup handling in the 'update' command. + +WORKDIR=work + +usage() +{ + echo "Usage: tzsetup.sh [-s script] [-w workdir]" + exit 1 +} + +# Allow the user to specify an alternate work directory or script. +COMMAND=etcupdate +while getopts "s:w:" option; do + case $option in + s) + COMMAND="sh $OPTARG" + ;; + w) + WORKDIR=$OPTARG + ;; + *) + echo + usage + ;; + esac +done +shift $((OPTIND - 1)) +if [ $# -ne 0 ]; then + usage +fi + +CONFLICTS=$WORKDIR/conflicts +OLD=$WORKDIR/old +NEW=$WORKDIR/current +TEST=$WORKDIR/test + +build_trees() +{ + + # Build the base tree, but not /etc/localtime itself + local i j k + + rm -rf $OLD $NEW $TEST $CONFLICTS + mkdir -p $OLD $NEW $TEST + mkdir -p $TEST/etc + mkdir -p $TEST/var/db + mkdir -p $TEST/usr/share/zoneinfo + + # Create a dummy timezone file + echo "foo" > $TEST/usr/share/zoneinfo/foo + +} + +# $1 - relative path to file that should be missing from TEST +missing() +{ + if [ -e $TEST/$1 -o -L $TEST/$1 ]; then + echo "File $1 should be missing" + fi +} + +# $1 - relative path to file that should be a symlink in TEST +# $2 - optional value of the link +link() +{ + local val + + if ! [ -L $TEST/$1 ]; then + echo "File $1 should be a link" + elif [ $# -gt 1 ]; then + val=`readlink $TEST/$1` + if [ "$val" != "$2" ]; then + echo "Link $1 should link to \"$2\"" + fi + fi +} + +# $1 - relative path to regular file that should be present in TEST +# $2 - optional string that should match file contents +# $3 - optional MD5 of the flie contents, overrides $2 if present +file() +{ + local contents sum + + if ! [ -f $TEST/$1 ]; then + echo "File $1 should be a regular file" + elif [ $# -eq 2 ]; then + contents=`cat $TEST/$1` + if [ "$contents" != "$2" ]; then + echo "File $1 has wrong contents" + fi + elif [ $# -eq 3 ]; then + sum=`md5 -q $TEST/$1` + if [ "$sum" != "$3" ]; then + echo "File $1 has wrong contents" + fi + fi +} + +if [ `id -u` -ne 0 ]; then + echo "must be root" +fi + +if [ -r /etc/etcupdate.conf ]; then + echo "WARNING: /etc/etcupdate.conf settings may break some tests." +fi + +# First, test for /etc/localtime not existing + +build_trees + +$COMMAND -nr -d $WORKDIR -D $TEST > $WORKDIR/testn.out + +cat > $WORKDIR/correct.out < $WORKDIR/test.out + +echo "Differences for no /etc/localtime:" +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out + +missing /etc/localtime +missing /var/db/zoneinfo + +# Second, test for /etc/localtime being a symlink + +build_trees +ln -s /dev/null $TEST/etc/localtime + +$COMMAND -nr -d $WORKDIR -D $TEST > $WORKDIR/testn.out + +cat > $WORKDIR/correct.out < $WORKDIR/test.out + +echo "Differences for symlinked /etc/localtime:" +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out + +link /etc/localtime "/dev/null" +missing /var/db/zoneinfo + +# Third, test for /etc/localtime as a file and a missing /var/db/zoneinfo + +build_trees +echo "bar" > $TEST/etc/localtime + +$COMMAND -nr -d $WORKDIR -D $TEST > $WORKDIR/testn.out + +cat > $WORKDIR/correct.out < $WORKDIR/test.out + +echo "Differences for missing /var/db/zoneinfo:" +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out + +file /etc/localtime "bar" +missing /var/db/zoneinfo + +# Finally, test the case where it should update /etc/localtime + +build_trees +echo "bar" > $TEST/etc/localtime +echo "foo" > $TEST/var/db/zoneinfo + +$COMMAND -nr -d $WORKDIR -D $TEST > $WORKDIR/testn.out + +cat > $WORKDIR/correct.out < $WORKDIR/test.out + +echo "Differences for real update:" +diff -u -L "correct" $WORKDIR/correct.out -L "test" $WORKDIR/test.out + +file /etc/localtime "foo" +file /var/db/zoneinfo "foo" Modified: head/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.8 Mon Dec 9 19:13:16 2013 (r259133) +++ head/usr.sbin/etcupdate/etcupdate.8 Mon Dec 9 19:31:30 2013 (r259134) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2010-2012 Advanced Computing Technologies LLC +.\" Copyright (c) 2010-2013 Advanced Computing Technologies LLC .\" Written by: John H. Baldwin .\" All rights reserved. .\" @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2013 +.Dd December 9, 2013 .Dt ETCUPDATE 8 .Os .Sh NAME @@ -695,6 +695,25 @@ has been removed from the tree, but it has been locally modified. The modified version of the file remains in the destination directory. +.It "Needs update: /etc/localtime (required manual update via tzsetup(1))" +The +.Fa /var/db/zoneinfo +file does not exist, +so +.Nm +was not able to refresh +.Fa /etc/localtime +from its source file in +.Fa /usr/share/zoneinfo . +Running +.Xr tzsetup 1 +will both refresh +.Fa /etc/localtime +and generate +.Fa /var/db/zoneinfo +permitting future updates to refresh +.Fa /etc/localtime +automatically. .It "Needs update: /etc/mail/aliases.db (required manual update via newaliases(1))" The file .Pa /etc/mail/aliases Modified: head/usr.sbin/etcupdate/etcupdate.sh ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.sh Mon Dec 9 19:13:16 2013 (r259133) +++ head/usr.sbin/etcupdate/etcupdate.sh Mon Dec 9 19:31:30 2013 (r259134) @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2010 Advanced Computing Technologies LLC +# Copyright (c) 2010-2013 Advanced Computing Technologies LLC # Written by: John H. Baldwin # All rights reserved. # @@ -486,6 +486,39 @@ diffnode() esac } +# Run one-off commands after an update has completed. These commands +# are not tied to a specific file, so they cannot be handled by +# post_install_file(). +post_update() +{ + local args + + # None of these commands should be run for a pre-world update. + if [ -n "$preworld" ]; then + return + fi + + # If /etc/localtime exists and is not a symlink and /var/db/zoneinfo + # exists, run tzsetup -r to refresh /etc/localtime. + if [ -f ${DESTDIR}/etc/localtime -a \ + ! -L ${DESTDIR}/etc/localtime ]; then + if [ -f ${DESTDIR}/var/db/zoneinfo ]; then + if [ -n "${DESTDIR}" ]; then + args="-C ${DESTDIR}" + else + args="" + fi + log "tzsetup -r ${args}" + if [ -z "$dryrun" ]; then + tzsetup -r ${args} >&3 2>&1 + fi + else + warn "Needs update: /etc/localtime (required" \ + "manual update via tzsetup(1))" + fi + fi +} + # Create missing parent directories of a node in a target tree # preserving the owner, group, and permissions from a specified # template tree. @@ -583,6 +616,14 @@ post_install_file() fi fi ;; + /etc/services) + log "services_mkdb -q -o $DESTDIR/var/db/services.db" \ + "${DESTDIR}$1" + if [ -z "$dryrun" ]; then + services_mkdb -q -o $DESTDIR/var/db/services.db \ + ${DESTDIR}$1 >&3 2>&1 + fi + ;; esac } @@ -1506,6 +1547,9 @@ EOF "(requires manual update via newaliases(1))" fi + # Run any special one-off commands after an update has completed. + post_update + if [ -s $WARNINGS ]; then echo "Warnings:" cat $WARNINGS From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 19:35:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCDE0482; Mon, 9 Dec 2013 19:35:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9615197A; Mon, 9 Dec 2013 19:35:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9JZgtl054638; Mon, 9 Dec 2013 19:35:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9JZgmG054637; Mon, 9 Dec 2013 19:35:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312091935.rB9JZgmG054637@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 Dec 2013 19:35:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259135 - head/sys/modules/iwnfw/iwn6000g2b X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 19:35:42 -0000 Author: adrian Date: Mon Dec 9 19:35:42 2013 New Revision: 259135 URL: http://svnweb.freebsd.org/changeset/base/259135 Log: Bump the g2b firmware to 18.x. Tested: * Intel 6235 Modified: head/sys/modules/iwnfw/iwn6000g2b/Makefile Modified: head/sys/modules/iwnfw/iwn6000g2b/Makefile ============================================================================== --- head/sys/modules/iwnfw/iwn6000g2b/Makefile Mon Dec 9 19:31:30 2013 (r259134) +++ head/sys/modules/iwnfw/iwn6000g2b/Makefile Mon Dec 9 19:35:42 2013 (r259135) @@ -1,6 +1,6 @@ # $FreeBSD$ KMOD= iwn6000g2bfw -IMG= iwlwifi-6000g2b-17.168.5.2 +IMG= iwlwifi-6000g2b-18.168.6.1 .include From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 20:04:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E7D7B84; Mon, 9 Dec 2013 20:04:58 +0000 (UTC) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ABF9B1CB3; Mon, 9 Dec 2013 20:04:57 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id k4so2976497qaq.8 for ; Mon, 09 Dec 2013 12:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YvYeo7hRH9fK6KpBmdw+r/Ea1GZ7tc0bdmKxa+mPOx8=; b=s7RK05ztVyn8n0CDwTyv0iFMpw7IeuTTsH7KUhhWdwu/wn+ML23+SNLZmcdIK3OEh4 l2aQ0DGH26LPruyVyIq9zaboj6weEKz0Ih8p+1dbHxBWuzmhIQSQ+j8oDBo2l2W//CTw gxYrQ5DEZNp7MWvSBcF6ehClFMg4mdCbCYcAJC6rNhpHasZZtpAIFAraR7+KQTXLzRvX hTFMpXk85Dt1vlePv3AsGJb1DrxokF8/dfwOLznOfmAvLpZw/3Syl1NgKxv1g3D104M/ 85ewBGxaUoD+i0o4h8m2rCcm5jTk27ubvdwbgsior7bF+UXJ7u4lO7OfBgYzev/YUkR0 SjMg== MIME-Version: 1.0 X-Received: by 10.49.129.38 with SMTP id nt6mr28873467qeb.78.1386619496935; Mon, 09 Dec 2013 12:04:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.53.200 with HTTP; Mon, 9 Dec 2013 12:04:56 -0800 (PST) In-Reply-To: <201312090726.rB97QuVA077110@svn.freebsd.org> References: <201312090726.rB97QuVA077110@svn.freebsd.org> Date: Mon, 9 Dec 2013 12:04:56 -0800 X-Google-Sender-Auth: zmfNWwtEb8MjV99dVN5tGC5cq7Q Message-ID: Subject: Re: svn commit: r259123 - head/sys/modules/usb From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 20:04:58 -0000 You don't have to build the whole kernel - you just need to have config run to spit out the opt_xxx files. -a On 8 December 2013 23:26, Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Dec 9 07:26:55 2013 > New Revision: 259123 > URL: http://svnweb.freebsd.org/changeset/base/259123 > > Log: > Make it easier to test build the USB code having the debug flags set > without having to build the complete kernel. > > MFC after: 2 weeks > > Modified: > head/sys/modules/usb/Makefile > > Modified: head/sys/modules/usb/Makefile > ============================================================================== > --- head/sys/modules/usb/Makefile Mon Dec 9 07:15:46 2013 (r259122) > +++ head/sys/modules/usb/Makefile Mon Dec 9 07:26:55 2013 (r259123) > @@ -27,6 +27,18 @@ > > .include > > +# > +# Check for common USB debug flags to pass when building the USB > +# modules in this directory: > +# > +.if defined(USB_DEBUG) > +MAKE+=" DEBUG_FLAGS+=-DUSB_DEBUG" > +.endif > + > +.if defined(USB_DEBUG) && defined(USB_REQ_DEBUG) > +MAKE+=" DEBUG_FLAGS+=-DUSB_REQ_DEBUG" > +.endif > + > # Modules that include binary-only blobs of microcode should be selectable by > # MK_SOURCELESS_UCODE option (see below). > From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 20:28:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF59E288; Mon, 9 Dec 2013 20:28:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C00D1DFA; Mon, 9 Dec 2013 20:28:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9KS95w073418; Mon, 9 Dec 2013 20:28:09 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9KS9sK073417; Mon, 9 Dec 2013 20:28:09 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312092028.rB9KS9sK073417@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Dec 2013 20:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259136 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 20:28:09 -0000 Author: gjb Date: Mon Dec 9 20:28:09 2013 New Revision: 259136 URL: http://svnweb.freebsd.org/changeset/base/259136 Log: The stable/10 branch is now thawed, and no longer requires re@ approval for commit. Committers are asked to please exercise caution when merging to stable/10 for the duration of the 10.0-RELEASE cycle. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Mon Dec 9 19:35:42 2013 (r259135) +++ svnadmin/conf/approvers Mon Dec 9 20:28:09 2013 (r259136) @@ -17,7 +17,7 @@ # $FreeBSD$ # #^head/ re -^stable/10/ re +#^stable/10/ re #^stable/9/ re #^stable/8/ re #^stable/7/ re From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 20:29:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B286F403; Mon, 9 Dec 2013 20:29:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E9C91E0B; Mon, 9 Dec 2013 20:29:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9KTsYb073626; Mon, 9 Dec 2013 20:29:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9KTsAu073625; Mon, 9 Dec 2013 20:29:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312092029.rB9KTsAu073625@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Dec 2013 20:29:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259137 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 20:29:54 -0000 Author: gjb Date: Mon Dec 9 20:29:54 2013 New Revision: 259137 URL: http://svnweb.freebsd.org/changeset/base/259137 Log: Expand the branch list to include stable/10 for approval requirements to random(4). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Mon Dec 9 20:28:09 2013 (r259136) +++ svnadmin/conf/approvers Mon Dec 9 20:29:54 2013 (r259137) @@ -35,7 +35,5 @@ ^head/LOCKS core ^head/sys/dev/random (security-officer|so|secteam|core) ^head/sys/libkern/arc4random.c (security-officer|so|secteam|core) -^stable/[7-9]/sys/dev/random (security-officer|so|secteam|core) -#^stable/([7-9]|10)/sys/dev/random (security-officer|so|secteam|core) -^stable/[7-9]/sys/libkern/arc4random.c (security-officer|so|secteam|core) -#^stable/([7-9]|10)/sys/libkern/arc4random.c (security-officer|so|secteam|core) +^stable/([7-9]|10)/sys/dev/random (security-officer|so|secteam|core) +^stable/([7-9]|10)/sys/libkern/arc4random.c (security-officer|so|secteam|core) From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 20:47:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7BCD8F2; Mon, 9 Dec 2013 20:47:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92DAA1F3A; Mon, 9 Dec 2013 20:47:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9KloI2080715; Mon, 9 Dec 2013 20:47:50 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9KloV7080714; Mon, 9 Dec 2013 20:47:50 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312092047.rB9KloV7080714@svn.freebsd.org> From: Bryan Drewery Date: Mon, 9 Dec 2013 20:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259138 - stable/10/tools/build/options X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 20:47:50 -0000 Author: bdrewery (ports committer) Date: Mon Dec 9 20:47:50 2013 New Revision: 259138 URL: http://svnweb.freebsd.org/changeset/base/259138 Log: MFC r258924: Add missing period for WITHOUT_PKGBOOTSTRAP so that it matches all other entries. Approved by: bapt (implicit) Modified: stable/10/tools/build/options/WITHOUT_PKGBOOTSTRAP Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/build/options/WITHOUT_PKGBOOTSTRAP ============================================================================== --- stable/10/tools/build/options/WITHOUT_PKGBOOTSTRAP Mon Dec 9 20:29:54 2013 (r259137) +++ stable/10/tools/build/options/WITHOUT_PKGBOOTSTRAP Mon Dec 9 20:47:50 2013 (r259138) @@ -1,4 +1,4 @@ .\" $FreeBSD$ Set to not build .Xr pkg 7 -bootstrap tool +bootstrap tool. From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 21:07:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 59FB1FC0; Mon, 9 Dec 2013 21:07:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 459EE10BF; Mon, 9 Dec 2013 21:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9L7wls088183; Mon, 9 Dec 2013 21:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9L7w5a088182; Mon, 9 Dec 2013 21:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312092107.rB9L7w5a088182@svn.freebsd.org> From: Bryan Drewery Date: Mon, 9 Dec 2013 21:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259139 - stable/10/share/man/man5 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 21:07:58 -0000 Author: bdrewery (ports committer) Date: Mon Dec 9 21:07:57 2013 New Revision: 259139 URL: http://svnweb.freebsd.org/changeset/base/259139 Log: Regenerate after r259138 Approved by: bapt (implicit) Modified: stable/10/share/man/man5/src.conf.5 Modified: stable/10/share/man/man5/src.conf.5 ============================================================================== --- stable/10/share/man/man5/src.conf.5 Mon Dec 9 20:47:50 2013 (r259138) +++ stable/10/share/man/man5/src.conf.5 Mon Dec 9 21:07:57 2013 (r259139) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: stable/10/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd November 11, 2013 +.Dd December 9, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -851,10 +851,10 @@ When set, it also enforces the following .Va WITHOUT_AUTHPF .El .It Va WITHOUT_PKGBOOTSTRAP -.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PKGBOOTSTRAP 257573 2013-11-03 13:06:43Z bdrewery +.\" from FreeBSD: stable/10/tools/build/options/WITHOUT_PKGBOOTSTRAP 259138 2013-12-09 20:47:50Z bdrewery Set to not build .Xr pkg 7 -bootstrap tool +bootstrap tool. .It Va WITH_PKGTOOLS .\" from FreeBSD: stable/10/tools/build/options/WITH_PKGTOOLS 253305 2013-07-12 23:11:17Z bapt Set to build From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 21:08:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC19B187; Mon, 9 Dec 2013 21:08:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B636C10C9; Mon, 9 Dec 2013 21:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9L8rbm088360; Mon, 9 Dec 2013 21:08:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9L8q00088353; Mon, 9 Dec 2013 21:08:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312092108.rB9L8q00088353@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Dec 2013 21:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259140 - in head/sys: amd64/include i386/include x86/acpica x86/include x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 21:08:54 -0000 Author: jhb Date: Mon Dec 9 21:08:52 2013 New Revision: 259140 URL: http://svnweb.freebsd.org/changeset/base/259140 Log: Move constants for indices in the local APIC's local vector table from apicvar.h to apicreg.h. Modified: head/sys/amd64/include/apicvar.h head/sys/i386/include/apicvar.h head/sys/x86/acpica/madt.c head/sys/x86/include/apicreg.h head/sys/x86/x86/local_apic.c head/sys/x86/x86/mptable.c Modified: head/sys/amd64/include/apicvar.h ============================================================================== --- head/sys/amd64/include/apicvar.h Mon Dec 9 21:07:57 2013 (r259139) +++ head/sys/amd64/include/apicvar.h Mon Dec 9 21:08:52 2013 (r259140) @@ -136,15 +136,6 @@ */ #define APIC_SPURIOUS_INT 255 -#define LVT_LINT0 0 -#define LVT_LINT1 1 -#define LVT_TIMER 2 -#define LVT_ERROR 3 -#define LVT_PMC 4 -#define LVT_THERMAL 5 -#define LVT_CMCI 6 -#define LVT_MAX LVT_CMCI - #ifndef LOCORE #define APIC_IPI_DEST_SELF -1 Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Mon Dec 9 21:07:57 2013 (r259139) +++ head/sys/i386/include/apicvar.h Mon Dec 9 21:08:52 2013 (r259140) @@ -135,15 +135,6 @@ */ #define APIC_SPURIOUS_INT 255 -#define LVT_LINT0 0 -#define LVT_LINT1 1 -#define LVT_TIMER 2 -#define LVT_ERROR 3 -#define LVT_PMC 4 -#define LVT_THERMAL 5 -#define LVT_CMCI 6 -#define LVT_MAX LVT_CMCI - #ifndef LOCORE #define APIC_IPI_DEST_SELF -1 Modified: head/sys/x86/acpica/madt.c ============================================================================== --- head/sys/x86/acpica/madt.c Mon Dec 9 21:07:57 2013 (r259139) +++ head/sys/x86/acpica/madt.c Mon Dec 9 21:08:52 2013 (r259140) @@ -517,9 +517,9 @@ madt_parse_local_nmi(ACPI_MADT_LOCAL_API return; } if (nmi->Lint == 0) - pin = LVT_LINT0; + pin = APIC_LVT_LINT0; else - pin = LVT_LINT1; + pin = APIC_LVT_LINT1; lapic_set_lvt_mode(apic_id, pin, APIC_LVT_DM_NMI); if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) lapic_set_lvt_triggermode(apic_id, pin, Modified: head/sys/x86/include/apicreg.h ============================================================================== --- head/sys/x86/include/apicreg.h Mon Dec 9 21:07:57 2013 (r259139) +++ head/sys/x86/include/apicreg.h Mon Dec 9 21:08:52 2013 (r259140) @@ -357,6 +357,16 @@ typedef struct IOAPIC ioapic_t; #define APIC_TDCR_128 0x0a #define APIC_TDCR_1 0x0b +/* LVT table indices */ +#define APIC_LVT_LINT0 0 +#define APIC_LVT_LINT1 1 +#define APIC_LVT_TIMER 2 +#define APIC_LVT_ERROR 3 +#define APIC_LVT_PMC 4 +#define APIC_LVT_THERMAL 5 +#define APIC_LVT_CMCI 6 +#define APIC_LVT_MAX APIC_LVT_CMCI + /****************************************************************************** * I/O APIC defines */ Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Dec 9 21:07:57 2013 (r259139) +++ head/sys/x86/x86/local_apic.c Mon Dec 9 21:08:52 2013 (r259140) @@ -111,7 +111,7 @@ struct lvt { }; struct lapic { - struct lvt la_lvts[LVT_MAX + 1]; + struct lvt la_lvts[APIC_LVT_MAX + 1]; u_int la_id:8; u_int la_cluster:4; u_int la_cluster_id:2; @@ -125,7 +125,7 @@ struct lapic { } static lapics[MAX_APIC_ID + 1]; /* Global defaults for local APIC LVT entries. */ -static struct lvt lvts[LVT_MAX + 1] = { +static struct lvt lvts[APIC_LVT_MAX + 1] = { { 1, 1, 1, 1, APIC_LVT_DM_EXTINT, 0 }, /* LINT0: masked ExtINT */ { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* LINT1: NMI */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT }, /* Timer */ @@ -179,7 +179,7 @@ lvt_mode(struct lapic *la, u_int pin, ui { struct lvt *lvt; - KASSERT(pin <= LVT_MAX, ("%s: pin %u out of range", __func__, pin)); + KASSERT(pin <= APIC_LVT_MAX, ("%s: pin %u out of range", __func__, pin)); if (la->la_lvts[pin].lvt_active) lvt = &la->la_lvts[pin]; else @@ -300,7 +300,7 @@ lapic_create(u_int apic_id, int boot_cpu */ lapics[apic_id].la_present = 1; lapics[apic_id].la_id = apic_id; - for (i = 0; i <= LVT_MAX; i++) { + for (i = 0; i <= APIC_LVT_MAX; i++) { lapics[apic_id].la_lvts[i] = lvts[i]; lapics[apic_id].la_lvts[i].lvt_active = 0; } @@ -339,10 +339,10 @@ lapic_dump(const char* str) lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); - if (maxlvt >= LVT_PMC) + if (maxlvt >= APIC_LVT_PMC) printf(" pmc: 0x%08x", lapic->lvt_pcint); printf("\n"); - if (maxlvt >= LVT_CMCI) + if (maxlvt >= APIC_LVT_CMCI) printf(" cmci: 0x%08x\n", lapic->lvt_cmci); } @@ -366,16 +366,16 @@ lapic_setup(int boot) lapic_enable(); /* Program LINT[01] LVT entries. */ - lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); - lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + lapic->lvt_lint0 = lvt_mode(la, APIC_LVT_LINT0, lapic->lvt_lint0); + lapic->lvt_lint1 = lvt_mode(la, APIC_LVT_LINT1, lapic->lvt_lint1); /* Program the PMC LVT entry if present. */ - if (maxlvt >= LVT_PMC) - lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); + if (maxlvt >= APIC_LVT_PMC) + lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); /* Program timer LVT and setup handler. */ la->lvt_timer_cache = lapic->lvt_timer = - lvt_mode(la, LVT_TIMER, lapic->lvt_timer); + lvt_mode(la, APIC_LVT_TIMER, lapic->lvt_timer); if (boot) { snprintf(buf, sizeof(buf), "cpu%d:timer", PCPU_GET(cpuid)); intrcnt_add(buf, &la->la_timer_count); @@ -393,14 +393,14 @@ lapic_setup(int boot) } /* Program error LVT and clear any existing errors. */ - lapic->lvt_error = lvt_mode(la, LVT_ERROR, lapic->lvt_error); + lapic->lvt_error = lvt_mode(la, APIC_LVT_ERROR, lapic->lvt_error); lapic->esr = 0; /* XXX: Thermal LVT */ /* Program the CMCI LVT entry if present. */ - if (maxlvt >= LVT_CMCI) - lapic->lvt_cmci = lvt_mode(la, LVT_CMCI, lapic->lvt_cmci); + if (maxlvt >= APIC_LVT_CMCI) + lapic->lvt_cmci = lvt_mode(la, APIC_LVT_CMCI, lapic->lvt_cmci); intr_restore(saveintr); } @@ -424,7 +424,7 @@ lapic_update_pmc(void *dummy) struct lapic *la; la = &lapics[lapic_id()]; - lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); + lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); } #endif @@ -440,10 +440,10 @@ lapic_enable_pmc(void) /* Fail if the PMC LVT is not present. */ maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; - if (maxlvt < LVT_PMC) + if (maxlvt < APIC_LVT_PMC) return (0); - lvts[LVT_PMC].lvt_masked = 0; + lvts[APIC_LVT_PMC].lvt_masked = 0; #ifdef SMP /* @@ -474,10 +474,10 @@ lapic_disable_pmc(void) /* Fail if the PMC LVT is not present. */ maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; - if (maxlvt < LVT_PMC) + if (maxlvt < APIC_LVT_PMC) return; - lvts[LVT_PMC].lvt_masked = 1; + lvts[APIC_LVT_PMC].lvt_masked = 1; #ifdef SMP /* The APs should always be started when hwpmc is unloaded. */ @@ -617,7 +617,7 @@ int lapic_set_lvt_mask(u_int apic_id, u_int pin, u_char masked) { - if (pin > LVT_MAX) + if (pin > APIC_LVT_MAX) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_masked = masked; @@ -641,7 +641,7 @@ lapic_set_lvt_mode(u_int apic_id, u_int { struct lvt *lvt; - if (pin > LVT_MAX) + if (pin > APIC_LVT_MAX) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvt = &lvts[pin]; @@ -696,7 +696,7 @@ int lapic_set_lvt_polarity(u_int apic_id, u_int pin, enum intr_polarity pol) { - if (pin > LVT_MAX || pol == INTR_POLARITY_CONFORM) + if (pin > APIC_LVT_MAX || pol == INTR_POLARITY_CONFORM) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_activehi = (pol == INTR_POLARITY_HIGH); @@ -721,7 +721,7 @@ int lapic_set_lvt_triggermode(u_int apic_id, u_int pin, enum intr_trigger trigger) { - if (pin > LVT_MAX || trigger == INTR_TRIGGER_CONFORM) + if (pin > APIC_LVT_MAX || trigger == INTR_TRIGGER_CONFORM) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_edgetrigger = (trigger == INTR_TRIGGER_EDGE); @@ -894,8 +894,8 @@ lapic_enable_cmc(void) apic_id = PCPU_GET(apic_id); KASSERT(lapics[apic_id].la_present, ("%s: missing APIC %u", __func__, apic_id)); - lapics[apic_id].la_lvts[LVT_CMCI].lvt_masked = 0; - lapics[apic_id].la_lvts[LVT_CMCI].lvt_active = 1; + lapics[apic_id].la_lvts[APIC_LVT_CMCI].lvt_masked = 0; + lapics[apic_id].la_lvts[APIC_LVT_CMCI].lvt_active = 1; if (bootverbose) printf("lapic%u: CMCI unmasked\n", apic_id); } Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Mon Dec 9 21:07:57 2013 (r259139) +++ head/sys/x86/x86/mptable.c Mon Dec 9 21:08:52 2013 (r259140) @@ -786,9 +786,9 @@ mptable_parse_local_int(int_entry_ptr in else apic_id = intr->dst_apic_id; if (intr->dst_apic_int == 0) - pin = LVT_LINT0; + pin = APIC_LVT_LINT0; else - pin = LVT_LINT1; + pin = APIC_LVT_LINT1; switch (intr->int_type) { case INTENTRY_TYPE_INT: #if 1 @@ -902,8 +902,9 @@ mptable_parse_ints(void) /* Is this a pre-defined config? */ if (mpfps->config_type != 0) { /* Configure LINT pins. */ - lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT0, APIC_LVT_DM_EXTINT); - lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT1, APIC_LVT_DM_NMI); + lapic_set_lvt_mode(APIC_ID_ALL, APIC_LVT_LINT0, + APIC_LVT_DM_EXTINT); + lapic_set_lvt_mode(APIC_ID_ALL, APIC_LVT_LINT1, APIC_LVT_DM_NMI); /* Configure I/O APIC pins. */ mptable_parse_default_config_ints(); From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 21:32:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61DCF3FC; Mon, 9 Dec 2013 21:32:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC821228; Mon, 9 Dec 2013 21:32:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9LWbxj098516; Mon, 9 Dec 2013 21:32:37 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9LWb28098515; Mon, 9 Dec 2013 21:32:37 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201312092132.rB9LWb28098515@svn.freebsd.org> From: Peter Wemm Date: Mon, 9 Dec 2013 21:32:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259141 - stable/10/etc/rc.d X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 21:32:37 -0000 Author: peter Date: Mon Dec 9 21:32:36 2013 New Revision: 259141 URL: http://svnweb.freebsd.org/changeset/base/259141 Log: MFC r259094 - Fix undocumented side effect of r256256 that changes/breaks existing jails. This burned us in the freebsd cluster yesterday. Modified: stable/10/etc/rc.d/jail Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/rc.d/jail ============================================================================== --- stable/10/etc/rc.d/jail Mon Dec 9 21:08:52 2013 (r259140) +++ stable/10/etc/rc.d/jail Mon Dec 9 21:32:36 2013 (r259141) @@ -319,8 +319,8 @@ jail_extract_address() _mask=${_mask:-/32} elif [ "${_type}" = "inet6" ]; then - # In case _maske is not set for IPv6, use /64. - _mask=${_mask:-/64} + # In case _maske is not set for IPv6, use /128. + _mask=${_mask:-/128} fi } From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 21:47:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94FC967C; Mon, 9 Dec 2013 21:47:50 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67F7612F9; Mon, 9 Dec 2013 21:47:50 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id ED20EB98F; Mon, 9 Dec 2013 16:47:48 -0500 (EST) From: John Baldwin To: "=?iso-8859-15?q?Jean-S=E9bastien?= =?iso-8859-15?q?_P=E9dron?=" Subject: Re: svn commit: r258930 - head/sys/dev/drm2 Date: Mon, 9 Dec 2013 16:46:27 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312041904.rB4J4vbM043709@svn.freebsd.org> <201312051005.23197.jhb@freebsd.org> <52A266CF.90007@FreeBSD.org> In-Reply-To: <52A266CF.90007@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201312091646.27179.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Dec 2013 16:47:49 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 21:47:50 -0000 On Friday, December 06, 2013 7:07:43 pm Jean-S=E9bastien P=E9dron wrote: > Le 05/12/2013 16:05, John Baldwin a =E9crit : > >>> Eh, vgapci is the right place to read this. The LINK_CAP here is=20 telling > >>> you the width of the slot you are plugged into, not the width of the= =20 card > >>> that is plugged into the slot. > >> > >> I'm sorry, my knowledge of PCI is very limited (still learning) and I > >> don't understand your comment. Could you please expand on it? > > > > [explanation] >=20 > Thank you very much for the explanation! >=20 > > Can you provide pciconf -lc output from your machine >=20 > You'll find it attached. >=20 > > and tell me what you think the function should be returning (i.e. > > are you trying to determine the speed of the slot, or the speed of > > the card?) >=20 > The result of this function is used to initialize the card (ie. it does=20 > more steps if speed is 5.0). The debug message is "enabling PCIE gen 2=20 > link speeds" in this case. I admit I don't know what the code is doing=20 > exactly, so I haven't any expectation :) >=20 > What I see is that now, this part of the initialization is similar to=20 > Linux 3.8 on the same computer: in both OSes, the PCI ID of the bridge=20 > and the linkcap/linkcap2 values are logged, and the PCI ID/values are=20 > matching. Ok, after looking at the original version of this function in Linux, it does read the capabilities from the parent bridge of the slot, not from the card itself, so your change is correct. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 21:54:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92999860 for ; Mon, 9 Dec 2013 21:54:23 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 40F5D138F for ; Mon, 9 Dec 2013 21:54:23 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id w5so3099105qac.0 for ; Mon, 09 Dec 2013 13:54:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=message-id:date:from:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type; bh=P726SWhsszItDe1MR+c2LOUt4i+3I6J5zrf4i3C7cJ4=; b=bec2eVjXOhJ0MUNAi06uCsT7ZvJE/dHnToKpKDnnhvIDFafLZfxC04V43PM7ufuFRm MUFhTdw4ZuXljlCIJ3/eovSfiiL2qPfmm8IQlYvnRXpeUNw09rMK36loA/ZfjqA3usdQ Xr57VluQdSvZFgVtct/dmJ0iIO7q3W3Qoqpd0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type; bh=P726SWhsszItDe1MR+c2LOUt4i+3I6J5zrf4i3C7cJ4=; b=CNjj7+RNntburz4Dq3MHlbBClH1d2CoOA96+Cobe7YrD5SdM5dFzPb+XKTal7EL2D6 muAMjTpPK9vcwYxIHCLwope7Nww05AwH5XWuKgZYvXw6ShX7zmc01zfy5FucqwV/86uj S2Sy2XbEXNS2yFwALPtGCfTSTJ9LprWrtgAkVrTOrXNbQ6aIZEITWpg7ORW1CMYTrXXB 9yEI1vCZPs5FJ65GJj4tUcYo53X6EYqbSKTehsVeluay/XGQkSeP70+uhoiYr3jWGKVf +P2V0eKLQn4M0JeIpKdqZD/0ojvoRqEEWtQPEcIRuDxvp7Fl54hFFxJIJs7VDmwqUMuH Bhmg== X-Gm-Message-State: ALoCoQlPU4yEf3U17SDcc+E5iLEpIjuCdgpM7aLnwBpK2+Cs/Vkw5eXaY+rUGw2dvjZsfH042GZ0 X-Received: by 10.49.71.34 with SMTP id r2mr162580319qeu.69.1386626062263; Mon, 09 Dec 2013 13:54:22 -0800 (PST) Received: from hackintosh.wemm.org ([2601:9:e80:d1:ece8:88ca:b1c6:e9cd]) by mx.google.com with ESMTPSA id o10sm37854547qaa.6.2013.12.09.13.54.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 13:54:20 -0800 (PST) Message-ID: <52A63C03.2030201@wemm.org> Date: Mon, 09 Dec 2013 13:54:11 -0800 From: Peter Wemm Organization: World Domination in progress. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Hiroki Sato , peter@FreeBSD.org Subject: Re: svn commit: r259094 - head/etc/rc.d References: <201312080555.rB85tu8W016979@svn.freebsd.org> <20131209.175119.597284254662875353.hrs@allbsd.org> In-Reply-To: <20131209.175119.597284254662875353.hrs@allbsd.org> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="80MvP1J1bf8dafClPrLbqErNKV2LKHNw9" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 21:54:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --80MvP1J1bf8dafClPrLbqErNKV2LKHNw9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 12/9/13, 12:51 AM, Hiroki Sato wrote: > Hi Peter, >=20 > Peter Wemm wrote > in <201312080555.rB85tu8W016979@svn.freebsd.org>: >=20 > pe> Author: peter > pe> Date: Sun Dec 8 05:55:55 2013 > pe> New Revision: 259094 > pe> URL: http://svnweb.freebsd.org/changeset/base/259094 > pe> > pe> Log: > pe> Rev 256256 had an undocumented side effect of breaking existing b= ehavior > pe> for ipv6 jails. > pe> > pe> Among the harmful side effects included putting a route to an ent= ire /64 > pe> onto an interface even if you were in a smaller network - eg: /80= =2E > pe> This broke the freebsd.org cluster hosted at ISC which has /80 ne= tworks. > pe> > pe> Modified: > pe> head/etc/rc.d/jail >=20 > The reason why it was changed is that I think an IPv6 GUA with no > prefix length information should always be interpret as a /64 because > the other tools like ifconfig do so. IPv6 is designed to always use > a correct prefix length and avoid using a /128 for aliases. Is there > a problem with specifying a /80 address to ip6.addr if a box is on a > /80 network? I'm all for issuing warnings and advising people to correct it. However = the problem is that the change silently breaks a working setup during an upgr= ade from 9.x to 10.x. At the ISC.org freebsd cluster site we lost the ability to talk to other services in nearby separate networks, including DNS. It had gone undetected until we tried to actually default to using IPv6 -= the first reaction from some of the other admins was to revert everything= back to IPv4. If breaking ipv6 jails leads to that outcome elsewhere the= n that would be sub-optimal for ipv6 adoption. --=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6F= JV UTF-8: for when a ' just won\342\200\231t do. --80MvP1J1bf8dafClPrLbqErNKV2LKHNw9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlKmPAgACgkQFRKuUnJ3cX8xIwCdE+i3QDsyv7s8a3BNABjW6atQ fIYAmgLWEd+b1tXRW/wWORQ4T7NX4xWo =Ia2w -----END PGP SIGNATURE----- --80MvP1J1bf8dafClPrLbqErNKV2LKHNw9-- From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 22:09:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28440D12 for ; Mon, 9 Dec 2013 22:09:27 +0000 (UTC) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5E4B14E0 for ; Mon, 9 Dec 2013 22:09:26 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id j5so3077692qaq.7 for ; Mon, 09 Dec 2013 14:09:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=88AOo0qlu9SCZ5QJaahbNuNROA1EuHqQsM/hajm7xh4=; b=IeW27gy3pBY+/0OtE+e8V+bXx+aRe0aydJFeQFtCTIYCL9g6qy6qfmgrQCgGWwArHD 3ucmcjVlLXFht0jAlh7l2k3PUJvRBKZ84l7d/pr7hbmaYBUqZTCpPiMV8uc2mqIyeD4Z dKiTRQXTnUOrZmOLXrGE8MVe7sRw8JbdZoBqE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=88AOo0qlu9SCZ5QJaahbNuNROA1EuHqQsM/hajm7xh4=; b=TA/AuRTWq19itppeb7mKFGlJRSo9bVdcUPxvh6j4ykUIImwa7Pp8emr0B2Ez3afjt2 DY9uM0dtiazgs8roKPzR++sqBINwE4FOSXLxZX1wS26MdiFLBqVkNiCtznhzHGIWtJHB 5NxeBh6SC0w+9RRJiQYmaxGiRDNzbycgDCzynNDeHFHTFnQ196g1l4LR3t3KcCRpIbFh FuwrjgpsQXqQTdeBAQ//UNhSTrmh7aAFAg8uG5hKADAaJYe6X6wE4RMBdHN4ZzxgE6pg WdfNFZbatYIeqQwEbcfiAuO4YYVU93aw5DK2vTAp0awJD0biFYaraSIiYuq8PctZCZzA Vz9g== X-Gm-Message-State: ALoCoQlXWftxwiIwiYtNeaCGW+4eLFLT4t/s0G+1B56xVqUKxVlFxFuRb1VwibElK+XD31XbSJCF X-Received: by 10.49.24.211 with SMTP id w19mr37640573qef.9.1386626965500; Mon, 09 Dec 2013 14:09:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.86.42 with HTTP; Mon, 9 Dec 2013 14:08:55 -0800 (PST) In-Reply-To: <201312092029.rB9KTsAu073625@svn.freebsd.org> References: <201312092029.rB9KTsAu073625@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Dec 2013 17:08:55 -0500 Message-ID: Subject: Re: svn commit: r259137 - svnadmin/conf To: Glen Barber Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-svnadmin@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 22:09:27 -0000 On Mon, Dec 9, 2013 at 3:29 PM, Glen Barber wrote: > Author: gjb > Date: Mon Dec 9 20:29:54 2013 > New Revision: 259137 > URL: http://svnweb.freebsd.org/changeset/base/259137 > > Log: > Expand the branch list to include stable/10 for approval requirements to > random(4). Can we just use a wildcard to avoid having to update this file for every branch? -- Eitan Adler From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 22:40:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAA9027B; Mon, 9 Dec 2013 22:40:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D495816CE; Mon, 9 Dec 2013 22:40:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9MeOjl023355; Mon, 9 Dec 2013 22:40:24 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9MeNG9023345; Mon, 9 Dec 2013 22:40:23 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312092240.rB9MeNG9023345@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 9 Dec 2013 22:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259142 - in stable/10: sys/dev/cxgbe sys/dev/cxgbe/common tools/tools/cxgbetool X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 22:40:25 -0000 Author: np Date: Mon Dec 9 22:40:22 2013 New Revision: 259142 URL: http://svnweb.freebsd.org/changeset/base/259142 Log: MFC r257654, r257772, r258441, r258689, r258698, r258879, r259048, and r259103. r257654: cxgbe(4): Exclude MPS_RPLC_MAP_CTL (0x11114) from the register dump. Turns out it's a write-only register with strange side effects on read. r257772: cxgbe(4): Tidy up the display for payload memory statistics (pm_stats). r258441: cxgbe(4): update the internal list of device features. r258689: Disable an assertion that relies on some code[1] that isn't in HEAD yet. r258698: cxgbetool: "modinfo" command to display SFP+ module information. r258879: cxgbe(4): T4_SET_SCHED_CLASS and T4_SET_SCHED_QUEUE ioctls to program scheduling classes in the chip and to bind tx queue(s) to a scheduling class respectively. These can be used for various kinds of tx traffic throttling (to force selected tx queues to drain at a fixed Kbps rate, or a % of the port's total bandwidth, or at a fixed pps rate, etc.). r259048: Two new cxgbetool subcommands to set up scheduler classes and to bind them to NIC queues. r259103: cxgbe(4): save a copy of the RSS map for each port for the driver's use. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/common.h stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/t4_ioctl.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c stable/10/tools/tools/cxgbetool/Makefile stable/10/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/sys/dev/cxgbe/adapter.h Mon Dec 9 22:40:22 2013 (r259142) @@ -194,6 +194,7 @@ struct port_info { unsigned long flags; int if_flags; + uint16_t *rss; uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ Modified: stable/10/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/10/sys/dev/cxgbe/common/common.h Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/sys/dev/cxgbe/common/common.h Mon Dec 9 22:40:22 2013 (r259142) @@ -587,4 +587,8 @@ int t4_sge_ctxt_rd_bd(struct adapter *ad int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); +int t4_sched_config(struct adapter *adapter, int type, int minmaxen); +int t4_sched_params(struct adapter *adapter, int type, int level, int mode, + int rateunit, int ratemode, int channel, int cl, + int minrate, int maxrate, int weight, int pktsize); #endif /* __CHELSIO_COMMON_H */ Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/10/sys/dev/cxgbe/common/t4_hw.c Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Mon Dec 9 22:40:22 2013 (r259142) @@ -5661,3 +5661,50 @@ int __devinit t4_port_init(struct port_i return 0; } + +int t4_sched_config(struct adapter *adapter, int type, int minmaxen) +{ + struct fw_sched_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_SCHED_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE); + cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd)); + + cmd.u.config.sc = FW_SCHED_SC_CONFIG; + cmd.u.config.type = type; + cmd.u.config.minmaxen = minmaxen; + + return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), + NULL, 1); +} + +int t4_sched_params(struct adapter *adapter, int type, int level, int mode, + int rateunit, int ratemode, int channel, int cl, + int minrate, int maxrate, int weight, int pktsize) +{ + struct fw_sched_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_SCHED_CMD) | + F_FW_CMD_REQUEST | + F_FW_CMD_WRITE); + cmd.retval_len16 = cpu_to_be32(FW_LEN16(cmd)); + + cmd.u.params.sc = FW_SCHED_SC_PARAMS; + cmd.u.params.type = type; + cmd.u.params.level = level; + cmd.u.params.mode = mode; + cmd.u.params.ch = channel; + cmd.u.params.cl = cl; + cmd.u.params.unit = rateunit; + cmd.u.params.rate = ratemode; + cmd.u.params.min = cpu_to_be32(minrate); + cmd.u.params.max = cpu_to_be32(maxrate); + cmd.u.params.weight = cpu_to_be16(weight); + cmd.u.params.pktsize = cpu_to_be16(pktsize); + + return t4_wr_mbox_meat(adapter,adapter->mbox, &cmd, sizeof(cmd), + NULL, 1); +} Modified: stable/10/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- stable/10/sys/dev/cxgbe/t4_ioctl.h Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/sys/dev/cxgbe/t4_ioctl.h Mon Dec 9 22:40:22 2013 (r259142) @@ -208,6 +208,74 @@ struct t4_filter { struct t4_filter_specification fs; }; +/* + * Support for "sched-class" command to allow a TX Scheduling Class to be + * programmed with various parameters. + */ +struct t4_sched_params { + int8_t subcmd; /* sub-command */ + int8_t type; /* packet or flow */ + union { + struct { /* sub-command SCHED_CLASS_CONFIG */ + int8_t minmax; /* minmax enable */ + } config; + struct { /* sub-command SCHED_CLASS_PARAMS */ + int8_t level; /* scheduler hierarchy level */ + int8_t mode; /* per-class or per-flow */ + int8_t rateunit; /* bit or packet rate */ + int8_t ratemode; /* %port relative or kbps + absolute */ + int8_t channel; /* scheduler channel [0..N] */ + int8_t cl; /* scheduler class [0..N] */ + int32_t minrate; /* minimum rate */ + int32_t maxrate; /* maximum rate */ + int16_t weight; /* percent weight */ + int16_t pktsize; /* average packet size */ + } params; + uint8_t reserved[6 + 8 * 8]; + } u; +}; + +enum { + SCHED_CLASS_SUBCMD_CONFIG, /* config sub-command */ + SCHED_CLASS_SUBCMD_PARAMS, /* params sub-command */ +}; + +enum { + SCHED_CLASS_TYPE_PACKET, +}; + +enum { + SCHED_CLASS_LEVEL_CL_RL, /* class rate limiter */ + SCHED_CLASS_LEVEL_CL_WRR, /* class weighted round robin */ + SCHED_CLASS_LEVEL_CH_RL, /* channel rate limiter */ +}; + +enum { + SCHED_CLASS_MODE_CLASS, /* per-class scheduling */ + SCHED_CLASS_MODE_FLOW, /* per-flow scheduling */ +}; + +enum { + SCHED_CLASS_RATEUNIT_BITS, /* bit rate scheduling */ + SCHED_CLASS_RATEUNIT_PKTS, /* packet rate scheduling */ +}; + +enum { + SCHED_CLASS_RATEMODE_REL, /* percent of port bandwidth */ + SCHED_CLASS_RATEMODE_ABS, /* Kb/s */ +}; + +/* + * Support for "sched_queue" command to allow one or more NIC TX Queues to be + * bound to a TX Scheduling Class. + */ +struct t4_sched_queue { + uint8_t port; + int8_t queue; /* queue index; -1 => all queues */ + int8_t cl; /* class index; -1 => unbind */ +}; + #define T4_SGE_CONTEXT_SIZE 24 enum { SGE_CONTEXT_EGRESS, @@ -261,6 +329,10 @@ struct t4_tracer { #define CHELSIO_T4_GET_MEM _IOW('f', T4_GET_MEM, struct t4_mem_range) #define CHELSIO_T4_GET_I2C _IOWR('f', T4_GET_I2C, struct t4_i2c_data) #define CHELSIO_T4_CLEAR_STATS _IOW('f', T4_CLEAR_STATS, uint32_t) +#define CHELSIO_T4_SCHED_CLASS _IOW('f', T4_SET_SCHED_CLASS, \ + struct t4_sched_params) +#define CHELSIO_T4_SCHED_QUEUE _IOW('f', T4_SET_SCHED_QUEUE, \ + struct t4_sched_queue) #define CHELSIO_T4_GET_TRACER _IOWR('f', T4_GET_TRACER, struct t4_tracer) #define CHELSIO_T4_SET_TRACER _IOW('f', T4_SET_TRACER, struct t4_tracer) #endif Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/sys/dev/cxgbe/t4_main.c Mon Dec 9 22:40:22 2013 (r259142) @@ -425,6 +425,8 @@ static int get_sge_context(struct adapte static int load_fw(struct adapter *, struct t4_data *); static int read_card_mem(struct adapter *, int, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); +static int set_sched_class(struct adapter *, struct t4_sched_params *); +static int set_sched_queue(struct adapter *, struct t4_sched_queue *); #ifdef TCP_OFFLOAD static int toe_capability(struct port_info *, int); #endif @@ -3155,7 +3157,7 @@ port_full_init(struct port_info *pi) struct ifnet *ifp = pi->ifp; uint16_t *rss; struct sge_rxq *rxq; - int rc, i; + int rc, i, j; ASSERT_SYNCHRONIZED_OP(sc); KASSERT((pi->flags & PORT_INIT_DONE) == 0, @@ -3172,21 +3174,25 @@ port_full_init(struct port_info *pi) goto done; /* error message displayed already */ /* - * Setup RSS for this port. + * Setup RSS for this port. Save a copy of the RSS table for later use. */ - rss = malloc(pi->nrxq * sizeof (*rss), M_CXGBE, - M_ZERO | M_WAITOK); - for_each_rxq(pi, i, rxq) { - rss[i] = rxq->iq.abs_id; + rss = malloc(pi->rss_size * sizeof (*rss), M_CXGBE, M_ZERO | M_WAITOK); + for (i = 0; i < pi->rss_size;) { + for_each_rxq(pi, j, rxq) { + rss[i++] = rxq->iq.abs_id; + if (i == pi->rss_size) + break; + } } - rc = -t4_config_rss_range(sc, sc->mbox, pi->viid, 0, - pi->rss_size, rss, pi->nrxq); - free(rss, M_CXGBE); + + rc = -t4_config_rss_range(sc, sc->mbox, pi->viid, 0, pi->rss_size, rss, + pi->rss_size); if (rc != 0) { if_printf(ifp, "rss_config failed: %d\n", rc); goto done; } + pi->rss = rss; pi->flags |= PORT_INIT_DONE; done: if (rc != 0) @@ -3235,6 +3241,7 @@ port_full_uninit(struct port_info *pi) quiesce_fl(sc, &ofld_rxq->fl); } #endif + free(pi->rss, M_CXGBE); } t4_teardown_port_queues(pi); @@ -3401,7 +3408,8 @@ t4_get_regs(struct adapter *sc, struct t 0xd004, 0xd03c, 0xdfc0, 0xdfe0, 0xe000, 0xea7c, - 0xf000, 0x11190, + 0xf000, 0x11110, + 0x11118, 0x11190, 0x19040, 0x1906c, 0x19078, 0x19080, 0x1908c, 0x19124, @@ -3607,7 +3615,8 @@ t4_get_regs(struct adapter *sc, struct t 0xd004, 0xd03c, 0xdfc0, 0xdfe0, 0xe000, 0x11088, - 0x1109c, 0x1117c, + 0x1109c, 0x11110, + 0x11118, 0x1117c, 0x11190, 0x11204, 0x19040, 0x1906c, 0x19078, 0x19080, @@ -4165,13 +4174,15 @@ t4_sysctls(struct adapter *sc) struct sysctl_oid_list *children, *c0; static char *caps[] = { "\20\1PPP\2QFC\3DCBX", /* caps[0] linkcaps */ - "\20\1NIC\2VM\3IDS\4UM\5UM_ISGL", /* caps[1] niccaps */ + "\20\1NIC\2VM\3IDS\4UM\5UM_ISGL" /* caps[1] niccaps */ + "\6HASHFILTER\7ETHOFLD", "\20\1TOE", /* caps[2] toecaps */ "\20\1RDDP\2RDMAC", /* caps[3] rdmacaps */ "\20\1INITIATOR_PDU\2TARGET_PDU" /* caps[4] iscsicaps */ "\3INITIATOR_CNXOFLD\4TARGET_CNXOFLD" "\5INITIATOR_SSNOFLD\6TARGET_SSNOFLD", "\20\1INITIATOR\2TARGET\3CTRL_OFLD" /* caps[5] fcoecaps */ + "\4PO_INITIAOR\5PO_TARGET" }; static char *doorbells = {"\20\1UDB\2WCWR\3UDBWC\4KDB"}; @@ -5953,10 +5964,13 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) struct adapter *sc = arg1; struct sbuf *sb; int rc, i; - uint32_t tx_cnt[PM_NSTATS], rx_cnt[PM_NSTATS]; - uint64_t tx_cyc[PM_NSTATS], rx_cyc[PM_NSTATS]; - static const char *pm_stats[] = { - "Read:", "Write bypass:", "Write mem:", "Flush:", "FIFO wait:" + uint32_t cnt[PM_NSTATS]; + uint64_t cyc[PM_NSTATS]; + static const char *rx_stats[] = { + "Read:", "Write bypass:", "Write mem:", "Flush:" + }; + static const char *tx_stats[] = { + "Read:", "Write bypass:", "Write mem:", "Bypass + mem:" }; rc = sysctl_wire_old_buffer(req, 0); @@ -5967,14 +5981,17 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - t4_pmtx_get_stats(sc, tx_cnt, tx_cyc); - t4_pmrx_get_stats(sc, rx_cnt, rx_cyc); - - sbuf_printf(sb, " Tx count Tx cycles " - "Rx count Rx cycles"); - for (i = 0; i < PM_NSTATS; i++) - sbuf_printf(sb, "\n%-13s %10u %20ju %10u %20ju", - pm_stats[i], tx_cnt[i], tx_cyc[i], rx_cnt[i], rx_cyc[i]); + t4_pmtx_get_stats(sc, cnt, cyc); + sbuf_printf(sb, " Tx pcmds Tx bytes"); + for (i = 0; i < ARRAY_SIZE(tx_stats); i++) + sbuf_printf(sb, "\n%-13s %10u %20ju", tx_stats[i], cnt[i], + cyc[i]); + + t4_pmrx_get_stats(sc, cnt, cyc); + sbuf_printf(sb, "\n Rx pcmds Rx bytes"); + for (i = 0; i < ARRAY_SIZE(rx_stats); i++) + sbuf_printf(sb, "\n%-13s %10u %20ju", rx_stats[i], cnt[i], + cyc[i]); rc = sbuf_finish(sb); sbuf_delete(sb); @@ -7285,6 +7302,228 @@ read_i2c(struct adapter *sc, struct t4_i return (rc); } +static int +in_range(int val, int lo, int hi) +{ + + return (val < 0 || (val <= hi && val >= lo)); +} + +static int +set_sched_class(struct adapter *sc, struct t4_sched_params *p) +{ + int fw_subcmd, fw_type, rc; + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsc"); + if (rc) + return (rc); + + if (!(sc->flags & FULL_INIT_DONE)) { + rc = EAGAIN; + goto done; + } + + /* + * Translate the cxgbetool parameters into T4 firmware parameters. (The + * sub-command and type are in common locations.) + */ + if (p->subcmd == SCHED_CLASS_SUBCMD_CONFIG) + fw_subcmd = FW_SCHED_SC_CONFIG; + else if (p->subcmd == SCHED_CLASS_SUBCMD_PARAMS) + fw_subcmd = FW_SCHED_SC_PARAMS; + else { + rc = EINVAL; + goto done; + } + if (p->type == SCHED_CLASS_TYPE_PACKET) + fw_type = FW_SCHED_TYPE_PKTSCHED; + else { + rc = EINVAL; + goto done; + } + + if (fw_subcmd == FW_SCHED_SC_CONFIG) { + /* Vet our parameters ..*/ + if (p->u.config.minmax < 0) { + rc = EINVAL; + goto done; + } + + /* And pass the request to the firmware ...*/ + rc = -t4_sched_config(sc, fw_type, p->u.config.minmax); + goto done; + } + + if (fw_subcmd == FW_SCHED_SC_PARAMS) { + int fw_level; + int fw_mode; + int fw_rateunit; + int fw_ratemode; + + if (p->u.params.level == SCHED_CLASS_LEVEL_CL_RL) + fw_level = FW_SCHED_PARAMS_LEVEL_CL_RL; + else if (p->u.params.level == SCHED_CLASS_LEVEL_CL_WRR) + fw_level = FW_SCHED_PARAMS_LEVEL_CL_WRR; + else if (p->u.params.level == SCHED_CLASS_LEVEL_CH_RL) + fw_level = FW_SCHED_PARAMS_LEVEL_CH_RL; + else { + rc = EINVAL; + goto done; + } + + if (p->u.params.mode == SCHED_CLASS_MODE_CLASS) + fw_mode = FW_SCHED_PARAMS_MODE_CLASS; + else if (p->u.params.mode == SCHED_CLASS_MODE_FLOW) + fw_mode = FW_SCHED_PARAMS_MODE_FLOW; + else { + rc = EINVAL; + goto done; + } + + if (p->u.params.rateunit == SCHED_CLASS_RATEUNIT_BITS) + fw_rateunit = FW_SCHED_PARAMS_UNIT_BITRATE; + else if (p->u.params.rateunit == SCHED_CLASS_RATEUNIT_PKTS) + fw_rateunit = FW_SCHED_PARAMS_UNIT_PKTRATE; + else { + rc = EINVAL; + goto done; + } + + if (p->u.params.ratemode == SCHED_CLASS_RATEMODE_REL) + fw_ratemode = FW_SCHED_PARAMS_RATE_REL; + else if (p->u.params.ratemode == SCHED_CLASS_RATEMODE_ABS) + fw_ratemode = FW_SCHED_PARAMS_RATE_ABS; + else { + rc = EINVAL; + goto done; + } + + /* Vet our parameters ... */ + if (!in_range(p->u.params.channel, 0, 3) || + !in_range(p->u.params.cl, 0, is_t4(sc) ? 15 : 16) || + !in_range(p->u.params.minrate, 0, 10000000) || + !in_range(p->u.params.maxrate, 0, 10000000) || + !in_range(p->u.params.weight, 0, 100)) { + rc = ERANGE; + goto done; + } + + /* + * Translate any unset parameters into the firmware's + * nomenclature and/or fail the call if the parameters + * are required ... + */ + if (p->u.params.rateunit < 0 || p->u.params.ratemode < 0 || + p->u.params.channel < 0 || p->u.params.cl < 0) { + rc = EINVAL; + goto done; + } + if (p->u.params.minrate < 0) + p->u.params.minrate = 0; + if (p->u.params.maxrate < 0) { + if (p->u.params.level == SCHED_CLASS_LEVEL_CL_RL || + p->u.params.level == SCHED_CLASS_LEVEL_CH_RL) { + rc = EINVAL; + goto done; + } else + p->u.params.maxrate = 0; + } + if (p->u.params.weight < 0) { + if (p->u.params.level == SCHED_CLASS_LEVEL_CL_WRR) { + rc = EINVAL; + goto done; + } else + p->u.params.weight = 0; + } + if (p->u.params.pktsize < 0) { + if (p->u.params.level == SCHED_CLASS_LEVEL_CL_RL || + p->u.params.level == SCHED_CLASS_LEVEL_CH_RL) { + rc = EINVAL; + goto done; + } else + p->u.params.pktsize = 0; + } + + /* See what the firmware thinks of the request ... */ + rc = -t4_sched_params(sc, fw_type, fw_level, fw_mode, + fw_rateunit, fw_ratemode, p->u.params.channel, + p->u.params.cl, p->u.params.minrate, p->u.params.maxrate, + p->u.params.weight, p->u.params.pktsize); + goto done; + } + + rc = EINVAL; +done: + end_synchronized_op(sc, 0); + return (rc); +} + +static int +set_sched_queue(struct adapter *sc, struct t4_sched_queue *p) +{ + struct port_info *pi = NULL; + struct sge_txq *txq; + uint32_t fw_mnem, fw_queue, fw_class; + int i, rc; + + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setsq"); + if (rc) + return (rc); + + if (!(sc->flags & FULL_INIT_DONE)) { + rc = EAGAIN; + goto done; + } + + if (p->port >= sc->params.nports) { + rc = EINVAL; + goto done; + } + + pi = sc->port[p->port]; + if (!in_range(p->queue, 0, pi->ntxq - 1) || !in_range(p->cl, 0, 7)) { + rc = EINVAL; + goto done; + } + + /* + * Create a template for the FW_PARAMS_CMD mnemonic and value (TX + * Scheduling Class in this case). + */ + fw_mnem = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_SCHEDCLASS_ETH)); + fw_class = p->cl < 0 ? 0xffffffff : p->cl; + + /* + * If op.queue is non-negative, then we're only changing the scheduling + * on a single specified TX queue. + */ + if (p->queue >= 0) { + txq = &sc->sge.txq[pi->first_txq + p->queue]; + fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, + &fw_class); + goto done; + } + + /* + * Change the scheduling on all the TX queues for the + * interface. + */ + for_each_txq(pi, i, txq) { + fw_queue = (fw_mnem | V_FW_PARAMS_PARAM_YZ(txq->eq.cntxt_id)); + rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, &fw_queue, + &fw_class); + if (rc) + goto done; + } + + rc = 0; +done: + end_synchronized_op(sc, 0); + return (rc); +} + int t4_os_find_pci_capability(struct adapter *sc, int cap) { @@ -7528,6 +7767,12 @@ t4_ioctl(struct cdev *dev, unsigned long } break; } + case CHELSIO_T4_SCHED_CLASS: + rc = set_sched_class(sc, (struct t4_sched_params *)data); + break; + case CHELSIO_T4_SCHED_QUEUE: + rc = set_sched_queue(sc, (struct t4_sched_queue *)data); + break; case CHELSIO_T4_GET_TRACER: rc = t4_get_tracer(sc, (struct t4_tracer *)data); break; Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/sys/dev/cxgbe/t4_sge.c Mon Dec 9 22:40:22 2013 (r259142) @@ -1391,7 +1391,7 @@ rxb_free(struct mbuf *m, void *arg1, voi { uma_zone_t zone = arg1; caddr_t cl = arg2; -#ifdef INVARIANTS +#ifdef notyet u_int refcount; refcount = *find_buf_refcnt(cl); @@ -1677,7 +1677,7 @@ t4_eth_rx(struct sge_iq *iq, const struc m0->m_pkthdr.rcvif = ifp; m0->m_flags |= M_FLOWID; - m0->m_pkthdr.flowid = rss->hash_val; + m0->m_pkthdr.flowid = be32toh(rss->hash_val); if (cpl->csum_calc && !cpl->err_vec) { if (ifp->if_capenable & IFCAP_RXCSUM && Modified: stable/10/tools/tools/cxgbetool/Makefile ============================================================================== --- stable/10/tools/tools/cxgbetool/Makefile Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/tools/tools/cxgbetool/Makefile Mon Dec 9 22:40:22 2013 (r259142) @@ -3,7 +3,7 @@ PROG= cxgbetool SRCS= cxgbetool.c NO_MAN= -CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgbe -I. +CFLAGS+= -I${.CURDIR}/../../../sys/dev/cxgbe -I${.CURDIR}/../../../sys -I. BINDIR?= /usr/sbin .include Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- stable/10/tools/tools/cxgbetool/cxgbetool.c Mon Dec 9 21:32:36 2013 (r259141) +++ stable/10/tools/tools/cxgbetool/cxgbetool.c Mon Dec 9 22:40:22 2013 (r259142) @@ -46,11 +46,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "t4_ioctl.h" #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) - +#define in_range(val, lo, hi) ( val < 0 || (val <= hi && val >= lo)) #define max(x, y) ((x) > (y) ? (x) : (y)) static const char *progname, *nexus; @@ -94,12 +95,15 @@ usage(FILE *fp) "\ti2c [] read from i2c device\n" "\tloadfw install firmware\n" "\tmemdump dump a memory range\n" + "\tmodinfo optics/cable information\n" "\treg
[=] read/write register\n" "\treg64
[=] read/write 64 bit register\n" "\tregdump [] ... dump registers\n" + "\tsched-class params .. configure TX scheduler class\n" + "\tsched-queue bind NIC queues to TX Scheduling class\n" "\tstdio interactive mode\n" "\ttcb read TCB\n" - "\ttracer tx|rx set and enable a tracer)\n" + "\ttracer tx|rx set and enable a tracer\n" "\ttracer disable|enable disable or enable a tracer\n" "\ttracer list list all tracers\n" ); @@ -321,7 +325,7 @@ dump_regs_t4(int argc, const char *argv[ T4_MODREGS(ma), { "edc0", t4_edc_0_regs }, { "edc1", t4_edc_1_regs }, - T4_MODREGS(cim), + T4_MODREGS(cim), T4_MODREGS(tp), T4_MODREGS(ulp_rx), T4_MODREGS(ulp_tx), @@ -333,7 +337,7 @@ dump_regs_t4(int argc, const char *argv[ { "i2c", t4_i2cm_regs }, T4_MODREGS(mi), T4_MODREGS(uart), - T4_MODREGS(pmu), + T4_MODREGS(pmu), T4_MODREGS(sf), T4_MODREGS(pl), T4_MODREGS(le), @@ -1869,6 +1873,420 @@ tracer_cmd(int argc, const char *argv[]) } static int +modinfo(int argc, const char *argv[]) +{ + long port; + char string[16], *p; + struct t4_i2c_data i2cd; + int rc, i; + uint16_t temp, vcc, tx_bias, tx_power, rx_power; + + if (argc != 1) { + warnx("must supply a port"); + return (EINVAL); + } + + p = str_to_number(argv[0], &port, NULL); + if (*p || port > UCHAR_MAX) { + warnx("invalid port id \"%s\"", argv[0]); + return (EINVAL); + } + + bzero(&i2cd, sizeof(i2cd)); + i2cd.len = 1; + i2cd.port_id = port; + i2cd.dev_addr = SFF_8472_BASE; + + i2cd.offset = SFF_8472_ID; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + + if (i2cd.data[0] > SFF_8472_ID_LAST) + printf("Unknown ID\n"); + else + printf("ID: %s\n", sff_8472_id[i2cd.data[0]]); + + bzero(&string, sizeof(string)); + for (i = SFF_8472_VENDOR_START; i < SFF_8472_VENDOR_END; i++) { + i2cd.offset = i; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + string[i - SFF_8472_VENDOR_START] = i2cd.data[0]; + } + printf("Vendor %s\n", string); + + bzero(&string, sizeof(string)); + for (i = SFF_8472_SN_START; i < SFF_8472_SN_END; i++) { + i2cd.offset = i; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + string[i - SFF_8472_SN_START] = i2cd.data[0]; + } + printf("SN %s\n", string); + + bzero(&string, sizeof(string)); + for (i = SFF_8472_PN_START; i < SFF_8472_PN_END; i++) { + i2cd.offset = i; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + string[i - SFF_8472_PN_START] = i2cd.data[0]; + } + printf("PN %s\n", string); + + bzero(&string, sizeof(string)); + for (i = SFF_8472_REV_START; i < SFF_8472_REV_END; i++) { + i2cd.offset = i; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + string[i - SFF_8472_REV_START] = i2cd.data[0]; + } + printf("Rev %s\n", string); + + i2cd.offset = SFF_8472_DIAG_TYPE; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + + if ((char )i2cd.data[0] & (SFF_8472_DIAG_IMPL | + SFF_8472_DIAG_INTERNAL)) { + + /* Switch to reading from the Diagnostic address. */ + i2cd.dev_addr = SFF_8472_DIAG; + i2cd.len = 1; + + i2cd.offset = SFF_8472_TEMP; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + temp = i2cd.data[0] << 8; + printf("Temp: "); + if ((temp & SFF_8472_TEMP_SIGN) == SFF_8472_TEMP_SIGN) + printf("-"); + else + printf("+"); + printf("%dC\n", (temp & SFF_8472_TEMP_MSK) >> + SFF_8472_TEMP_SHIFT); + + i2cd.offset = SFF_8472_VCC; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + vcc = i2cd.data[0] << 8; + printf("Vcc %fV\n", vcc / SFF_8472_VCC_FACTOR); + + i2cd.offset = SFF_8472_TX_BIAS; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + tx_bias = i2cd.data[0] << 8; + printf("TX Bias %fuA\n", tx_bias / SFF_8472_BIAS_FACTOR); + + i2cd.offset = SFF_8472_TX_POWER; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + tx_power = i2cd.data[0] << 8; + printf("TX Power %fmW\n", tx_power / SFF_8472_POWER_FACTOR); + + i2cd.offset = SFF_8472_RX_POWER; + if ((rc = doit(CHELSIO_T4_GET_I2C, &i2cd)) != 0) + goto fail; + rx_power = i2cd.data[0] << 8; + printf("RX Power %fmW\n", rx_power / SFF_8472_POWER_FACTOR); + + } else + printf("Diagnostics not supported.\n"); + + return(0); + +fail: + if (rc == EPERM) + warnx("No module/cable in port %ld", port); + return (rc); + +} + +/* XXX: pass in a low/high and do range checks as well */ +static int +get_sched_param(const char *param, const char *args[], long *val) +{ + char *p; + + if (strcmp(param, args[0]) != 0) + return (EINVAL); + + p = str_to_number(args[1], val, NULL); + if (*p) { + warnx("parameter \"%s\" has bad value \"%s\"", args[0], + args[1]); + return (EINVAL); + } + + return (0); +} + +static int +sched_class(int argc, const char *argv[]) +{ + struct t4_sched_params op; + int errs, i; + + memset(&op, 0xff, sizeof(op)); + op.subcmd = -1; + op.type = -1; + if (argc == 0) { + warnx("missing scheduling sub-command"); + return (EINVAL); + } + if (!strcmp(argv[0], "config")) { + op.subcmd = SCHED_CLASS_SUBCMD_CONFIG; + op.u.config.minmax = -1; + } else if (!strcmp(argv[0], "params")) { + op.subcmd = SCHED_CLASS_SUBCMD_PARAMS; + op.u.params.level = op.u.params.mode = op.u.params.rateunit = + op.u.params.ratemode = op.u.params.channel = + op.u.params.cl = op.u.params.minrate = op.u.params.maxrate = + op.u.params.weight = op.u.params.pktsize = -1; + } else { + warnx("invalid scheduling sub-command \"%s\"", argv[0]); + return (EINVAL); + } + + /* Decode remaining arguments ... */ + errs = 0; + for (i = 1; i < argc; i += 2) { + const char **args = &argv[i]; + long l; + + if (i + 1 == argc) { + warnx("missing argument for \"%s\"", args[0]); + errs++; + break; + } + + if (!strcmp(args[0], "type")) { + if (!strcmp(args[1], "packet")) + op.type = SCHED_CLASS_TYPE_PACKET; + else { + warnx("invalid type parameter \"%s\"", args[1]); + errs++; + } + + continue; + } + + if (op.subcmd == SCHED_CLASS_SUBCMD_CONFIG) { + if(!get_sched_param("minmax", args, &l)) + op.u.config.minmax = (int8_t)l; + else { + warnx("unknown scheduler config parameter " + "\"%s\"", args[0]); + errs++; + } + + continue; + } + + /* Rest applies only to SUBCMD_PARAMS */ + if (op.subcmd != SCHED_CLASS_SUBCMD_PARAMS) + continue; + + if (!strcmp(args[0], "level")) { + if (!strcmp(args[1], "cl-rl")) + op.u.params.level = SCHED_CLASS_LEVEL_CL_RL; + else if (!strcmp(args[1], "cl-wrr")) + op.u.params.level = SCHED_CLASS_LEVEL_CL_WRR; + else if (!strcmp(args[1], "ch-rl")) + op.u.params.level = SCHED_CLASS_LEVEL_CH_RL; + else { + warnx("invalid level parameter \"%s\"", + args[1]); + errs++; + } + } else if (!strcmp(args[0], "mode")) { + if (!strcmp(args[1], "class")) + op.u.params.mode = SCHED_CLASS_MODE_CLASS; + else if (!strcmp(args[1], "flow")) + op.u.params.mode = SCHED_CLASS_MODE_FLOW; + else { + warnx("invalid mode parameter \"%s\"", args[1]); + errs++; + } + } else if (!strcmp(args[0], "rate-unit")) { + if (!strcmp(args[1], "bits")) + op.u.params.rateunit = SCHED_CLASS_RATEUNIT_BITS; + else if (!strcmp(args[1], "pkts")) + op.u.params.rateunit = SCHED_CLASS_RATEUNIT_PKTS; + else { + warnx("invalid rate-unit parameter \"%s\"", + args[1]); + errs++; + } + } else if (!strcmp(args[0], "rate-mode")) { + if (!strcmp(args[1], "relative")) + op.u.params.ratemode = SCHED_CLASS_RATEMODE_REL; + else if (!strcmp(args[1], "absolute")) + op.u.params.ratemode = SCHED_CLASS_RATEMODE_ABS; + else { + warnx("invalid rate-mode parameter \"%s\"", + args[1]); + errs++; + } + } else if (!get_sched_param("channel", args, &l)) + op.u.params.channel = (int8_t)l; + else if (!get_sched_param("class", args, &l)) + op.u.params.cl = (int8_t)l; + else if (!get_sched_param("min-rate", args, &l)) + op.u.params.minrate = (int32_t)l; + else if (!get_sched_param("max-rate", args, &l)) + op.u.params.maxrate = (int32_t)l; + else if (!get_sched_param("weight", args, &l)) + op.u.params.weight = (int16_t)l; + else if (!get_sched_param("pkt-size", args, &l)) + op.u.params.pktsize = (int16_t)l; + else { + warnx("unknown scheduler parameter \"%s\"", args[0]); + errs++; + } + } + + /* + * Catch some logical fallacies in terms of argument combinations here + * so we can offer more than just the EINVAL return from the driver. + * The driver will be able to catch a lot more issues since it knows + * the specifics of the device hardware capabilities like how many + * channels, classes, etc. the device supports. + */ + if (op.type < 0) { + warnx("sched \"type\" parameter missing"); + errs++; + } + if (op.subcmd == SCHED_CLASS_SUBCMD_CONFIG) { + if (op.u.config.minmax < 0) { + warnx("sched config \"minmax\" parameter missing"); + errs++; + } + } + if (op.subcmd == SCHED_CLASS_SUBCMD_PARAMS) { + if (op.u.params.level < 0) { + warnx("sched params \"level\" parameter missing"); + errs++; + } + if (op.u.params.mode < 0) { + warnx("sched params \"mode\" parameter missing"); + errs++; + } + if (op.u.params.rateunit < 0) { + warnx("sched params \"rate-unit\" parameter missing"); + errs++; + } + if (op.u.params.ratemode < 0) { + warnx("sched params \"rate-mode\" parameter missing"); + errs++; + } + if (op.u.params.channel < 0) { + warnx("sched params \"channel\" missing"); + errs++; + } + if (op.u.params.cl < 0) { + warnx("sched params \"class\" missing"); + errs++; + } + if (op.u.params.maxrate < 0 && + (op.u.params.level == SCHED_CLASS_LEVEL_CL_RL || + op.u.params.level == SCHED_CLASS_LEVEL_CH_RL)) { + warnx("sched params \"max-rate\" missing for " + "rate-limit level"); + errs++; + } + if (op.u.params.weight < 0 && + op.u.params.level == SCHED_CLASS_LEVEL_CL_WRR) { + warnx("sched params \"weight\" missing for " + "weighted-round-robin level"); + errs++; + } + if (op.u.params.pktsize < 0 && + (op.u.params.level == SCHED_CLASS_LEVEL_CL_RL || + op.u.params.level == SCHED_CLASS_LEVEL_CH_RL)) { + warnx("sched params \"pkt-size\" missing for " + "rate-limit level"); + errs++; + } + if (op.u.params.mode == SCHED_CLASS_MODE_FLOW && + op.u.params.ratemode != SCHED_CLASS_RATEMODE_ABS) { + warnx("sched params mode flow needs rate-mode absolute"); + errs++; + } + if (op.u.params.ratemode == SCHED_CLASS_RATEMODE_REL && + !in_range(op.u.params.maxrate, 1, 100)) { + warnx("sched params \"max-rate\" takes " + "percentage value(1-100) for rate-mode relative"); + errs++; + } + if (op.u.params.ratemode == SCHED_CLASS_RATEMODE_ABS && + !in_range(op.u.params.maxrate, 1, 10000000)) { + warnx("sched params \"max-rate\" takes " + "value(1-10000000) for rate-mode absolute"); + errs++; + } + if (op.u.params.maxrate > 0 && + op.u.params.maxrate < op.u.params.minrate) { + warnx("sched params \"max-rate\" is less than " + "\"min-rate\""); + errs++; + } + } + + if (errs > 0) { + warnx("%d error%s in sched-class command", errs, + errs == 1 ? "" : "s"); + return (EINVAL); + } + + return doit(CHELSIO_T4_SCHED_CLASS, &op); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 22:56:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3D907D5; Mon, 9 Dec 2013 22:56:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8FF921812; Mon, 9 Dec 2013 22:56:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9MuJao027963; Mon, 9 Dec 2013 22:56:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9MuJ1i027962; Mon, 9 Dec 2013 22:56:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312092256.rB9MuJ1i027962@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Dec 2013 22:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259143 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 22:56:19 -0000 Author: eadler Date: Mon Dec 9 22:56:19 2013 New Revision: 259143 URL: http://svnweb.freebsd.org/changeset/base/259143 Log: sed(1): Use /i instead of /I the i modifier was added in r259132 since POSIX recently agreed to add it. Switch uses of /I to /i. Modified: head/usr.sbin/bsdinstall/scripts/services Modified: head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- head/usr.sbin/bsdinstall/scripts/services Mon Dec 9 22:40:22 2013 (r259142) +++ head/usr.sbin/bsdinstall/scripts/services Mon Dec 9 22:56:19 2013 (r259143) @@ -29,7 +29,7 @@ : ${DIALOG_OK=0} if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then - eval `sed -e s/YES/on/I -e s/NO/off/I $BSDINSTALL_TMPETC/rc.conf.services` + eval `sed -e s/YES/on/i -e s/NO/off/i $BSDINSTALL_TMPETC/rc.conf.services` else # Default service states. Everything is off if not enabled. sshd_enable="on" From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 22:58:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D0B9E93D; Mon, 9 Dec 2013 22:58:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC930182A; Mon, 9 Dec 2013 22:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9MwQfk028293; Mon, 9 Dec 2013 22:58:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9MwQGL028292; Mon, 9 Dec 2013 22:58:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312092258.rB9MwQGL028292@svn.freebsd.org> From: Devin Teske Date: Mon, 9 Dec 2013 22:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259144 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 22:58:26 -0000 Author: dteske Date: Mon Dec 9 22:58:26 2013 New Revision: 259144 URL: http://svnweb.freebsd.org/changeset/base/259144 Log: Fix a regression introduced by SVN r257842. Result was that after successfully installing to encrypted ZFS root, the passphrase is not accepted and a message about "incorrect key" is displayed. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 9 22:56:19 2013 (r259143) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 9 22:58:26 2013 (r259144) @@ -1203,7 +1203,7 @@ zfs_create_boot() return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart"' \ + '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 23:05:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E164DAC4; Mon, 9 Dec 2013 23:05:25 +0000 (UTC) Received: from mail-pd0-x231.google.com (mail-pd0-x231.google.com [IPv6:2607:f8b0:400e:c02::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A46A6189D; Mon, 9 Dec 2013 23:05:25 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id q10so6043382pdj.36 for ; Mon, 09 Dec 2013 15:05:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=QS3Fk+c012lDmIGhuWjBhpRPM1sGAv78pMkRHQEOjIk=; b=F6U/mwkg3Fq+42FflJ1HuFGgI30sUTwAnWJMYriCRV2aTiSY31sLvGVpZoauKbZuB5 YGGVRlTwP6pjxofH89B8TcoifeqQ8u0ArB8JqsWZXnuV4bKozbWSTh+xj+053XhJLfcx 7pTCF7IYloN8WcH9xMhslxqh/IztyR14jUvmuAPFElu4gx4rbk5hHTr5MJR90S28LDx6 MiaSzZLjvZUkOlV+45sp2GUtWBfDJsmaqb14oNSaxyanPgwFXDthH0sS8O+lHvC7vxP7 4kjBqNDxUm/Yjq5CDRbRpQl/OsOSV7LJUoCjT9xrTn3O4Ow4oMBoZHcZtR8OoMKUIpVt +sig== X-Received: by 10.68.125.198 with SMTP id ms6mr23646050pbb.98.1386630325258; Mon, 09 Dec 2013 15:05:25 -0800 (PST) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id bh6sm28755165pad.20.2013.12.09.15.05.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 15:05:23 -0800 (PST) Sender: Navdeep Parhar Message-ID: <52A64CB1.4060201@FreeBSD.org> Date: Mon, 09 Dec 2013 15:05:21 -0800 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r259143 - head/usr.sbin/bsdinstall/scripts References: <201312092256.rB9MuJ1i027962@svn.freebsd.org> In-Reply-To: <201312092256.rB9MuJ1i027962@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 23:05:26 -0000 On 12/09/13 14:56, Eitan Adler wrote: > Author: eadler > Date: Mon Dec 9 22:56:19 2013 > New Revision: 259143 > URL: http://svnweb.freebsd.org/changeset/base/259143 > > Log: > sed(1): Use /i instead of /I > > the i modifier was added in r259132 since POSIX recently agreed to add > it. Switch uses of /I to /i. There doesn't seem to be any upside to this sort of change. The downside obviously is that it won't work with older sed's that don't understand /i. If you are considering sweeping over the entire tree looking for sed invocations and "fixing" them then please reconsider. Regards, Navdeep > > Modified: > head/usr.sbin/bsdinstall/scripts/services > > Modified: head/usr.sbin/bsdinstall/scripts/services > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/services Mon Dec 9 22:40:22 2013 (r259142) > +++ head/usr.sbin/bsdinstall/scripts/services Mon Dec 9 22:56:19 2013 (r259143) > @@ -29,7 +29,7 @@ > : ${DIALOG_OK=0} > > if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then > - eval `sed -e s/YES/on/I -e s/NO/off/I $BSDINSTALL_TMPETC/rc.conf.services` > + eval `sed -e s/YES/on/i -e s/NO/off/i $BSDINSTALL_TMPETC/rc.conf.services` > else > # Default service states. Everything is off if not enabled. > sshd_enable="on" > From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 23:08:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42E9EC32; Mon, 9 Dec 2013 23:08:55 +0000 (UTC) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 05B3018BB; Mon, 9 Dec 2013 23:08:55 +0000 (UTC) Received: from 2a02-8428-011a-a000-e860-16a5-158a-a42a.rev.sfr.net ([2a02:8428:11a:a000:e860:16a5:158a:a42a]) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Vq9wb-00044T-H1; Tue, 10 Dec 2013 00:08:53 +0100 Message-ID: <52A64D84.6070309@FreeBSD.org> Date: Tue, 10 Dec 2013 00:08:52 +0100 From: =?ISO-8859-15?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r258930 - head/sys/dev/drm2 References: <201312041904.rB4J4vbM043709@svn.freebsd.org> <201312051005.23197.jhb@freebsd.org> <52A266CF.90007@FreeBSD.org> <201312091646.27179.jhb@freebsd.org> In-Reply-To: <201312091646.27179.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 23:08:55 -0000 Le 09/12/2013 22:46, John Baldwin a crit : > Ok, after looking at the original version of this function in Linux, it > does read the capabilities from the parent bridge of the slot, not > from the card itself, so your change is correct. Thank you for the review! -- Jean-Sbastien Pdron From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 23:11:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF0DAE25 for ; Mon, 9 Dec 2013 23:11:09 +0000 (UTC) Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 74FC51923 for ; Mon, 9 Dec 2013 23:11:09 +0000 (UTC) Received: by mail-qa0-f41.google.com with SMTP id j5so3165167qaq.0 for ; Mon, 09 Dec 2013 15:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=au3ptS/QDd/yXz91gwkTZ5NBwHDhkmOa8p3Xk71vq+U=; b=sLugwoJlL7pO4zpNmZvno4x1ycJfutZLh7OmTKJjhZrbHZR7dF69rAvFncO9jO7Pxd a8cHfn+WnPUkYdT+jXUPqI7hNKtaI2XFtHC0reknMy+EktFwsPoFiG9ybYvyC5t7gdRt Lx8/smqoO7PHfs0wViuBmJa9NDDFZ1rFk7EIs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=au3ptS/QDd/yXz91gwkTZ5NBwHDhkmOa8p3Xk71vq+U=; b=UAWUEvJW/K0w4LKCxDDhaIn1c50gEDND1qfdL7MnxCpoh0NHubWnlCfRP8Oo8Wpwat UGaCUaD3jyLrBs7MJZ5Dcp9CJai6bEpEV6uU2aPYKXZy9uBOByAvWgFpXgveO3aDmF8r sY/ydcNYbuMEJwrC8RarltEj2LY5S0/WkbwcPph+kptplrCRWqGOElreSt4U45Ewo+QR 4hDGvm8gC89I98xFPsca+IR1wsoZ2MbuOBpXlCOZijALrzec1WE2zKeN3QHOGYoaJqxb bNMyZ1fqi9LSngDU3sviRM2lRo3/6/cKef9QwIAYKo//LzT3vjinELN+M/soqph28reH iEBQ== X-Gm-Message-State: ALoCoQlEvMgkOdBG3GwSXSNwP4JApWsjOZ+K+43NlcbuL1moWWPJ10gDI8R+nWzQVovAHzVBVrAA X-Received: by 10.49.81.206 with SMTP id c14mr87435518qey.79.1386630668546; Mon, 09 Dec 2013 15:11:08 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.86.42 with HTTP; Mon, 9 Dec 2013 15:10:38 -0800 (PST) In-Reply-To: <52A64CB1.4060201@FreeBSD.org> References: <201312092256.rB9MuJ1i027962@svn.freebsd.org> <52A64CB1.4060201@FreeBSD.org> From: Eitan Adler Date: Mon, 9 Dec 2013 18:10:38 -0500 X-Google-Sender-Auth: 4TAT5_AdsbRQi_eiozXHkhainuU Message-ID: Subject: Re: svn commit: r259143 - head/usr.sbin/bsdinstall/scripts To: Navdeep Parhar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 23:11:09 -0000 On Mon, Dec 9, 2013 at 6:05 PM, Navdeep Parhar wrote: > On 12/09/13 14:56, Eitan Adler wrote: >> Author: eadler >> Date: Mon Dec 9 22:56:19 2013 >> New Revision: 259143 >> URL: http://svnweb.freebsd.org/changeset/base/259143 >> >> Log: >> sed(1): Use /i instead of /I >> >> the i modifier was added in r259132 since POSIX recently agreed to add >> it. Switch uses of /I to /i. > > There doesn't seem to be any upside to this sort of change. The > downside obviously is that it won't work with older sed's that don't > understand /i. > > If you are considering sweeping over the entire tree looking for sed > invocations and "fixing" them then please reconsider. Understood. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 23:33:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCBAE2F0; Mon, 9 Dec 2013 23:33:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A94DE1A93; Mon, 9 Dec 2013 23:33:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9NXvDt042990; Mon, 9 Dec 2013 23:33:57 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9NXvkk042989; Mon, 9 Dec 2013 23:33:57 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312092333.rB9NXvkk042989@svn.freebsd.org> From: Navdeep Parhar Date: Mon, 9 Dec 2013 23:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259145 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 23:33:57 -0000 Author: np Date: Mon Dec 9 23:33:57 2013 New Revision: 259145 URL: http://svnweb.freebsd.org/changeset/base/259145 Log: Unstaticize t4_list and t4_uld_list. This works around a clang annoyance[1] and allows kgdb to find these symbols. [1] http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041166.html MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Dec 9 22:58:26 2013 (r259144) +++ head/sys/dev/cxgbe/t4_main.c Mon Dec 9 23:33:57 2013 (r259145) @@ -161,10 +161,10 @@ MALLOC_DEFINE(M_CXGBE, "cxgbe", "Chelsio * then ADAPTER_LOCK, then t4_uld_list_lock. */ static struct sx t4_list_lock; -static SLIST_HEAD(, adapter) t4_list; +SLIST_HEAD(, adapter) t4_list; #ifdef TCP_OFFLOAD static struct sx t4_uld_list_lock; -static SLIST_HEAD(, uld_info) t4_uld_list; +SLIST_HEAD(, uld_info) t4_uld_list; #endif /* From owner-svn-src-all@FreeBSD.ORG Mon Dec 9 23:58:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF08FAAF; Mon, 9 Dec 2013 23:58:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB2181D36; Mon, 9 Dec 2013 23:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB9NwQ8s050867; Mon, 9 Dec 2013 23:58:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB9NwQ7D050866; Mon, 9 Dec 2013 23:58:26 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312092358.rB9NwQ7D050866@svn.freebsd.org> From: Devin Teske Date: Mon, 9 Dec 2013 23:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259148 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Dec 2013 23:58:26 -0000 Author: dteske Date: Mon Dec 9 23:58:26 2013 New Revision: 259148 URL: http://svnweb.freebsd.org/changeset/base/259148 Log: Fix a regression introduced by SVN r257842; resulting in mountroot prompt after attempting to install to encrypted ZFS root (caused by a typo in a variable name -- ZFSBOOT_BOOT_FSNAME -> ZFSBOOT_BOOTFS_NAME). MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 9 23:54:48 2013 (r259147) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Mon Dec 9 23:58:26 2013 (r259148) @@ -1190,7 +1190,7 @@ zfs_create_boot() f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOT_FSNAME"' \ + '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE f_dprintf "$funcname: disks=[%s]" "$disks" for disk in $disks; do From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 00:07:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91484DF4; Tue, 10 Dec 2013 00:07:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D29A1E18; Tue, 10 Dec 2013 00:07:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA074hw055580; Tue, 10 Dec 2013 00:07:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA074Qq055579; Tue, 10 Dec 2013 00:07:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312100007.rBA074Qq055579@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Dec 2013 00:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259150 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 00:07:04 -0000 Author: adrian Date: Tue Dec 10 00:07:04 2013 New Revision: 259150 URL: http://svnweb.freebsd.org/changeset/base/259150 Log: Print out the full PCIe link negotiation during dmesg. I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot or not. Reviewed by: np Sponsored by: Netflix, inc. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Dec 9 23:59:16 2013 (r259149) +++ head/sys/dev/cxgbe/t4_main.c Tue Dec 10 00:07:04 2013 (r259150) @@ -549,6 +549,7 @@ t4_attach(device_t dev) #ifdef TCP_OFFLOAD int ofld_rqidx, ofld_tqidx; #endif + const char *pcie_ts; sc = device_get_softc(dev); sc->dev = dev; @@ -816,9 +817,24 @@ t4_attach(device_t dev) goto done; } + switch (sc->params.pci.speed) { + case 0x1: + pcie_ts = "2.5"; + break; + case 0x2: + pcie_ts = "5.0"; + break; + case 0x3: + pcie_ts = "8.0"; + break; + default: + pcie_ts = "??"; + break; + } device_printf(dev, - "PCIe x%d, %d ports, %d %s interrupt%s, %d eq, %d iq\n", - sc->params.pci.width, sc->params.nports, sc->intr_count, + "PCIe x%d (%s GTS/s) (%d), %d ports, %d %s interrupt%s, %d eq, %d iq\n", + sc->params.pci.width, pcie_ts, sc->params.pci.speed, + sc->params.nports, sc->intr_count, sc->intr_type == INTR_MSIX ? "MSI-X" : (sc->intr_type == INTR_MSI ? "MSI" : "INTx"), sc->intr_count > 1 ? "s" : "", sc->sge.neq, sc->sge.niq); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 00:20:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 176292F5; Tue, 10 Dec 2013 00:20:31 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id C2B661EEE; Tue, 10 Dec 2013 00:20:30 +0000 (UTC) Received: from rnote.ddteam.net (224-13-135-95.pool.ukrtel.net [95.135.13.224]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 25073C4930; Tue, 10 Dec 2013 02:20:29 +0200 (EET) Date: Tue, 10 Dec 2013 02:20:15 +0200 From: Aleksandr Rybalko To: Marius Strobl Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-Id: <20131210022015.2a5a1ed3.ray@freebsd.org> In-Reply-To: <20131208153620.GA21278@alchemy.franken.de> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <20131208153620.GA21278@alchemy.franken.de> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 00:20:31 -0000 On Sun, 8 Dec 2013 16:36:20 +0100 Marius Strobl wrote: > On Thu, Dec 05, 2013 at 10:38:54PM +0000, Aleksandr Rybalko wrote: > > Author: ray > > Date: Thu Dec 5 22:38:53 2013 > > New Revision: 259016 > > URL: http://svnweb.freebsd.org/changeset/base/259016 > > > > Log: > > Merge VT(9) project (a.k.a. newcons). > > > > Reviewed by: nwhitehorn > > MFC_to_10_after: re approval > > Have you addressed any of the points raised in: > http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045887.html > to get VT(9) at least en par with syscons(4) regarding being able to > use a hardware cursor, allowing different low-level console drivers > to compete for the same hardware etc. in the meantime? > > Marius > Hello Marius! Yes and No :) Lets make it as list with short items: 1. Making these drivers work as low-level console. 2. Drivers priority. 3. Using hardware acceleration. 4. Using the 12 x 22 gallant font. 5. Allowing Xorg to map the frame buffer. 6. (Part of 5) Other register banks as needed. 7. Allowing late attachment. Answers: 1. Works, I did testing on ARM board Efika MX with vt_fb_early driver. (Still have to discuss several things with arm@ guys, then commit) 2. Works. F.e. amd64 start with vt_vga driver, then vt_kms driver override it as more specific. 3. Not used at all yet. 4. I like that font. If you want more "gallant" - I will help. Thanks to Ed, newcons support any font dimensions. 5. It works, but only for those drivers which attach dev/fb/fbd, via fbd devfs node (not accessible via vt(9) ioctls yet). 6. IMO better to put it into some drm emulation. 7. Works in many combination. ( start w/ vga, load kms; (kms replace vga) start w/o driver, load kms; preload kms, start w/ vga; (kms replace vga) preload kms, start w/o driver; (kms attached after drm node initialized) ) Have to put your list on Newcons's wiki page too. As I remember such long list of requirement you provide was based on expectation that I want to replace syscons right now :) But, for now we (me and x11 team) want to see it 10.0 as disabled by default (just like in HEAD now), so peoples who want to help with debug of new xorg and drm drivers will be able to see messages after KMS-xorg starts. Oh, looks like I forget what I have to say more. :) So it will be said later, when I will less sleepy. Anyway. Thanks a lot for your comments!!! WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 00:26:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1113252A; Tue, 10 Dec 2013 00:26:54 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id BAFDF1F78; Tue, 10 Dec 2013 00:26:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id DE2DF3820B; Mon, 9 Dec 2013 18:26:46 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id lqXHx0DBEp7m; Mon, 9 Dec 2013 18:26:46 -0600 (CST) Received: from terminus.icecube.wisc.edu (terminus.icecube.wisc.edu [172.16.223.97]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id CC0113810D; Mon, 9 Dec 2013 18:26:46 -0600 (CST) Message-ID: <52A65FC6.4000502@freebsd.org> Date: Mon, 09 Dec 2013 18:26:46 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Aleksandr Rybalko , Marius Strobl Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <20131208153620.GA21278@alchemy.franken.de> <20131210022015.2a5a1ed3.ray@freebsd.org> In-Reply-To: <20131210022015.2a5a1ed3.ray@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 00:26:54 -0000 On 12/09/13 18:20, Aleksandr Rybalko wrote: > On Sun, 8 Dec 2013 16:36:20 +0100 > Marius Strobl wrote: > >> On Thu, Dec 05, 2013 at 10:38:54PM +0000, Aleksandr Rybalko wrote: >>> Author: ray >>> Date: Thu Dec 5 22:38:53 2013 >>> New Revision: 259016 >>> URL: http://svnweb.freebsd.org/changeset/base/259016 >>> >>> Log: >>> Merge VT(9) project (a.k.a. newcons). >>> >>> Reviewed by: nwhitehorn >>> MFC_to_10_after: re approval >> Have you addressed any of the points raised in: >> http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045887.html >> to get VT(9) at least en par with syscons(4) regarding being able to >> use a hardware cursor, allowing different low-level console drivers >> to compete for the same hardware etc. in the meantime? >> >> Marius >> > Hello Marius! > > Yes and No :) > > Lets make it as list with short items: > 1. Making these drivers work as low-level console. > 2. Drivers priority. > 3. Using hardware acceleration. > 4. Using the 12 x 22 gallant font. > 5. Allowing Xorg to map the frame buffer. > 6. (Part of 5) Other register banks as needed. > 7. Allowing late attachment. > > Answers: > 1. Works, I did testing on ARM board Efika MX with vt_fb_early driver. > (Still have to discuss several things with arm@ guys, then commit) As I mentioned in my review, this particular code is a really weird bug-filled copy of ofwfb.c, which already works as a low-level console early in the boot process. > 2. Works. F.e. amd64 start with vt_vga driver, then vt_kms driver > override it as more specific. I think Marius meant having early-boot drivers bid amongst each other for attachment.... > 3. Not used at all yet. > > 4. I like that font. If you want more "gallant" - I will help. Thanks > to Ed, newcons support any font dimensions. > > 5. It works, but only for those drivers which attach dev/fb/fbd, via > fbd devfs node (not accessible via vt(9) ioctls yet). Could you provide more detail about how this is supposed to work? X doesn't map at offset 0 in general, and that means that 100% of X UMS drivers are currently broken with newcons. > 6. IMO better to put it into some drm emulation. > > 7. Works in many combination. ( > start w/ vga, load kms; (kms replace vga) > start w/o driver, load kms; > preload kms, start w/ vga; (kms replace vga) > preload kms, start w/o driver; (kms attached after drm node initialized) > ) > > Have to put your list on Newcons's wiki page too. > > As I remember such long list of requirement you provide was based on > expectation that I want to replace syscons right now :) > But, for now we (me and x11 team) want to see it 10.0 as disabled by > default (just like in HEAD now), so peoples who want to help with debug > of new xorg and drm drivers will be able to see messages after KMS-xorg > starts. > > Oh, looks like I forget what I have to say more. :) > So it will be said later, when I will less sleepy. > > Anyway. Thanks a lot for your comments!!! > > WBW We should come up with a sunset plan for syscons, though. -Nathan From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 00:35:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D1F1761; Tue, 10 Dec 2013 00:35:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68497101E; Tue, 10 Dec 2013 00:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA0ZYKm066424; Tue, 10 Dec 2013 00:35:34 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA0ZY51066422; Tue, 10 Dec 2013 00:35:34 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312100035.rBA0ZY51066422@svn.freebsd.org> From: Glen Barber Date: Tue, 10 Dec 2013 00:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259151 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 00:35:34 -0000 Author: gjb Date: Tue Dec 10 00:35:33 2013 New Revision: 259151 URL: http://svnweb.freebsd.org/changeset/base/259151 Log: MFC r259079: Add WITH_DVD to RELEASE_RMAKEFLAGS, otherwise it is not actually passed to 'make release'. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/release.conf.sample stable/10/release/release.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/release/release.conf.sample ============================================================================== --- stable/10/release/release.conf.sample Tue Dec 10 00:07:04 2013 (r259150) +++ stable/10/release/release.conf.sample Tue Dec 10 00:35:33 2013 (r259151) @@ -39,3 +39,4 @@ PORTBRANCH="ports/head@rHEAD" #NODOC= #NOPORTS= #RELSTRING= +#WITH_DVD= Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Tue Dec 10 00:07:04 2013 (r259150) +++ stable/10/release/release.sh Tue Dec 10 00:35:33 2013 (r259151) @@ -72,6 +72,9 @@ KERNEL="GENERIC" NODOC= NOPORTS= +# Set to non-empty value to build dvd1.iso as part of the release. +WITH_DVD= + usage() { echo "Usage: $0 [-c release.conf]" exit 1 @@ -129,7 +132,7 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS}" + ${DOCPORTS} WITH_DVD=${WITH_DVD}" # Force src checkout if configured FORCE_SRC_KEY= From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 01:39:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C307148E; Tue, 10 Dec 2013 01:39:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AEEC91530; Tue, 10 Dec 2013 01:39:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA1dMwn088862; Tue, 10 Dec 2013 01:39:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA1dMK3088861; Tue, 10 Dec 2013 01:39:22 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312100139.rBA1dMK3088861@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Dec 2013 01:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259152 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 01:39:22 -0000 Author: eadler Date: Tue Dec 10 01:39:22 2013 New Revision: 259152 URL: http://svnweb.freebsd.org/changeset/base/259152 Log: calendar(1): Add support for #include with absolute paths Prior to the addition of cpp support into calendar itself #include was a legal construction in a calendar file. Permit this again Modified: head/usr.bin/calendar/calcpp.c Modified: head/usr.bin/calendar/calcpp.c ============================================================================== --- head/usr.bin/calendar/calcpp.c Tue Dec 10 00:35:33 2013 (r259151) +++ head/usr.bin/calendar/calcpp.c Tue Dec 10 01:39:22 2013 (r259152) @@ -155,8 +155,11 @@ tokenscpp(char *buf, char *string) s = p+1; if ((p = strchr(s, '>')) != NULL) *p = '\0'; - snprintf (string, MAXPATHLEN, "%s/%s", - _PATH_INCLUDE, s); + if (*s != '/') + snprintf (string, MAXPATHLEN, "%s/%s", + _PATH_INCLUDE, s); + else + strncpy(string, s, MAXPATHLEN); } else if (*p == '(') { s = p+1; if ((p = strchr(p, '>')) != NULL) From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 04:56:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 662B488E; Tue, 10 Dec 2013 04:56:34 +0000 (UTC) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 2520111E6; Tue, 10 Dec 2013 04:56:33 +0000 (UTC) Received: from c122-106-156-23.carlnfd1.nsw.optusnet.com.au (c122-106-156-23.carlnfd1.nsw.optusnet.com.au [122.106.156.23]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 59087D43CEB; Tue, 10 Dec 2013 15:56:24 +1100 (EST) Date: Tue, 10 Dec 2013 15:56:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Hibbits Subject: Re: svn commit: r259080 - in head/sys: dev/iicbus geom/cache geom/journal In-Reply-To: <20131208013614.6dc63ef9@zhabar.gateway.2wire.net> Message-ID: <20131210155324.R1022@besplex.bde.org> References: <201312071955.rB7JtYNH001792@svn.freebsd.org> <20131208123144.U883@besplex.bde.org> <20131208013614.6dc63ef9@zhabar.gateway.2wire.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=bpB1Wiqi c=1 sm=1 tr=0 a=ebeQFi2P/qHVC0Yw9JDJ4g==:117 a=PO7r1zJSAAAA:8 a=3HaF-T8NxwoA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=ssdoF7uQumEA:10 a=9pnJ-HnNXQN87wXru4sA:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, Justin Hibbits , src-committers@freebsd.org, svn-src-all@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 04:56:34 -0000 On Sun, 8 Dec 2013, Justin Hibbits wrote: > On Sun, 8 Dec 2013 13:53:30 +1100 (EST) > Bruce Evans wrote: > >> On Sat, 7 Dec 2013, Justin Hibbits wrote: >[>]* [...] >>> Modified: head/sys/geom/cache/g_cache.c >>> ============================================================================== >>> --- head/sys/geom/cache/g_cache.c Sat Dec 7 19:39:38 >>> 2013 (r259079) +++ head/sys/geom/cache/g_cache.c Sat >>> Dec 7 19:55:34 2013 (r259080) @@ -67,7 +67,7 @@ static >>> u_int g_cache_used_hi = 20; static int >>> sysctl_handle_pct(SYSCTL_HANDLER_ARGS) >>> { >>> - u_int val = *(u_int *)arg1; >>> + int val; >>> int error; >>> >>> error = sysctl_handle_int(oidp, &val, 0, req); >> >> This adds the larger non-style bug that val is used uninitialized. >> Compilers should warn about this. This results in stack garbage >> being copied out instead of the "old" value. >> ... > I just reverted these two changes in r259096. Rather than fix what I > did and change the rest of the files, I'm leaving them for another day, > and reverted my changes so they're at least back to the working order > from before. Thanks. Does it work to just remove the check for val < 0? Bruce From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 05:01:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 758CBCB0; Tue, 10 Dec 2013 05:01:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 622761262; Tue, 10 Dec 2013 05:01:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA5128R066212; Tue, 10 Dec 2013 05:01:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA512AT066211; Tue, 10 Dec 2013 05:01:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312100501.rBA512AT066211@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Dec 2013 05:01:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259156 - head/usr.sbin/mtest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 05:01:02 -0000 Author: eadler Date: Tue Dec 10 05:01:01 2013 New Revision: 259156 URL: http://svnweb.freebsd.org/changeset/base/259156 Log: mtest(8): use correct macro in mdoc The An macros is used for authors while the Ar macro is used for arguments. AFAIK mcast-addr and ifname are not authors. PR: docs/184649 Submitted by: cnst++ MFC After: 3 days Modified: head/usr.sbin/mtest/mtest.8 Modified: head/usr.sbin/mtest/mtest.8 ============================================================================== --- head/usr.sbin/mtest/mtest.8 Tue Dec 10 04:57:56 2013 (r259155) +++ head/usr.sbin/mtest/mtest.8 Tue Dec 10 05:01:01 2013 (r259156) @@ -131,9 +131,9 @@ to allow traffic from source Print .Ar n source filter entries for -.An mcast-addr +.Ar mcast-addr on interface -.An ifname . +.Ar ifname . .\" .Pp .It Ic f Ar filename From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 07:25:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3282296; Tue, 10 Dec 2013 07:25:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCC461B18; Tue, 10 Dec 2013 07:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7PP5M017707; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7PPUV017705; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100725.rBA7PPUV017705@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259157 - in stable: 10/contrib/llvm/tools/clang/lib/Driver 9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:25:26 -0000 Author: dim Date: Tue Dec 10 07:25:25 2013 New Revision: 259157 URL: http://svnweb.freebsd.org/changeset/base/259157 Log: MFC r259053: Pull in r196590 from upstream clang trunk (by rdivacky): Move the body of GCCInstallationDetector ctor into an init() function and call it from its only user. The linux toolchain. This saves quite a lot of directory searching on other platforms. See http://docs.freebsd.org/cgi/mid.cgi?51E6FAF5.3080802 for the original discussion. With this fix, the search for gcc installations is completely eliminated on FreeBSD. Reported by: Kurt Lidl Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 05:01:01 2013 (r259156) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 07:25:25 2013 (r259157) @@ -991,7 +991,7 @@ static StringRef getGCCToolchainDir(cons return GCC_INSTALL_PREFIX; } -/// \brief Construct a GCCInstallationDetector from the driver. +/// \brief Initialize a GCCInstallationDetector from the driver. /// /// This performs all of the autodetection and sets up the various paths. /// Once constructed, a GCCInstallationDetector is essentially immutable. @@ -1000,11 +1000,9 @@ static StringRef getGCCToolchainDir(cons /// should instead pull the target out of the driver. This is currently /// necessary because the driver doesn't store the final version of the target /// triple. -Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( - const Driver &D, - const llvm::Triple &TargetTriple, - const ArgList &Args) - : IsValid(false) { +void +Generic_GCC::GCCInstallationDetector::init( + const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args) { llvm::Triple MultiarchTriple = TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant() : TargetTriple.get32BitArchVariant(); @@ -1448,7 +1446,7 @@ void Generic_GCC::GCCInstallationDetecto Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) - : ToolChain(D, Triple, Args), GCCInstallation(getDriver(), Triple, Args) { + : ToolChain(D, Triple, Args), GCCInstallation() { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) getProgramPaths().push_back(getDriver().Dir); @@ -2211,6 +2209,7 @@ static StringRef getMultilibDir(const ll Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { + GCCInstallation.init(D, Triple, Args); llvm::Triple::ArchType Arch = Triple.getArch(); std::string SysRoot = computeSysRoot(Args); Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 05:01:01 2013 (r259156) +++ stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 07:25:25 2013 (r259157) @@ -78,7 +78,8 @@ protected: GCCVersion Version; public: - GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple, + GCCInstallationDetector() : IsValid(false) {} + void init(const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args); /// \brief Check whether we detected a valid GCC install. From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 07:25:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6948E297; Tue, 10 Dec 2013 07:25:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5325C1B19; Tue, 10 Dec 2013 07:25:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7PQ8E017714; Tue, 10 Dec 2013 07:25:26 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7PP93017712; Tue, 10 Dec 2013 07:25:25 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100725.rBA7PP93017712@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259157 - in stable: 10/contrib/llvm/tools/clang/lib/Driver 9/contrib/llvm/tools/clang/lib/Driver X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:25:26 -0000 Author: dim Date: Tue Dec 10 07:25:25 2013 New Revision: 259157 URL: http://svnweb.freebsd.org/changeset/base/259157 Log: MFC r259053: Pull in r196590 from upstream clang trunk (by rdivacky): Move the body of GCCInstallationDetector ctor into an init() function and call it from its only user. The linux toolchain. This saves quite a lot of directory searching on other platforms. See http://docs.freebsd.org/cgi/mid.cgi?51E6FAF5.3080802 for the original discussion. With this fix, the search for gcc installations is completely eliminated on FreeBSD. Reported by: Kurt Lidl Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 05:01:01 2013 (r259156) +++ stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp Tue Dec 10 07:25:25 2013 (r259157) @@ -991,7 +991,7 @@ static StringRef getGCCToolchainDir(cons return GCC_INSTALL_PREFIX; } -/// \brief Construct a GCCInstallationDetector from the driver. +/// \brief Initialize a GCCInstallationDetector from the driver. /// /// This performs all of the autodetection and sets up the various paths. /// Once constructed, a GCCInstallationDetector is essentially immutable. @@ -1000,11 +1000,9 @@ static StringRef getGCCToolchainDir(cons /// should instead pull the target out of the driver. This is currently /// necessary because the driver doesn't store the final version of the target /// triple. -Generic_GCC::GCCInstallationDetector::GCCInstallationDetector( - const Driver &D, - const llvm::Triple &TargetTriple, - const ArgList &Args) - : IsValid(false) { +void +Generic_GCC::GCCInstallationDetector::init( + const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args) { llvm::Triple MultiarchTriple = TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant() : TargetTriple.get32BitArchVariant(); @@ -1448,7 +1446,7 @@ void Generic_GCC::GCCInstallationDetecto Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple, const ArgList &Args) - : ToolChain(D, Triple, Args), GCCInstallation(getDriver(), Triple, Args) { + : ToolChain(D, Triple, Args), GCCInstallation() { getProgramPaths().push_back(getDriver().getInstalledDir()); if (getDriver().getInstalledDir() != getDriver().Dir) getProgramPaths().push_back(getDriver().Dir); @@ -2243,6 +2241,7 @@ static StringRef getMultilibDir(const ll Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) : Generic_ELF(D, Triple, Args) { + GCCInstallation.init(D, Triple, Args); llvm::Triple::ArchType Arch = Triple.getArch(); std::string SysRoot = computeSysRoot(Args); Modified: stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 05:01:01 2013 (r259156) +++ stable/10/contrib/llvm/tools/clang/lib/Driver/ToolChains.h Tue Dec 10 07:25:25 2013 (r259157) @@ -78,7 +78,8 @@ protected: GCCVersion Version; public: - GCCInstallationDetector(const Driver &D, const llvm::Triple &TargetTriple, + GCCInstallationDetector() : IsValid(false) {} + void init(const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args); /// \brief Check whether we detected a valid GCC install. From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 07:28:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FB52515; Tue, 10 Dec 2013 07:28:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5AA411B2F; Tue, 10 Dec 2013 07:28:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7SRtl018251; Tue, 10 Dec 2013 07:28:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7SRI4018249; Tue, 10 Dec 2013 07:28:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100728.rBA7SRI4018249@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259158 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:28:27 -0000 Author: dim Date: Tue Dec 10 07:28:26 2013 New Revision: 259158 URL: http://svnweb.freebsd.org/changeset/base/259158 Log: MFC r259083: For WARNS <= 3, change the clang warning flag -Wno-conversion to -Wno-enum-conversion. In earlier clang versions (before 3.2), the latter did not exist, and suppressing enum conversion warnings was really the goal of this warning suppression flag. This should enable the same kind of warning again as was fixed by r259072 ("incompatible integer to pointer conversion passing 'Elf_Addr' (aka 'unsigned int') to parameter of type 'void *'"), and which was only emitted by gcc. Noticed by: kib Modified: stable/9/share/mk/bsd.sys.mk (contents, props changed) Directory Properties: stable/9/share/mk/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/mk/bsd.sys.mk Directory Properties: stable/10/ (props changed) Modified: stable/9/share/mk/bsd.sys.mk ============================================================================== --- stable/9/share/mk/bsd.sys.mk Tue Dec 10 07:25:25 2013 (r259157) +++ stable/9/share/mk/bsd.sys.mk Tue Dec 10 07:28:26 2013 (r259158) @@ -69,7 +69,7 @@ CWARNFLAGS+= -Wno-empty-body -Wno-string .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS+= -Wno-tautological-compare -Wno-unused-value\ - -Wno-parentheses-equality -Wno-unused-function -Wno-conversion + -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion .endif # WARNS <= 3 .if ${WARNS} <= 2 CWARNFLAGS+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 07:28:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4D11516; Tue, 10 Dec 2013 07:28:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B030D1B30; Tue, 10 Dec 2013 07:28:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA7SRVB018257; Tue, 10 Dec 2013 07:28:27 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA7SRbb018256; Tue, 10 Dec 2013 07:28:27 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312100728.rBA7SRbb018256@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Dec 2013 07:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259158 - in stable: 10/share/mk 9/share/mk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 07:28:27 -0000 Author: dim Date: Tue Dec 10 07:28:26 2013 New Revision: 259158 URL: http://svnweb.freebsd.org/changeset/base/259158 Log: MFC r259083: For WARNS <= 3, change the clang warning flag -Wno-conversion to -Wno-enum-conversion. In earlier clang versions (before 3.2), the latter did not exist, and suppressing enum conversion warnings was really the goal of this warning suppression flag. This should enable the same kind of warning again as was fixed by r259072 ("incompatible integer to pointer conversion passing 'Elf_Addr' (aka 'unsigned int') to parameter of type 'void *'"), and which was only emitted by gcc. Noticed by: kib Modified: stable/10/share/mk/bsd.sys.mk Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/share/mk/bsd.sys.mk (contents, props changed) Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/10/share/mk/bsd.sys.mk ============================================================================== --- stable/10/share/mk/bsd.sys.mk Tue Dec 10 07:25:25 2013 (r259157) +++ stable/10/share/mk/bsd.sys.mk Tue Dec 10 07:28:26 2013 (r259158) @@ -73,7 +73,7 @@ CWARNFLAGS+= -Wno-empty-body -Wno-string .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS+= -Wno-tautological-compare -Wno-unused-value\ - -Wno-parentheses-equality -Wno-unused-function -Wno-conversion + -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion .endif # WARNS <= 3 .if ${WARNS} <= 2 CWARNFLAGS+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 09:38:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D159821; Tue, 10 Dec 2013 09:38:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18D97173E; Tue, 10 Dec 2013 09:38:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBA9cIaX066375; Tue, 10 Dec 2013 09:38:18 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBA9cIjR066373; Tue, 10 Dec 2013 09:38:18 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201312100938.rBA9cIjR066373@svn.freebsd.org> From: Juli Mallett Date: Tue, 10 Dec 2013 09:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259161 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 09:38:19 -0000 Author: jmallett Date: Tue Dec 10 09:38:18 2013 New Revision: 259161 URL: http://svnweb.freebsd.org/changeset/base/259161 Log: Add missing includes. Modified: head/sys/mips/cavium/octe/cavium-ethernet.h head/sys/mips/cavium/octe/ethernet-mv88e61xx.c Modified: head/sys/mips/cavium/octe/cavium-ethernet.h ============================================================================== --- head/sys/mips/cavium/octe/cavium-ethernet.h Tue Dec 10 09:14:11 2013 (r259160) +++ head/sys/mips/cavium/octe/cavium-ethernet.h Tue Dec 10 09:38:18 2013 (r259161) @@ -38,7 +38,9 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS #ifndef CAVIUM_ETHERNET_H #define CAVIUM_ETHERNET_H +#include #include +#include /** * This is the definition of the Ethernet driver's private Modified: head/sys/mips/cavium/octe/ethernet-mv88e61xx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mv88e61xx.c Tue Dec 10 09:14:11 2013 (r259160) +++ head/sys/mips/cavium/octe/ethernet-mv88e61xx.c Tue Dec 10 09:38:18 2013 (r259161) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 11:31:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F6F6E10; Tue, 10 Dec 2013 11:31:01 +0000 (UTC) Received: from mail-vc0-x230.google.com (mail-vc0-x230.google.com [IPv6:2607:f8b0:400c:c03::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6900120F; Tue, 10 Dec 2013 11:31:00 +0000 (UTC) Received: by mail-vc0-f176.google.com with SMTP id lf12so4383532vcb.21 for ; Tue, 10 Dec 2013 03:31:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=lW0oB/8Jeo4frpKuJYDhMkXRulEGXJm2ycNXGj717KU=; b=r0Z6nMtG4WT7E6/f5eUv91i8Xa2PmVIQ+nmC0S4UJoFdxqWdOev3Jxhl7rPEqfikDb 0FBZlUnSBkvjkvszk8B3PCETyqeTThZBrKLVM2q5hCO8kcCOHBD5/L9g0G1xQKbvwA3f ga1Xeg6oebAwntw+CsGrSSJ4Gq29Mzny7LihPsNBZrWljSDZWpRqX6ua6Bg4g4i+ZK0N YLsXVW41pwvrb3nRldxFDxHvM9EhW4PXXePV6r6XlnbspxpWMv7R4A6ItyN82TSOY3gO DTlbSqEjNh2jYX59pa9fVWyWhHHA8fligezCXuMt7D6IGc4Y+slIcsc172Bs6OEIFBND l9hQ== MIME-Version: 1.0 X-Received: by 10.58.156.106 with SMTP id wd10mr13108023veb.7.1386675059969; Tue, 10 Dec 2013 03:30:59 -0800 (PST) Sender: edschouten@gmail.com Received: by 10.220.74.6 with HTTP; Tue, 10 Dec 2013 03:30:59 -0800 (PST) In-Reply-To: <20131210022015.2a5a1ed3.ray@freebsd.org> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <20131208153620.GA21278@alchemy.franken.de> <20131210022015.2a5a1ed3.ray@freebsd.org> Date: Tue, 10 Dec 2013 22:30:59 +1100 X-Google-Sender-Auth: mABLlEaCttKHpLRs8dat-i_T7h0 Message-ID: Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken From: Ed Schouten To: Aleksandr Rybalko Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Marius Strobl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 11:31:01 -0000 2013/12/10 Aleksandr Rybalko : > Thanks to Ed, [...] No, thanks to you! Thanks a lot for pushing forward something that I should have done years ago. Can't wait to buy you a beer. -- Ed Schouten From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 12:36:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C5231AD; Tue, 10 Dec 2013 12:36:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F20AD171A; Tue, 10 Dec 2013 12:36:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBACaib0031408; Tue, 10 Dec 2013 12:36:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBACaia2031406; Tue, 10 Dec 2013 12:36:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312101236.rBACaia2031406@svn.freebsd.org> From: Alexander Motin Date: Tue, 10 Dec 2013 12:36:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259168 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 12:36:45 -0000 Author: mav Date: Tue Dec 10 12:36:44 2013 New Revision: 259168 URL: http://svnweb.freebsd.org/changeset/base/259168 Log: Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE (64MB). Even if we would find one somehow, ZFS kernel code rejects such devices. It is funny to look on attempts to read 4 256K vdev labels from 1.44MB floppy, though it is not very practical and quite slow. Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Dec 10 11:47:38 2013 (r259167) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Dec 10 12:36:44 2013 (r259168) @@ -995,10 +995,10 @@ nozpool_all_slices(avl_tree_t *r, const #endif /* sun */ } +#ifdef sun static void check_slices(avl_tree_t *r, int fd, const char *sname) { -#ifdef sun struct extvtoc vtoc; struct dk_gpt *gpt; char diskname[MAXNAMELEN]; @@ -1028,8 +1028,8 @@ check_slices(avl_tree_t *r, int fd, cons check_one_slice(r, diskname, i, 0, 1); efi_free(gpt); } -#endif /* sun */ } +#endif /* sun */ static void zpool_open_func(void *arg) @@ -1059,6 +1059,7 @@ zpool_open_func(void *arg) return; } /* this file is too small to hold a zpool */ +#ifdef sun if (S_ISREG(statbuf.st_mode) && statbuf.st_size < SPA_MINDEVSIZE) { (void) close(fd); @@ -1070,6 +1071,12 @@ zpool_open_func(void *arg) */ check_slices(rn->rn_avl, fd, rn->rn_name); } +#else /* !sun */ + if (statbuf.st_size < SPA_MINDEVSIZE) { + (void) close(fd); + return; + } +#endif /* sun */ if ((zpool_read_label(fd, &config)) != 0) { (void) close(fd); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 10 11:47:38 2013 (r259167) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Dec 10 12:36:44 2013 (r259168) @@ -401,10 +401,16 @@ vdev_geom_attach_taster(struct g_consume if (pp->flags & G_PF_WITHER) return (EINVAL); - if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) - return (EINVAL); g_attach(cp, pp); error = g_access(cp, 1, 0, 0); + if (error == 0) { + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) + error = EINVAL; + else if (pp->mediasize < SPA_MINDEVSIZE) + error = EINVAL; + if (error != 0) + g_access(cp, -1, 0, 0); + } if (error != 0) g_detach(cp); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:10:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4469BA7B; Tue, 10 Dec 2013 13:10:57 +0000 (UTC) Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [IPv6:2607:f8b0:400d:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B92C719F9; Tue, 10 Dec 2013 13:10:56 +0000 (UTC) Received: by mail-qa0-f54.google.com with SMTP id f11so3634653qae.20 for ; Tue, 10 Dec 2013 05:10:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AAvI5v0PeSZpbI9F3JE9qGFFfXbA9VScoZESuTRZyRQ=; b=UVYxhwVfj/2OFMH3I2jaNcMHGAkGzuUoBBldP5ulUCM6iOnGVBeEM/mHSULPr2b07U vtcXZTmLn/leDPzhVEUvpAvqs30cU+dSO5W4B/l88r5wyfUkz2pl7OkFnC5mj/zqeRIP JJG1ex6q6y1G3B3XBcXz478ZqAdw8klnwvoYsxd2353qcPz1kHeuZRcPQ5BHBtHlTzIh zI2BuWD0l5pyvqd+Yxcm4aDT1yi993ORht+CQ9xoLJWCHZwegG4oPdKfVrsXPhsMwfms dxjvgcWuDHM7gbBLDaK3PubS9qRfiegRBS2qoAvGuHuX1jaqVH0rPBAHenTM/IQqDt/w dZkw== X-Received: by 10.49.12.43 with SMTP id v11mr43739084qeb.50.1386681055908; Tue, 10 Dec 2013 05:10:55 -0800 (PST) Received: from [10.10.1.142] ([201.72.203.70]) by mx.google.com with ESMTPSA id n14sm45916789qav.8.2013.12.10.05.10.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 05:10:55 -0800 (PST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken From: Luiz Otavio O Souza In-Reply-To: Date: Tue, 10 Dec 2013 11:10:50 -0200 Content-Transfer-Encoding: quoted-printable Message-Id: <70879E0A-FED3-4861-AAE8-C01C61BC193E@gmail.com> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <20131208153620.GA21278@alchemy.franken.de> <20131210022015.2a5a1ed3.ray@freebsd.org> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1822) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Marius Strobl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:10:57 -0000 On Dec 10, 2013, at 9:30 AM, Ed Schouten wrote: > 2013/12/10 Aleksandr Rybalko : >> Thanks to Ed, [...] >=20 > No, thanks to you! [=85] > Can't wait to buy you a beer. +1= From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:14:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1924BBF2; Tue, 10 Dec 2013 13:14:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EDDE61A1D; Tue, 10 Dec 2013 13:14:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADEs3k045711; Tue, 10 Dec 2013 13:14:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADEsLh045710; Tue, 10 Dec 2013 13:14:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312101314.rBADEsLh045710@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 10 Dec 2013 13:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259169 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:14:55 -0000 Author: ae Date: Tue Dec 10 13:14:54 2013 New Revision: 259169 URL: http://svnweb.freebsd.org/changeset/base/259169 Log: Ansify function definitions. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Tue Dec 10 12:36:44 2013 (r259168) +++ head/usr.sbin/ndp/ndp.c Tue Dec 10 13:14:54 2013 (r259169) @@ -168,9 +168,7 @@ int mode = 0; char *arg = NULL; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch; @@ -320,8 +318,7 @@ main(argc, argv) * Process a file to set standard ndp entries */ int -file(name) - char *name; +file(char *name) { FILE *fp; int i, retval; @@ -378,9 +375,7 @@ struct { * Set an individual neighbor cache entry */ int -set(argc, argv) - int argc; - char **argv; +set(int argc, char **argv) { register struct sockaddr_in6 *sin = &sin_m; register struct sockaddr_dl *sdl; @@ -455,8 +450,7 @@ overwrite: * Display an individual neighbor cache entry */ void -get(host) - char *host; +get(char *host) { struct sockaddr_in6 *sin = &sin_m; struct addrinfo hints, *res; @@ -486,8 +480,7 @@ get(host) * Delete a neighbor cache entry */ int -delete(host) - char *host; +delete(char *host) { struct sockaddr_in6 *sin = &sin_m; register struct rt_msghdr *rtm = &m_rtmsg.m_rtm; @@ -555,9 +548,7 @@ delete: * Dump the entire neighbor cache */ void -dump(addr, cflag) - struct in6_addr *addr; - int cflag; +dump(struct in6_addr *addr, int cflag) { int mib[6]; size_t needed; @@ -762,10 +753,7 @@ again:; } static struct in6_nbrinfo * -getnbrinfo(addr, ifindex, warning) - struct in6_addr *addr; - int ifindex; - int warning; +getnbrinfo(struct in6_addr *addr, int ifindex, int warning) { static struct in6_nbrinfo nbi; int s; @@ -806,9 +794,7 @@ ether_str(struct sockaddr_dl *sdl) } int -ndp_ether_aton(a, n) - char *a; - u_char *n; +ndp_ether_aton(char *a, u_char *n) { int i, o[6]; @@ -840,8 +826,7 @@ usage() } int -rtmsg(cmd) - int cmd; +rtmsg(int cmd) { static int seq; int rlen; @@ -906,10 +891,7 @@ doit: } void -ifinfo(ifname, argc, argv) - char *ifname; - int argc; - char **argv; +ifinfo(char *ifname, int argc, char **argv) { struct in6_ndireq nd; int i, s; @@ -1478,8 +1460,7 @@ harmonize_rtr() #ifdef SIOCSDEFIFACE_IN6 /* XXX: check SIOCGDEFIFACE_IN6 as well? */ static void -setdefif(ifname) - char *ifname; +setdefif(char *ifname) { struct in6_ndifreq ndifreq; unsigned int ifindex; @@ -1532,8 +1513,7 @@ getdefif() #endif static char * -sec2str(total) - time_t total; +sec2str(time_t total) { static char result[256]; int days, hours, mins, secs; @@ -1578,8 +1558,7 @@ sec2str(total) * from tcpdump/util.c */ static void -ts_print(tvp) - const struct timeval *tvp; +ts_print(const struct timeval *tvp) { int s; From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:31:06 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85E16151; Tue, 10 Dec 2013 13:31:06 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 3D3891C7C; Tue, 10 Dec 2013 13:31:05 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id C9E51C4927; Tue, 10 Dec 2013 15:31:04 +0200 (EET) Date: Tue, 10 Dec 2013 15:31:44 +0200 From: Aleksandr Rybalko To: Andreas Tobler Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-Id: <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> In-Reply-To: <52A4E865.6080602@FreeBSD.org> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, Aleksandr Rybalko , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:31:06 -0000 On Sun, 08 Dec 2013 22:45:09 +0100 Andreas Tobler wrote: > Hi Aleksandr, > > On 08.12.13 00:59, Aleksandr Rybalko wrote: > > Andreas Tobler написав(ла): > >> On 05.12.13 23:38, Aleksandr Rybalko wrote: > >>> Author: ray > >>> Date: Thu Dec 5 22:38:53 2013 > >>> New Revision: 259016 > >>> URL: http://svnweb.freebsd.org/changeset/base/259016 > >>> > >>> Log: > >>> Merge VT(9) project (a.k.a. newcons). > >>> > >>> Reviewed by: nwhitehorn > >>> MFC_to_10_after: re approval > >>> > >>> Sponsored by: The FreeBSD Foundation > >> > >> Great! Thanks, gives a new look & feel on the console :) > >> Have it running on amd64/i386 and PowerMac(32/64-bit). > >> The only thing I need to figure is the mapping of the AltGr or in Mac > >> world, the alt key mapping. Iow, the third level mapping of the keys. > >> e.g. the @ here is on altgr-2... > >> > >> Again, thanks! > >> Andreas > > > > > I'm glad to fix that, but I've to understand how it is should work :-) > > Hehe :) > > So do I. I was playing a bit while comparing to syscons.c > > And with the below diff I'm able to get what I want. At least when I > press RALT (Altgr) I get the third symbol printed on my keyboard. > I have a couple of Thinkpads here where I play with. (The PowerMac's are > currently to loud) > > For example, on the '2' I have the '"' as the second symbol and the '@' > as third symbol. Yeah, these are european keyboards.... > > Now I do not prepend the 0x1b and then my RALT behaves as used to, at > least for me. > > I do not know the fine details but LALT and RALT are different. > > What do you think, others? > > For me this is a really important thing since all the 'special' keys are > not accesible w/o the 'hack' below. If I want the pipe (|), or writing > code ({}, [], ...) I have to remote login to get the characters I need. > But I guess I do not need to explain that ;) > > TIA, > Andreas Hi Andreas! That keyboards have no Shift key for that? :) I will be glad to apply your changes, but I have to know how it should be controlled. RU and UA PC keyboards have same 3 symbols '2', '"', '@' To get '2' i have to press only '2' To get '@' I have to press Shift+'2' To get '"' I have to switch to UA or RU and press Shift+'2' Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary lang switch. Which commonly mapped to one of Alt. Right? So R-Alt+Shift+'2'? > > Index: vt_core.c > =================================================================== > --- vt_core.c (revision 259095) > +++ vt_core.c (working copy) > @@ -408,6 +408,7 @@ > } else { > switch (c & ~RELKEY) { > case (SPCLKEY | RALT): > + break; > case (SPCLKEY | LALT): > vd->vd_kbstate |= ALKED; > } -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:33:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A3DC2C6; Tue, 10 Dec 2013 13:33:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 028E71C9E; Tue, 10 Dec 2013 13:33:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADXwNO052619; Tue, 10 Dec 2013 13:33:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADXuI5052602; Tue, 10 Dec 2013 13:33:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201312101333.rBADXuI5052602@svn.freebsd.org> From: Andriy Gapon Date: Tue, 10 Dec 2013 13:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259170 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:33:59 -0000 Author: avg Date: Tue Dec 10 13:33:56 2013 New Revision: 259170 URL: http://svnweb.freebsd.org/changeset/base/259170 Log: 4370 avoid transmitting holes during zfs send 4371 DMU code clean up illumos/illumos-gate@43466aae47bfcd2ad9bf501faec8e75c08095e4f Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/ddt.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_cache.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zdb/zdb_il.c vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/man/man5/zpool-features.5 Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.c Tue Dec 10 13:33:56 2013 (r259170) @@ -115,10 +115,21 @@ zfeature_lookup_name(const char *name, s return (ENOENT); } +boolean_t +zfeature_depends_on(spa_feature_t fid, spa_feature_t check) { + zfeature_info_t *feature = &spa_feature_table[fid]; + + for (int i = 0; feature->fi_depends[i] != SPA_FEATURE_NONE; i++) { + if (feature->fi_depends[i] == check) + return (B_TRUE); + } + return (B_FALSE); +} + static void zfeature_register(spa_feature_t fid, const char *guid, const char *name, const char *desc, boolean_t readonly, boolean_t mos, - const spa_feature_t *deps) + boolean_t activate_on_enable, const spa_feature_t *deps) { zfeature_info_t *feature = &spa_feature_table[fid]; static spa_feature_t nodeps[] = { SPA_FEATURE_NONE }; @@ -138,6 +149,7 @@ zfeature_register(spa_feature_t fid, con feature->fi_desc = desc; feature->fi_can_readonly = readonly; feature->fi_mos = mos; + feature->fi_activate_on_enable = activate_on_enable; feature->fi_depends = deps; } @@ -146,21 +158,43 @@ zpool_feature_init(void) { zfeature_register(SPA_FEATURE_ASYNC_DESTROY, "com.delphix:async_destroy", "async_destroy", - "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, NULL); + "Destroy filesystems asynchronously.", B_TRUE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_EMPTY_BPOBJ, "com.delphix:empty_bpobj", "empty_bpobj", - "Snapshots use less space.", B_TRUE, B_FALSE, NULL); + "Snapshots use less space.", B_TRUE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", - "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL); + "LZ4 compression algorithm support.", B_FALSE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", - "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); + "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, + B_FALSE, NULL); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, "com.delphix:spacemap_histogram", "spacemap_histogram", - "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, + B_FALSE, NULL); + + zfeature_register(SPA_FEATURE_ENABLED_TXG, + "com.delphix:enabled_txg", "enabled_txg", + "Record txg at which a feature is enabled", B_TRUE, B_FALSE, + B_FALSE, NULL); + + static spa_feature_t hole_birth_deps[] = { SPA_FEATURE_ENABLED_TXG, + SPA_FEATURE_NONE }; + zfeature_register(SPA_FEATURE_HOLE_BIRTH, + "com.delphix:hole_birth", "hole_birth", + "Retain hole birth txg for more precise zfs send", + B_FALSE, B_TRUE, B_TRUE, hole_birth_deps); + zfeature_register(SPA_FEATURE_EXTENSIBLE_DATASET, "com.delphix:extensible_dataset", "extensible_dataset", "Enhanced dataset functionality, used by other features.", - B_FALSE, B_FALSE, NULL); + B_FALSE, B_FALSE, B_FALSE, NULL); } Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.h ============================================================================== --- vendor-sys/illumos/dist/common/zfs/zfeature_common.h Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/common/zfs/zfeature_common.h Tue Dec 10 13:33:56 2013 (r259170) @@ -45,10 +45,14 @@ typedef enum spa_feature { SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, SPA_FEATURE_SPACEMAP_HISTOGRAM, + SPA_FEATURE_ENABLED_TXG, + SPA_FEATURE_HOLE_BIRTH, SPA_FEATURE_EXTENSIBLE_DATASET, SPA_FEATURES } spa_feature_t; +#define SPA_FEATURE_DISABLED (-1ULL) + typedef struct zfeature_info { spa_feature_t fi_feature; const char *fi_uname; /* User-facing feature name */ @@ -56,6 +60,8 @@ typedef struct zfeature_info { const char *fi_desc; /* Feature description */ boolean_t fi_can_readonly; /* Can open pool readonly w/o support? */ boolean_t fi_mos; /* Is the feature necessary to read the MOS? */ + /* Activate this feature at the same time it is enabled */ + boolean_t fi_activate_on_enable; /* array of dependencies, terminated by SPA_FEATURE_NONE */ const spa_feature_t *fi_depends; } zfeature_info_t; @@ -70,6 +76,7 @@ extern boolean_t zfeature_is_valid_guid( extern boolean_t zfeature_is_supported(const char *); extern int zfeature_lookup_name(const char *name, spa_feature_t *res); +extern boolean_t zfeature_depends_on(spa_feature_t fid, spa_feature_t check); extern void zpool_feature_init(void); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Tue Dec 10 13:33:56 2013 (r259170) @@ -727,7 +727,7 @@ buf_hash(uint64_t spa, const dva_t *dva, #define BUF_EMPTY(buf) \ ((buf)->b_dva.dva_word[0] == 0 && \ (buf)->b_dva.dva_word[1] == 0 && \ - (buf)->b_birth == 0) + (buf)->b_cksum0 == 0) #define BUF_EQUAL(spa, dva, birth, buf) \ ((buf)->b_dva.dva_word[0] == (dva)->dva_word[0]) && \ @@ -3509,9 +3509,13 @@ arc_write_done(zio_t *zio) ASSERT(hdr->b_acb == NULL); if (zio->io_error == 0) { - hdr->b_dva = *BP_IDENTITY(zio->io_bp); - hdr->b_birth = BP_PHYSICAL_BIRTH(zio->io_bp); - hdr->b_cksum0 = zio->io_bp->blk_cksum.zc_word[0]; + if (BP_IS_HOLE(zio->io_bp)) { + buf_discard_identity(hdr); + } else { + hdr->b_dva = *BP_IDENTITY(zio->io_bp); + hdr->b_birth = BP_PHYSICAL_BIRTH(zio->io_bp); + hdr->b_cksum0 = zio->io_bp->blk_cksum.zc_word[0]; + } } else { ASSERT(BUF_EMPTY(hdr)); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c Tue Dec 10 13:33:56 2013 (r259170) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -141,7 +141,7 @@ bptree_visit_cb(spa_t *spa, zilog_t *zil int err; struct bptree_args *ba = arg; - if (bp == NULL) + if (BP_IS_HOLE(bp)) return (0); err = ba->ba_func(ba->ba_arg, bp, ba->ba_tx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Tue Dec 10 13:33:56 2013 (r259170) @@ -455,10 +455,9 @@ dbuf_loan_arcbuf(dmu_buf_impl_t *db) mutex_enter(&db->db_mtx); if (arc_released(db->db_buf) || refcount_count(&db->db_holds) > 1) { int blksz = db->db.db_size; - spa_t *spa; + spa_t *spa = db->db_objset->os_spa; mutex_exit(&db->db_mtx); - DB_GET_SPA(&spa, db); abuf = arc_loan_buf(spa, blksz); bcopy(db->db.db_data, abuf->b_data, blksz); } else { @@ -519,7 +518,6 @@ static void dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t *flags) { dnode_t *dn; - spa_t *spa; zbookmark_t zb; uint32_t aflags = ARC_NOWAIT; @@ -559,9 +557,9 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t BP_IS_HOLE(db->db_blkptr)))) { arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - dbuf_set_data(db, arc_buf_alloc(dn->dn_objset->os_spa, - db->db.db_size, db, type)); DB_DNODE_EXIT(db); + dbuf_set_data(db, arc_buf_alloc(db->db_objset->os_spa, + db->db.db_size, db, type)); bzero(db->db.db_data, db->db.db_size); db->db_state = DB_CACHED; *flags |= DB_RF_CACHED; @@ -569,7 +567,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t return; } - spa = dn->dn_objset->os_spa; DB_DNODE_EXIT(db); db->db_state = DB_READ; @@ -586,7 +583,7 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t dbuf_add_ref(db, NULL); - (void) arc_read(zio, spa, db->db_blkptr, + (void) arc_read(zio, db->db_objset->os_spa, db->db_blkptr, dbuf_read_done, db, ZIO_PRIORITY_SYNC_READ, (*flags & DB_RF_CANFAIL) ? ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED, &aflags, &zb); @@ -598,8 +595,8 @@ int dbuf_read(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags) { int err = 0; - int havepzio = (zio != NULL); - int prefetch; + boolean_t havepzio = (zio != NULL); + boolean_t prefetch; dnode_t *dn; /* @@ -694,11 +691,10 @@ dbuf_noread(dmu_buf_impl_t *db) cv_wait(&db->db_changed, &db->db_mtx); if (db->db_state == DB_UNCACHED) { arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - spa_t *spa; + spa_t *spa = db->db_objset->os_spa; ASSERT(db->db_buf == NULL); ASSERT(db->db.db_data == NULL); - DB_GET_SPA(&spa, db); dbuf_set_data(db, arc_buf_alloc(spa, db->db.db_size, db, type)); db->db_state = DB_FILL; } else if (db->db_state == DB_NOFILL) { @@ -753,9 +749,8 @@ dbuf_fix_old_data(dmu_buf_impl_t *db, ui } else if (refcount_count(&db->db_holds) > db->db_dirtycnt) { int size = db->db.db_size; arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - spa_t *spa; + spa_t *spa = db->db_objset->os_spa; - DB_GET_SPA(&spa, db); dr->dt.dl.dr_data = arc_buf_alloc(spa, size, db, type); bcopy(db->db.db_data, dr->dt.dl.dr_data->b_data, size); } else { @@ -781,12 +776,9 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) ASSERT(db->db_data_pending != dr); /* free this block */ - if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { - spa_t *spa; + if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) + zio_free(db->db_objset->os_spa, txg, bp); - DB_GET_SPA(&spa, db); - zio_free(spa, txg, bp); - } dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; dr->dt.dl.dr_nopwrite = B_FALSE; @@ -804,9 +796,7 @@ dbuf_unoverride(dbuf_dirty_record_t *dr) /* * Evict (if its unreferenced) or clear (if its referenced) any level-0 * data blocks in the free range, so that any future readers will find - * empty blocks. Also, if we happen across any level-1 dbufs in the - * range that have not already been marked dirty, mark them dirty so - * they stay in memory. + * empty blocks. * * This is a no-op if the dataset is in the middle of an incremental * receive; see comment below for details. @@ -816,14 +806,9 @@ dbuf_free_range(dnode_t *dn, uint64_t st { dmu_buf_impl_t *db, *db_next; uint64_t txg = tx->tx_txg; - int epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; - uint64_t first_l1 = start >> epbs; - uint64_t last_l1 = end >> epbs; - if (end > dn->dn_maxblkid && (end != DMU_SPILL_BLKID)) { + if (end > dn->dn_maxblkid && (end != DMU_SPILL_BLKID)) end = dn->dn_maxblkid; - last_l1 = end >> epbs; - } dprintf_dnode(dn, "start=%llu end=%llu\n", start, end); mutex_enter(&dn->dn_dbufs_mtx); @@ -846,23 +831,8 @@ dbuf_free_range(dnode_t *dn, uint64_t st db_next = list_next(&dn->dn_dbufs, db); ASSERT(db->db_blkid != DMU_BONUS_BLKID); - if (db->db_level == 1 && - db->db_blkid >= first_l1 && db->db_blkid <= last_l1) { - mutex_enter(&db->db_mtx); - if (db->db_last_dirty && - db->db_last_dirty->dr_txg < txg) { - dbuf_add_ref(db, FTAG); - mutex_exit(&db->db_mtx); - dbuf_will_dirty(db, tx); - dbuf_rele(db, FTAG); - } else { - mutex_exit(&db->db_mtx); - } - } - if (db->db_level != 0) continue; - dprintf_dbuf(db, "found buf %s\n", ""); if (db->db_blkid < start || db->db_blkid > end) continue; @@ -939,24 +909,29 @@ dbuf_block_freeable(dmu_buf_impl_t *db) * We don't need any locking to protect db_blkptr: * If it's syncing, then db_last_dirty will be set * so we'll ignore db_blkptr. + * + * This logic ensures that only block births for + * filled blocks are considered. */ ASSERT(MUTEX_HELD(&db->db_mtx)); - if (db->db_last_dirty) + if (db->db_last_dirty && (db->db_blkptr == NULL || + !BP_IS_HOLE(db->db_blkptr))) { birth_txg = db->db_last_dirty->dr_txg; - else if (db->db_blkptr) + } else if (db->db_blkptr != NULL && !BP_IS_HOLE(db->db_blkptr)) { birth_txg = db->db_blkptr->blk_birth; + } /* - * If we don't exist or are in a snapshot, we can't be freed. + * If this block don't exist or is in a snapshot, it can't be freed. * Don't pass the bp to dsl_dataset_block_freeable() since we * are holding the db_mtx lock and might deadlock if we are * prefetching a dedup-ed block. */ - if (birth_txg) + if (birth_txg != 0) return (ds == NULL || dsl_dataset_block_freeable(ds, NULL, birth_txg)); else - return (FALSE); + return (B_FALSE); } void @@ -976,7 +951,7 @@ dbuf_new_size(dmu_buf_impl_t *db, int si ASSERT(RW_WRITE_HELD(&dn->dn_struct_rwlock)); /* - * This call to dbuf_will_dirty() with the dn_struct_rwlock held + * This call to dmu_buf_will_dirty() with the dn_struct_rwlock held * is OK, because there can be no other references to the db * when we are changing its size, so no concurrent DB_FILL can * be happening. @@ -985,7 +960,7 @@ dbuf_new_size(dmu_buf_impl_t *db, int si * XXX we should be doing a dbuf_read, checking the return * value and returning that up to our callers */ - dbuf_will_dirty(db, tx); + dmu_buf_will_dirty(&db->db, tx); /* create the data buffer for the new block */ buf = arc_buf_alloc(dn->dn_objset->os_spa, size, db, type); @@ -1015,9 +990,8 @@ dbuf_new_size(dmu_buf_impl_t *db, int si void dbuf_release_bp(dmu_buf_impl_t *db) { - objset_t *os; + objset_t *os = db->db_objset; - DB_GET_OBJSET(&os, db); ASSERT(dsl_pool_sync_context(dmu_objset_pool(os))); ASSERT(arc_released(os->os_phys_buf) || list_link_active(&os->os_dsl_dataset->ds_synced_link)); @@ -1391,10 +1365,10 @@ dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_ return (B_FALSE); } -#pragma weak dmu_buf_will_dirty = dbuf_will_dirty void -dbuf_will_dirty(dmu_buf_impl_t *db, dmu_tx_t *tx) +dmu_buf_will_dirty(dmu_buf_t *db_fake, dmu_tx_t *tx) { + dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; int rf = DB_RF_MUST_SUCCEED | DB_RF_NOPREFETCH; ASSERT(tx->tx_txg != 0); @@ -1517,7 +1491,7 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a db->db_state = DB_FILL; mutex_exit(&db->db_mtx); (void) dbuf_dirty(db, tx); - dbuf_fill_done(db, tx); + dmu_buf_fill_done(&db->db, tx); } /* @@ -2022,7 +1996,6 @@ dbuf_add_ref(dmu_buf_impl_t *db, void *t * Without that, the dbuf_rele() could lead to a dnode_rele() followed by the * dnode's parent dbuf evicting its dnode handles. */ -#pragma weak dmu_buf_rele = dbuf_rele void dbuf_rele(dmu_buf_impl_t *db, void *tag) { @@ -2030,6 +2003,12 @@ dbuf_rele(dmu_buf_impl_t *db, void *tag) dbuf_rele_and_unlock(db, tag); } +void +dmu_buf_rele(dmu_buf_t *db, void *tag) +{ + dbuf_rele((dmu_buf_impl_t *)db, tag); +} + /* * dbuf_rele() for an already-locked dbuf. This is necessary to allow * db_dirtycnt and db_holds to be updated atomically. @@ -2476,18 +2455,14 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * dnode_diduse_space(dn, delta - zio->io_prev_space_delta); zio->io_prev_space_delta = delta; - if (BP_IS_HOLE(bp)) { - ASSERT(bp->blk_fill == 0); - DB_DNODE_EXIT(db); - return; + if (bp->blk_birth != 0) { + ASSERT((db->db_blkid != DMU_SPILL_BLKID && + BP_GET_TYPE(bp) == dn->dn_type) || + (db->db_blkid == DMU_SPILL_BLKID && + BP_GET_TYPE(bp) == dn->dn_bonustype)); + ASSERT(BP_GET_LEVEL(bp) == db->db_level); } - ASSERT((db->db_blkid != DMU_SPILL_BLKID && - BP_GET_TYPE(bp) == dn->dn_type) || - (db->db_blkid == DMU_SPILL_BLKID && - BP_GET_TYPE(bp) == dn->dn_bonustype)); - ASSERT(BP_GET_LEVEL(bp) == db->db_level); - mutex_enter(&db->db_mtx); #ifdef ZFS_DEBUG @@ -2513,7 +2488,11 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * fill++; } } else { - fill = 1; + if (BP_IS_HOLE(bp)) { + fill = 0; + } else { + fill = 1; + } } } else { blkptr_t *ibp = db->db.db_data; @@ -2568,9 +2547,10 @@ static void dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb) { dmu_buf_impl_t *db = vdb; - blkptr_t *bp = zio->io_bp; blkptr_t *bp_orig = &zio->io_bp_orig; - uint64_t txg = zio->io_txg; + blkptr_t *bp = db->db_blkptr; + objset_t *os = db->db_objset; + dmu_tx_t *tx = os->os_synctx; dbuf_dirty_record_t **drp, *dr; ASSERT0(zio->io_error); @@ -2583,14 +2563,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { ASSERT(BP_EQUAL(bp, bp_orig)); } else { - objset_t *os; - dsl_dataset_t *ds; - dmu_tx_t *tx; - - DB_GET_OBJSET(&os, db); - ds = os->os_dsl_dataset; - tx = os->os_synctx; - + dsl_dataset_t *ds = os->os_dsl_dataset; (void) dsl_dataset_block_kill(ds, bp_orig, tx, B_TRUE); dsl_dataset_block_born(ds, bp, tx); } @@ -2603,7 +2576,6 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b while ((dr = *drp) != db->db_data_pending) drp = &dr->dr_next; ASSERT(!list_link_active(&dr->dr_dirty_node)); - ASSERT(dr->dr_txg == txg); ASSERT(dr->dr_dbuf == db); ASSERT(dr->dr_next == NULL); *drp = dr->dr_next; @@ -2637,14 +2609,14 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b DB_DNODE_ENTER(db); dn = DB_DNODE(db); ASSERT(list_head(&dr->dt.di.dr_children) == NULL); - ASSERT3U(db->db.db_size, ==, 1<dn_phys->dn_indblkshift); + ASSERT3U(db->db.db_size, ==, 1 << dn->dn_phys->dn_indblkshift); if (!BP_IS_HOLE(db->db_blkptr)) { int epbs = dn->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT; + ASSERT3U(db->db_blkid, <=, + dn->dn_phys->dn_maxblkid >> (db->db_level * epbs)); ASSERT3U(BP_GET_LSIZE(db->db_blkptr), ==, db->db.db_size); - ASSERT3U(dn->dn_phys->dn_maxblkid - >> (db->db_level * epbs), >=, db->db_blkid); arc_set_callback(db->db_buf, dbuf_do_evict, db); } DB_DNODE_EXIT(db); @@ -2657,8 +2629,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *b ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1; db->db_data_pending = NULL; - - dbuf_rele_and_unlock(db, (void *)(uintptr_t)txg); + dbuf_rele_and_unlock(db, (void *)(uintptr_t)tx->tx_txg); } static void Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/ddt.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/ddt.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/ddt.c Tue Dec 10 13:33:56 2013 (r259170) @@ -111,12 +111,12 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ error = zap_lookup(ddt->ddt_os, DMU_POOL_DIRECTORY_OBJECT, name, sizeof (uint64_t), 1, &ddt->ddt_object[type][class]); - if (error) + if (error != 0) return (error); - error = zap_lookup(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name, + VERIFY0(zap_lookup(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name, sizeof (uint64_t), sizeof (ddt_histogram_t) / sizeof (uint64_t), - &ddt->ddt_histogram[type][class]); + &ddt->ddt_histogram[type][class])); /* * Seed the cached statistics. @@ -127,8 +127,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; - ASSERT(error == 0); - return (error); + return (0); } static void @@ -581,7 +580,10 @@ ddt_compress(void *src, uchar_t *dst, si bcopy(src, dst, s_len); } - *version = (ZFS_HOST_BYTEORDER & DDT_COMPRESS_BYTEORDER_MASK) | cpfunc; + *version = cpfunc; + /* CONSTCOND */ + if (ZFS_HOST_BYTEORDER) + *version |= DDT_COMPRESS_BYTEORDER_MASK; return (c_len + 1); } @@ -598,7 +600,8 @@ ddt_decompress(uchar_t *src, void *dst, else bcopy(src, dst, d_len); - if ((version ^ ZFS_HOST_BYTEORDER) & DDT_COMPRESS_BYTEORDER_MASK) + if (((version & DDT_COMPRESS_BYTEORDER_MASK) != 0) != + (ZFS_HOST_BYTEORDER != 0)) byteswap_uint64_array(dst, d_len); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Tue Dec 10 13:33:56 2013 (r259170) @@ -680,7 +680,7 @@ dmu_free_long_range(objset_t *os, uint64 * will take the fast path, and (b) dnode_reallocate() can verify * that the entire file has been freed. */ - if (offset == 0 && length == DMU_OBJECT_END) + if (err == 0 && offset == 0 && length == DMU_OBJECT_END) dn->dn_maxblkid = 0; dnode_rele(dn, FTAG); @@ -1184,10 +1184,8 @@ arc_buf_t * dmu_request_arcbuf(dmu_buf_t *handle, int size) { dmu_buf_impl_t *db = (dmu_buf_impl_t *)handle; - spa_t *spa; - DB_GET_SPA(&spa, db); - return (arc_loan_buf(spa, size)); + return (arc_loan_buf(db->db_objset->os_spa, size)); } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Tue Dec 10 13:33:56 2013 (r259170) @@ -118,7 +118,7 @@ diff_cb(spa_t *spa, zilog_t *zilog, cons if (zb->zb_object != DMU_META_DNODE_OBJECT) return (0); - if (bp == NULL) { + if (BP_IS_HOLE(bp)) { uint64_t span = DBP_SPAN(dnp, zb->zb_level); uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Tue Dec 10 13:33:56 2013 (r259170) @@ -356,11 +356,12 @@ backup_cb(spa_t *spa, zilog_t *zilog, co if (zb->zb_object != DMU_META_DNODE_OBJECT && DMU_OBJECT_IS_SPECIAL(zb->zb_object)) { return (0); - } else if (bp == NULL && zb->zb_object == DMU_META_DNODE_OBJECT) { + } else if (BP_IS_HOLE(bp) && + zb->zb_object == DMU_META_DNODE_OBJECT) { uint64_t span = BP_SPAN(dnp, zb->zb_level); uint64_t dnobj = (zb->zb_blkid * span) >> DNODE_SHIFT; err = dump_freeobjects(dsp, dnobj, span >> DNODE_SHIFT); - } else if (bp == NULL) { + } else if (BP_IS_HOLE(bp)) { uint64_t span = BP_SPAN(dnp, zb->zb_level); err = dump_free(dsp, zb->zb_object, zb->zb_blkid * span, span); } else if (zb->zb_level > 0 || type == DMU_OT_OBJSET) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Tue Dec 10 13:33:56 2013 (r259170) @@ -36,6 +36,7 @@ #include #include #include +#include int zfs_pd_blks_max = 100; @@ -72,7 +73,7 @@ traverse_zil_block(zilog_t *zilog, blkpt traverse_data_t *td = arg; zbookmark_t zb; - if (bp->blk_birth == 0) + if (BP_IS_HOLE(bp)) return (0); if (claim_txg == 0 && bp->blk_birth >= spa_first_txg(td->td_spa)) @@ -96,7 +97,7 @@ traverse_zil_record(zilog_t *zilog, lr_t blkptr_t *bp = &lr->lr_blkptr; zbookmark_t zb; - if (bp->blk_birth == 0) + if (BP_IS_HOLE(bp)) return (0); if (claim_txg == 0 || bp->blk_birth < claim_txg) @@ -226,14 +227,35 @@ traverse_visitbp(traverse_data_t *td, co ASSERT(0); } + if (bp->blk_birth == 0) { + if (spa_feature_is_active(td->td_spa, SPA_FEATURE_HOLE_BIRTH)) { + /* + * Since this block has a birth time of 0 it must be a + * hole created before the SPA_FEATURE_HOLE_BIRTH + * feature was enabled. If SPA_FEATURE_HOLE_BIRTH + * was enabled before the min_txg for this traveral we + * know the hole must have been created before the + * min_txg for this traveral, so we can skip it. If + * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg + * for this traveral we cannot tell if the hole was + * created before or after the min_txg for this + * traversal, so we cannot skip it. + */ + uint64_t hole_birth_enabled_txg; + VERIFY(spa_feature_enabled_txg(td->td_spa, + SPA_FEATURE_HOLE_BIRTH, &hole_birth_enabled_txg)); + if (hole_birth_enabled_txg < td->td_min_txg) + return (0); + } + } else if (bp->blk_birth <= td->td_min_txg) { + return (0); + } + if (BP_IS_HOLE(bp)) { - err = td->td_func(td->td_spa, NULL, NULL, zb, dnp, td->td_arg); + err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); return (err); } - if (bp->blk_birth <= td->td_min_txg) - return (0); - if (pd && !pd->pd_exited && ((pd->pd_flags & TRAVERSE_PREFETCH_DATA) || BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0)) { @@ -436,7 +458,8 @@ traverse_prefetcher(spa_t *spa, zilog_t if (pfd->pd_cancel) return (SET_ERROR(EINTR)); - if (bp == NULL || !((pfd->pd_flags & TRAVERSE_PREFETCH_DATA) || + if (BP_IS_HOLE(bp) || + !((pfd->pd_flags & TRAVERSE_PREFETCH_DATA) || BP_GET_TYPE(bp) == DMU_OT_DNODE || BP_GET_LEVEL(bp) > 0) || BP_GET_TYPE(bp) == DMU_OT_INTENT_LOG) return (0); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Tue Dec 10 13:33:56 2013 (r259170) @@ -1544,7 +1544,13 @@ dnode_free_range(dnode_t *dn, uint64_t o } else { ASSERT(dn->dn_maxblkid == 0); if (off == 0 && len >= blksz) { - /* Freeing the whole block; fast-track this request */ + /* + * Freeing the whole block; fast-track this request. + * Note that we won't dirty any indirect blocks, + * which is fine because we will be freeing the entire + * file and thus all indirect blocks will be freed + * by free_children(). + */ blkid = 0; nblks = 1; goto done; @@ -1571,7 +1577,7 @@ dnode_free_range(dnode_t *dn, uint64_t o if (db->db_last_dirty || (db->db_blkptr && !BP_IS_HOLE(db->db_blkptr))) { rw_exit(&dn->dn_struct_rwlock); - dbuf_will_dirty(db, tx); + dmu_buf_will_dirty(&db->db, tx); rw_enter(&dn->dn_struct_rwlock, RW_WRITER); data = db->db.db_data; bzero(data + blkoff, head); @@ -1607,7 +1613,7 @@ dnode_free_range(dnode_t *dn, uint64_t o if (db->db_last_dirty || (db->db_blkptr && !BP_IS_HOLE(db->db_blkptr))) { rw_exit(&dn->dn_struct_rwlock); - dbuf_will_dirty(db, tx); + dmu_buf_will_dirty(&db->db, tx); rw_enter(&dn->dn_struct_rwlock, RW_WRITER); bzero(db->db.db_data, tail); } @@ -1628,18 +1634,18 @@ dnode_free_range(dnode_t *dn, uint64_t o nblks += 1; /* - * Read in and mark all the level-1 indirects dirty, - * so that they will stay in memory until syncing phase. - * Always dirty the first and last indirect to make sure - * we dirty all the partial indirects. + * Dirty the first and last indirect blocks, as they (and/or their + * parents) will need to be written out if they were only + * partially freed. Interior indirect blocks will be themselves freed, + * by free_children(), so they need not be dirtied. Note that these + * interior blocks have already been prefetched by dmu_tx_hold_free(). */ if (dn->dn_nlevels > 1) { - uint64_t i, first, last; - int shift = epbs + dn->dn_datablkshift; + uint64_t first, last; first = blkid >> epbs; if (db = dbuf_hold_level(dn, 1, first, FTAG)) { - dbuf_will_dirty(db, tx); + dmu_buf_will_dirty(&db->db, tx); dbuf_rele(db, FTAG); } if (trunc) @@ -1647,26 +1653,11 @@ dnode_free_range(dnode_t *dn, uint64_t o else last = (blkid + nblks - 1) >> epbs; if (last > first && (db = dbuf_hold_level(dn, 1, last, FTAG))) { - dbuf_will_dirty(db, tx); + dmu_buf_will_dirty(&db->db, tx); dbuf_rele(db, FTAG); } - for (i = first + 1; i < last; i++) { - uint64_t ibyte = i << shift; - int err; - - err = dnode_next_offset(dn, - DNODE_FIND_HAVELOCK, &ibyte, 1, 1, 0); - i = ibyte >> shift; - if (err == ESRCH || i >= last) - break; - ASSERT(err == 0); - db = dbuf_hold_level(dn, 1, i, FTAG); - if (db) { - dbuf_will_dirty(db, tx); - dbuf_rele(db, FTAG); - } - } } + done: /* * Add this range to the dnode range list. @@ -1694,8 +1685,6 @@ done: dbuf_free_range(dn, blkid, blkid + nblks - 1, tx); dnode_setdirty(dn, tx); out: - if (trunc && dn->dn_maxblkid >= (off >> blkshift)) - dn->dn_maxblkid = (off >> blkshift ? (off >> blkshift) - 1 : 0); rw_exit(&dn->dn_struct_rwlock); } @@ -1872,8 +1861,10 @@ dnode_next_offset_level(dnode_t *dn, int data = db->db.db_data; } - if (db && txg && - (db->db_blkptr == NULL || db->db_blkptr->blk_birth <= txg)) { + + if (db != NULL && txg != 0 && (db->db_blkptr == NULL || + db->db_blkptr->blk_birth <= txg || + BP_IS_HOLE(db->db_blkptr))) { /* * This can only happen when we are searching up the tree * and these conditions mean that we need to keep climbing. Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Tue Dec 10 13:33:56 2013 (r259170) @@ -32,6 +32,7 @@ #include #include #include +#include static void dnode_increase_indirection(dnode_t *dn, dmu_tx_t *tx) @@ -112,26 +113,44 @@ dnode_increase_indirection(dnode_t *dn, rw_exit(&dn->dn_struct_rwlock); } -static int +static void free_blocks(dnode_t *dn, blkptr_t *bp, int num, dmu_tx_t *tx) { dsl_dataset_t *ds = dn->dn_objset->os_dsl_dataset; uint64_t bytesfreed = 0; - int i, blocks_freed = 0; dprintf("ds=%p obj=%llx num=%d\n", ds, dn->dn_object, num); - for (i = 0; i < num; i++, bp++) { + for (int i = 0; i < num; i++, bp++) { if (BP_IS_HOLE(bp)) continue; bytesfreed += dsl_dataset_block_kill(ds, bp, tx, B_FALSE); ASSERT3U(bytesfreed, <=, DN_USED_BYTES(dn->dn_phys)); + + /* + * Save some useful information on the holes being + * punched, including logical size, type, and indirection + * level. Retaining birth time enables detection of when + * holes are punched for reducing the number of free + * records transmitted during a zfs send. + */ + + uint64_t lsize = BP_GET_LSIZE(bp); + dmu_object_type_t type = BP_GET_TYPE(bp); + uint64_t lvl = BP_GET_LEVEL(bp); + bzero(bp, sizeof (blkptr_t)); - blocks_freed += 1; + + if (spa_feature_is_active(dn->dn_objset->os_spa, + SPA_FEATURE_HOLE_BIRTH)) { + BP_SET_LSIZE(bp, lsize); + BP_SET_TYPE(bp, type); + BP_SET_LEVEL(bp, lvl); + BP_SET_BIRTH(bp, dmu_tx_get_txg(tx), 0); + } } dnode_diduse_space(dn, -bytesfreed); - return (blocks_freed); } #ifdef ZFS_DEBUG @@ -215,30 +234,27 @@ free_verify(dmu_buf_impl_t *db, uint64_t #define ALL -1 -static int -free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks, int trunc, +static void +free_children(dmu_buf_impl_t *db, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx) { dnode_t *dn; blkptr_t *bp; dmu_buf_impl_t *subdb; uint64_t start, end, dbstart, dbend, i; - int epbs, shift, err; - int all = TRUE; - int blocks_freed = 0; + int epbs, shift; /* * There is a small possibility that this block will not be cached: * 1 - if level > 1 and there are no children with level <= 1 - * 2 - if we didn't get a dirty hold (because this block had just - * finished being written -- and so had no holds), and then this - * block got evicted before we got here. + * 2 - if this block was evicted since we read it from + * dmu_tx_hold_free(). */ if (db->db_state != DB_CACHED) (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED); dbuf_release_bp(db); - bp = (blkptr_t *)db->db.db_data; + bp = db->db.db_data; DB_DNODE_ENTER(db); dn = DB_DNODE(db); @@ -248,7 +264,6 @@ free_children(dmu_buf_impl_t *db, uint64 start = blkid >> shift; if (dbstart < start) { bp += start - dbstart; - all = FALSE; } else { start = dbstart; } @@ -256,49 +271,46 @@ free_children(dmu_buf_impl_t *db, uint64 end = (blkid + nblks - 1) >> shift; if (dbend <= end) end = dbend; - else if (all) - all = trunc; + ASSERT3U(start, <=, end); if (db->db_level == 1) { FREE_VERIFY(db, start, end, tx); - blocks_freed = free_blocks(dn, bp, end-start+1, tx); - arc_buf_freeze(db->db_buf); - ASSERT(all || blocks_freed == 0 || db->db_last_dirty); - DB_DNODE_EXIT(db); - return (all ? ALL : blocks_freed); + free_blocks(dn, bp, end-start+1, tx); + } else { + for (i = start; i <= end; i++, bp++) { + if (BP_IS_HOLE(bp)) + continue; + rw_enter(&dn->dn_struct_rwlock, RW_READER); + VERIFY0(dbuf_hold_impl(dn, db->db_level - 1, + i, B_TRUE, FTAG, &subdb)); + rw_exit(&dn->dn_struct_rwlock); + ASSERT3P(bp, ==, subdb->db_blkptr); + + free_children(subdb, blkid, nblks, tx); + dbuf_rele(subdb, FTAG); + } } - for (i = start; i <= end; i++, bp++) { - if (BP_IS_HOLE(bp)) - continue; - rw_enter(&dn->dn_struct_rwlock, RW_READER); - err = dbuf_hold_impl(dn, db->db_level-1, i, TRUE, FTAG, &subdb); - ASSERT0(err); - rw_exit(&dn->dn_struct_rwlock); - - if (free_children(subdb, blkid, nblks, trunc, tx) == ALL) { - ASSERT3P(subdb->db_blkptr, ==, bp); - blocks_freed += free_blocks(dn, bp, 1, tx); - } else { - all = FALSE; - } - dbuf_rele(subdb, FTAG); + /* If this whole block is free, free ourself too. */ + for (i = 0, bp = db->db.db_data; i < 1 << epbs; i++, bp++) { + if (!BP_IS_HOLE(bp)) + break; } + if (i == 1 << epbs) { + /* didn't find any non-holes */ + bzero(db->db.db_data, db->db.db_size); + free_blocks(dn, db->db_blkptr, 1, tx); + } else { + /* + * Partial block free; must be marked dirty so that it + * will be written out. + */ + ASSERT(db->db_dirtycnt > 0); + } + DB_DNODE_EXIT(db); arc_buf_freeze(db->db_buf); -#ifdef ZFS_DEBUG - bp -= (end-start)+1; - for (i = start; i <= end; i++, bp++) { - if (i == start && blkid != 0) - continue; - else if (i == end && !trunc) - continue; - ASSERT0(bp->blk_birth); - } -#endif - ASSERT(all || blocks_freed == 0 || db->db_last_dirty); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:34:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F25862C7; Tue, 10 Dec 2013 13:33:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB5BB1C9F; Tue, 10 Dec 2013 13:33:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADXxOi052631; Tue, 10 Dec 2013 13:33:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADXxND052625; Tue, 10 Dec 2013 13:33:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201312101333.rBADXxND052625@svn.freebsd.org> From: Andriy Gapon Date: Tue, 10 Dec 2013 13:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r259170 - vendor-sys/illumos/dist/common/zfs vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb vendor/illumos/dist/cmd/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:34:00 -0000 Author: avg Date: Tue Dec 10 13:33:56 2013 New Revision: 259170 URL: http://svnweb.freebsd.org/changeset/base/259170 Log: 4370 avoid transmitting holes during zfs send 4371 DMU code clean up illumos/illumos-gate@43466aae47bfcd2ad9bf501faec8e75c08095e4f Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/cmd/zdb/zdb_il.c vendor/illumos/dist/cmd/zhack/zhack.c vendor/illumos/dist/man/man5/zpool-features.5 Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/common/zfs/zfeature_common.c vendor-sys/illumos/dist/common/zfs/zfeature_common.h vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/bptree.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/ddt.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfeature.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_cache.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_disk.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfeature.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/fs/zfs/zvol.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor/illumos/dist/cmd/zdb/zdb.c Tue Dec 10 13:33:56 2013 (r259170) @@ -764,7 +764,7 @@ dump_dde(const ddt_t *ddt, const ddt_ent if (ddp->ddp_phys_birth == 0) continue; ddt_bp_create(ddt->ddt_checksum, ddk, ddp, &blk); - sprintf_blkptr(blkbuf, &blk); + snprintf_blkptr(blkbuf, sizeof (blkbuf), &blk); (void) printf("index %llx refcnt %llu %s %s\n", (u_longlong_t)index, (u_longlong_t)ddp->ddp_refcnt, types[p], blkbuf); @@ -1022,31 +1022,39 @@ blkid2offset(const dnode_phys_t *dnp, co } static void -sprintf_blkptr_compact(char *blkbuf, const blkptr_t *bp) +snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp) { const dva_t *dva = bp->blk_dva; int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1; if (dump_opt['b'] >= 6) { - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, buflen, bp); return; } blkbuf[0] = '\0'; for (int i = 0; i < ndvas; i++) - (void) sprintf(blkbuf + strlen(blkbuf), "%llu:%llx:%llx ", + (void) snprintf(blkbuf + strlen(blkbuf), + buflen - strlen(blkbuf), "%llu:%llx:%llx ", (u_longlong_t)DVA_GET_VDEV(&dva[i]), (u_longlong_t)DVA_GET_OFFSET(&dva[i]), (u_longlong_t)DVA_GET_ASIZE(&dva[i])); - (void) sprintf(blkbuf + strlen(blkbuf), - "%llxL/%llxP F=%llu B=%llu/%llu", - (u_longlong_t)BP_GET_LSIZE(bp), - (u_longlong_t)BP_GET_PSIZE(bp), - (u_longlong_t)bp->blk_fill, - (u_longlong_t)bp->blk_birth, - (u_longlong_t)BP_PHYSICAL_BIRTH(bp)); + if (BP_IS_HOLE(bp)) { + (void) snprintf(blkbuf + strlen(blkbuf), + buflen - strlen(blkbuf), "B=%llu", + (u_longlong_t)bp->blk_birth); + } else { + (void) snprintf(blkbuf + strlen(blkbuf), + buflen - strlen(blkbuf), + "%llxL/%llxP F=%llu B=%llu/%llu", + (u_longlong_t)BP_GET_LSIZE(bp), + (u_longlong_t)BP_GET_PSIZE(bp), + (u_longlong_t)bp->blk_fill, + (u_longlong_t)bp->blk_birth, + (u_longlong_t)BP_PHYSICAL_BIRTH(bp)); + } } static void @@ -1071,7 +1079,7 @@ print_indirect(blkptr_t *bp, const zbook } } - sprintf_blkptr_compact(blkbuf, bp); + snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), bp); (void) printf("%s\n", blkbuf); } @@ -1086,7 +1094,7 @@ visit_indirect(spa_t *spa, const dnode_p print_indirect(bp, zb, dnp); - if (BP_GET_LEVEL(bp) > 0) { + if (BP_GET_LEVEL(bp) > 0 && !BP_IS_HOLE(bp)) { uint32_t flags = ARC_WAIT; int i; blkptr_t *cbp; @@ -1211,7 +1219,7 @@ dump_dsl_dataset(objset_t *os, uint64_t zdb_nicenum(ds->ds_compressed_bytes, compressed); zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed); zdb_nicenum(ds->ds_unique_bytes, unique); - sprintf_blkptr(blkbuf, &ds->ds_bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), &ds->ds_bp); (void) printf("\t\tdir_obj = %llu\n", (u_longlong_t)ds->ds_dir_obj); @@ -1256,7 +1264,7 @@ dump_bptree_cb(void *arg, const blkptr_t char blkbuf[BP_SPRINTF_LEN]; if (bp->blk_birth != 0) { - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("\t%s\n", blkbuf); } return (0); @@ -1294,7 +1302,7 @@ dump_bpobj_cb(void *arg, const blkptr_t char blkbuf[BP_SPRINTF_LEN]; ASSERT(bp->blk_birth != 0); - sprintf_blkptr_compact(blkbuf, bp); + snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), bp); (void) printf("\t%s\n", blkbuf); return (0); } @@ -1793,8 +1801,9 @@ dump_dir(objset_t *os) zdb_nicenum(refdbytes, numbuf); if (verbosity >= 4) { - (void) sprintf(blkbuf, ", rootbp "); - (void) sprintf_blkptr(blkbuf + strlen(blkbuf), os->os_rootbp); + (void) snprintf(blkbuf, sizeof (blkbuf), ", rootbp "); + (void) snprintf_blkptr(blkbuf + strlen(blkbuf), + sizeof (blkbuf) - strlen(blkbuf), os->os_rootbp); } else { blkbuf[0] = '\0'; } @@ -1824,7 +1833,7 @@ dump_dir(objset_t *os) if (verbosity < 2) return; - if (os->os_rootbp->blk_birth == 0) + if (BP_IS_HOLE(os->os_rootbp)) return; dump_object(os, 0, verbosity, &print_header); @@ -1865,7 +1874,7 @@ dump_uberblock(uberblock_t *ub, const ch (u_longlong_t)ub->ub_timestamp, asctime(localtime(×tamp))); if (dump_opt['u'] >= 3) { char blkbuf[BP_SPRINTF_LEN]; - sprintf_blkptr(blkbuf, &ub->ub_rootbp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), &ub->ub_rootbp); (void) printf("\trootbp = %s\n", blkbuf); } (void) printf(footer ? footer : ""); @@ -2202,7 +2211,7 @@ zdb_blkptr_done(zio_t *zio) zcb->zcb_errors[ioerr]++; if (dump_opt['b'] >= 2) - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); else blkbuf[0] = '\0'; @@ -2224,11 +2233,22 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog const zbookmark_t *zb, const dnode_phys_t *dnp, void *arg) { zdb_cb_t *zcb = arg; - char blkbuf[BP_SPRINTF_LEN]; dmu_object_type_t type; boolean_t is_metadata; - if (bp == NULL) + if (dump_opt['b'] >= 5 && bp->blk_birth > 0) { + char blkbuf[BP_SPRINTF_LEN]; + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); + (void) printf("objset %llu object %llu " + "level %lld offset 0x%llx %s\n", + (u_longlong_t)zb->zb_objset, + (u_longlong_t)zb->zb_object, + (longlong_t)zb->zb_level, + (u_longlong_t)blkid2offset(dnp, bp, zb), + blkbuf); + } + + if (BP_IS_HOLE(bp)) return (0); type = BP_GET_TYPE(bp); @@ -2259,17 +2279,6 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] >= 5) { - sprintf_blkptr(blkbuf, bp); - (void) printf("objset %llu object %llu " - "level %lld offset 0x%llx %s\n", - (u_longlong_t)zb->zb_objset, - (u_longlong_t)zb->zb_object, - (longlong_t)zb->zb_level, - (u_longlong_t)blkid2offset(dnp, bp, zb), - blkbuf); - } - if (dump_opt['b'] < 5 && isatty(STDERR_FILENO) && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); @@ -2426,7 +2435,7 @@ count_block_cb(void *arg, const blkptr_t if (dump_opt['b'] >= 5) { char blkbuf[BP_SPRINTF_LEN]; - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("[%s] %s\n", "deferred free", blkbuf); } @@ -2673,7 +2682,7 @@ zdb_ddt_add_cb(spa_t *spa, zilog_t *zilo avl_index_t where; zdb_ddt_entry_t *zdde, zdde_search; - if (bp == NULL) + if (BP_IS_HOLE(bp)) return (0); if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) { @@ -2840,7 +2849,7 @@ zdb_print_blkptr(blkptr_t *bp, int flags if (flags & ZDB_FLAG_BSWAP) byteswap_uint64_array((void *)bp, sizeof (blkptr_t)); - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("%s\n", blkbuf); } Modified: vendor/illumos/dist/cmd/zdb/zdb_il.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb_il.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor/illumos/dist/cmd/zdb/zdb_il.c Tue Dec 10 13:33:56 2013 (r259170) @@ -24,6 +24,10 @@ */ /* + * Copyright (c) 2013 by Delphix. All rights reserved. + */ + +/* * Print intent log header and statistics. */ @@ -47,7 +51,7 @@ print_log_bp(const blkptr_t *bp, const c { char blkbuf[BP_SPRINTF_LEN]; - sprintf_blkptr(blkbuf, bp); + snprintf_blkptr(blkbuf, sizeof (blkbuf), bp); (void) printf("%s%s\n", prefix, blkbuf); } @@ -132,6 +136,7 @@ zil_prt_rec_write(zilog_t *zilog, int tx if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) { (void) printf("%shas blkptr, %s\n", prefix, + !BP_IS_HOLE(bp) && bp->blk_birth >= spa_first_txg(zilog->zl_spa) ? "will claim" : "won't claim"); print_log_bp(bp, prefix); @@ -139,8 +144,6 @@ zil_prt_rec_write(zilog_t *zilog, int tx if (BP_IS_HOLE(bp)) { (void) printf("\t\t\tLSIZE 0x%llx\n", (u_longlong_t)BP_GET_LSIZE(bp)); - } - if (bp->blk_birth == 0) { bzero(buf, sizeof (buf)); (void) printf("%s\n", prefix); return; @@ -313,7 +316,8 @@ print_log_block(zilog_t *zilog, blkptr_t if (verbose >= 5) { (void) strcpy(blkbuf, ", "); - sprintf_blkptr(blkbuf + strlen(blkbuf), bp); + snprintf_blkptr(blkbuf + strlen(blkbuf), + sizeof (blkbuf) - strlen(blkbuf), bp); } else { blkbuf[0] = '\0'; } @@ -361,7 +365,7 @@ dump_intent_log(zilog_t *zilog) int verbose = MAX(dump_opt['d'], dump_opt['i']); int i; - if (zh->zh_log.blk_birth == 0 || verbose < 1) + if (BP_IS_HOLE(&zh->zh_log) || verbose < 1) return; (void) printf("\n ZIL header: claim_txg %llu, " Modified: vendor/illumos/dist/cmd/zhack/zhack.c ============================================================================== --- vendor/illumos/dist/cmd/zhack/zhack.c Tue Dec 10 13:14:54 2013 (r259169) +++ vendor/illumos/dist/cmd/zhack/zhack.c Tue Dec 10 13:33:56 2013 (r259170) @@ -277,6 +277,9 @@ zhack_do_feature_stat(int argc, char **a dump_obj(os, spa->spa_feat_for_read_obj, "for_read"); dump_obj(os, spa->spa_feat_for_write_obj, "for_write"); dump_obj(os, spa->spa_feat_desc_obj, "descriptions"); + if (spa_feature_is_active(spa, SPA_FEATURE_ENABLED_TXG)) { + dump_obj(os, spa->spa_feat_enabled_txg_obj, "enabled_txg"); + } dump_mos(spa); spa_close(spa, FTAG); @@ -313,7 +316,9 @@ zhack_do_feature_enable(int argc, char * feature.fi_uname = "zhack"; feature.fi_mos = B_FALSE; feature.fi_can_readonly = B_FALSE; + feature.fi_activate_on_enable = B_FALSE; feature.fi_depends = nodeps; + feature.fi_feature = SPA_FEATURE_NONE; optind = 1; while ((c = getopt(argc, argv, "rmd:")) != -1) { @@ -371,7 +376,7 @@ feature_incr_sync(void *arg, dmu_tx_t *t zfeature_info_t *feature = arg; uint64_t refcount; - VERIFY0(feature_get_refcount(spa, feature, &refcount)); + VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount)); feature_sync(spa, feature, refcount + 1, tx); spa_history_log_internal(spa, "zhack feature incr", tx, "guid=%s", feature->fi_guid); @@ -384,7 +389,7 @@ feature_decr_sync(void *arg, dmu_tx_t *t zfeature_info_t *feature = arg; uint64_t refcount; - VERIFY0(feature_get_refcount(spa, feature, &refcount)); + VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount)); feature_sync(spa, feature, refcount - 1, tx); spa_history_log_internal(spa, "zhack feature decr", tx, "guid=%s", feature->fi_guid); @@ -411,6 +416,7 @@ zhack_do_feature_ref(int argc, char **ar feature.fi_mos = B_FALSE; feature.fi_desc = NULL; feature.fi_depends = nodeps; + feature.fi_feature = SPA_FEATURE_NONE; optind = 1; while ((c = getopt(argc, argv, "md")) != -1) { @@ -459,8 +465,8 @@ zhack_do_feature_ref(int argc, char **ar if (decr) { uint64_t count; - if (feature_get_refcount(spa, &feature, &count) == 0 && - count != 0) { + if (feature_get_refcount_from_disk(spa, &feature, + &count) == 0 && count != 0) { fatal(spa, FTAG, "feature refcount already 0: %s", feature.fi_guid); } Modified: vendor/illumos/dist/man/man5/zpool-features.5 ============================================================================== --- vendor/illumos/dist/man/man5/zpool-features.5 Tue Dec 10 13:14:54 2013 (r259169) +++ vendor/illumos/dist/man/man5/zpool-features.5 Tue Dec 10 13:33:56 2013 (r259170) @@ -295,5 +295,70 @@ this feature are destroyed. .RE +.sp +.ne 2 +.na +\fB\fBenabled_txg\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.delphix:enabled_txg +READ\-ONLY COMPATIBLE yes +DEPENDENCIES none +.TE + +Once this feature is enabled ZFS records the transaction group number +in which new features are enabled. This has no user-visible impact, +but other features may depend on this feature. + +This feature becomes \fBactive\fR as soon as it is enabled and will +never return to being \fBenabled\fB. + +.RE + +.sp +.ne 2 +.na +\fB\fBhole_birth\fR\fR +.ad +.RS 4n +.TS +l l . +GUID com.delphix:hole_birth +READ\-ONLY COMPATIBLE no +DEPENDENCIES enabled_txg +.TE + +This feature improves performance of incremental sends ("zfs send -i") +and receives for objects with many holes. The most common case of +hole-filled objects is zvols. + +An incremental send stream from snapshot \fBA\fR to snapshot \fBB\fR +contains information about every block that changed between \fBA\fR and +\fBB\fR. Blocks which did not change between those snapshots can be +identified and omitted from the stream using a piece of metadata called +the 'block birth time', but birth times are not recorded for holes (blocks +filled only with zeroes). Since holes created after \fBA\fR cannot be +distinguished from holes created before \fBA\fR, information about every +hole in the entire filesystem or zvol is included in the send stream. + +For workloads where holes are rare this is not a problem. However, when +incrementally replicating filesystems or zvols with many holes (for +example a zvol formatted with another filesystem) a lot of time will +be spent sending and receiving unnecessary information about holes that +already exist on the receiving side. + +Once the \fBhole_birth\fR feature has been enabled the block birth times +of all new holes will be recorded. Incremental sends between snapshots +created after this feature is enabled will use this new metadata to avoid +sending information about holes that already exist on the receiving side. + +This feature becomes \fBactive\fR as soon as it is enabled and will +never return to being \fBenabled\fB. + +.RE + + .SH "SEE ALSO" \fBzpool\fR(1M) From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:34:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4A43515; Tue, 10 Dec 2013 13:34:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D190F1CA9; Tue, 10 Dec 2013 13:34:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADYSCD052736; Tue, 10 Dec 2013 13:34:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADYSlS052735; Tue, 10 Dec 2013 13:34:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312101334.rBADYSlS052735@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 10 Dec 2013 13:34:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259171 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:34:29 -0000 Author: ae Date: Tue Dec 10 13:34:28 2013 New Revision: 259171 URL: http://svnweb.freebsd.org/changeset/base/259171 Log: Remove unused macro ADVANCE() and replace ROUNDUP() macro with ALIGN(). They aren't the same, but in our use cases ALIGN gives the same results. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Tue Dec 10 13:33:56 2013 (r259170) +++ head/usr.sbin/ndp/ndp.c Tue Dec 10 13:34:28 2013 (r259171) @@ -109,11 +109,6 @@ #include #include "gmt2local.h" -/* packing rule for routing socket */ -#define ROUNDUP(a) \ - ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) -#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) - #define NEXTADDR(w, s) \ if (rtm->rtm_addrs & (w)) { \ bcopy((char *)&s, cp, sizeof(s)); cp += SA_SIZE(&s);} @@ -421,7 +416,7 @@ set(int argc, char **argv) /* NOTREACHED */ } sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); + sdl = (struct sockaddr_dl *)(ALIGN(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && !(rtm->rtm_flags & RTF_GATEWAY)) { @@ -508,7 +503,7 @@ delete(char *host) /* NOTREACHED */ } sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)(ROUNDUP(sin->sin6_len) + (char *)sin); + sdl = (struct sockaddr_dl *)(ALIGN(sin->sin6_len) + (char *)sin); if (IN6_ARE_ADDR_EQUAL(&sin->sin6_addr, &sin_m.sin6_addr)) { if (sdl->sdl_family == AF_LINK && !(rtm->rtm_flags & RTF_GATEWAY)) { @@ -598,7 +593,7 @@ again:; rtm = (struct rt_msghdr *)next; sin = (struct sockaddr_in6 *)(rtm + 1); - sdl = (struct sockaddr_dl *)((char *)sin + ROUNDUP(sin->sin6_len)); + sdl = (struct sockaddr_dl *)((char *)sin + ALIGN(sin->sin6_len)); /* * Some OSes can produce a route that has the LINK flag but From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:35:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79A2A65B; Tue, 10 Dec 2013 13:35:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 659ED1CB0; Tue, 10 Dec 2013 13:35:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADZ5pZ052867; Tue, 10 Dec 2013 13:35:05 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADZ5rV052865; Tue, 10 Dec 2013 13:35:05 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101335.rBADZ5rV052865@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 13:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259172 - stable/10/sys/net80211 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:35:05 -0000 Author: gavin Date: Tue Dec 10 13:35:04 2013 New Revision: 259172 URL: http://svnweb.freebsd.org/changeset/base/259172 Log: Merge r257754 (by adrian) from head: Don't return ENOBUFS if the transmit path handles the frame but queues it (eg in power save.) 10.0 candidate. PR: kern/183727 Modified: stable/10/sys/net80211/ieee80211_output.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_output.c ============================================================================== --- stable/10/sys/net80211/ieee80211_output.c Tue Dec 10 13:34:28 2013 (r259171) +++ stable/10/sys/net80211/ieee80211_output.c Tue Dec 10 13:35:04 2013 (r259172) @@ -143,8 +143,12 @@ ieee80211_vap_pkt_send_dest(struct ieee8 */ (void) ieee80211_pwrsave(ni, m); ieee80211_free_node(ni); - /* XXX better status? */ - return (ENOBUFS); + + /* + * We queued it fine, so tell the upper layer + * that we consumed it. + */ + return (0); } /* calculate priority so drivers can find the tx queue */ if (ieee80211_classify(ni, m)) { @@ -155,8 +159,9 @@ ieee80211_vap_pkt_send_dest(struct ieee8 ifp->if_oerrors++; m_freem(m); ieee80211_free_node(ni); + /* XXX better status? */ - return (ENOBUFS); + return (0); } /* * Stash the node pointer. Note that we do this after @@ -168,7 +173,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 BPF_MTAP(ifp, m); /* 802.3 tx */ - /* * Check if A-MPDU tx aggregation is setup or if we * should try to enable it. The sta must be associated From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:36:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D2D97A9; Tue, 10 Dec 2013 13:36:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 092F91CC2; Tue, 10 Dec 2013 13:36:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADauFw053098; Tue, 10 Dec 2013 13:36:56 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADauFV053097; Tue, 10 Dec 2013 13:36:56 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101336.rBADauFV053097@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 13:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259173 - stable/10/sys/net80211 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:36:57 -0000 Author: gavin Date: Tue Dec 10 13:36:56 2013 New Revision: 259173 URL: http://svnweb.freebsd.org/changeset/base/259173 Log: Merge r258758 (by adrian) from head: Make sure any waiters on the scan results get notified if the scan task decides to do nothing. If this isn't done, then a scan request whilst a scan occurs in an active channel set or a completed channel set will hang. Candidate for 10.0. Modified: stable/10/sys/net80211/ieee80211_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_scan.c ============================================================================== --- stable/10/sys/net80211/ieee80211_scan.c Tue Dec 10 13:35:04 2013 (r259172) +++ stable/10/sys/net80211/ieee80211_scan.c Tue Dec 10 13:36:56 2013 (r259173) @@ -859,6 +859,7 @@ scan_task(void *arg, int pending) if (ss->ss_next == ss->ss_last) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: no channels to scan\n", __func__); + scandone = 1; goto done; } From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:38:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA9799C2; Tue, 10 Dec 2013 13:38:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9647E1CD3; Tue, 10 Dec 2013 13:38:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADcd6J053329; Tue, 10 Dec 2013 13:38:39 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADcdH3053328; Tue, 10 Dec 2013 13:38:39 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101338.rBADcdH3053328@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 13:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259174 - stable/10/sys/net80211 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:38:39 -0000 Author: gavin Date: Tue Dec 10 13:38:39 2013 New Revision: 259174 URL: http://svnweb.freebsd.org/changeset/base/259174 Log: Merge r256294 (by adrian) from head: Fix the "am I a net80211 vap" check for bpf listeners. I changed it to use if_transmit a while ago but apparently with monitor mode the if_transmit method is overridden. This is (mostly) a workaround until a more permanent solution can be found. Candidate for 10.0. Submitted by: Patrick Kelsey Modified: stable/10/sys/net80211/ieee80211_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_freebsd.c ============================================================================== --- stable/10/sys/net80211/ieee80211_freebsd.c Tue Dec 10 13:36:56 2013 (r259173) +++ stable/10/sys/net80211/ieee80211_freebsd.c Tue Dec 10 13:38:39 2013 (r259174) @@ -808,9 +808,9 @@ static eventhandler_tag wlan_ifllevent; static void bpf_track(void *arg, struct ifnet *ifp, int dlt, int attach) { - /* NB: identify vap's by if_start */ + /* NB: identify vap's by if_init */ if (dlt == DLT_IEEE802_11_RADIO && - ifp->if_transmit == ieee80211_vap_transmit) { + ifp->if_init == ieee80211_init) { struct ieee80211vap *vap = ifp->if_softc; /* * Track bpf radiotap listener state. We mark the vap From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:43:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CBF23B78; Tue, 10 Dec 2013 13:43:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC06C1D40; Tue, 10 Dec 2013 13:43:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBADh0XE056190; Tue, 10 Dec 2013 13:43:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBADh0Ih056181; Tue, 10 Dec 2013 13:43:00 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101343.rBADh0Ih056181@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 13:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259175 - stable/10/sys/net80211 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:43:01 -0000 Author: gavin Date: Tue Dec 10 13:42:59 2013 New Revision: 259175 URL: http://svnweb.freebsd.org/changeset/base/259175 Log: Merge r257065 (by adrian) from head: Fix a use-after-free node reference issue when waiting for a return from a management frame transmission. This bug is a bit loopy, so here goes. The underlying cause is pretty easy to understand - the node isn't referenced before passing into the callout, so if the node is deleted before the callout fires, it'll dereference free'd memory. The code path however is slightly more convoluted. The functions _say_ mgt_tx - ie management transmit - which is partially true. Yes, that callback is attached to the mbuf for some management frames. However, it's only for frames relating to scanning and authentication attempts. It helpfully drives the VAP state back to "SCAN" if the transmission fails _OR_ (as I subsequently found out!) if the transmission succeeds but the state machine doesn't make progress towards being authenticated and active. Now, the code itself isn't terribly clear about this. It _looks_ like it's just handling the transmit failure case. However, when you look at what goes on in the transmit success case, it's moving the VAP state back to SCAN if it hasn't changed state since the time the callback was scheduled. Ie, if it's in ASSOC or AUTH still, it'll go back to SCAN. But if it has transitioned to the RUN state, the comparison will fail and it'll not transition things back to the SCAN state. So, to fix this, I decided to leave everything the way it is and merely fix the locking and remove the node reference. The _better_ fix would be to turn this callout into a "assoc/auth request" timeout callback and make the callout locked, thus eliminating all races. However, until all the drivers have been fixed so that transmit completions occur outside of any locking that's going on, it's going to be impossible to do this without introducing LORs. So, I leave some of the evilness in there. Candidate for 10.0. Modified: stable/10/sys/net80211/ieee80211_output.c stable/10/sys/net80211/ieee80211_proto.c stable/10/sys/net80211/ieee80211_proto.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net80211/ieee80211_output.c ============================================================================== --- stable/10/sys/net80211/ieee80211_output.c Tue Dec 10 13:38:39 2013 (r259174) +++ stable/10/sys/net80211/ieee80211_output.c Tue Dec 10 13:42:59 2013 (r259175) @@ -2736,20 +2736,35 @@ ieee80211_alloc_cts(struct ieee80211com static void ieee80211_tx_mgt_timeout(void *arg) { - struct ieee80211_node *ni = arg; - struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211vap *vap = arg; + IEEE80211_LOCK(vap->iv_ic); if (vap->iv_state != IEEE80211_S_INIT && (vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0) { /* * NB: it's safe to specify a timeout as the reason here; * it'll only be used in the right state. */ - ieee80211_new_state(vap, IEEE80211_S_SCAN, + ieee80211_new_state_locked(vap, IEEE80211_S_SCAN, IEEE80211_SCAN_FAIL_TIMEOUT); } + IEEE80211_UNLOCK(vap->iv_ic); } +/* + * This is the callback set on net80211-sourced transmitted + * authentication request frames. + * + * This does a couple of things: + * + * + If the frame transmitted was a success, it schedules a future + * event which will transition the interface to scan. + * If a state transition _then_ occurs before that event occurs, + * said state transition will cancel this callout. + * + * + If the frame transmit was a failure, it immediately schedules + * the transition back to scan. + */ static void ieee80211_tx_mgt_cb(struct ieee80211_node *ni, void *arg, int status) { @@ -2767,10 +2782,11 @@ ieee80211_tx_mgt_cb(struct ieee80211_nod * * XXX what happens if !acked but response shows up before callback? */ - if (vap->iv_state == ostate) + if (vap->iv_state == ostate) { callout_reset(&vap->iv_mgtsend, status == 0 ? IEEE80211_TRANS_WAIT*hz : 0, - ieee80211_tx_mgt_timeout, ni); + ieee80211_tx_mgt_timeout, vap); + } } static void Modified: stable/10/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/10/sys/net80211/ieee80211_proto.c Tue Dec 10 13:38:39 2013 (r259174) +++ stable/10/sys/net80211/ieee80211_proto.c Tue Dec 10 13:42:59 2013 (r259175) @@ -107,8 +107,6 @@ static void update_promisc(void *, int); static void update_channel(void *, int); static void update_chw(void *, int); static void ieee80211_newstate_cb(void *, int); -static int ieee80211_new_state_locked(struct ieee80211vap *, - enum ieee80211_state, int); static int null_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, @@ -1834,7 +1832,7 @@ done: * is usually a mistake and indicates lack of proper integration * with the net80211 layer. */ -static int +int ieee80211_new_state_locked(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: stable/10/sys/net80211/ieee80211_proto.h ============================================================================== --- stable/10/sys/net80211/ieee80211_proto.h Tue Dec 10 13:38:39 2013 (r259174) +++ stable/10/sys/net80211/ieee80211_proto.h Tue Dec 10 13:42:59 2013 (r259175) @@ -332,6 +332,8 @@ void ieee80211_dturbo_switch(struct ieee void ieee80211_swbmiss(void *arg); void ieee80211_beacon_miss(struct ieee80211com *); int ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int); +int ieee80211_new_state_locked(struct ieee80211vap *, enum ieee80211_state, + int); void ieee80211_print_essid(const uint8_t *, int); void ieee80211_dump_pkt(struct ieee80211com *, const uint8_t *, int, int, int); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 13:43:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B71ECAE; Tue, 10 Dec 2013 13:43:18 +0000 (UTC) Received: from mailrelay009.isp.belgacom.be (mailrelay009.isp.belgacom.be [195.238.6.176]) by mx1.freebsd.org (Postfix) with ESMTP id 6671E1D43; Tue, 10 Dec 2013 13:43:17 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgGAN0Zp1JbsKXL/2dsb2JhbABZgwc4uW6BGxd0giUBAQU6HCMQCw4KCRoLDyoeBogZAQjAchMEjwUHhDQEmBOSFIFrgT87gSwk Received: from 203.165-176-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.176.165.203]) by relay.skynet.be with ESMTP; 10 Dec 2013 14:43:09 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id rBADh7a1003488; Tue, 10 Dec 2013 14:43:08 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Tue, 10 Dec 2013 14:43:07 +0100 From: Tijl Coosemans To: Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken Message-ID: <20131210144307.20d32075@kalimero.tijl.coosemans.org> In-Reply-To: <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> 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, Andreas Tobler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 13:43:18 -0000 On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: > That keyboards have no Shift key for that? :) > I will be glad to apply your changes, but I have to know how it should > be controlled. > > RU and UA PC keyboards have same 3 symbols '2', '"', '@' > To get '2' i have to press only '2' > To get '@' I have to press Shift+'2' > To get '"' I have to switch to UA or RU and press Shift+'2' > > Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary > lang switch. Which commonly mapped to one of Alt. Right? > So R-Alt+Shift+'2'? https://en.wikipedia.org/wiki/AltGr From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 14:17:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A6553E3; Tue, 10 Dec 2013 14:17:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E979F1FB0; Tue, 10 Dec 2013 14:17:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAEH7X1067811; Tue, 10 Dec 2013 14:17:07 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAEH74I067810; Tue, 10 Dec 2013 14:17:07 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312101417.rBAEH74I067810@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Tue, 10 Dec 2013 14:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259176 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 14:17:08 -0000 Author: ae Date: Tue Dec 10 14:17:07 2013 New Revision: 259176 URL: http://svnweb.freebsd.org/changeset/base/259176 Log: Change the type of addr argument in dump() function to be able disambiguate link-local addresses from different zones. Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Tue Dec 10 13:42:59 2013 (r259175) +++ head/usr.sbin/ndp/ndp.c Tue Dec 10 14:17:07 2013 (r259176) @@ -131,7 +131,7 @@ void getsocket(void); int set(int, char **); void get(char *); int delete(char *); -void dump(struct in6_addr *, int); +void dump(struct sockaddr_in6 *, int); static struct in6_nbrinfo *getnbrinfo(struct in6_addr *, int, int); static char *ether_str(struct sockaddr_dl *); int ndp_ether_aton(char *, u_char *); @@ -461,7 +461,9 @@ get(char *host) return; } sin->sin6_addr = ((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; - dump(&sin->sin6_addr, 0); + sin->sin6_scope_id = + ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id; + dump(sin, 0); if (found_entry == 0) { getnameinfo((struct sockaddr *)sin, sin->sin6_len, host_buf, sizeof(host_buf), NULL ,0, @@ -543,7 +545,7 @@ delete: * Dump the entire neighbor cache */ void -dump(struct in6_addr *addr, int cflag) +dump(struct sockaddr_in6 *addr, int cflag) { int mib[6]; size_t needed; @@ -615,7 +617,9 @@ again:; continue; if (addr) { - if (!IN6_ARE_ADDR_EQUAL(addr, &sin->sin6_addr)) + if (IN6_ARE_ADDR_EQUAL(&addr->sin6_addr, + &sin->sin6_addr) == 0 || + addr->sin6_scope_id != sin->sin6_scope_id) continue; found_entry = 1; } else if (IN6_IS_ADDR_MULTICAST(&sin->sin6_addr)) From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 15:36:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E86116FC; Tue, 10 Dec 2013 15:36:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4F2D160E; Tue, 10 Dec 2013 15:36:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAFaTTn096420; Tue, 10 Dec 2013 15:36:29 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAFaTON096418; Tue, 10 Dec 2013 15:36:29 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312101536.rBAFaTON096418@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 10 Dec 2013 15:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259178 - in head/sys: conf dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 15:36:30 -0000 Author: ray Date: Tue Dec 10 15:36:29 2013 New Revision: 259178 URL: http://svnweb.freebsd.org/changeset/base/259178 Log: Break build with error in case when both syscons and newcons are enabled. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/options head/sys/dev/vt/vt.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Dec 10 14:54:11 2013 (r259177) +++ head/sys/conf/options Tue Dec 10 15:36:29 2013 (r259178) @@ -757,6 +757,9 @@ SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h +DEV_SC opt_syscons.h +DEV_VT opt_syscons.h + # teken terminal emulator options TEKEN_CONS25 opt_teken.h Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Tue Dec 10 14:54:11 2013 (r259177) +++ head/sys/dev/vt/vt.h Tue Dec 10 15:36:29 2013 (r259178) @@ -49,6 +49,11 @@ #include "opt_syscons.h" #include "opt_splash.h" +#ifdef DEV_SC +#error "Build with both syscons and vt is not supported. Please enable only \ +one 'device sc' or 'device vt'" +#endif + #ifndef VT_MAXWINDOWS #ifdef MAXCONS #define VT_MAXWINDOWS MAXCONS From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 15:53:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DD17BAC; Tue, 10 Dec 2013 15:53:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F29591775; Tue, 10 Dec 2013 15:53:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAFr1mN003247; Tue, 10 Dec 2013 15:53:01 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAFr0jx003237; Tue, 10 Dec 2013 15:53:00 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312101553.rBAFr0jx003237@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 10 Dec 2013 15:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259179 - in head/sys: dev/drm2 modules/drm2/drm2 modules/drm2/i915kms modules/drm2/radeonkms X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 15:53:02 -0000 Author: ray Date: Tue Dec 10 15:53:00 2013 New Revision: 259179 URL: http://svnweb.freebsd.org/changeset/base/259179 Log: Disable error message about failed attempt to attach fbd when drm2 built with syscons. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/drm2/drmP.h head/sys/dev/drm2/drm_fb_helper.c head/sys/modules/drm2/drm2/Makefile head/sys/modules/drm2/i915kms/Makefile head/sys/modules/drm2/radeonkms/Makefile Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Tue Dec 10 15:36:29 2013 (r259178) +++ head/sys/dev/drm2/drmP.h Tue Dec 10 15:53:00 2013 (r259179) @@ -113,6 +113,7 @@ struct drm_device; #include "opt_compat.h" #include "opt_drm.h" +#include "opt_syscons.h" #ifdef DRM_DEBUG #undef DRM_DEBUG #define DRM_DEBUG_DEFAULT_ON 1 Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Tue Dec 10 15:36:29 2013 (r259178) +++ head/sys/dev/drm2/drm_fb_helper.c Tue Dec 10 15:53:00 2013 (r259179) @@ -1044,8 +1044,10 @@ int drm_fb_helper_single_fb_probe(struct kdev = fb_helper->dev->device; fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); ret = device_probe_and_attach(fbd); +#ifdef DEV_VT if (ret != 0) DRM_ERROR("Failed to attach fbd device: %d\n", ret); +#endif } #else if (new_fb) { Modified: head/sys/modules/drm2/drm2/Makefile ============================================================================== --- head/sys/modules/drm2/drm2/Makefile Tue Dec 10 15:36:29 2013 (r259178) +++ head/sys/modules/drm2/drm2/Makefile Tue Dec 10 15:53:00 2013 (r259179) @@ -54,6 +54,6 @@ SRCS += drm_ioc32.c .endif SRCS +=device_if.h bus_if.h pci_if.h device_if.h iicbus_if.h opt_drm.h \ - opt_vm.h opt_compat.h + opt_vm.h opt_compat.h opt_syscons.h .include Modified: head/sys/modules/drm2/i915kms/Makefile ============================================================================== --- head/sys/modules/drm2/i915kms/Makefile Tue Dec 10 15:36:29 2013 (r259178) +++ head/sys/modules/drm2/i915kms/Makefile Tue Dec 10 15:53:00 2013 (r259179) @@ -35,6 +35,6 @@ SRCS += i915_ioc32.c .endif SRCS += device_if.h fb_if.h bus_if.h pci_if.h iicbus_if.h iicbb_if.h \ - opt_drm.h opt_compat.h + opt_drm.h opt_compat.h opt_syscons.h .include Modified: head/sys/modules/drm2/radeonkms/Makefile ============================================================================== --- head/sys/modules/drm2/radeonkms/Makefile Tue Dec 10 15:36:29 2013 (r259178) +++ head/sys/modules/drm2/radeonkms/Makefile Tue Dec 10 15:53:00 2013 (r259179) @@ -94,6 +94,7 @@ SRCS += \ opt_acpi.h \ opt_compat.h \ opt_drm.h \ + opt_syscons.h \ acpi_if.h \ bus_if.h \ fb_if.h \ From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 17:16:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D4B32EE; Tue, 10 Dec 2013 17:16:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 379CD1E75; Tue, 10 Dec 2013 17:16:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAHGETl033141; Tue, 10 Dec 2013 17:16:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAHGESo033140; Tue, 10 Dec 2013 17:16:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201312101716.rBAHGESo033140@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 10 Dec 2013 17:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259180 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 17:16:14 -0000 Author: pjd Date: Tue Dec 10 17:16:13 2013 New Revision: 259180 URL: http://svnweb.freebsd.org/changeset/base/259180 Log: Fix missing new line after: Netvsc initializing... during boot. Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Dec 10 15:53:00 2013 (r259179) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Dec 10 17:16:13 2013 (r259180) @@ -190,6 +190,7 @@ netvsc_init(void) if (!cold && !g_netvsc_drv.drv_inited) { g_netvsc_drv.drv_inited = 1; netvsc_drv_init(); + printf("done!\n"); } else { printf("Already initialized!\n"); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 17:26:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13DDC67D; Tue, 10 Dec 2013 17:26:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F38B41F1A; Tue, 10 Dec 2013 17:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAHQqJ9036811; Tue, 10 Dec 2013 17:26:52 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAHQqkJ036809; Tue, 10 Dec 2013 17:26:52 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312101726.rBAHQqkJ036809@svn.freebsd.org> From: Glen Barber Date: Tue, 10 Dec 2013 17:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259181 - releng/10.0/release X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 17:26:53 -0000 Author: gjb Date: Tue Dec 10 17:26:52 2013 New Revision: 259181 URL: http://svnweb.freebsd.org/changeset/base/259181 Log: MFstable10 r259151: Add WITH_DVD to RELEASE_RMAKEFLAGS, otherwise it is not actually passed to 'make release'. Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/release/release.conf.sample releng/10.0/release/release.sh Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/release/release.conf.sample ============================================================================== --- releng/10.0/release/release.conf.sample Tue Dec 10 17:16:13 2013 (r259180) +++ releng/10.0/release/release.conf.sample Tue Dec 10 17:26:52 2013 (r259181) @@ -39,3 +39,4 @@ PORTBRANCH="ports/head@rHEAD" #NODOC= #NOPORTS= #RELSTRING= +#WITH_DVD= Modified: releng/10.0/release/release.sh ============================================================================== --- releng/10.0/release/release.sh Tue Dec 10 17:16:13 2013 (r259180) +++ releng/10.0/release/release.sh Tue Dec 10 17:26:52 2013 (r259181) @@ -72,6 +72,9 @@ KERNEL="GENERIC" NODOC= NOPORTS= +# Set to non-empty value to build dvd1.iso as part of the release. +WITH_DVD= + usage() { echo "Usage: $0 [-c release.conf]" exit 1 @@ -129,7 +132,7 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}" RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}" RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \ - ${DOCPORTS}" + ${DOCPORTS} WITH_DVD=${WITH_DVD}" # Force src checkout if configured FORCE_SRC_KEY= From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 17:27:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6128C7A9; Tue, 10 Dec 2013 17:27:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D7641F20; Tue, 10 Dec 2013 17:27:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAHRCbR036895; Tue, 10 Dec 2013 17:27:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAHRC79036894; Tue, 10 Dec 2013 17:27:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312101727.rBAHRC79036894@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 10 Dec 2013 17:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259182 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 17:27:12 -0000 Author: trasz Date: Tue Dec 10 17:27:11 2013 New Revision: 259182 URL: http://svnweb.freebsd.org/changeset/base/259182 Log: Fix handling for empty auth-groups. Without it, ctld child process would either exit on assertion, or, if assertions are not enabled, fail to authenticate the target. MFC after: 2 days Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/login.c Modified: head/usr.sbin/ctld/login.c ============================================================================== --- head/usr.sbin/ctld/login.c Tue Dec 10 17:26:52 2013 (r259181) +++ head/usr.sbin/ctld/login.c Tue Dec 10 17:27:11 2013 (r259182) @@ -1007,6 +1007,14 @@ login(struct connection *conn) return; } + if (ag->ag_type == AG_TYPE_UNKNOWN) { + /* + * This can happen with empty auth-group. + */ + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-group type not set, denying access"); + } + log_debugx("CHAP authentication required"); auth_method = keys_find(request_keys, "AuthMethod"); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 18:18:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1497926; Tue, 10 Dec 2013 18:18:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD58312D0; Tue, 10 Dec 2013 18:18:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAIId3O055279; Tue, 10 Dec 2013 18:18:39 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAIId6U055278; Tue, 10 Dec 2013 18:18:39 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312101818.rBAIId6U055278@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 10 Dec 2013 18:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259183 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 18:18:39 -0000 Author: trasz Date: Tue Dec 10 18:18:39 2013 New Revision: 259183 URL: http://svnweb.freebsd.org/changeset/base/259183 Log: Properly refuse handoff requests on already connected sessions. Previously this would result in dropping the session. MFC after: 2 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Tue Dec 10 17:27:11 2013 (r259182) +++ head/sys/dev/iscsi/iscsi.c Tue Dec 10 18:18:39 2013 (r259183) @@ -1247,6 +1247,18 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ sx_sunlock(&sc->sc_lock); return (EINVAL); } + if (is->is_connected) { + /* + * This might have happened because another iscsid(8) + * instance handed off the connection in the meantime. + * Just return. + */ + ISCSI_SESSION_WARN(is, "handoff on already connected " + "session"); + ISCSI_SESSION_UNLOCK(is); + sx_sunlock(&sc->sc_lock); + return (EBUSY); + } strlcpy(is->is_target_alias, handoff->idh_target_alias, sizeof(is->is_target_alias)); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:12:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03E15D7B; Tue, 10 Dec 2013 19:12:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3A25173D; Tue, 10 Dec 2013 19:12:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJCGhp076976; Tue, 10 Dec 2013 19:12:16 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJCGxE076975; Tue, 10 Dec 2013 19:12:16 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101912.rBAJCGxE076975@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 19:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259184 - releng/10.0/sys/net80211 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:12:17 -0000 Author: gavin Date: Tue Dec 10 19:12:16 2013 New Revision: 259184 URL: http://svnweb.freebsd.org/changeset/base/259184 Log: Merge r259172 from stable/10 (head r257754 by adrian): Don't return ENOBUFS if the transmit path handles the frame but queues it (eg in power save.) PR: kern/183727 Approved by: re (glebius) Modified: releng/10.0/sys/net80211/ieee80211_output.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/net80211/ieee80211_output.c ============================================================================== --- releng/10.0/sys/net80211/ieee80211_output.c Tue Dec 10 18:18:39 2013 (r259183) +++ releng/10.0/sys/net80211/ieee80211_output.c Tue Dec 10 19:12:16 2013 (r259184) @@ -143,8 +143,12 @@ ieee80211_vap_pkt_send_dest(struct ieee8 */ (void) ieee80211_pwrsave(ni, m); ieee80211_free_node(ni); - /* XXX better status? */ - return (ENOBUFS); + + /* + * We queued it fine, so tell the upper layer + * that we consumed it. + */ + return (0); } /* calculate priority so drivers can find the tx queue */ if (ieee80211_classify(ni, m)) { @@ -155,8 +159,9 @@ ieee80211_vap_pkt_send_dest(struct ieee8 ifp->if_oerrors++; m_freem(m); ieee80211_free_node(ni); + /* XXX better status? */ - return (ENOBUFS); + return (0); } /* * Stash the node pointer. Note that we do this after @@ -168,7 +173,6 @@ ieee80211_vap_pkt_send_dest(struct ieee8 BPF_MTAP(ifp, m); /* 802.3 tx */ - /* * Check if A-MPDU tx aggregation is setup or if we * should try to enable it. The sta must be associated From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:14:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C899FF98; Tue, 10 Dec 2013 19:14:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B48B71752; Tue, 10 Dec 2013 19:14:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJEJ1j077338; Tue, 10 Dec 2013 19:14:19 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJEJai077337; Tue, 10 Dec 2013 19:14:19 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101914.rBAJEJai077337@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 19:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259185 - releng/10.0/sys/net80211 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:14:19 -0000 Author: gavin Date: Tue Dec 10 19:14:19 2013 New Revision: 259185 URL: http://svnweb.freebsd.org/changeset/base/259185 Log: Merge r259173 from stable/10 (head r258758 by adrian): Make sure any waiters on the scan results get notified if the scan task decides to do nothing. If this isn't done, then a scan request whilst a scan occurs in an active channel set or a completed channel set will hang. Approved by: re (glebius) Modified: releng/10.0/sys/net80211/ieee80211_scan.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/net80211/ieee80211_scan.c ============================================================================== --- releng/10.0/sys/net80211/ieee80211_scan.c Tue Dec 10 19:12:16 2013 (r259184) +++ releng/10.0/sys/net80211/ieee80211_scan.c Tue Dec 10 19:14:19 2013 (r259185) @@ -859,6 +859,7 @@ scan_task(void *arg, int pending) if (ss->ss_next == ss->ss_last) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: no channels to scan\n", __func__); + scandone = 1; goto done; } From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:15:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DD881A9; Tue, 10 Dec 2013 19:15:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3A7001762; Tue, 10 Dec 2013 19:15:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJFRDe077574; Tue, 10 Dec 2013 19:15:27 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJFRWp077573; Tue, 10 Dec 2013 19:15:27 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201312101915.rBAJFRWp077573@svn.freebsd.org> From: Joel Dahl Date: Tue, 10 Dec 2013 19:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259186 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:15:27 -0000 Author: joel (doc committer) Date: Tue Dec 10 19:15:26 2013 New Revision: 259186 URL: http://svnweb.freebsd.org/changeset/base/259186 Log: Minor mdoc fixes. Modified: head/share/man/man4/netmap.4 Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Tue Dec 10 19:14:19 2013 (r259185) +++ head/share/man/man4/netmap.4 Tue Dec 10 19:15:26 2013 (r259186) @@ -77,7 +77,6 @@ sockets or BPF/pcap). For a list of devices with native .Nm support, see the end of this manual page. -.Pp .Sh OPERATION - THE NETMAP API .Nm clients must first @@ -99,7 +98,6 @@ interface or on a port of a switch, as indicated below. Additional fields in the .Pa struct nmreq control the details of operation. -.Pp .Bl -tag -width XXXX .It Dv Interface name (e.g. 'em0', 'eth1', ... ) The data path of the interface is disconnected from the host stack. @@ -237,7 +235,6 @@ accordingly, as shown in the figure belo |-- avail --| (before syscall) cur .Ed - In receive rings, after a system call 'cur' indicates the first slot that contains a valid packet, and 'avail' reports how many of them are available. @@ -289,7 +286,6 @@ are normally fixed size (2 Kbyte) buffer that contain packet data. Buffers addresses are computed through macros. .El -.Pp .Bl -tag -width XXX Some macros support the access to objects in the shared memory region. In particular, From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:17:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79ABD4D6; Tue, 10 Dec 2013 19:17:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 66290178A; Tue, 10 Dec 2013 19:17:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJHWdj077975; Tue, 10 Dec 2013 19:17:32 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJHWGV077974; Tue, 10 Dec 2013 19:17:32 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101917.rBAJHWGV077974@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 19:17:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259187 - releng/10.0/sys/net80211 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:17:32 -0000 Author: gavin Date: Tue Dec 10 19:17:31 2013 New Revision: 259187 URL: http://svnweb.freebsd.org/changeset/base/259187 Log: Merge r259174 from stable/10 (head r256294 by adrian): Fix the "am I a net80211 vap" check for bpf listeners. I changed it to use if_transmit a while ago but apparently with monitor mode the if_transmit method is overridden. This is (mostly) a workaround until a more permanent solution can be found. Submitted by: Patrick Kelsey Approved by: re (glebius) Modified: releng/10.0/sys/net80211/ieee80211_freebsd.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/net80211/ieee80211_freebsd.c ============================================================================== --- releng/10.0/sys/net80211/ieee80211_freebsd.c Tue Dec 10 19:15:26 2013 (r259186) +++ releng/10.0/sys/net80211/ieee80211_freebsd.c Tue Dec 10 19:17:31 2013 (r259187) @@ -808,9 +808,9 @@ static eventhandler_tag wlan_ifllevent; static void bpf_track(void *arg, struct ifnet *ifp, int dlt, int attach) { - /* NB: identify vap's by if_start */ + /* NB: identify vap's by if_init */ if (dlt == DLT_IEEE802_11_RADIO && - ifp->if_transmit == ieee80211_vap_transmit) { + ifp->if_init == ieee80211_init) { struct ieee80211vap *vap = ifp->if_softc; /* * Track bpf radiotap listener state. We mark the vap From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:22:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45CC374E; Tue, 10 Dec 2013 19:22:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31FC11819; Tue, 10 Dec 2013 19:22:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJM3XP080961; Tue, 10 Dec 2013 19:22:03 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJM2BJ080958; Tue, 10 Dec 2013 19:22:02 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101922.rBAJM2BJ080958@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 19:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259188 - releng/10.0/sys/net80211 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:22:03 -0000 Author: gavin Date: Tue Dec 10 19:22:02 2013 New Revision: 259188 URL: http://svnweb.freebsd.org/changeset/base/259188 Log: Merge r259175 from stable/10 (head r257065 by adrian): Fix a use-after-free node reference issue when waiting for a return from a management frame transmission. Approved by: re (glebius) Modified: releng/10.0/sys/net80211/ieee80211_output.c releng/10.0/sys/net80211/ieee80211_proto.c releng/10.0/sys/net80211/ieee80211_proto.h Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/net80211/ieee80211_output.c ============================================================================== --- releng/10.0/sys/net80211/ieee80211_output.c Tue Dec 10 19:17:31 2013 (r259187) +++ releng/10.0/sys/net80211/ieee80211_output.c Tue Dec 10 19:22:02 2013 (r259188) @@ -2736,20 +2736,35 @@ ieee80211_alloc_cts(struct ieee80211com static void ieee80211_tx_mgt_timeout(void *arg) { - struct ieee80211_node *ni = arg; - struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211vap *vap = arg; + IEEE80211_LOCK(vap->iv_ic); if (vap->iv_state != IEEE80211_S_INIT && (vap->iv_ic->ic_flags & IEEE80211_F_SCAN) == 0) { /* * NB: it's safe to specify a timeout as the reason here; * it'll only be used in the right state. */ - ieee80211_new_state(vap, IEEE80211_S_SCAN, + ieee80211_new_state_locked(vap, IEEE80211_S_SCAN, IEEE80211_SCAN_FAIL_TIMEOUT); } + IEEE80211_UNLOCK(vap->iv_ic); } +/* + * This is the callback set on net80211-sourced transmitted + * authentication request frames. + * + * This does a couple of things: + * + * + If the frame transmitted was a success, it schedules a future + * event which will transition the interface to scan. + * If a state transition _then_ occurs before that event occurs, + * said state transition will cancel this callout. + * + * + If the frame transmit was a failure, it immediately schedules + * the transition back to scan. + */ static void ieee80211_tx_mgt_cb(struct ieee80211_node *ni, void *arg, int status) { @@ -2767,10 +2782,11 @@ ieee80211_tx_mgt_cb(struct ieee80211_nod * * XXX what happens if !acked but response shows up before callback? */ - if (vap->iv_state == ostate) + if (vap->iv_state == ostate) { callout_reset(&vap->iv_mgtsend, status == 0 ? IEEE80211_TRANS_WAIT*hz : 0, - ieee80211_tx_mgt_timeout, ni); + ieee80211_tx_mgt_timeout, vap); + } } static void Modified: releng/10.0/sys/net80211/ieee80211_proto.c ============================================================================== --- releng/10.0/sys/net80211/ieee80211_proto.c Tue Dec 10 19:17:31 2013 (r259187) +++ releng/10.0/sys/net80211/ieee80211_proto.c Tue Dec 10 19:22:02 2013 (r259188) @@ -107,8 +107,6 @@ static void update_promisc(void *, int); static void update_channel(void *, int); static void update_chw(void *, int); static void ieee80211_newstate_cb(void *, int); -static int ieee80211_new_state_locked(struct ieee80211vap *, - enum ieee80211_state, int); static int null_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, @@ -1834,7 +1832,7 @@ done: * is usually a mistake and indicates lack of proper integration * with the net80211 layer. */ -static int +int ieee80211_new_state_locked(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: releng/10.0/sys/net80211/ieee80211_proto.h ============================================================================== --- releng/10.0/sys/net80211/ieee80211_proto.h Tue Dec 10 19:17:31 2013 (r259187) +++ releng/10.0/sys/net80211/ieee80211_proto.h Tue Dec 10 19:22:02 2013 (r259188) @@ -332,6 +332,8 @@ void ieee80211_dturbo_switch(struct ieee void ieee80211_swbmiss(void *arg); void ieee80211_beacon_miss(struct ieee80211com *); int ieee80211_new_state(struct ieee80211vap *, enum ieee80211_state, int); +int ieee80211_new_state_locked(struct ieee80211vap *, enum ieee80211_state, + int); void ieee80211_print_essid(const uint8_t *, int); void ieee80211_dump_pkt(struct ieee80211com *, const uint8_t *, int, int, int); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:26:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3DAB5970; Tue, 10 Dec 2013 19:26:54 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9842A183B; Tue, 10 Dec 2013 19:26:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBAJQoNA009224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Dec 2013 23:26:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBAJQoMH009223; Tue, 10 Dec 2013 23:26:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 10 Dec 2013 23:26:50 +0400 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe Message-ID: <20131210192650.GK4615@FreeBSD.org> References: <201312100007.rBA074Qq055579@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201312100007.rBA074Qq055579@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:26:54 -0000 On Tue, Dec 10, 2013 at 12:07:04AM +0000, Adrian Chadd wrote: A> Author: adrian A> Date: Tue Dec 10 00:07:04 2013 A> New Revision: 259150 A> URL: http://svnweb.freebsd.org/changeset/base/259150 A> A> Log: A> Print out the full PCIe link negotiation during dmesg. A> A> I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot A> or not. A> A> Reviewed by: np A> Sponsored by: Netflix, inc. Shouldn't this be done with common code for all drivers on PCI bus(es)? This is definitely useful for all devices, not to cxgbe(4) only. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:30:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A099B23; Tue, 10 Dec 2013 19:30:08 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71377185A; Tue, 10 Dec 2013 19:30:08 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4D38EB91E; Tue, 10 Dec 2013 14:30:06 -0500 (EST) From: John Baldwin To: Gleb Smirnoff Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe Date: Tue, 10 Dec 2013 14:29:57 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> In-Reply-To: <20131210192650.GK4615@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201312101429.58025.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 10 Dec 2013 14:30:06 -0500 (EST) Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:30:08 -0000 On Tuesday, December 10, 2013 2:26:50 pm Gleb Smirnoff wrote: > On Tue, Dec 10, 2013 at 12:07:04AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Tue Dec 10 00:07:04 2013 > A> New Revision: 259150 > A> URL: http://svnweb.freebsd.org/changeset/base/259150 > A> > A> Log: > A> Print out the full PCIe link negotiation during dmesg. > A> > A> I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot > A> or not. > A> > A> Reviewed by: np > A> Sponsored by: Netflix, inc. > > Shouldn't this be done with common code for all drivers > on PCI bus(es)? > > This is definitely useful for all devices, not to cxgbe(4) only. It's already done in pciconf -lc which is the right place to put this instead of adding more noise to dmesg. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:30:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69899B28; Tue, 10 Dec 2013 19:30:12 +0000 (UTC) Received: from mail-ea0-x233.google.com (mail-ea0-x233.google.com [IPv6:2a00:1450:4013:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5C3A9185C; Tue, 10 Dec 2013 19:30:11 +0000 (UTC) Received: by mail-ea0-f179.google.com with SMTP id r15so2461842ead.24 for ; Tue, 10 Dec 2013 11:30:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=W6xCtS2rF97H5U+L8kYWZJS2Tdi1xpEz2DwnfkWGOwQ=; b=p2f7oRoMyJbnsgsgAplYQEE9J2ukH8k5sWH8Y79lGpApxozrqG1P1Wz/OvQi4AwUGG eqHlNbIExTgZOIRApfxCxbJnme2jAuerMMSG/nAfZt7JS5A2NjkbIF/5R40WYifTtAQ8 MEU0anyGk6zspGNgfBqG1j3XJ85QYkdmYesGYvRUHvdW5a/H3qEF5mSSR6DbDMw1KmGb Q+2or2u8a9dQ0sKbE6B/2mMpZGzE/Z/OtFA5s80fNPxOL09FVdZHysJEfo2p1r99a74d Hd+1SXswQFd+k0NsxcBPajgUEUo9477IDV2owBp4qxbBqGSbYpbUzJq+usH600rEgxe2 7hMQ== X-Received: by 10.14.215.67 with SMTP id d43mr3988965eep.108.1386703809667; Tue, 10 Dec 2013 11:30:09 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([178.137.150.35]) by mx.google.com with ESMTPSA id 4sm14860693eed.14.2013.12.10.11.30.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Dec 2013 11:30:08 -0800 (PST) Sender: Alexander Motin Message-ID: <52A76BBE.5030903@FreeBSD.org> Date: Tue, 10 Dec 2013 21:30:06 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Gleb Smirnoff , Adrian Chadd Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> In-Reply-To: <20131210192650.GK4615@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:30:12 -0000 On 10.12.2013 21:26, Gleb Smirnoff wrote: > On Tue, Dec 10, 2013 at 12:07:04AM +0000, Adrian Chadd wrote: > A> Author: adrian > A> Date: Tue Dec 10 00:07:04 2013 > A> New Revision: 259150 > A> URL: http://svnweb.freebsd.org/changeset/base/259150 > A> > A> Log: > A> Print out the full PCIe link negotiation during dmesg. > A> > A> I found this useful when checking whether a NIC is in a PCIE 3.0 8x slot > A> or not. > A> > A> Reviewed by: np > A> Sponsored by: Netflix, inc. > > Shouldn't this be done with common code for all drivers > on PCI bus(es)? > > This is definitely useful for all devices, not to cxgbe(4) only. Why not just read `pciconf -lc` output for that? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:42:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 611D1752; Tue, 10 Dec 2013 19:42:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D73C1984; Tue, 10 Dec 2013 19:42:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJgaNo088727; Tue, 10 Dec 2013 19:42:36 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJgar8088726; Tue, 10 Dec 2013 19:42:36 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312101942.rBAJgar8088726@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 10 Dec 2013 19:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259189 - head/games/fortune/datfiles X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:42:36 -0000 Author: gavin Date: Tue Dec 10 19:42:35 2013 New Revision: 259189 URL: http://svnweb.freebsd.org/changeset/base/259189 Log: Fix typo in fortune (go -> to) Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Tue Dec 10 19:22:02 2013 (r259188) +++ head/games/fortune/datfiles/fortunes Tue Dec 10 19:42:35 2013 (r259189) @@ -46677,7 +46677,7 @@ they had just discovered that he lived i taken another one of those damned Vermont winters!" % THE OLD POOL SHOOTER had won many a game in his life. But now it was time -to hang up the cue. When he did, all the other cues came crashing go the +to hang up the cue. When he did, all the other cues came crashing to the floor. "Sorry," he said with a smile. From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:48:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7F5ED4C; Tue, 10 Dec 2013 19:48:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 997BD19FA; Tue, 10 Dec 2013 19:48:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJmmKg090145; Tue, 10 Dec 2013 19:48:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJmmOL090144; Tue, 10 Dec 2013 19:48:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312101948.rBAJmmOL090144@svn.freebsd.org> From: Warner Losh Date: Tue, 10 Dec 2013 19:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259190 - stable/9/sys/arm/arm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:48:48 -0000 Author: imp Date: Tue Dec 10 19:48:48 2013 New Revision: 259190 URL: http://svnweb.freebsd.org/changeset/base/259190 Log: Hand merge from current r235717: Implement pmap_mincore for arm. Now programs using it don't cause a flood of console messages. Reviewed by: alc@ Modified: stable/9/sys/arm/arm/pmap.c Modified: stable/9/sys/arm/arm/pmap.c ============================================================================== --- stable/9/sys/arm/arm/pmap.c Tue Dec 10 19:42:35 2013 (r259189) +++ stable/9/sys/arm/arm/pmap.c Tue Dec 10 19:48:48 2013 (r259190) @@ -4675,9 +4675,59 @@ pmap_remove_write(vm_page_t m) int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *locked_pa) { - printf("pmap_mincore()\n"); - - return (0); + struct l2_bucket *l2b; + pt_entry_t *ptep, pte; + vm_paddr_t pa; + vm_page_t m; + int val; + boolean_t managed; + + PMAP_LOCK(pmap); +retry: + l2b = pmap_get_l2_bucket(pmap, addr); + if (l2b == NULL) { + val = 0; + goto out; + } + ptep = &l2b->l2b_kva[l2pte_index(addr)]; + pte = *ptep; + if (!l2pte_valid(pte)) { + val = 0; + goto out; + } + val = MINCORE_INCORE; + if (pte & L2_S_PROT_W) + val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; + managed = false; + pa = l2pte_pa(pte); + m = PHYS_TO_VM_PAGE(pa); + if (m != NULL && !(m->oflags & VPO_UNMANAGED)) + managed = true; + if (managed) { + /* + * The ARM pmap tries to maintain a per-mapping + * reference bit. The trouble is that it's kept in + * the PV entry, not the PTE, so it's costly to access + * here. You would need to acquire the pvh global + * lock, call pmap_find_pv(), and introduce a custom + * version of vm_page_pa_tryrelock() that releases and + * reacquires the pvh global lock. In the end, I + * doubt it's worthwhile. This may falsely report + * the given address as referenced. + */ + if ((m->md.pvh_attrs & PVF_REF) != 0) + val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; + } + if ((val & (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER)) != + (MINCORE_MODIFIED_OTHER | MINCORE_REFERENCED_OTHER) && managed) { + /* Ensure that "PHYS_TO_VM_PAGE(pa)->object" doesn't change. */ + if (vm_page_pa_tryrelock(pmap, pa, locked_pa)) + goto retry; + } else +out: + PA_UNLOCK_COND(*locked_pa); + PMAP_UNLOCK(pmap); + return (val); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:56:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21DA81A9; Tue, 10 Dec 2013 19:56:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 018E11AA1; Tue, 10 Dec 2013 19:56:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJuQhd093519; Tue, 10 Dec 2013 19:56:26 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJuQ26093518; Tue, 10 Dec 2013 19:56:26 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201312101956.rBAJuQ26093518@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Dec 2013 19:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259191 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:56:27 -0000 Author: trociny Date: Tue Dec 10 19:56:26 2013 New Revision: 259191 URL: http://svnweb.freebsd.org/changeset/base/259191 Log: For memsync replication, hio_countdown is used not only as an indication when a request can be moved to done queue, but also for detecting the current state of memsync request. This approach has problems, e.g. leaking a request if memsynk ack from the secondary failed, or racy usage of write_complete, which should be called only once per write request, but for memsync can be entered by local_send_thread and ggate_send_thread simultaneously. So the following approach is implemented instead: 1) Use hio_countdown only for counting components we waiting to complete, i.e. initially it is always 2 for any replication mode. 2) To distinguish between "memsync ack" and "memsync fin" responses from the secondary, add and use hio_memsyncacked field. 3) write_complete() in component threads is called only before releasing hio_countdown (i.e. before the hio may be returned to the done queue). 4) Add and use hio_writecount refcounter to detect when write_complete() can be called in memsync case. Reported by: Pete French petefrench ingresso.co.uk Tested by: Pete French petefrench ingresso.co.uk MFC after: 2 weeks Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Dec 10 19:48:48 2013 (r259190) +++ head/sbin/hastd/primary.c Tue Dec 10 19:56:26 2013 (r259191) @@ -94,6 +94,15 @@ struct hio { */ bool hio_done; /* + * Number of components we are still waiting before sending write + * completion ack to GEOM Gate. Used for memsync. + */ + refcnt_t hio_writecount; + /* + * Memsync request was acknowleged by remote. + */ + bool hio_memsyncacked; + /* * Remember replication from the time the request was initiated, * so we won't get confused when replication changes on reload. */ @@ -231,6 +240,9 @@ static pthread_mutex_t metadata_lock; #define ISSYNCREQ(hio) ((hio)->hio_ggio.gctl_unit == -1) #define SYNCREQDONE(hio) do { (hio)->hio_ggio.gctl_unit = -2; } while (0) #define ISSYNCREQDONE(hio) ((hio)->hio_ggio.gctl_unit == -2) +#define ISMEMSYNCWRITE(hio) \ + (((hio)->hio_replication == HAST_REPLICATION_MEMSYNC && \ + (hio)->hio_ggio.gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio))) static struct hast_resource *gres; @@ -1344,6 +1356,10 @@ ggate_recv_thread(void *arg) } else { mtx_unlock(&res->hr_amp_lock); } + if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) { + hio->hio_memsyncacked = false; + refcnt_init(&hio->hio_writecount, ncomps); + } break; case BIO_DELETE: res->hr_stat_delete++; @@ -1354,13 +1370,7 @@ ggate_recv_thread(void *arg) } pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); - if (hio->hio_replication == HAST_REPLICATION_MEMSYNC && - ggio->gctl_cmd == BIO_WRITE) { - /* Each remote request needs two responses in memsync. */ - refcnt_init(&hio->hio_countdown, ncomps + 1); - } else { - refcnt_init(&hio->hio_countdown, ncomps); - } + refcnt_init(&hio->hio_countdown, ncomps); for (ii = ncomp; ii < ncomps; ii++) QUEUE_INSERT1(hio, send, ii); } @@ -1470,42 +1480,13 @@ local_send_thread(void *arg) } break; } - - if (hio->hio_replication != HAST_REPLICATION_MEMSYNC || - ggio->gctl_cmd != BIO_WRITE || ISSYNCREQ(hio)) { - if (refcnt_release(&hio->hio_countdown) > 0) - continue; - } else { - /* - * Depending on hio_countdown value, requests finished - * in the following order: - * 0: remote memsync, remote final, local write - * 1: remote memsync, local write, (remote final) - * 2: local write, (remote memsync), (remote final) - */ - switch (refcnt_release(&hio->hio_countdown)) { - case 0: - /* - * Local write finished as last. - */ - break; - case 1: - /* - * Local write finished after remote memsync - * reply arrvied. We can complete the write now. - */ - if (hio->hio_errors[0] == 0) - write_complete(res, hio); - continue; - case 2: - /* - * Local write finished as first. - */ - continue; - default: - PJDLOG_ABORT("Invalid hio_countdown."); + if (ISMEMSYNCWRITE(hio)) { + if (refcnt_release(&hio->hio_writecount) == 0) { + write_complete(res, hio); } } + if (refcnt_release(&hio->hio_countdown) > 0) + continue; if (ISSYNCREQ(hio)) { mtx_lock(&sync_lock); SYNCREQDONE(hio); @@ -1627,10 +1608,8 @@ remote_send_thread(void *arg) nv_add_uint64(nv, (uint64_t)ggio->gctl_seq, "seq"); nv_add_uint64(nv, offset, "offset"); nv_add_uint64(nv, length, "length"); - if (hio->hio_replication == HAST_REPLICATION_MEMSYNC && - ggio->gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio)) { + if (ISMEMSYNCWRITE(hio)) nv_add_uint8(nv, 1, "memsync"); - } if (nv_error(nv) != 0) { hio->hio_errors[ncomp] = nv_error(nv); pjdlog_debug(2, @@ -1709,8 +1688,12 @@ done_queue: } else { mtx_unlock(&res->hr_amp_lock); } - if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) - (void)refcnt_release(&hio->hio_countdown); + if (ISMEMSYNCWRITE(hio)) { + if (refcnt_release(&hio->hio_writecount) == 0) { + if (hio->hio_errors[0] == 0) + write_complete(res, hio); + } + } } if (refcnt_release(&hio->hio_countdown) > 0) continue; @@ -1768,6 +1751,7 @@ remote_recv_thread(void *arg) hio_next[ncomp]); hio_recv_list_size[ncomp]--; mtx_unlock(&hio_recv_list_lock[ncomp]); + hio->hio_errors[ncomp] = ENOTCONN; goto done_queue; } if (hast_proto_recv_hdr(res->hr_remotein, &nv) == -1) { @@ -1841,82 +1825,34 @@ remote_recv_thread(void *arg) hio->hio_errors[ncomp] = 0; nv_free(nv); done_queue: - if (hio->hio_replication != HAST_REPLICATION_MEMSYNC || - hio->hio_ggio.gctl_cmd != BIO_WRITE || ISSYNCREQ(hio)) { - if (refcnt_release(&hio->hio_countdown) > 0) - continue; - } else { - /* - * Depending on hio_countdown value, requests finished - * in the following order: - * - * 0: local write, remote memsync, remote final - * or - * 0: remote memsync, local write, remote final - * - * 1: local write, remote memsync, (remote final) - * or - * 1: remote memsync, remote final, (local write) - * - * 2: remote memsync, (local write), (remote final) - * or - * 2: remote memsync, (remote final), (local write) - */ - switch (refcnt_release(&hio->hio_countdown)) { - case 0: - /* - * Remote final reply arrived. - */ - PJDLOG_ASSERT(!memsyncack); - break; - case 1: - if (memsyncack) { - /* - * Local request already finished, so we - * can complete the write. - */ + if (ISMEMSYNCWRITE(hio)) { + if (!hio->hio_memsyncacked) { + PJDLOG_ASSERT(memsyncack || + hio->hio_errors[ncomp] != 0); + /* Remote ack arrived. */ + if (refcnt_release(&hio->hio_writecount) == 0) { if (hio->hio_errors[0] == 0) write_complete(res, hio); - /* - * We still need to wait for final - * remote reply. - */ + } + hio->hio_memsyncacked = true; + if (hio->hio_errors[ncomp] == 0) { pjdlog_debug(2, - "remote_recv: (%p) Moving request back to the recv queue.", - hio); + "remote_recv: (%p) Moving request " + "back to the recv queue.", hio); mtx_lock(&hio_recv_list_lock[ncomp]); TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, hio_next[ncomp]); hio_recv_list_size[ncomp]++; mtx_unlock(&hio_recv_list_lock[ncomp]); - } else { - /* - * Remote final reply arrived before - * local write finished. - * Nothing to do in such case. - */ + continue; } - continue; - case 2: - /* - * We received remote memsync reply even before - * local write finished. - */ - PJDLOG_ASSERT(memsyncack); - - pjdlog_debug(2, - "remote_recv: (%p) Moving request back to the recv queue.", - hio); - mtx_lock(&hio_recv_list_lock[ncomp]); - TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, - hio_next[ncomp]); - hio_recv_list_size[ncomp]++; - mtx_unlock(&hio_recv_list_lock[ncomp]); - continue; - default: - PJDLOG_ABORT("Invalid hio_countdown."); + } else { + PJDLOG_ASSERT(!memsyncack); + /* Remote final reply arrived. */ } } + if (refcnt_release(&hio->hio_countdown) > 0) + continue; if (ISSYNCREQ(hio)) { mtx_lock(&sync_lock); SYNCREQDONE(hio); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 19:58:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD3392FF; Tue, 10 Dec 2013 19:58:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80F011AB0; Tue, 10 Dec 2013 19:58:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAJwAUY093731; Tue, 10 Dec 2013 19:58:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAJwAKI093730; Tue, 10 Dec 2013 19:58:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201312101958.rBAJwAKI093730@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Dec 2013 19:58:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259192 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 19:58:10 -0000 Author: trociny Date: Tue Dec 10 19:58:10 2013 New Revision: 259192 URL: http://svnweb.freebsd.org/changeset/base/259192 Log: Add some macros to make the code more readable (no functional chages). MFC after: 2 weeks Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Dec 10 19:56:26 2013 (r259191) +++ head/sbin/hastd/primary.c Tue Dec 10 19:58:10 2013 (r259192) @@ -233,6 +233,10 @@ static pthread_mutex_t metadata_lock; mtx_unlock(&hio_##name##_list_lock); \ } while (0) +#define ISFULLSYNC(hio) ((hio)->hio_replication == HAST_REPLICATION_FULLSYNC) +#define ISMEMSYNC(hio) ((hio)->hio_replication == HAST_REPLICATION_MEMSYNC) +#define ISASYNC(hio) ((hio)->hio_replication == HAST_REPLICATION_ASYNC) + #define SYNCREQ(hio) do { \ (hio)->hio_ggio.gctl_unit = -1; \ (hio)->hio_ggio.gctl_seq = 1; \ @@ -240,9 +244,9 @@ static pthread_mutex_t metadata_lock; #define ISSYNCREQ(hio) ((hio)->hio_ggio.gctl_unit == -1) #define SYNCREQDONE(hio) do { (hio)->hio_ggio.gctl_unit = -2; } while (0) #define ISSYNCREQDONE(hio) ((hio)->hio_ggio.gctl_unit == -2) -#define ISMEMSYNCWRITE(hio) \ - (((hio)->hio_replication == HAST_REPLICATION_MEMSYNC && \ - (hio)->hio_ggio.gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio))) + +#define ISMEMSYNCWRITE(hio) (ISMEMSYNC(hio) && \ + (hio)->hio_ggio.gctl_cmd == BIO_WRITE && !ISSYNCREQ(hio)) static struct hast_resource *gres; @@ -1356,7 +1360,7 @@ ggate_recv_thread(void *arg) } else { mtx_unlock(&res->hr_amp_lock); } - if (hio->hio_replication == HAST_REPLICATION_MEMSYNC) { + if (ISMEMSYNC(hio)) { hio->hio_memsyncacked = false; refcnt_init(&hio->hio_writecount, ncomps); } @@ -1441,8 +1445,7 @@ local_send_thread(void *arg) ret, (intmax_t)ggio->gctl_length); } else { hio->hio_errors[ncomp] = 0; - if (hio->hio_replication == - HAST_REPLICATION_ASYNC) { + if (ISASYNC(hio)) { ggio->gctl_error = 0; write_complete(res, hio); } From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 20:02:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A5AD480; Tue, 10 Dec 2013 20:02:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 370D91B17; Tue, 10 Dec 2013 20:02:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAK2A6R096924; Tue, 10 Dec 2013 20:02:10 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAK29nF096921; Tue, 10 Dec 2013 20:02:09 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201312102002.rBAK29nF096921@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Dec 2013 20:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259193 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 20:02:10 -0000 Author: trociny Date: Tue Dec 10 20:02:09 2013 New Revision: 259193 URL: http://svnweb.freebsd.org/changeset/base/259193 Log: Fix compiler warnings. MFC after: 2 weeks Modified: head/sbin/hastd/nv.c head/sbin/hastd/proto.c Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Tue Dec 10 19:58:10 2013 (r259192) +++ head/sbin/hastd/nv.c Tue Dec 10 20:02:09 2013 (r259193) @@ -566,7 +566,7 @@ nv_get_string(struct nv *nv, const char return (NULL); PJDLOG_ASSERT((nvh->nvh_type & NV_ORDER_MASK) == NV_ORDER_HOST); PJDLOG_ASSERT(nvh->nvh_dsize >= 1); - str = NVH_DATA(nvh); + str = (char *)NVH_DATA(nvh); PJDLOG_ASSERT(str[nvh->nvh_dsize - 1] == '\0'); PJDLOG_ASSERT(strlen(str) == nvh->nvh_dsize - 1); return (str); Modified: head/sbin/hastd/proto.c ============================================================================== --- head/sbin/hastd/proto.c Tue Dec 10 19:58:10 2013 (r259192) +++ head/sbin/hastd/proto.c Tue Dec 10 20:02:09 2013 (r259193) @@ -298,8 +298,8 @@ proto_connection_send(const struct proto protoname = mconn->pc_proto->prt_name; PJDLOG_ASSERT(protoname != NULL); - ret = conn->pc_proto->prt_send(conn->pc_ctx, protoname, - strlen(protoname) + 1, fd); + ret = conn->pc_proto->prt_send(conn->pc_ctx, + (const unsigned char *)protoname, strlen(protoname) + 1, fd); proto_close(mconn); if (ret != 0) { errno = ret; @@ -325,7 +325,7 @@ proto_connection_recv(const struct proto bzero(protoname, sizeof(protoname)); - ret = conn->pc_proto->prt_recv(conn->pc_ctx, protoname, + ret = conn->pc_proto->prt_recv(conn->pc_ctx, (unsigned char *)protoname, sizeof(protoname) - 1, &fd); if (ret != 0) { errno = ret; From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 20:05:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B6406C0; Tue, 10 Dec 2013 20:05:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37F701B32; Tue, 10 Dec 2013 20:05:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAK58DS097486; Tue, 10 Dec 2013 20:05:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAK58cV097485; Tue, 10 Dec 2013 20:05:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201312102005.rBAK58cV097485@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Dec 2013 20:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259194 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 20:05:08 -0000 Author: trociny Date: Tue Dec 10 20:05:07 2013 New Revision: 259194 URL: http://svnweb.freebsd.org/changeset/base/259194 Log: In remote_send_thread, if sending a request fails don't take the request back from the receive queue -- it might already be processed by remote_recv_thread, which lead to crashes like below: (primary) Unable to receive reply header: Connection reset by peer. (primary) Unable to send request (Connection reset by peer): WRITE(954662912, 131072). (primary) Disconnected from kopusha:7772. (primary) Increasing localcnt to 1. (primary) Assertion failed: (old > 0), function refcnt_release, file refcnt.h, line 62. Taking the request back was not necessary (it would properly be processed by the remote_recv_thread) and only complicated things. MFC after: 2 weeks Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Dec 10 20:02:09 2013 (r259193) +++ head/sbin/hastd/primary.c Tue Dec 10 20:05:07 2013 (r259194) @@ -1656,18 +1656,9 @@ remote_send_thread(void *arg) "Unable to send request (%s): ", strerror(hio->hio_errors[ncomp])); remote_close(res, ncomp); - /* - * Take request back from the receive queue and move - * it immediately to the done queue. - */ - mtx_lock(&hio_recv_list_lock[ncomp]); - TAILQ_REMOVE(&hio_recv_list[ncomp], hio, - hio_next[ncomp]); - hio_recv_list_size[ncomp]--; - mtx_unlock(&hio_recv_list_lock[ncomp]); - goto done_queue; + } else { + rw_unlock(&hio_remote_lock[ncomp]); } - rw_unlock(&hio_remote_lock[ncomp]); nv_free(nv); if (wakeup) cv_signal(&hio_recv_list_cond[ncomp]); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 20:06:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 203C9813; Tue, 10 Dec 2013 20:06:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E76E61B44; Tue, 10 Dec 2013 20:06:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAK6foI097747; Tue, 10 Dec 2013 20:06:41 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAK6fZM097744; Tue, 10 Dec 2013 20:06:41 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201312102006.rBAK6fZM097744@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Dec 2013 20:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259195 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 20:06:42 -0000 Author: trociny Date: Tue Dec 10 20:06:41 2013 New Revision: 259195 URL: http://svnweb.freebsd.org/changeset/base/259195 Log: Send wakeup to threads waiting on empty queue before releasing the lock to decrease spurious wakeups. Submitted by: davidxu MFC after: 2 weeks Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Dec 10 20:05:07 2013 (r259194) +++ head/sbin/hastd/primary.c Tue Dec 10 20:06:41 2013 (r259195) @@ -180,27 +180,21 @@ static pthread_mutex_t metadata_lock; ((res)->hr_remotein != NULL && (res)->hr_remoteout != NULL) #define QUEUE_INSERT1(hio, name, ncomp) do { \ - bool _wakeup; \ - \ mtx_lock(&hio_##name##_list_lock[(ncomp)]); \ - _wakeup = TAILQ_EMPTY(&hio_##name##_list[(ncomp)]); \ + if (TAILQ_EMPTY(&hio_##name##_list[(ncomp)])) \ + cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \ TAILQ_INSERT_TAIL(&hio_##name##_list[(ncomp)], (hio), \ hio_next[(ncomp)]); \ hio_##name##_list_size[(ncomp)]++; \ - mtx_unlock(&hio_##name##_list_lock[ncomp]); \ - if (_wakeup) \ - cv_broadcast(&hio_##name##_list_cond[(ncomp)]); \ + mtx_unlock(&hio_##name##_list_lock[(ncomp)]); \ } while (0) #define QUEUE_INSERT2(hio, name) do { \ - bool _wakeup; \ - \ mtx_lock(&hio_##name##_list_lock); \ - _wakeup = TAILQ_EMPTY(&hio_##name##_list); \ + if (TAILQ_EMPTY(&hio_##name##_list)) \ + cv_broadcast(&hio_##name##_list_cond); \ TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_##name##_next);\ hio_##name##_list_size++; \ mtx_unlock(&hio_##name##_list_lock); \ - if (_wakeup) \ - cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE1(hio, name, ncomp, timeout) do { \ bool _last; \ Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Tue Dec 10 20:05:07 2013 (r259194) +++ head/sbin/hastd/secondary.c Tue Dec 10 20:06:41 2013 (r259195) @@ -110,15 +110,12 @@ static void *disk_thread(void *arg); static void *send_thread(void *arg); #define QUEUE_INSERT(name, hio) do { \ - bool _wakeup; \ - \ mtx_lock(&hio_##name##_list_lock); \ - _wakeup = TAILQ_EMPTY(&hio_##name##_list); \ + if (TAILQ_EMPTY(&hio_##name##_list)) \ + cv_broadcast(&hio_##name##_list_cond); \ TAILQ_INSERT_TAIL(&hio_##name##_list, (hio), hio_next); \ hio_##name##_list_size++; \ mtx_unlock(&hio_##name##_list_lock); \ - if (_wakeup) \ - cv_broadcast(&hio_##name##_list_cond); \ } while (0) #define QUEUE_TAKE(name, hio) do { \ mtx_lock(&hio_##name##_list_lock); \ From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 20:09:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC1F89B5; Tue, 10 Dec 2013 20:09:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B861C1B7B; Tue, 10 Dec 2013 20:09:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAK9nsC098209; Tue, 10 Dec 2013 20:09:49 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAK9n0b098208; Tue, 10 Dec 2013 20:09:49 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201312102009.rBAK9n0b098208@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 10 Dec 2013 20:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259196 - head/sbin/hastd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 20:09:49 -0000 Author: trociny Date: Tue Dec 10 20:09:49 2013 New Revision: 259196 URL: http://svnweb.freebsd.org/changeset/base/259196 Log: Check remote protocol version only for the first connection (when it is actually sent by the remote node). Otherwise it generated confusing "Negotiated protocol version 1" debug messages when processing the second connection. MFC after: 2 weeks Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Tue Dec 10 20:06:41 2013 (r259195) +++ head/sbin/hastd/hastd.c Tue Dec 10 20:09:49 2013 (r259196) @@ -806,12 +806,6 @@ listen_accept(struct hastd_listen *lst) */ version = 1; } - if (version > HAST_PROTO_VERSION) { - pjdlog_info("Remote protocol version %hhu is not supported, falling back to version %hhu.", - version, (unsigned char)HAST_PROTO_VERSION); - version = HAST_PROTO_VERSION; - } - pjdlog_debug(1, "Negotiated protocol version %hhu.", version); token = nv_get_uint8_array(nvin, &size, "token"); /* * NULL token means that this is first connection. @@ -925,6 +919,12 @@ listen_accept(struct hastd_listen *lst) */ if (token == NULL) { + if (version > HAST_PROTO_VERSION) { + pjdlog_info("Remote protocol version %hhu is not supported, falling back to version %hhu.", + version, (unsigned char)HAST_PROTO_VERSION); + version = HAST_PROTO_VERSION; + } + pjdlog_debug(1, "Negotiated protocol version %hhu.", version); res->hr_version = version; arc4random_buf(res->hr_token, sizeof(res->hr_token)); nvout = nv_alloc(); From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 20:25:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 940F1D77; Tue, 10 Dec 2013 20:25:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80BAF1DA5; Tue, 10 Dec 2013 20:25:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAKPinp005302; Tue, 10 Dec 2013 20:25:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAKPiNh005301; Tue, 10 Dec 2013 20:25:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312102025.rBAKPiNh005301@svn.freebsd.org> From: Alexander Motin Date: Tue, 10 Dec 2013 20:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259197 - head/sys/x86/cpufreq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 20:25:44 -0000 Author: mav Date: Tue Dec 10 20:25:43 2013 New Revision: 259197 URL: http://svnweb.freebsd.org/changeset/base/259197 Log: Do not DELAY() for P-state transition unless we want to see the result. Intel manual says: "If a transition is already in progress, transition to a new value will subsequently take effect. Reads of IA32_PERF_CTL determine the last targeted operating point." So seems it should be fine to just trigger wanted transition and go. Linux does the same. MFC after: 1 month Modified: head/sys/x86/cpufreq/est.c Modified: head/sys/x86/cpufreq/est.c ============================================================================== --- head/sys/x86/cpufreq/est.c Tue Dec 10 20:09:49 2013 (r259196) +++ head/sys/x86/cpufreq/est.c Tue Dec 10 20:25:43 2013 (r259197) @@ -1288,10 +1288,9 @@ est_set_id16(device_t dev, uint16_t id16 msr = (msr & ~0xffff) | id16; wrmsr(MSR_PERF_CTL, msr); - /* Wait a short while for the new setting. XXX Is this necessary? */ - DELAY(EST_TRANS_LAT); - if (need_check) { + /* Wait a short while and read the new status. */ + DELAY(EST_TRANS_LAT); est_get_id16(&new_id16); if (new_id16 != id16) { if (bootverbose) From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 20:52:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAE7A649; Tue, 10 Dec 2013 20:52:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A52FE1F76; Tue, 10 Dec 2013 20:52:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAKqVAU015839; Tue, 10 Dec 2013 20:52:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAKqVYO015838; Tue, 10 Dec 2013 20:52:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312102052.rBAKqVYO015838@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Dec 2013 20:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259198 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 20:52:31 -0000 Author: kib Date: Tue Dec 10 20:52:31 2013 New Revision: 259198 URL: http://svnweb.freebsd.org/changeset/base/259198 Log: Only assert the length of the passed bio in the mdstart_vnode() when the bio is unmapped, so we must map the bio pages into pbuf. This works around the geom classes which do not follow the MAXPHYS limit on the i/o size, since such classes do not know about unmapped bios either. Reported by: Paolo Pinto Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Dec 10 20:25:43 2013 (r259197) +++ head/sys/dev/md/md.c Tue Dec 10 20:52:31 2013 (r259198) @@ -746,12 +746,12 @@ mdstart_vnode(struct md_s *sc, struct bi return (error); } - KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd", - (uintmax_t)bp->bio_length)); if ((bp->bio_flags & BIO_UNMAPPED) == 0) { pb = NULL; aiov.iov_base = bp->bio_data; } else { + KASSERT(bp->bio_length <= MAXPHYS, ("bio_length %jd", + (uintmax_t)bp->bio_length)); pb = getpbuf(&md_vnode_pbuf_freecnt); pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n); aiov.iov_base = (void *)((vm_offset_t)pb->b_data + From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 21:01:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7B5BD04; Tue, 10 Dec 2013 21:01:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B44EB105B; Tue, 10 Dec 2013 21:01:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAL1SFn019554; Tue, 10 Dec 2013 21:01:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAL1SN1019553; Tue, 10 Dec 2013 21:01:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312102101.rBAL1SN1019553@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 10 Dec 2013 21:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259199 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 21:01:28 -0000 Author: nwhitehorn Date: Tue Dec 10 21:01:28 2013 New Revision: 259199 URL: http://svnweb.freebsd.org/changeset/base/259199 Log: Return the correct IEEE 1275 code for "nextprop". Modified: head/sys/dev/ofw/ofw_fdt.c Modified: head/sys/dev/ofw/ofw_fdt.c ============================================================================== --- head/sys/dev/ofw/ofw_fdt.c Tue Dec 10 20:52:31 2013 (r259198) +++ head/sys/dev/ofw/ofw_fdt.c Tue Dec 10 21:01:28 2013 (r259199) @@ -267,8 +267,10 @@ ofw_fdt_getprop(ofw_t ofw, phandle_t pac } /* - * Get the next property of a package. Return the actual len of retrieved - * prop name. + * Get the next property of a package. Return values: + * -1: package or previous property does not exist + * 0: no more properties + * 1: success */ static int ofw_fdt_nextprop(ofw_t ofw, phandle_t package, const char *previous, char *buf, @@ -310,7 +312,7 @@ ofw_fdt_nextprop(ofw_t ofw, phandle_t pa strncpy(buf, fdt_string(fdtp, fdt32_to_cpu(prop->nameoff)), size); - return (strlen(buf)); + return (1); } /* Set the value of a property of a package. */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 21:15:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0AC771B; Tue, 10 Dec 2013 21:15:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8D1CC1138; Tue, 10 Dec 2013 21:15:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBALFIY6024384; Tue, 10 Dec 2013 21:15:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBALFIDx024383; Tue, 10 Dec 2013 21:15:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312102115.rBALFIDx024383@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Dec 2013 21:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259200 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 21:15:18 -0000 Author: kib Date: Tue Dec 10 21:15:18 2013 New Revision: 259200 URL: http://svnweb.freebsd.org/changeset/base/259200 Log: Fix detection of EOF in kern_physio(). If bio_length was clipped by the excess code in g_io_check(), bio_resid is also truncated by g_io_deliver(). As result, bufdonebio() assigns truncated value to the buffer b_resid field. Use the residual bio_completed to calculate buffer b_resid from b_bcount in bufdonebio(), instead of bio_resid, calculated from bio_length in g_io_deliver(). The issue is seemingly caused by the code rearrange into g_io_check(), which is not present in stable/10. The change still looks as the useful change to have in 10 nevertheless. Reported by: Stefan Hegnauer Tested by: pho, Stefan Hegnauer Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Dec 10 21:01:28 2013 (r259199) +++ head/sys/kern/vfs_bio.c Tue Dec 10 21:15:18 2013 (r259200) @@ -3679,7 +3679,6 @@ bufdonebio(struct bio *bip) bp = bip->bio_caller2; bp->b_resid = bp->b_bcount - bip->bio_completed; - bp->b_resid = bip->bio_resid; /* XXX: remove */ bp->b_ioflags = bip->bio_flags; bp->b_error = bip->bio_error; if (bp->b_error) From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 22:04:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 274564E3; Tue, 10 Dec 2013 22:04:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 126DC14AB; Tue, 10 Dec 2013 22:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAM3xa9041732; Tue, 10 Dec 2013 22:03:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAM3xfx041731; Tue, 10 Dec 2013 22:03:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312102203.rBAM3xfx041731@svn.freebsd.org> From: Rick Macklem Date: Tue, 10 Dec 2013 22:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259201 - stable/9/sys/fs/nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:04:00 -0000 Author: rmacklem Date: Tue Dec 10 22:03:59 2013 New Revision: 259201 URL: http://svnweb.freebsd.org/changeset/base/259201 Log: MFC: r257598 During code inspection, I spotted that there was a code path where CLNT_CONTROL() would be called on "client" after it was released via CLNT_RELEASE(). It was unlikely that this code path gets executed and I have not heard of any problem report caused by this bug. This patch fixes the code so that this cannot happen. Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Tue Dec 10 21:15:18 2013 (r259200) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Tue Dec 10 22:03:59 2013 (r259201) @@ -316,24 +316,25 @@ newnfs_connect(struct nfsmount *nmp, str mtx_lock(&nrp->nr_mtx); if (nrp->nr_client != NULL) { + mtx_unlock(&nrp->nr_mtx); /* * Someone else already connected. */ CLNT_RELEASE(client); } else { nrp->nr_client = client; + /* + * Protocols that do not require connections may be optionally + * left unconnected for servers that reply from a port other + * than NFS_PORT. + */ + if (nmp == NULL || (nmp->nm_flag & NFSMNT_NOCONN) == 0) { + mtx_unlock(&nrp->nr_mtx); + CLNT_CONTROL(client, CLSET_CONNECT, &one); + } else + mtx_unlock(&nrp->nr_mtx); } - /* - * Protocols that do not require connections may be optionally left - * unconnected for servers that reply from a port other than NFS_PORT. - */ - if (nmp == NULL || (nmp->nm_flag & NFSMNT_NOCONN) == 0) { - mtx_unlock(&nrp->nr_mtx); - CLNT_CONTROL(client, CLSET_CONNECT, &one); - } else { - mtx_unlock(&nrp->nr_mtx); - } /* Restore current thread's credentials. */ td->td_ucred = origcred; From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 22:13:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F14A85B; Tue, 10 Dec 2013 22:13:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2F8F4158A; Tue, 10 Dec 2013 22:13:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAMDbt2045412; Tue, 10 Dec 2013 22:13:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAMDa17045409; Tue, 10 Dec 2013 22:13:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312102213.rBAMDa17045409@svn.freebsd.org> From: John Baldwin Date: Tue, 10 Dec 2013 22:13:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259202 - in head/sys/arm: arm versatile xilinx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:13:37 -0000 Author: jhb Date: Tue Dec 10 22:13:36 2013 New Revision: 259202 URL: http://svnweb.freebsd.org/changeset/base/259202 Log: Correct license statements to reflect the fact that these files were all derived from sys/arm/mv/bus_space.c. Approved by: core Modified: head/sys/arm/arm/bus_space-v6.c head/sys/arm/versatile/bus_space.c head/sys/arm/xilinx/zy7_bus_space.c Modified: head/sys/arm/arm/bus_space-v6.c ============================================================================== --- head/sys/arm/arm/bus_space-v6.c Tue Dec 10 22:03:59 2013 (r259201) +++ head/sys/arm/arm/bus_space-v6.c Tue Dec 10 22:13:36 2013 (r259202) @@ -1,7 +1,9 @@ /*- - * Copyright (c) 2012 Damjan Marion + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * + * Developed by Semihalf. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -10,11 +12,14 @@ * 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 MARVELL nor the names of contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * 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 THE AUTHOR OR CONTRIBUTORS BE LIABLE + * 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) Modified: head/sys/arm/versatile/bus_space.c ============================================================================== --- head/sys/arm/versatile/bus_space.c Tue Dec 10 22:03:59 2013 (r259201) +++ head/sys/arm/versatile/bus_space.c Tue Dec 10 22:13:36 2013 (r259202) @@ -1,7 +1,9 @@ /*- - * Copyright (C) 2012 FreeBSD Foundation + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * + * Developed by Semihalf. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: Modified: head/sys/arm/xilinx/zy7_bus_space.c ============================================================================== --- head/sys/arm/xilinx/zy7_bus_space.c Tue Dec 10 22:03:59 2013 (r259201) +++ head/sys/arm/xilinx/zy7_bus_space.c Tue Dec 10 22:13:36 2013 (r259202) @@ -1,7 +1,9 @@ /*- - * Copyright (C) 2012 FreeBSD Foundation + * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * + * Developed by Semihalf. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 22:33:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 744BCCDB; Tue, 10 Dec 2013 22:33:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 607B816D3; Tue, 10 Dec 2013 22:33:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAMX3FX052737; Tue, 10 Dec 2013 22:33:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAMX3AB052736; Tue, 10 Dec 2013 22:33:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312102233.rBAMX3AB052736@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Dec 2013 22:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259203 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:33:03 -0000 Author: kib Date: Tue Dec 10 22:33:02 2013 New Revision: 259203 URL: http://svnweb.freebsd.org/changeset/base/259203 Log: The opt_*.h headers must be included before any system header, except sys/cdefs.h. In particular, in case of COMPAT_43, param.h includes sys/types.h, which includes sys/select.h, which includes sys/_sigset.h. The _sigset.h customizes the provided definions based on COMPAT_43, eliminating osigset_t if symbol is not defined. The sys/proc.h is included after opt_compat.h and needs osigset_t. Move opt_compat.h inclusion into the right place. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Dec 10 22:13:36 2013 (r259202) +++ head/sys/dev/vt/vt_core.c Tue Dec 10 22:33:02 2013 (r259203) @@ -33,10 +33,9 @@ #include __FBSDID("$FreeBSD$"); -#include - #include "opt_compat.h" +#include #include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 22:49:52 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84AD7399; Tue, 10 Dec 2013 22:49:52 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9B017C7; Tue, 10 Dec 2013 22:49:51 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id rBAMncqB018454; Tue, 10 Dec 2013 23:49:44 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <52A79A82.7050801@FreeBSD.org> Date: Tue, 10 Dec 2013 23:49:38 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Tijl Coosemans , Aleksandr Rybalko Subject: Re: svn commit: r259016 - in head/sys: conf dev/drm2 dev/drm2/i915 dev/drm2/radeon dev/fb dev/vt kern modules/drm2/i915kms modules/drm2/radeonkms sparc64/sparc64 sys teken References: <201312052238.rB5McsVN020719@svn.freebsd.org> <52A3A8DE.9090907@FreeBSD.org> <2a683b40-1465-44f9-a9aa-d079f660529d@email.android.com> <52A4E865.6080602@FreeBSD.org> <20131210153144.c46b74fa28253f3456aa2821@ddteam.net> <20131210144307.20d32075@kalimero.tijl.coosemans.org> In-Reply-To: <20131210144307.20d32075@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andreas Tobler X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:49:52 -0000 On 10.12.13 14:43, Tijl Coosemans wrote: > On Tue, 10 Dec 2013 15:31:44 +0200 Aleksandr Rybalko wrote: >> That keyboards have no Shift key for that? :) >> I will be glad to apply your changes, but I have to know how it should >> be controlled. >> >> RU and UA PC keyboards have same 3 symbols '2', '"', '@' >> To get '2' i have to press only '2' >> To get '@' I have to press Shift+'2' >> To get '"' I have to switch to UA or RU and press Shift+'2' >> >> Ahh, or use some called Third-Level (IIRC) in Xorg terms. Temporary >> lang switch. Which commonly mapped to one of Alt. Right? >> So R-Alt+Shift+'2'? > > https://en.wikipedia.org/wiki/AltGr Thanks Tijl! To get the @ I have to press AltGr + '2'. There are combinations where I have to press AltGr+Shift. e.g to get the 'broken bar, ', AltGr+Shift+'7'. Andreas From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 22:55:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E8E15FC; Tue, 10 Dec 2013 22:55:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36E29184E; Tue, 10 Dec 2013 22:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAMtOI3060089; Tue, 10 Dec 2013 22:55:24 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAMtNv6060083; Tue, 10 Dec 2013 22:55:23 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312102255.rBAMtNv6060083@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 10 Dec 2013 22:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259204 - in stable/10: lib/libcam sbin/camcontrol sys/cam sys/cam/scsi sys/powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:55:24 -0000 Author: nwhitehorn Date: Tue Dec 10 22:55:22 2013 New Revision: 259204 URL: http://svnweb.freebsd.org/changeset/base/259204 Log: MFC r257345,257382,257388: Implement extended LUN support. If PIM_EXTLUNS is set by a SIM, encode the upper 32-bits of the LUN, if possible, into the target_lun field as passed directly from the REPORT LUNs response. This allows extended LUN support to work for all LUNs with zeros in the lower 32-bits, which covers most addressing modes without breaking KBI. Behavior for drivers not setting PIM_EXTLUNS is unchanged. No user-facing interfaces are modified. Extended LUNs are stored with swizzled 16-bit word order so that, for devices implementing LUN addressing (like SCSI-2), the numerical representation of the LUN is identical with and without PIM_EXTLUNS. Thus setting PIM_EXTLUNS keeps most behavior, and user-facing LUN IDs, unchanged. This follows the strategy used in Solaris. A macro (CAM_EXTLUN_BYTE_SWIZZLE) is provided to transform a lun_id_t into a uint64_t ordered for the wire. This is the second part of work for full 64-bit extended LUN support and is designed to a bridge for stable/10 to the final 64-bit LUN code. The third and final part will involve widening lun_id_t to 64 bits and will not be MFCed. This third part will break the KBI but will keep the KPI unchanged so that all drivers that will care about this can be updated now and not require code changes between HEAD and stable/10. Reviewed by: scottl Modified: stable/10/lib/libcam/camlib.c stable/10/sbin/camcontrol/camcontrol.c stable/10/sys/cam/cam.h stable/10/sys/cam/cam_xpt.c stable/10/sys/cam/scsi/scsi_xpt.c stable/10/sys/powerpc/pseries/phyp_vscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libcam/camlib.c ============================================================================== --- stable/10/lib/libcam/camlib.c Tue Dec 10 22:33:02 2013 (r259203) +++ stable/10/lib/libcam/camlib.c Tue Dec 10 22:55:22 2013 (r259204) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -348,16 +349,16 @@ cam_open_btl(path_id_t path_id, target_i if (ccb.cdm.status == CAM_DEV_MATCH_MORE) { snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: CDM reported more than one" - " passthrough device at %d:%d:%d!!\n", - func_name, path_id, target_id, target_lun); + " passthrough device at %d:%d:%jx!!\n", + func_name, path_id, target_id, (uintmax_t)target_lun); goto btl_bailout; } if (ccb.cdm.num_matches == 0) { snprintf(cam_errbuf, CAM_ERRBUF_SIZE, "%s: no passthrough device found at" - " %d:%d:%d", func_name, path_id, target_id, - target_lun); + " %d:%d:%jx", func_name, path_id, target_id, + (uintmax_t)target_lun); goto btl_bailout; } @@ -687,14 +688,14 @@ cam_path_string(struct cam_device *dev, return(str); } - snprintf(str, len, "(%s%d:%s%d:%d:%d:%d): ", + snprintf(str, len, "(%s%d:%s%d:%d:%d:%jx): ", (dev->device_name[0] != '\0') ? dev->device_name : "pass", dev->dev_unit_num, (dev->sim_name[0] != '\0') ? dev->sim_name : "unknown", dev->sim_unit_number, dev->bus_id, dev->target_id, - dev->target_lun); + (uintmax_t)dev->target_lun); return(str); } Modified: stable/10/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/10/sbin/camcontrol/camcontrol.c Tue Dec 10 22:33:02 2013 (r259203) +++ stable/10/sbin/camcontrol/camcontrol.c Tue Dec 10 22:55:22 2013 (r259204) @@ -566,11 +566,11 @@ getdevtree(void) } fprintf(stdout, "%-33s at scbus%d " - "target %d lun %d (", + "target %d lun %jx (", tmpstr, dev_result->path_id, dev_result->target_id, - dev_result->target_lun); + (uintmax_t)dev_result->target_lun); need_close = 1; Modified: stable/10/sys/cam/cam.h ============================================================================== --- stable/10/sys/cam/cam.h Tue Dec 10 22:33:02 2013 (r259203) +++ stable/10/sys/cam/cam.h Tue Dec 10 22:55:22 2013 (r259204) @@ -50,6 +50,12 @@ typedef union { #define CAM_TARGET_WILDCARD ((target_id_t)~0) #define CAM_LUN_WILDCARD ((lun_id_t)~0) +#define CAM_EXTLUN_BYTE_SWIZZLE(lun) ( \ + ((((u_int64_t)lun) & 0xffff000000000000L) >> 48) | \ + ((((u_int64_t)lun) & 0x0000ffff00000000L) >> 16) | \ + ((((u_int64_t)lun) & 0x00000000ffff0000L) << 16) | \ + ((((u_int64_t)lun) & 0x000000000000ffffL) << 48)) + /* * Maximum length for a CAM CDB. */ Modified: stable/10/sys/cam/cam_xpt.c ============================================================================== --- stable/10/sys/cam/cam_xpt.c Tue Dec 10 22:33:02 2013 (r259203) +++ stable/10/sys/cam/cam_xpt.c Tue Dec 10 22:55:22 2013 (r259204) @@ -1025,14 +1025,14 @@ xpt_announce_periph(struct cam_periph *p mtx_assert(periph->sim->mtx, MA_OWNED); periph->flags |= CAM_PERIPH_ANNOUNCED; - printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, path->bus->sim->unit_number, path->bus->sim->bus_id, path->bus->path_id, path->target->target_id, - path->device->lun_id); + (uintmax_t)path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); if (path->device->protocol == PROTO_SCSI) scsi_print_inquiry(&path->device->inq_data); @@ -1078,14 +1078,14 @@ xpt_denounce_periph(struct cam_periph *p struct cam_path *path = periph->path; mtx_assert(periph->sim->mtx, MA_OWNED); - printf("%s%d at %s%d bus %d scbus%d target %d lun %d\n", + printf("%s%d at %s%d bus %d scbus%d target %d lun %jx\n", periph->periph_name, periph->unit_number, path->bus->sim->sim_name, path->bus->sim->unit_number, path->bus->sim->bus_id, path->bus->path_id, path->target->target_id, - path->device->lun_id); + (uintmax_t)path->device->lun_id); printf("%s%d: ", periph->periph_name, periph->unit_number); if (path->device->protocol == PROTO_SCSI) scsi_print_inquiry_short(&path->device->inq_data); @@ -3652,7 +3652,7 @@ xpt_print_path(struct cam_path *path) printf("X:"); if (path->device != NULL) - printf("%d): ", path->device->lun_id); + printf("%jx): ", (uintmax_t)path->device->lun_id); else printf("X): "); } @@ -3665,11 +3665,11 @@ xpt_print_device(struct cam_ed *device) if (device == NULL) printf("(nopath): "); else { - printf("(noperiph:%s%d:%d:%d:%d): ", device->sim->sim_name, + printf("(noperiph:%s%d:%d:%d:%jx): ", device->sim->sim_name, device->sim->unit_number, device->sim->bus_id, device->target->target_id, - device->lun_id); + (uintmax_t)device->lun_id); } } @@ -3717,7 +3717,8 @@ xpt_path_string(struct cam_path *path, c sbuf_printf(&sb, "X:"); if (path->device != NULL) - sbuf_printf(&sb, "%d): ", path->device->lun_id); + sbuf_printf(&sb, "%jx): ", + (uintmax_t)path->device->lun_id); else sbuf_printf(&sb, "X): "); } Modified: stable/10/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_xpt.c Tue Dec 10 22:33:02 2013 (r259203) +++ stable/10/sys/cam/scsi/scsi_xpt.c Tue Dec 10 22:55:22 2013 (r259204) @@ -100,6 +100,12 @@ SYSCTL_PROC(_kern_cam, OID_AUTO, cam_src (lval) <<= 8; \ (lval) |= (lp)->luns[(i)].lundata[1]; \ } +#define CAM_GET_LUN(lp, i, lval) \ + (lval) = scsi_4btoul((lp)->luns[(i)].lundata); \ + (lval) = ((lval) >> 16) | ((lval) << 16); +#define CAM_LUN_ONLY_32BITS(lp, i) \ + (scsi_4btoul(&((lp)->luns[(i)].lundata[4])) == 0) + /* * If we're not quirked to search <= the first 8 luns * and we are either quirked to search above lun 8, @@ -175,7 +181,8 @@ do { \ typedef enum { PROBE_INQUIRY_CKSUM = 0x01, PROBE_SERIAL_CKSUM = 0x02, - PROBE_NO_ANNOUNCE = 0x04 + PROBE_NO_ANNOUNCE = 0x04, + PROBE_EXTLUN = 0x08 } probe_flags; typedef struct { @@ -561,10 +568,9 @@ static void proberequestdefaultnegotiat static int proberequestbackoff(struct cam_periph *periph, struct cam_ed *device); static void probedone(struct cam_periph *periph, union ccb *done_ccb); -static int probe_strange_rpl_data(struct scsi_report_luns_data *rp, - uint32_t maxlun); static void probe_purge_old(struct cam_path *path, - struct scsi_report_luns_data *new); + struct scsi_report_luns_data *new, + probe_flags flags); static void probecleanup(struct cam_periph *periph); static void scsi_find_quirk(struct cam_ed *device); static void scsi_scan_bus(struct cam_periph *periph, union ccb *ccb); @@ -699,6 +705,11 @@ probeschedule(struct cam_periph *periph) else softc->flags &= ~PROBE_NO_ANNOUNCE; + if (cpi.hba_misc & PIM_EXTLUNS) + softc->flags |= PROBE_EXTLUN; + else + softc->flags &= ~PROBE_EXTLUN; + xpt_schedule(periph, CAM_PRIORITY_XPT); } @@ -1277,13 +1288,6 @@ out: */ free(lp, M_CAMXPT); lp = NULL; - } else if (probe_strange_rpl_data(lp, maxlun)) { - /* - * If we can't understand the lun format - * of any entry, bail. - */ - free(lp, M_CAMXPT); - lp = NULL; } else { lun_id_t lun; int idx; @@ -1291,14 +1295,14 @@ out: CAM_DEBUG(path, CAM_DEBUG_PROBE, ("Probe: %u lun(s) reported\n", nlun)); - CAM_GET_SIMPLE_LUN(lp, 0, lun); + CAM_GET_LUN(lp, 0, lun); /* * If the first lun is not lun 0, then either there * is no lun 0 in the list, or the list is unsorted. */ if (lun != 0) { for (idx = 0; idx < nlun; idx++) { - CAM_GET_SIMPLE_LUN(lp, idx, lun); + CAM_GET_LUN(lp, idx, lun); if (lun == 0) { break; } @@ -1330,7 +1334,7 @@ out: * This function will also install the new list * in the target structure. */ - probe_purge_old(path, lp); + probe_purge_old(path, lp, softc->flags); lp = NULL; } if (path->device->flags & CAM_DEV_INQUIRY_DATA_VALID) { @@ -1702,26 +1706,14 @@ probe_device_check: } } -static int -probe_strange_rpl_data(struct scsi_report_luns_data *rp, uint32_t maxlun) -{ - uint32_t idx; - uint32_t nlun = MIN(maxlun, (scsi_4btoul(rp->length) / 8)); - - for (idx = 0; idx < nlun; idx++) { - if (!CAM_CAN_GET_SIMPLE_LUN(rp, idx)) { - return (-1); - } - } - return (0); -} - static void -probe_purge_old(struct cam_path *path, struct scsi_report_luns_data *new) +probe_purge_old(struct cam_path *path, struct scsi_report_luns_data *new, + probe_flags flags) { struct cam_path *tp; struct scsi_report_luns_data *old; - u_int idx1, idx2, nlun_old, nlun_new, this_lun; + u_int idx1, idx2, nlun_old, nlun_new; + lun_id_t this_lun; u_int8_t *ol, *nl; if (path->target == NULL) { @@ -1755,17 +1747,26 @@ probe_purge_old(struct cam_path *path, s * that would be what the probe state * machine is currently working on, * so we won't do that. - * - * We also cannot nuke it if it is - * not in a lun format we understand. */ - if (!CAM_CAN_GET_SIMPLE_LUN(old, idx1)) { - continue; - } - CAM_GET_SIMPLE_LUN(old, idx1, this_lun); + CAM_GET_LUN(old, idx1, this_lun); if (this_lun == 0) { continue; } + + /* + * We also cannot nuke it if it is + * not in a lun format we understand + * and replace the LUN with a "simple" LUN + * if that is all the HBA supports. + */ + if (!(flags & PROBE_EXTLUN)) { + if (!CAM_CAN_GET_SIMPLE_LUN(old, idx1)) + continue; + CAM_GET_SIMPLE_LUN(old, idx1, this_lun); + } + if (!CAM_LUN_ONLY_32BITS(old, idx1)) + continue; + if (xpt_create_path(&tp, NULL, xpt_path_path_id(path), xpt_path_target_id(path), this_lun) == CAM_REQ_CMP) { xpt_async(AC_LOST_DEVICE, tp, NULL); @@ -2001,7 +2002,7 @@ scsi_scan_bus(struct cam_periph *periph, next_target = 1; if (target->luns) { - uint32_t first; + lun_id_t first; u_int nluns = scsi_4btoul(target->luns->length) / 8; /* @@ -2009,19 +2010,44 @@ scsi_scan_bus(struct cam_periph *periph, * of the list as we've actually just finished probing * it. */ - CAM_GET_SIMPLE_LUN(target->luns, 0, first); + CAM_GET_LUN(target->luns, 0, first); if (first == 0 && scan_info->lunindex[target_id] == 0) { scan_info->lunindex[target_id]++; } + /* + * Skip any LUNs that the HBA can't deal with. + */ + while (scan_info->lunindex[target_id] < nluns) { + if (scan_info->cpi->hba_misc & PIM_EXTLUNS) { + CAM_GET_LUN(target->luns, + scan_info->lunindex[target_id], + lun_id); + break; + } + + /* XXX print warning? */ + if (!CAM_LUN_ONLY_32BITS(target->luns, + scan_info->lunindex[target_id])) + continue; + if (CAM_CAN_GET_SIMPLE_LUN(target->luns, + scan_info->lunindex[target_id])) { + CAM_GET_SIMPLE_LUN(target->luns, + scan_info->lunindex[target_id], + lun_id); + break; + } + + scan_info->lunindex[target_id]++; + } + if (scan_info->lunindex[target_id] < nluns) { - CAM_GET_SIMPLE_LUN(target->luns, - scan_info->lunindex[target_id], lun_id); next_target = 0; CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("next lun to try at index %u is %u\n", - scan_info->lunindex[target_id], lun_id)); + ("next lun to try at index %u is %jx\n", + scan_info->lunindex[target_id], + (uintmax_t)lun_id)); scan_info->lunindex[target_id]++; } else { /* Modified: stable/10/sys/powerpc/pseries/phyp_vscsi.c ============================================================================== --- stable/10/sys/powerpc/pseries/phyp_vscsi.c Tue Dec 10 22:33:02 2013 (r259203) +++ stable/10/sys/powerpc/pseries/phyp_vscsi.c Tue Dec 10 22:55:22 2013 (r259204) @@ -548,12 +548,6 @@ vscsi_task_management(struct vscsi_softc TAILQ_REMOVE(&sc->free_xferq, xp, queue); TAILQ_INSERT_TAIL(&sc->active_xferq, xp, queue); - if (!(ccb->ccb_h.xflags & CAM_EXTLUN_VALID)) { - ccb->ccb_h.xflags |= CAM_EXTLUN_VALID; - ccb->ccb_h.ext_lun.lun64 = (0x1UL << 62) | - ((uint64_t)ccb->ccb_h.target_lun << 48); - } - xp->srp_iu_size = crq.iu_length = sizeof(*cmd); err = vmem_alloc(xp->sc->srp_iu_arena, xp->srp_iu_size, M_BESTFIT | M_NOWAIT, &xp->srp_iu_offset); @@ -565,7 +559,7 @@ vscsi_task_management(struct vscsi_softc bzero(cmd, xp->srp_iu_size); cmd->type = SRP_TSK_MGMT; cmd->tag = (uint64_t)xp; - cmd->lun = ccb->ccb_h.ext_lun.lun64; + cmd->lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); switch (ccb->ccb_h.func_code) { case XPT_RESET_DEV: @@ -608,12 +602,6 @@ vscsi_scsi_command(void *xxp, bus_dma_se cdb = (ccb->ccb_h.flags & CAM_CDB_POINTER) ? ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes; - if (!(ccb->ccb_h.xflags & CAM_EXTLUN_VALID)) { - ccb->ccb_h.xflags |= CAM_EXTLUN_VALID; - ccb->ccb_h.ext_lun.lun64 = (0x1UL << 62) | - ((uint64_t)ccb->ccb_h.target_lun << 48); - } - /* Command format from Table 20, page 37 of SRP spec */ crq.iu_length = 48 + ((nsegs > 1) ? 20 : 16) + ((ccb->csio.cdb_len > 16) ? (ccb->csio.cdb_len - 16) : 0); @@ -635,7 +623,7 @@ vscsi_scsi_command(void *xxp, bus_dma_se memcpy(cmd->cdb, cdb, ccb->csio.cdb_len); cmd->tag = (uint64_t)(xp); /* Let the responder find this again */ - cmd->lun = ccb->ccb_h.ext_lun.lun64; + cmd->lun = htobe64(CAM_EXTLUN_BYTE_SWIZZLE(ccb->ccb_h.target_lun)); if (nsegs > 1) { /* Use indirect descriptors */ From owner-svn-src-all@FreeBSD.ORG Tue Dec 10 22:56:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5A76739; Tue, 10 Dec 2013 22:56:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5B951859; Tue, 10 Dec 2013 22:56:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBAMurO2060280; Tue, 10 Dec 2013 22:56:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBAMupqe060270; Tue, 10 Dec 2013 22:56:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312102256.rBAMupqe060270@svn.freebsd.org> From: Neel Natu Date: Tue, 10 Dec 2013 22:56:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259205 - in head/sys/amd64/vmm: . intel io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2013 22:56:53 -0000 Author: neel Date: Tue Dec 10 22:56:51 2013 New Revision: 259205 URL: http://svnweb.freebsd.org/changeset/base/259205 Log: Fix x2apic support in bhyve. When the guest is bringing up the APs in the x2APIC mode a write to the ICR register will now trigger a return to userspace with an exitcode of VM_EXITCODE_SPINUP_AP. This gets SMP guests working again with x2APIC. Change the vlapic timer lock to be a spinlock because the vlapic can be accessed from within a critical section (vm run loop) when guest is using x2apic mode. Reviewed by: grehan@ Modified: head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/io/vlapic.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_lapic.c head/sys/amd64/vmm/vmm_lapic.h head/sys/amd64/vmm/vmm_msr.c head/sys/amd64/vmm/vmm_msr.h Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/intel/vmx.c Tue Dec 10 22:56:51 2013 (r259205) @@ -1337,6 +1337,7 @@ vmx_exit_process(struct vmx *vmx, int vc struct vmxctx *vmxctx; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, reason; uint64_t qual, gpa, rflags; + bool retu; handled = 0; vmcs = &vmx->vmcs[vcpu]; @@ -1382,27 +1383,39 @@ vmx_exit_process(struct vmx *vmx, int vc break; case EXIT_REASON_RDMSR: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1); + retu = false; ecx = vmxctx->guest_rcx; - error = emulate_rdmsr(vmx->vm, vcpu, ecx); + error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_RDMSR; vmexit->u.msr.code = ecx; - } else + } else if (!retu) { handled = 1; + } else { + /* Return to userspace with a valid exitcode */ + KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, + ("emulate_wrmsr retu with bogus exitcode")); + } break; case EXIT_REASON_WRMSR: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_WRMSR, 1); + retu = false; eax = vmxctx->guest_rax; ecx = vmxctx->guest_rcx; edx = vmxctx->guest_rdx; error = emulate_wrmsr(vmx->vm, vcpu, ecx, - (uint64_t)edx << 32 | eax); + (uint64_t)edx << 32 | eax, &retu); if (error) { vmexit->exitcode = VM_EXITCODE_WRMSR; vmexit->u.msr.code = ecx; vmexit->u.msr.wval = (uint64_t)edx << 32 | eax; - } else + } else if (!retu) { handled = 1; + } else { + /* Return to userspace with a valid exitcode */ + KASSERT(vmexit->exitcode != VM_EXITCODE_BOGUS, + ("emulate_wrmsr retu with bogus exitcode")); + } break; case EXIT_REASON_HLT: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/io/vlapic.c Tue Dec 10 22:56:51 2013 (r259205) @@ -139,8 +139,8 @@ struct vlapic { * Note that the vlapic_callout_handler() does not write to any of these * registers so they can be safely read from the vcpu context without locking. */ -#define VLAPIC_TIMER_LOCK(vlapic) mtx_lock(&((vlapic)->timer_mtx)) -#define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock(&((vlapic)->timer_mtx)) +#define VLAPIC_TIMER_LOCK(vlapic) mtx_lock_spin(&((vlapic)->timer_mtx)) +#define VLAPIC_TIMER_UNLOCK(vlapic) mtx_unlock_spin(&((vlapic)->timer_mtx)) #define VLAPIC_TIMER_LOCKED(vlapic) mtx_owned(&((vlapic)->timer_mtx)) #define VLAPIC_BUS_FREQ tsc_freq @@ -613,7 +613,7 @@ vlapic_set_icr_timer(struct vlapic *vlap static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); static int -lapic_process_icr(struct vlapic *vlapic, uint64_t icrval) +lapic_process_icr(struct vlapic *vlapic, uint64_t icrval, bool *retu) { int i; cpuset_t dmask; @@ -688,17 +688,18 @@ lapic_process_icr(struct vlapic *vlapic, if (vlapic2->boot_state != BS_SIPI) return (0); - vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid); - vmexit->exitcode = VM_EXITCODE_SPINUP_AP; - vmexit->u.spinup_ap.vcpu = dest; - vmexit->u.spinup_ap.rip = vec << PAGE_SHIFT; - /* * XXX this assumes that the startup IPI always succeeds */ vlapic2->boot_state = BS_RUNNING; vm_activate_cpu(vlapic2->vm, dest); + *retu = true; + vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid); + vmexit->exitcode = VM_EXITCODE_SPINUP_AP; + vmexit->u.spinup_ap.vcpu = dest; + vmexit->u.spinup_ap.rip = vec << PAGE_SHIFT; + return (0); } } @@ -804,7 +805,7 @@ lapic_set_svr(struct vlapic *vlapic, uin } int -vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data) +vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, bool *retu) { struct LAPIC *lapic = &vlapic->apic; uint32_t *reg; @@ -895,7 +896,7 @@ done: } int -vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data) +vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, bool *retu) { struct LAPIC *lapic = &vlapic->apic; int retval; @@ -931,7 +932,7 @@ vlapic_write(struct vlapic *vlapic, uint data &= 0xffffffff; data |= (uint64_t)lapic->icr_hi << 32; } - retval = lapic_process_icr(vlapic, data); + retval = lapic_process_icr(vlapic, data, retu); break; case APIC_OFFSET_ICR_HI: if (!x2apic(vlapic)) { @@ -978,7 +979,14 @@ vlapic_init(struct vm *vm, int vcpuid) vlapic->vm = vm; vlapic->vcpuid = vcpuid; - mtx_init(&vlapic->timer_mtx, "vlapic timer mtx", NULL, MTX_DEF); + /* + * If the vlapic is configured in x2apic mode then it will be + * accessed in the critical section via the MSR emulation code. + * + * Therefore the timer mutex must be a spinlock because blockable + * mutexes cannot be acquired in a critical section. + */ + mtx_init(&vlapic->timer_mtx, "vlapic timer mtx", NULL, MTX_SPIN); callout_init(&vlapic->callout, 1); vlapic->msr_apicbase = DEFAULT_APIC_BASE | APICBASE_ENABLED; Modified: head/sys/amd64/vmm/io/vlapic.h ============================================================================== --- head/sys/amd64/vmm/io/vlapic.h Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/io/vlapic.h Tue Dec 10 22:56:51 2013 (r259205) @@ -90,8 +90,10 @@ enum x2apic_state; struct vlapic *vlapic_init(struct vm *vm, int vcpuid); void vlapic_cleanup(struct vlapic *vlapic); -int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data); -int vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data); +int vlapic_write(struct vlapic *vlapic, uint64_t offset, uint64_t data, + bool *retu); +int vlapic_read(struct vlapic *vlapic, uint64_t offset, uint64_t *data, + bool *retu); int vlapic_pending_intr(struct vlapic *vlapic); void vlapic_intr_accepted(struct vlapic *vlapic, int vector); void vlapic_set_intr_ready(struct vlapic *vlapic, int vector, bool level); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/vmm.c Tue Dec 10 22:56:51 2013 (r259205) @@ -860,8 +860,7 @@ vcpu_require_state_locked(struct vcpu *v * Emulate a guest 'hlt' by sleeping until the vcpu is ready to run. */ static int -vm_handle_hlt(struct vm *vm, int vcpuid, boolean_t intr_disabled, - boolean_t *retu) +vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu) { struct vm_exit *vmexit; struct vcpu *vcpu; @@ -894,7 +893,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, * Spindown the vcpu if the apic is disabled and it * had entered the halted state. */ - *retu = TRUE; + *retu = true; vmexit = vm_exitinfo(vm, vcpuid); vmexit->exitcode = VM_EXITCODE_SPINDOWN_CPU; VCPU_CTR0(vm, vcpuid, "spinning down cpu"); @@ -908,7 +907,7 @@ vm_handle_hlt(struct vm *vm, int vcpuid, } static int -vm_handle_paging(struct vm *vm, int vcpuid, boolean_t *retu) +vm_handle_paging(struct vm *vm, int vcpuid, bool *retu) { int rv, ftype; struct vm_map *map; @@ -946,7 +945,7 @@ done: } static int -vm_handle_inst_emul(struct vm *vm, int vcpuid, boolean_t *retu) +vm_handle_inst_emul(struct vm *vm, int vcpuid, bool *retu) { struct vie *vie; struct vcpu *vcpu; @@ -987,15 +986,12 @@ vm_handle_inst_emul(struct vm *vm, int v mread = vhpet_mmio_read; mwrite = vhpet_mmio_write; } else { - *retu = TRUE; + *retu = true; return (0); } - error = vmm_emulate_instruction(vm, vcpuid, gpa, vie, mread, mwrite, 0); - - /* return to userland to spin up the AP */ - if (error == 0 && vme->exitcode == VM_EXITCODE_SPINUP_AP) - *retu = TRUE; + error = vmm_emulate_instruction(vm, vcpuid, gpa, vie, mread, mwrite, + retu); return (error); } @@ -1008,7 +1004,7 @@ vm_run(struct vm *vm, struct vm_run *vmr struct pcb *pcb; uint64_t tscval, rip; struct vm_exit *vme; - boolean_t retu, intr_disabled; + bool retu, intr_disabled; pmap_t pmap; vcpuid = vmrun->cpuid; @@ -1048,13 +1044,10 @@ restart: critical_exit(); if (error == 0) { - retu = FALSE; + retu = false; switch (vme->exitcode) { case VM_EXITCODE_HLT: - if ((vme->u.hlt.rflags & PSL_I) == 0) - intr_disabled = TRUE; - else - intr_disabled = FALSE; + intr_disabled = ((vme->u.hlt.rflags & PSL_I) == 0); error = vm_handle_hlt(vm, vcpuid, intr_disabled, &retu); break; case VM_EXITCODE_PAGING: @@ -1064,12 +1057,12 @@ restart: error = vm_handle_inst_emul(vm, vcpuid, &retu); break; default: - retu = TRUE; /* handled in userland */ + retu = true; /* handled in userland */ break; } } - if (error == 0 && retu == FALSE) { + if (error == 0 && retu == false) { rip = vme->rip + vme->inst_length; goto restart; } Modified: head/sys/amd64/vmm/vmm_lapic.c ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.c Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/vmm_lapic.c Tue Dec 10 22:56:51 2013 (r259205) @@ -107,7 +107,7 @@ lapic_msr(u_int msr) } int -lapic_rdmsr(struct vm *vm, int cpu, u_int msr, uint64_t *rval) +lapic_rdmsr(struct vm *vm, int cpu, u_int msr, uint64_t *rval, bool *retu) { int error; u_int offset; @@ -120,14 +120,14 @@ lapic_rdmsr(struct vm *vm, int cpu, u_in error = 0; } else { offset = x2apic_msr_to_regoff(msr); - error = vlapic_read(vlapic, offset, rval); + error = vlapic_read(vlapic, offset, rval, retu); } return (error); } int -lapic_wrmsr(struct vm *vm, int cpu, u_int msr, uint64_t val) +lapic_wrmsr(struct vm *vm, int cpu, u_int msr, uint64_t val, bool *retu) { int error; u_int offset; @@ -140,7 +140,7 @@ lapic_wrmsr(struct vm *vm, int cpu, u_in error = 0; } else { offset = x2apic_msr_to_regoff(msr); - error = vlapic_write(vlapic, offset, val); + error = vlapic_write(vlapic, offset, val, retu); } return (error); @@ -164,7 +164,7 @@ lapic_mmio_write(void *vm, int cpu, uint return (EINVAL); vlapic = vm_lapic(vm, cpu); - error = vlapic_write(vlapic, off, wval); + error = vlapic_write(vlapic, off, wval, arg); return (error); } @@ -186,6 +186,6 @@ lapic_mmio_read(void *vm, int cpu, uint6 return (EINVAL); vlapic = vm_lapic(vm, cpu); - error = vlapic_read(vlapic, off, rval); + error = vlapic_read(vlapic, off, rval, arg); return (error); } Modified: head/sys/amd64/vmm/vmm_lapic.h ============================================================================== --- head/sys/amd64/vmm/vmm_lapic.h Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/vmm_lapic.h Tue Dec 10 22:56:51 2013 (r259205) @@ -32,8 +32,10 @@ struct vm; boolean_t lapic_msr(u_int num); -int lapic_rdmsr(struct vm *vm, int cpu, u_int msr, uint64_t *rval); -int lapic_wrmsr(struct vm *vm, int cpu, u_int msr, uint64_t wval); +int lapic_rdmsr(struct vm *vm, int cpu, u_int msr, uint64_t *rval, + bool *retu); +int lapic_wrmsr(struct vm *vm, int cpu, u_int msr, uint64_t wval, + bool *retu); int lapic_mmio_read(void *vm, int cpu, uint64_t gpa, uint64_t *rval, int size, void *arg); Modified: head/sys/amd64/vmm/vmm_msr.c ============================================================================== --- head/sys/amd64/vmm/vmm_msr.c Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/vmm_msr.c Tue Dec 10 22:56:51 2013 (r259205) @@ -154,13 +154,13 @@ msr_num_to_idx(u_int num) } int -emulate_wrmsr(struct vm *vm, int cpu, u_int num, uint64_t val) +emulate_wrmsr(struct vm *vm, int cpu, u_int num, uint64_t val, bool *retu) { int idx; uint64_t *guest_msrs; if (lapic_msr(num)) - return (lapic_wrmsr(vm, cpu, num, val)); + return (lapic_wrmsr(vm, cpu, num, val, retu)); idx = msr_num_to_idx(num); if (idx < 0 || invalid_msr(idx)) @@ -181,14 +181,14 @@ emulate_wrmsr(struct vm *vm, int cpu, u_ } int -emulate_rdmsr(struct vm *vm, int cpu, u_int num) +emulate_rdmsr(struct vm *vm, int cpu, u_int num, bool *retu) { int error, idx; uint32_t eax, edx; uint64_t result, *guest_msrs; if (lapic_msr(num)) { - error = lapic_rdmsr(vm, cpu, num, &result); + error = lapic_rdmsr(vm, cpu, num, &result, retu); goto done; } Modified: head/sys/amd64/vmm/vmm_msr.h ============================================================================== --- head/sys/amd64/vmm/vmm_msr.h Tue Dec 10 22:55:22 2013 (r259204) +++ head/sys/amd64/vmm/vmm_msr.h Tue Dec 10 22:56:51 2013 (r259205) @@ -33,8 +33,9 @@ struct vm; void vmm_msr_init(void); -int emulate_wrmsr(struct vm *vm, int vcpu, u_int msr, uint64_t val); -int emulate_rdmsr(struct vm *vm, int vcpu, u_int msr); +int emulate_wrmsr(struct vm *vm, int vcpu, u_int msr, uint64_t val, + bool *retu); +int emulate_rdmsr(struct vm *vm, int vcpu, u_int msr, bool *retu); void guest_msrs_init(struct vm *vm, int cpu); void guest_msr_valid(int msr); void restore_host_msrs(struct vm *vm, int cpu); From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 00:17:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18B86ADA; Wed, 11 Dec 2013 00:17:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 024651E62; Wed, 11 Dec 2013 00:17:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB0HDkF090836; Wed, 11 Dec 2013 00:17:13 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB0HDgX090835; Wed, 11 Dec 2013 00:17:13 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312110017.rBB0HDgX090835@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 11 Dec 2013 00:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259206 - stable/10/sys/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 00:17:14 -0000 Author: np Date: Wed Dec 11 00:17:13 2013 New Revision: 259206 URL: http://svnweb.freebsd.org/changeset/base/259206 Log: MFC r258692 (gnn). Add constants for use in interrogating various fiber and copper connectors most often used with network interfaces. The SFF-8472 standard defines the information that can be retrieved from an optic or a copper cable plugged into a NIC, most often referred to as SFP+. Examples of values that can be read include the cable vendor's name, part number, date of manufacture as well as running data such as temperature, voltage and tx and rx power. Copious comments on how to use these values with an I2C interface are given in the header file itself. Discussed with: gnn Added: stable/10/sys/net/sff8472.h - copied unchanged from r258692, head/sys/net/sff8472.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/net/sff8472.h (from r258692, head/sys/net/sff8472.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/net/sff8472.h Wed Dec 11 00:17:13 2013 (r259206, copy of r258692, head/sys/net/sff8472.h) @@ -0,0 +1,433 @@ +/*- + * Copyright (c) 2013 George V. Neville-Neil + * 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$ + */ + +/* + * The following set of constants are from Document SFF-8472 + * "Diagnostic Monitoring Interface for Optical Transceivers" revision + * 11.3 published by the SFF Committee on June 11, 2013 + * + * The SFF standard defines two ranges of addresses, each 255 bytes + * long for the storage of data and diagnostics on cables, such as + * SFP+ optics and TwinAx cables. The ranges are defined in the + * following way: + * + * Base Address 0xa0 (Identification Data) + * 0-95 Serial ID Defined by SFP MSA + * 96-127 Vendor Specific Data + * 128-255 Reserved + * + * Base Address 0xa2 (Diagnostic Data) + * 0-55 Alarm and Warning Thresholds + * 56-95 Cal Constants + * 96-119 Real Time Diagnostic Interface + * 120-127 Vendor Specific + * 128-247 User Writable EEPROM + * 248-255 Vendor Specific + * + * Note that not all addresses are supported. Where support is + * optional this is noted and instructions for checking for the + * support are supplied. + * + * All these values are read across an I2C (i squared C) bus. Any + * device wishing to read these addresses must first have support for + * i2c calls. The Chelsio T4/T5 driver (dev/cxgbe) is one such + * driver. + */ + + +/* Table 3.1 Two-wire interface ID: Data Fields */ + +#define SFF_8472_BASE 0xa0 /* Base address for all our queries. */ +#define SFF_8472_ID 0 /* Transceiver Type (Table 3.2) */ +#define SFF_8472_EXT_ID 1 /* Extended transceiver type (Table 3.3) */ +#define SFF_8472_CONNECTOR 2 /* Connector type (Table 3.4) */ +#define SFF_8472_TRANS_START 3 /* Elec or Optical Compatibility + * (Table 3.5) */ +#define SFF_8472_TRANS_END 10 +#define SFF_8472_ENCODING 11 /* Encoding Code for high speed + * serial encoding algorithm (see + * Table 3.6) */ +#define SFF_8472_BITRATE 12 /* Nominal signaling rate, units + * of 100MBd. (see details for + * rates > 25.0Gb/s) */ +#define SFF_8472_RATEID 13 /* Type of rate select + * functionality (see Table + * 3.6a) */ +#define SFF_8472_LEN_SMF_KM 14 /* Link length supported for single + * mode fiber, units of km */ +#define SFF_8472_LEN_SMF 15 /* Link length supported for single + * mode fiber, units of 100 m */ +#define SFF_8472_LEN_50UM 16 /* Link length supported for 50 um + * OM2 fiber, units of 10 m */ +#define SFF_8472_LEN_625UM 17 /* Link length supported for 62.5 + * um OM1 fiber, units of 10 m */ +#define SFF_8472_LEN_OM4 18 /* Link length supported for 50um + * OM4 fiber, units of 10m. + * Alternatively copper or direct + * attach cable, units of m */ +#define SFF_8472_LEN_OM3 19 /* Link length supported for 50 um OM3 fiber, units of 10 m */ +#define SFF_8472_VENDOR_START 20 /* Vendor name [Address A0h, Bytes + * 20-35] */ +#define SFF_8472_VENDOR_END 35 +#define SFF_8472_TRANS 36 /* Transceiver Code for electronic + * or optical compatibility (see + * Table 3.5) */ +#define SFF_8472_VENDOR_OUI_START 37 /* Vendor OUI SFP vendor IEEE + * company ID */ +#define SFF_8472_VENDOR_OUI_END 39 +#define SFF_8472_PN_START 40 /* Vendor PN */ +#define SFF_8472_PN_END 55 +#define SFF_8472_REV_START 56 /* Vendor Revision */ +#define SFF_8472_REV_END 59 +#define SFF_8472_WAVELEN_START 60 /* Wavelength Laser wavelength + * (Passive/Active Cable + * Specification Compliance) */ +#define SFF_8472_WAVELEN_END 61 +#define SFF_8472_CC_BASE 63 /* CC_BASE Check code for Base ID + * Fields (addresses 0 to 62) */ + +/* + * Extension Fields (optional) check the options before reading other + * addresses. + */ +#define SFF_8472_OPTIONS_MSB 64 /* Options Indicates which optional + * transceiver signals are + * implemented */ +#define SFF_8472_OPTIONS_LSB 65 /* (see Table 3.7) */ +#define SFF_8472_BR_MAX 66 /* BR max Upper bit rate margin, + * units of % (see details for + * rates > 25.0Gb/s) */ +#define SFF_8472_BR_MIN 67 /* Lower bit rate margin, units of + * % (see details for rates > + * 25.0Gb/s) */ +#define SFF_8472_SN_START 68 /* Vendor SN [Address A0h, Bytes 68-83] */ +#define SFF_8472_SN_END 83 +#define SFF_8472_DATE_START 84 /* Date code Vendor’s manufacturing + * date code (see Table 3.8) */ +#define SFF_8472_DATE_END 91 +#define SFF_8472_DIAG_TYPE 92 /* Diagnostic Monitoring Type + * Indicates which type of + * diagnostic monitoring is + * implemented (if any) in the + * transceiver (see Table 3.9) + */ +#define SFF_8472_DIAG_IMPL (1 << 6) /* Required to be 1 */ +#define SFF_8472_DIAG_INTERNAL (1 << 5) /* Internal measurements. */ +#define SFF_8472_DIAG_EXTERNAL (1 << 4) /* External measurements. */ +#define SFF_8472_DIAG_POWER (1 << 3) /* Power measurement type */ +#define SFF_8472_DIAG_ADDR_CHG (1 << 2) /* Address change required. + * See SFF-8472 doc. */ + +#define SFF_8472_ENHANCED 93 /* Enhanced Options Indicates which + * optional enhanced features are + * implemented (if any) in the + * transceiver (see Table 3.10) */ +#define SFF_8472_COMPLIANCE 94 /* SFF-8472 Compliance Indicates + * which revision of SFF-8472 the + * transceiver complies with. (see + * Table 3.12)*/ +#define SFF_8472_CC_EXT 95 /* Check code for the Extended ID + * Fields (addresses 64 to 94) + */ + +#define SFF_8472_VENDOR_RSRVD_START 96 +#define SFF_8472_VENDOR_RSRVD_END 127 + +#define SFF_8472_RESERVED_START 128 +#define SFF_8472_RESERVED_END 255 + + /* + * Diagnostics are available at the two wire address 0xa2. All + * diagnostics are OPTIONAL so you should check 0xa0 registers 92 to + * see which, if any are supported. + */ + +#define SFF_8472_DIAG 0xa2 /* Base address for diagnostics. */ + + /* + * Table 3.15 Alarm and Warning Thresholds All values are 2 bytes + * and MUST be read in a single read operation starting at the MSB + */ + +#define SFF_8472_TEMP_HIGH_ALM 0 /* Temp High Alarm */ +#define SFF_8472_TEMP_LOW_ALM 2 /* Temp Low Alarm */ +#define SFF_8472_TEMP_HIGH_WARN 4 /* Temp High Warning */ +#define SFF_8472_TEMP_LOW_WARN 6 /* Temp Low Warning */ +#define SFF_8472_VOLTAGE_HIGH_ALM 8 /* Voltage High Alarm */ +#define SFF_8472_VOLTAGE_LOW_ALM 10 /* Voltage Low Alarm */ +#define SFF_8472_VOLTAGE_HIGH_WARN 12 /* Voltage High Warning */ +#define SFF_8472_VOLTAGE_LOW_WARN 14 /* Voltage Low Warning */ +#define SFF_8472_BIAS_HIGH_ALM 16 /* Bias High Alarm */ +#define SFF_8472_BIAS_LOW_ALM 18 /* Bias Low Alarm */ +#define SFF_8472_BIAS_HIGH_WARN 20 /* Bias High Warning */ +#define SFF_8472_BIAS_LOW_WARN 22 /* Bias Low Warning */ +#define SFF_8472_TX_POWER_HIGH_ALM 24 /* TX Power High Alarm */ +#define SFF_8472_TX_POWER_LOW_ALM 26 /* TX Power Low Alarm */ +#define SFF_8472_TX_POWER_HIGH_WARN 28 /* TX Power High Warning */ +#define SFF_8472_TX_POWER_LOW_WARN 30 /* TX Power Low Warning */ +#define SFF_8472_RX_POWER_HIGH_ALM 32 /* RX Power High Alarm */ +#define SFF_8472_RX_POWER_LOW_ALM 34 /* RX Power Low Alarm */ +#define SFF_8472_RX_POWER_HIGH_WARN 36 /* RX Power High Warning */ +#define SFF_8472_RX_POWER_LOW_WARN 38 /* RX Power Low Warning */ + +#define SFF_8472_RX_POWER4 56 /* Rx_PWR(4) Single precision + * floating point calibration data + * - Rx optical power. Bit 7 of + * byte 56 is MSB. Bit 0 of byte + * 59 is LSB. Rx_PWR(4) should be + * set to zero for “internally + * calibrated” devices. */ +#define SFF_8472_RX_POWER3 60 /* Rx_PWR(3) Single precision + * floating point calibration data + * - Rx optical power. Bit 7 of + * byte 60 is MSB. Bit 0 of byte 63 + * is LSB. Rx_PWR(3) should be set + * to zero for “internally + * calibrated” devices.*/ +#define SFF_8472_RX_POWER2 64 /* Rx_PWR(2) Single precision + * floating point calibration data, + * Rx optical power. Bit 7 of byte + * 64 is MSB, bit 0 of byte 67 is + * LSB. Rx_PWR(2) should be set to + * zero for “internally calibrated” + * devices. */ +#define SFF_8472_RX_POWER1 68 /* Rx_PWR(1) Single precision + * floating point calibration data, + * Rx optical power. Bit 7 of byte + * 68 is MSB, bit 0 of byte 71 is + * LSB. Rx_PWR(1) should be set to + * 1 for “internally calibrated” + * devices. */ +#define SFF_8472_RX_POWER0 72 /* Rx_PWR(0) Single precision + * floating point calibration data, + * Rx optical power. Bit 7 of byte + * 72 is MSB, bit 0 of byte 75 is + * LSB. Rx_PWR(0) should be set to + * zero for “internally calibrated” + * devices. */ +#define SFF_8472_TX_I_SLOPE 76 /* Tx_I(Slope) Fixed decimal + * (unsigned) calibration data, + * laser bias current. Bit 7 of + * byte 76 is MSB, bit 0 of byte 77 + * is LSB. Tx_I(Slope) should be + * set to 1 for “internally + * calibrated” devices. */ +#define SFF_8472_TX_I_OFFSET 78 /* Tx_I(Offset) Fixed decimal + * (signed two’s complement) + * calibration data, laser bias + * current. Bit 7 of byte 78 is + * MSB, bit 0 of byte 79 is + * LSB. Tx_I(Offset) should be set + * to zero for “internally + * calibrated” devices. */ +#define SFF_8472_TX_POWER_SLOPE 80 /* Tx_PWR(Slope) Fixed decimal + * (unsigned) calibration data, + * transmitter coupled output + * power. Bit 7 of byte 80 is MSB, + * bit 0 of byte 81 is LSB. + * Tx_PWR(Slope) should be set to 1 + * for “internally calibrated” + * devices. */ +#define SFF_8472_TX_POWER_OFFSET 82 /* Tx_PWR(Offset) Fixed decimal + * (signed two’s complement) + * calibration data, transmitter + * coupled output power. Bit 7 of + * byte 82 is MSB, bit 0 of byte 83 + * is LSB. Tx_PWR(Offset) should be + * set to zero for “internally + * calibrated” devices. */ +#define SFF_8472_T_SLOPE 84 /* T (Slope) Fixed decimal + * (unsigned) calibration data, + * internal module temperature. Bit + * 7 of byte 84 is MSB, bit 0 of + * byte 85 is LSB. T(Slope) should + * be set to 1 for “internally + * calibrated” devices. */ +#define SFF_8472_T_OFFSET 86 /* T (Offset) Fixed decimal (signed + * two’s complement) calibration + * data, internal module + * temperature. Bit 7 of byte 86 is + * MSB, bit 0 of byte 87 is LSB. + * T(Offset) should be set to zero + * for “internally calibrated” + * devices. */ +#define SFF_8472_V_SLOPE 88 /* V (Slope) Fixed decimal + * (unsigned) calibration data, + * internal module supply + * voltage. Bit 7 of byte 88 is + * MSB, bit 0 of byte 89 is + * LSB. V(Slope) should be set to 1 + * for “internally calibrated” + * devices. */ +#define SFF_8472_V_OFFSET 90 /* V (Offset) Fixed decimal (signed + * two’s complement) calibration + * data, internal module supply + * voltage. Bit 7 of byte 90 is + * MSB. Bit 0 of byte 91 is + * LSB. V(Offset) should be set to + * zero for “internally calibrated” + * devices. */ +#define SFF_8472_CHECKSUM 95 /* Checksum Byte 95 contains the + * low order 8 bits of the sum of + * bytes 0 – 94. */ + /* Internal measurements. */ + +#define SFF_8472_TEMP 96 /* Internally measured module temperature. */ +#define SFF_8472_VCC 98 /* Internally measured supply + * voltage in transceiver. + */ +#define SFF_8472_TX_BIAS 100 /* Internally measured TX Bias Current. */ +#define SFF_8472_TX_POWER 102 /* Measured TX output power. */ +#define SFF_8472_RX_POWER 104 /* Measured RX input power. */ + +#define SFF_8472_STATUS 110 /* See below */ + + /* Status Bits Described */ + +/* + * TX Disable State Digital state of the TX Disable Input Pin. Updated + * within 100ms of change on pin. + */ +#define SFF_8472_STATUS_TX_DISABLE (1 << 7) + +/* + * Select Read/write bit that allows software disable of + * laser. Writing ‘1’ disables laser. See Table 3.11 for + * enable/disable timing requirements. This bit is “OR”d with the hard + * TX_DISABLE pin value. Note, per SFP MSA TX_DISABLE pin is default + * enabled unless pulled low by hardware. If Soft TX Disable is not + * implemented, the transceiver ignores the value of this bit. Default + * power up value is zero/low. + */ +#define SFF_8472_STATUS_SOFT_TX_DISABLE (1 << 6) + +/* + * RS(1) State Digital state of SFP input pin AS(1) per SFF-8079 or + * RS(1) per SFF-8431. Updated within 100ms of change on pin. See A2h + * Byte 118, Bit 3 for Soft RS(1) Select control information. + */ +#define SFF_8472_RS_STATE (1 << 5) + +/* + * Rate_Select State [aka. “RS(0)”] Digital state of the SFP + * Rate_Select Input Pin. Updated within 100ms of change on pin. Note: + * This pin is also known as AS(0) in SFF-8079 and RS(0) in SFF-8431. + */ +#define SFF_8472_STATUS_SELECT_STATE (1 << 4) + +/* + * Read/write bit that allows software rate select control. Writing + * ‘1’ selects full bandwidth operation. This bit is “OR’d with the + * hard Rate_Select, AS(0) or RS(0) pin value. See Table 3.11 for + * timing requirements. Default at power up is logic zero/low. If Soft + * Rate Select is not implemented, the transceiver ignores the value + * of this bit. Note: Specific transceiver behaviors of this bit are + * identified in Table 3.6a and referenced documents. See Table 3.18a, + * byte 118, bit 3 for Soft RS(1) Select. + */ +#define SFF_8472_STATUS_SOFT_RATE_SELECT (1 << 3) + +/* + * TX Fault State Digital state of the TX Fault Output Pin. Updated + * within 100ms of change on pin. + */ +#define SFF_8472_STATUS_TX_FAULT_STATE (1 << 2) + +/* + * Digital state of the RX_LOS Output Pin. Updated within 100ms of + * change on pin. + */ +#define SFF_8472_STATUS_RX_LOS (1 << 1) + +/* + * Indicates transceiver has achieved power up and data is ready. Bit + * remains high until data is ready to be read at which time the + * device sets the bit low. + */ +#define SFF_8472_STATUS_DATA_READY (1 << 0) + +/* Table 3.2 Identifier values */ +#define SFF_8472_ID_UNKNOWN 0x0 /* Unknown or unspecified */ +#define SFF_8472_ID_GBIC 0x1 /* GBIC */ +#define SFF_8472_ID_SFF 0x2 /* Module soldered to motherboard (ex: SFF)*/ +#define SFF_8472_ID_SFP 0x3 /* SFP or SFP “Plus” */ +#define SFF_8472_ID_XBI 0x4 /* Reserved for “300 pin XBI” devices */ +#define SFF_8472_ID_XENPAK 0x5 /* Reserved for “Xenpak” devices */ +#define SFF_8472_ID_XFP 0x6 /* Reserved for “XFP” devices */ +#define SFF_8472_ID_XFF 0x7 /* Reserved for “XFF” devices */ +#define SFF_8472_ID_XFPE 0x8 /* Reserved for “XFP-E” devices */ +#define SFF_8472_ID_XPAK 0x9 /* Reserved for “XPak” devices */ +#define SFF_8472_ID_X2 0xA /* Reserved for “X2” devices */ +#define SFF_8472_ID_DWDM_SFP 0xB /* Reserved for “DWDM-SFP” devices */ +#define SFF_8472_ID_QSFP 0xC /* Reserved for “QSFP” devices */ +#define SFF_8472_ID_LAST SFF_8472_ID_QSFP + +static char *sff_8472_id[SFF_8472_ID_LAST + 1] = {"Unknown", + "GBIC", + "SFF", + "SFP", + "XBI", + "Xenpak", + "XFP", + "XFF", + "XFP-E", + "XPak", + "X2", + "DWDM-SFP", + "QSFP"}; + +/* Table 3.13 and 3.14 Temperature Conversion Values */ +#define SFF_8472_TEMP_SIGN (1 << 15) +#define SFF_8472_TEMP_SHIFT 8 +#define SFF_8472_TEMP_MSK 0xEF00 +#define SFF_8472_TEMP_FRAC 0x00FF + +/* Internal Callibration Conversion factors */ + +/* + * Represented as a 16 bit unsigned integer with the voltage defined + * as the full 16 bit value (0 – 65535) with LSB equal to 100 uVolt, + * yielding a total range of 0 to +6.55 Volts. + */ +#define SFF_8472_VCC_FACTOR 10000.0 + +/* + * Represented as a 16 bit unsigned integer with the current defined + * as the full 16 bit value (0 – 65535) with LSB equal to 2 uA, + * yielding a total range of 0 to 131 mA. + */ + +#define SFF_8472_BIAS_FACTOR 2000.0 + +/* + * Represented as a 16 bit unsigned integer with the power defined as + * the full 16 bit value (0 – 65535) with LSB equal to 0.1 uW, + * yielding a total range of 0 to 6.5535 mW (~ -40 to +8.2 dBm). + */ + +#define SFF_8472_POWER_FACTOR 10000.0 From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 00:39:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7C8E2AF; Wed, 11 Dec 2013 00:39:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9230C1FBD; Wed, 11 Dec 2013 00:39:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB0duJb098268; Wed, 11 Dec 2013 00:39:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB0dulK098266; Wed, 11 Dec 2013 00:39:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312110039.rBB0dulK098266@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Dec 2013 00:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259207 - stable/10/sys/fs/nfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 00:39:56 -0000 Author: rmacklem Date: Wed Dec 11 00:39:56 2013 New Revision: 259207 URL: http://svnweb.freebsd.org/changeset/base/259207 Log: MFC: r257598 During code inspection, I spotted that there was a code path where CLNT_CONTROL() would be called on "client" after it was released via CLNT_RELEASE(). It was unlikely that this code path gets executed and I have not heard of any problem report caused by this bug. This patch fixes the code so that this cannot happen. Modified: stable/10/sys/fs/nfs/nfs_commonkrpc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonkrpc.c Wed Dec 11 00:17:13 2013 (r259206) +++ stable/10/sys/fs/nfs/nfs_commonkrpc.c Wed Dec 11 00:39:56 2013 (r259207) @@ -336,24 +336,25 @@ newnfs_connect(struct nfsmount *nmp, str mtx_lock(&nrp->nr_mtx); if (nrp->nr_client != NULL) { + mtx_unlock(&nrp->nr_mtx); /* * Someone else already connected. */ CLNT_RELEASE(client); } else { nrp->nr_client = client; + /* + * Protocols that do not require connections may be optionally + * left unconnected for servers that reply from a port other + * than NFS_PORT. + */ + if (nmp == NULL || (nmp->nm_flag & NFSMNT_NOCONN) == 0) { + mtx_unlock(&nrp->nr_mtx); + CLNT_CONTROL(client, CLSET_CONNECT, &one); + } else + mtx_unlock(&nrp->nr_mtx); } - /* - * Protocols that do not require connections may be optionally left - * unconnected for servers that reply from a port other than NFS_PORT. - */ - if (nmp == NULL || (nmp->nm_flag & NFSMNT_NOCONN) == 0) { - mtx_unlock(&nrp->nr_mtx); - CLNT_CONTROL(client, CLSET_CONNECT, &one); - } else { - mtx_unlock(&nrp->nr_mtx); - } /* Restore current thread's credentials. */ td->td_ucred = origcred; From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 03:39:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E2AB4B2; Wed, 11 Dec 2013 03:39:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F9DC1E3D; Wed, 11 Dec 2013 03:39:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB3dpeO064051; Wed, 11 Dec 2013 03:39:51 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB3doVs064049; Wed, 11 Dec 2013 03:39:51 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201312110339.rBB3doVs064049@svn.freebsd.org> From: Julio Merino Date: Wed, 11 Dec 2013 03:39:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259208 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 03:39:51 -0000 Author: jmmv Date: Wed Dec 11 03:39:50 2013 New Revision: 259208 URL: http://svnweb.freebsd.org/changeset/base/259208 Log: Add tap.test.mk. This file provides support to build test programs that comply with the Test Anything Protocol. Its main goal is to support the painless integration of existing tests from tools/regression/ into the Kyua-based test suite. Approved by: rpaulo (mentor) Added: head/share/mk/tap.test.mk (contents, props changed) Modified: head/share/mk/Makefile Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Wed Dec 11 00:39:56 2013 (r259207) +++ head/share/mk/Makefile Wed Dec 11 03:39:50 2013 (r259208) @@ -46,6 +46,7 @@ FILESDIR= ${BINDIR}/mk .if ${MK_TESTS} != "no" FILES+= atf.test.mk FILES+= plain.test.mk +FILES+= tap.test.mk .endif .include Added: head/share/mk/tap.test.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/mk/tap.test.mk Wed Dec 11 03:39:50 2013 (r259208) @@ -0,0 +1,64 @@ +# $FreeBSD$ +# +# Logic to build and install TAP-compliant test programs. +# +# This is provided to support existing tests in the FreeBSD source tree +# (particularly those coming from tools/regression/) that comply with the +# Test Anything Protocol. It should not be used for new tests. + +.include + +# List of C, C++ and shell test programs to build. +# +# Programs listed here are built according to the semantics of bsd.prog.mk for +# PROGS, PROGS_CXX and SCRIPTS, respectively. +# +# Test programs registered in this manner are set to be installed into TESTSDIR +# (which should be overriden by the Makefile) and are not required to provide a +# manpage. +TAP_TESTS_C?= +TAP_TESTS_CXX?= +TAP_TESTS_SH?= + +.if !empty(TAP_TESTS_C) +PROGS+= ${TAP_TESTS_C} +_TESTS+= ${TAP_TESTS_C} +.for _T in ${TAP_TESTS_C} +BINDIR.${_T}= ${TESTSDIR} +MAN.${_T}?= # empty +SRCS.${_T}?= ${_T}.c +TEST_INTERFACE.${_T}= tap +.endfor +.endif + +.if !empty(TAP_TESTS_CXX) +PROGS_CXX+= ${TAP_TESTS_CXX} +_TESTS+= ${TAP_TESTS_CXX} +.for _T in ${TAP_TESTS_CXX} +BINDIR.${_T}= ${TESTSDIR} +MAN.${_T}?= # empty +SRCS.${_T}?= ${_T}.cc +TEST_INTERFACE.${_T}= tap +.endfor +.endif + +.if !empty(TAP_TESTS_SH) +SCRIPTS+= ${TAP_TESTS_SH} +_TESTS+= ${TAP_TESTS_SH} +.for _T in ${TAP_TESTS_SH} +SCRIPTSDIR_${_T}= ${TESTSDIR} +TEST_INTERFACE.${_T}= tap +CLEANFILES+= ${_T} ${_T}.tmp +# TODO(jmmv): It seems to me that this SED and SRC functionality should +# exist in bsd.prog.mk along the support for SCRIPTS. Move it there if +# this proves to be useful within the tests. +TAP_TESTS_SH_SED_${_T}?= # empty +TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh +${_T}: ${TAP_TESTS_SH_SRC_${_T}} + cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp + chmod +x ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} +.endfor +.endif + +.include From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 03:41:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F11095FD; Wed, 11 Dec 2013 03:41:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD53F1E8F; Wed, 11 Dec 2013 03:41:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB3f7E8066618; Wed, 11 Dec 2013 03:41:07 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB3f7xU066617; Wed, 11 Dec 2013 03:41:07 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201312110341.rBB3f7xU066617@svn.freebsd.org> From: Julio Merino Date: Wed, 11 Dec 2013 03:41:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259209 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 03:41:08 -0000 Author: jmmv Date: Wed Dec 11 03:41:07 2013 New Revision: 259209 URL: http://svnweb.freebsd.org/changeset/base/259209 Log: Make bsd.progs.mk work in directories with SCRIPTS but no PROGS. This change fixes some cases where bsd.progs.mk would fail to handle directories with SCRIPTS but no PROGS. In particular, "install" did not handle such scripts nor dependent files when bsd.subdir.mk was added to the mix. This is "make tinderbox" clean. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) Modified: head/share/mk/bsd.progs.mk Modified: head/share/mk/bsd.progs.mk ============================================================================== --- head/share/mk/bsd.progs.mk Wed Dec 11 03:39:50 2013 (r259208) +++ head/share/mk/bsd.progs.mk Wed Dec 11 03:41:07 2013 (r259209) @@ -73,7 +73,7 @@ UPDATE_DEPENDFILE = NO # handle being called [bsd.]progs.mk .include -.ifndef PROG +.ifndef _RECURSING_PROGS # tell progs.mk we might want to install things PROGS_TARGETS+= cleandepend cleandir cleanobj depend install @@ -84,11 +84,13 @@ x.$p= PROG_CXX=$p .endif $p ${p}_p: .PHONY .MAKE - (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} PROG=$p ${x.$p}) + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + SUBDIR= PROG=$p ${x.$p}) .for t in ${PROGS_TARGETS:O:u} $p.$t: .PHONY .MAKE - (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} PROG=$p ${x.$p} ${@:E}) + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + SUBDIR= PROG=$p ${x.$p} ${@:E}) .endfor .endfor @@ -96,4 +98,18 @@ $p.$t: .PHONY .MAKE $t: ${PROGS:%=%.$t} .endfor +SCRIPTS_TARGETS+= cleandepend cleandir cleanobj depend install + +.for p in ${SCRIPTS} +.for t in ${SCRIPTS_TARGETS:O:u} +$p.$t: .PHONY .MAKE + (cd ${.CURDIR} && ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS= \ + SUBDIR= SCRIPT=$p ${x.$p} ${@:E}) +.endfor +.endfor + +.for t in ${SCRIPTS_TARGETS:O:u} +$t: ${SCRIPTS:%=%.$t} +.endfor + .endif From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 04:09:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39CE8BD0; Wed, 11 Dec 2013 04:09:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 231DA1039; Wed, 11 Dec 2013 04:09:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB49MVo074987; Wed, 11 Dec 2013 04:09:22 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB49Ir6074961; Wed, 11 Dec 2013 04:09:18 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201312110409.rBB49Ir6074961@svn.freebsd.org> From: Julio Merino Date: Wed, 11 Dec 2013 04:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259210 - in head: bin bin/date bin/date/tests bin/mv bin/mv/tests bin/pax bin/pax/tests bin/sh bin/sh/tests bin/sh/tests/builtins bin/sh/tests/errors bin/sh/tests/execution bin/sh/test... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 04:09:22 -0000 Author: jmmv Date: Wed Dec 11 04:09:17 2013 New Revision: 259210 URL: http://svnweb.freebsd.org/changeset/base/259210 Log: Migrate tools/regression/bin/ tests to the new layout. This change is a proof of concept on how to easily integrate existing tests from the tools/regression/ hierarchy into the /usr/tests/ test suite and on how to adapt them to the new layout for src. To achieve these goals, this change: - Moves tests from tools/regression/bin// to bin//tests/. - Renames the previous regress.sh files to legacy_test.sh. - Adds Makefiles to build and install the tests and all their supporting data files into /usr/tests/bin/. - Plugs the legacy_test test programs into the test suite using the new TAP backend for Kyua (appearing in 0.8) so that the code of the test programs does not have to change. - Registers the new directories in the BSD.test.dist mtree file. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) Added: head/bin/date/tests/ head/bin/date/tests/Makefile (contents, props changed) head/bin/date/tests/legacy_test.sh - copied unchanged from r259205, head/tools/regression/bin/date/regress.sh head/bin/mv/tests/ head/bin/mv/tests/Makefile (contents, props changed) head/bin/mv/tests/legacy_test.sh - copied unchanged from r258552, head/tools/regression/bin/mv/regress.sh head/bin/pax/tests/ head/bin/pax/tests/Makefile (contents, props changed) - copied unchanged from r258552, head/tools/regression/bin/pax/regress.t head/bin/sh/tests/ head/bin/sh/tests/Makefile (contents, props changed) head/bin/sh/tests/builtins/ - copied from r258552, head/tools/regression/bin/sh/builtins/ head/bin/sh/tests/builtins/Makefile (contents, props changed) head/bin/sh/tests/errors/ - copied from r258552, head/tools/regression/bin/sh/errors/ head/bin/sh/tests/errors/Makefile (contents, props changed) head/bin/sh/tests/execution/ - copied from r258552, head/tools/regression/bin/sh/execution/ head/bin/sh/tests/execution/Makefile (contents, props changed) head/bin/sh/tests/expansion/ - copied from r258552, head/tools/regression/bin/sh/expansion/ head/bin/sh/tests/expansion/Makefile (contents, props changed) head/bin/sh/tests/legacy_test.sh - copied, changed from r258552, head/tools/regression/bin/sh/regress.sh head/bin/sh/tests/parameters/ - copied from r258552, head/tools/regression/bin/sh/parameters/ head/bin/sh/tests/parameters/Makefile (contents, props changed) head/bin/sh/tests/parser/ - copied from r258552, head/tools/regression/bin/sh/parser/ head/bin/sh/tests/parser/Makefile (contents, props changed) head/bin/sh/tests/set-e/ - copied from r258552, head/tools/regression/bin/sh/set-e/ head/bin/sh/tests/set-e/Makefile (contents, props changed) head/bin/test/tests/ head/bin/test/tests/Makefile (contents, props changed) head/bin/test/tests/legacy_test.sh - copied unchanged from r258552, head/tools/regression/bin/test/regress.sh head/bin/tests/ head/bin/tests/Makefile (contents, props changed) Directory Properties: head/bin/pax/tests/legacy_test.sh (props changed) Deleted: head/tools/regression/bin/ Modified: head/bin/Makefile head/bin/date/Makefile head/bin/mv/Makefile head/bin/pax/Makefile head/bin/sh/Makefile head/bin/test/Makefile head/etc/mtree/BSD.tests.dist Modified: head/bin/Makefile ============================================================================== --- head/bin/Makefile Wed Dec 11 03:41:07 2013 (r259209) +++ head/bin/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -52,6 +52,10 @@ SUBDIR+= rmail SUBDIR+= csh .endif +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include SUBDIR:= ${SUBDIR:O} Modified: head/bin/date/Makefile ============================================================================== --- head/bin/date/Makefile Wed Dec 11 03:41:07 2013 (r259209) +++ head/bin/date/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -1,7 +1,13 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + PROG= date SRCS= date.c netdate.c vary.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/bin/date/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/date/tests/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/date + +TAP_TESTS_SH= legacy_test + +.include Copied: head/bin/date/tests/legacy_test.sh (from r259205, head/tools/regression/bin/date/regress.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/date/tests/legacy_test.sh Wed Dec 11 04:09:17 2013 (r259210, copy of r259205, head/tools/regression/bin/date/regress.sh) @@ -0,0 +1,91 @@ +#!/bin/sh + +# +# Regression tests for date(1) +# +# Submitted by Edwin Groothuis +# +# $FreeBSD$ +# + +# +# These two date/times have been chosen carefully, they +# create both the single digit and double/multidigit version of +# the values. +# +# To create a new one, make sure you are using the UTC timezone! +# + +TEST1=3222243 # 1970-02-07 07:04:03 +TEST2=1005600000 # 2001-11-12 21:11:12 + +export LC_ALL=C +export TZ=UTC +count=0 + +check() +{ + S=$1 + A1=$2 + A2=$3 + + count=`expr ${count} + 1` + + if [ -z "${A2}" ]; then A2=${A1}; fi + + R=`date -r ${TEST1} +%${S}` + if [ "${R}" = "${A1}" ]; then + echo "ok ${S}{t1}" + else + echo "no ok ${S}{t1} - (got ${R}, expected ${A1})" + fi + + R=`date -r ${TEST2} +%${S}` + if [ "${R}" = "${A2}" ]; then + echo "ok ${S}{t2}" + else + echo "no ok ${S}{t2} - (got ${R}, expected ${A2})" + fi +} + +echo "1..78" + +check A Saturday Monday +check a Sat Mon +check B February November +check b Feb Nov +check C 19 20 +check c "Sat Feb 7 07:04:03 1970" "Mon Nov 12 21:20:00 2001" +check D 02/07/70 11/12/01 +check d 07 12 +check e " 7" 12 +check F "1970-02-07" "2001-11-12" +check G 1970 2001 +check g 70 01 +check H 07 21 +check h Feb Nov +check I 07 09 +check j 038 316 +check k " 7" 21 +check l " 7" " 9" +check M 04 20 +check m 02 11 +check p AM PM +check R 07:04 21:20 +check r "07:04:03 AM" "09:20:00 PM" +check S 03 00 +check s ${TEST1} ${TEST2} +check U 05 45 +check u 6 1 +check V 06 46 +check v " 7-Feb-1970" "12-Nov-2001" +check W 05 46 +check w 6 1 +check X "07:04:03" "21:20:00" +check x "02/07/70" "11/12/01" +check Y 1970 2001 +check y 70 01 +check Z UTC UTC +check z +0000 +0000 +check % % % +check + "Sat Feb 7 07:04:03 UTC 1970" "Mon Nov 12 21:20:00 UTC 2001" Modified: head/bin/mv/Makefile ============================================================================== --- head/bin/mv/Makefile Wed Dec 11 03:41:07 2013 (r259209) +++ head/bin/mv/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -1,6 +1,12 @@ # @(#)Makefile 8.2 (Berkeley) 4/2/94 # $FreeBSD$ +.include + PROG= mv +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/bin/mv/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/mv/tests/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/mv + +TAP_TESTS_SH= legacy_test + +.include Copied: head/bin/mv/tests/legacy_test.sh (from r258552, head/tools/regression/bin/mv/regress.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/mv/tests/legacy_test.sh Wed Dec 11 04:09:17 2013 (r259210, copy of r258552, head/tools/regression/bin/mv/regress.sh) @@ -0,0 +1,296 @@ +#!/bin/sh +# $FreeBSD$ + +# A directory in a device different from that where the tests are run +TMPDIR=/tmp/regress.$$ +COUNT=0 + +# Begin an individual test +begin() +{ + COUNT=`expr $COUNT + 1` + OK=1 + if [ -z "$FS" ] + then + NAME="$1" + else + NAME="$1 (cross device)" + fi + rm -rf testdir $TMPDIR/testdir + mkdir -p testdir $TMPDIR/testdir + cd testdir +} + +# End an individual test +end() +{ + if [ $OK = 1 ] + then + printf 'ok ' + else + printf 'not ok ' + fi + echo "$COUNT - $NAME" + cd .. + rm -rf testdir $TMPDIR/testdir +} + +# Make a file that can later be verified +mkf() +{ + CN=`basename $1` + echo "$CN-$CN" >$1 +} + +# Verify that the file specified is correct +ckf() +{ + if [ -f $2 ] && echo "$1-$1" | diff - $2 >/dev/null + then + ok + else + notok + fi +} + +# Make a fifo that can later be verified +mkp() +{ + mkfifo $1 +} + +# Verify that the file specified is correct +ckp() +{ + if [ -p $2 ] + then + ok + else + notok + fi +} + +# Make a directory that can later be verified +mkd() +{ + CN=`basename $1` + mkdir -p $1/"$CN-$CN" +} + +# Verify that the directory specified is correct +ckd() +{ + if [ -d $2/$1-$1 ] + then + ok + else + notok + fi +} + +# Verify that the specified file does not exist +# (is not there) +cknt() +{ + if [ -r $1 ] + then + notok + else + ok + fi +} + +# A part of a test succeeds +ok() +{ + : +} + +# A part of a test fails +notok() +{ + OK=0 +} + +# Verify that the exit code passed is for unsuccessful termination +ckfail() +{ + if [ $1 -gt 0 ] + then + ok + else + notok + fi +} + +# Verify that the exit code passed is for successful termination +ckok() +{ + if [ $1 -eq 0 ] + then + ok + else + notok + fi +} + +# Run all tests locally and across devices +echo 1..32 +for FS in '' $TMPDIR/testdir/ +do + begin 'Rename file' + mkf fa + mv fa ${FS}fb + ckok $? + ckf fa ${FS}fb + cknt fa + end + + begin 'Move files into directory' + mkf fa + mkf fb + mkdir -p ${FS}1/2/3 + mv fa fb ${FS}1/2/3 + ckok $? + ckf fa ${FS}1/2/3/fa + ckf fb ${FS}1/2/3/fb + cknt fa + cknt fb + end + + begin 'Move file from directory to file' + mkdir -p 1/2/3 + mkf 1/2/3/fa + mv 1/2/3/fa ${FS}fb + ckok $? + ckf fa ${FS}fb + cknt 1/2/3/fa + end + + begin 'Move file from directory to existing file' + mkdir -p 1/2/3 + mkf 1/2/3/fa + :> ${FS}fb + mv 1/2/3/fa ${FS}fb + ckok $? + ckf fa ${FS}fb + cknt 1/2/3/fa + end + + begin 'Move file from directory to existing directory' + mkdir -p 1/2/3 + mkf 1/2/3/fa + mkdir -p ${FS}db/fa + # Should fail per POSIX step 3a: + # Destination path is a file of type directory and + # source_file is not a file of type directory + mv 1/2/3/fa ${FS}db 2>/dev/null + ckfail $? + ckf fa 1/2/3/fa + end + + begin 'Move file from directory to directory' + mkdir -p da1/da2/da3 + mkdir -p ${FS}db1/db2/db3 + mkf da1/da2/da3/fa + mv da1/da2/da3/fa ${FS}db1/db2/db3/fb + ckok $? + ckf fa ${FS}db1/db2/db3/fb + cknt da1/da2/da3/fa + end + + begin 'Rename directory' + mkd da + mv da ${FS}db + ckok $? + ckd da ${FS}db + cknt da + end + + begin 'Move directory to directory name' + mkd da1/da2/da3/da + mkdir -p ${FS}db1/db2/db3 + mv da1/da2/da3/da ${FS}db1/db2/db3/db + ckok $? + ckd da ${FS}db1/db2/db3/db + cknt da1/da2/da3/da + end + + begin 'Move directory to directory' + mkd da1/da2/da3/da + mkdir -p ${FS}db1/db2/db3 + mv da1/da2/da3/da ${FS}db1/db2/db3 + ckok $? + ckd da ${FS}db1/db2/db3/da + cknt da1/da2/da3/da + end + + begin 'Move directory to existing empty directory' + mkd da1/da2/da3/da + mkdir -p ${FS}db1/db2/db3/da + mv da1/da2/da3/da ${FS}db1/db2/db3 + ckok $? + ckd da ${FS}db1/db2/db3/da + cknt da1/da2/da3/da + end + + begin 'Move directory to existing non-empty directory' + mkd da1/da2/da3/da + mkdir -p ${FS}db1/db2/db3/da/full + # Should fail (per the semantics of rename(2)) + mv da1/da2/da3/da ${FS}db1/db2/db3 2>/dev/null + ckfail $? + ckd da da1/da2/da3/da + end + + begin 'Move directory to existing file' + mkd da1/da2/da3/da + mkdir -p ${FS}db1/db2/db3 + :> ${FS}db1/db2/db3/da + # Should fail per POSIX step 3b: + # Destination path is a file not of type directory + # and source_file is a file of type directory + mv da1/da2/da3/da ${FS}db1/db2/db3/da 2>/dev/null + ckfail $? + ckd da da1/da2/da3/da + end + + begin 'Rename fifo' + mkp fa + mv fa ${FS}fb + ckok $? + ckp fa ${FS}fb + cknt fa + end + + begin 'Move fifos into directory' + mkp fa + mkp fb + mkdir -p ${FS}1/2/3 + mv fa fb ${FS}1/2/3 + ckok $? + ckp fa ${FS}1/2/3/fa + ckp fb ${FS}1/2/3/fb + cknt fa + cknt fb + end + + begin 'Move fifo from directory to fifo' + mkdir -p 1/2/3 + mkp 1/2/3/fa + mv 1/2/3/fa ${FS}fb + ckok $? + ckp fa ${FS}fb + cknt 1/2/3/fa + end + + begin 'Move fifo from directory to directory' + mkdir -p da1/da2/da3 + mkdir -p ${FS}db1/db2/db3 + mkp da1/da2/da3/fa + mv da1/da2/da3/fa ${FS}db1/db2/db3/fb + ckok $? + ckp fa ${FS}db1/db2/db3/fb + cknt da1/da2/da3/fa + end +done Modified: head/bin/pax/Makefile ============================================================================== --- head/bin/pax/Makefile Wed Dec 11 03:41:07 2013 (r259209) +++ head/bin/pax/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD$ +.include + # To install on versions prior to BSD 4.4 the following may have to be # defined with CFLAGS += # @@ -30,4 +32,8 @@ SRCS= ar_io.c ar_subs.c buf_subs.c cache gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \ tables.c tar.c tty_subs.c +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/bin/pax/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/pax/tests/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/pax + +TAP_TESTS_SH= legacy_test + +.include Copied: head/bin/pax/tests/legacy_test.sh (from r258552, head/tools/regression/bin/pax/regress.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/pax/tests/legacy_test.sh Wed Dec 11 04:09:17 2013 (r259210, copy of r258552, head/tools/regression/bin/pax/regress.t) @@ -0,0 +1,91 @@ +#! /usr/bin/perl +# +# $FreeBSD$ + +use strict; +use warnings; + +use Test::More tests => 6; +use File::Path qw(rmtree mkpath); +use Cwd; + +my $n = 0; +sub create_file { + my $fn = shift; + + $n++; + (my $dir = $fn) =~ s,/[^/]+$,,; + mkpath $dir; + open my $fd, ">", $fn or die "$fn: $!"; + print $fd "file $n\n"; +} + + +ustar_pathnames: { SKIP: { + # Prove that pax breaks up ustar pathnames properly + + my $top = getcwd . "/ustar-pathnames-1"; + skip "Current path is too long", 6 if length $top > 92; + rmtree $top; + my $subdir = "x" . "x" x (92 - length $top); + my $work94 = "$top/$subdir"; + mkpath $work94; # $work is 94 characters long + + my $x49 = "x" x 49; + my $x50 = "x" x 50; + my $x60 = "x" x 60; + my $x95 = "x" x 95; + + my @paths = ( + "$work94/x099", # 99 chars + "$work94/xx100", # 100 chars + "$work94/xxx101", # 101 chars + "$work94/$x49/${x50}x199", # 199 chars + "$work94/$x49/${x50}xx200", # 200 chars + "$work94/$x49/${x50}xxx201", # 201 chars + "$work94/$x60/${x95}254", # 254 chars + "$work94/$x60/${x95}x255", # 255 chars + ); + + my @l = map { length } @paths; + + my $n = 0; + create_file $_ for @paths; + system "pax -wf ustar.ok $work94"; + ok($? == 0, "Wrote 'ustar.ok' containing files with lengths @l"); + + (my $orig = $top) =~ s,1$,2,; + rmtree $orig; + rename $top, $orig; + + system "pax -rf ustar.ok"; + ok($? == 0, "Restored 'ustar.ok' containing files with lengths @l"); + + system "diff -ru $orig $top"; + ok($? == 0, "Restored files are identical"); + + rmtree $top; + rename $orig, $top; + + # 256 chars (with components < 100 chars) should not work + push @paths, "$work94/x$x60/${x95}x256"; # 256 chars + push @l, length $paths[-1]; + create_file $paths[-1]; + system "pax -wf ustar.fail1 $work94"; + ok($?, "Failed to write 'ustar.fail1' containing files with lengths @l"); + + # Components with 100 chars shouldn't work + unlink $paths[-1]; + $paths[-1] = "$work94/${x95}xc100"; # 100 char filename + $l[-1] = length $paths[-1]; + create_file $paths[-1]; + system "pax -wf ustar.fail2 $work94"; + ok($?, "Failed to write 'ustar.fail2' with a 100 char filename"); + + unlink $paths[-1]; + $paths[-1] = "$work94/${x95}xc100/x"; # 100 char component + $l[-1] = length $paths[-1]; + create_file $paths[-1]; + system "pax -wf ustar.fail3 $work94"; + ok($?, "Failed to write 'ustar.fail3' with a 100 char component"); +}} Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Dec 11 03:41:07 2013 (r259209) +++ head/bin/sh/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -1,6 +1,8 @@ # @(#)Makefile 8.4 (Berkeley) 5/5/95 # $FreeBSD$ +.include + PROG= sh INSTALLFLAGS= -S SHSRCS= alias.c arith_yacc.c arith_yylex.c cd.c echo.c error.c eval.c \ @@ -59,7 +61,8 @@ syntax.c syntax.h: mksyntax token.h: mktokens sh ${.CURDIR}/mktokens -regress: - cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif .include Added: head/bin/sh/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/sh + +TAP_TESTS_SH= legacy_test +TAP_TESTS_SH_SED_legacy_test= -e 's,__SH__,/bin/sh,g' + +SUBDIR+= builtins errors execution expansion parameters parser set-e + +.include Added: head/bin/sh/tests/builtins/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,147 @@ +# $FreeBSD$ + +.include + +FILESDIR= ${TESTSBASE}/bin/sh/builtins +KYUAFILE= no + +FILES= alias.0 alias.0.stdout +FILES+= alias.1 alias.1.stderr +FILES+= alias3.0 alias3.0.stdout +FILES+= alias4.0 +FILES+= break1.0 +FILES+= break2.0 break2.0.stdout +FILES+= break3.0 +FILES+= break4.4 +FILES+= break5.4 +FILES+= builtin1.0 +FILES+= case1.0 +FILES+= case2.0 +FILES+= case3.0 +FILES+= case4.0 +FILES+= case5.0 +FILES+= case6.0 +FILES+= case7.0 +FILES+= case8.0 +FILES+= case9.0 +FILES+= case10.0 +FILES+= case11.0 +FILES+= case12.0 +FILES+= case13.0 +FILES+= case14.0 +FILES+= case15.0 +FILES+= case16.0 +FILES+= case17.0 +FILES+= case18.0 +FILES+= case19.0 +FILES+= cd1.0 +FILES+= cd2.0 +FILES+= cd3.0 +FILES+= cd4.0 +FILES+= cd5.0 +FILES+= cd6.0 +FILES+= cd7.0 +FILES+= cd8.0 +FILES+= command1.0 +FILES+= command2.0 +FILES+= command3.0 +FILES+= command3.0.stdout +FILES+= command4.0 +FILES+= command5.0 +FILES+= command5.0.stdout +FILES+= command6.0 +FILES+= command6.0.stdout +FILES+= command7.0 +FILES+= command8.0 +FILES+= command9.0 +FILES+= command10.0 +FILES+= command11.0 +FILES+= command12.0 +FILES+= dot1.0 +FILES+= dot2.0 +FILES+= dot3.0 +FILES+= dot4.0 +FILES+= eval1.0 +FILES+= eval2.0 +FILES+= eval3.0 +FILES+= eval4.0 +FILES+= eval5.0 +FILES+= eval6.0 +FILES+= exec1.0 +FILES+= exec2.0 +FILES+= exit1.0 +FILES+= exit2.8 +FILES+= exit3.0 +FILES+= export1.0 +FILES+= fc1.0 +FILES+= fc2.0 +FILES+= for1.0 +FILES+= for2.0 +FILES+= for3.0 +FILES+= getopts1.0 getopts1.0.stdout +FILES+= getopts2.0 getopts2.0.stdout +FILES+= hash1.0 hash1.0.stdout +FILES+= hash2.0 hash2.0.stdout +FILES+= hash3.0 hash3.0.stdout +FILES+= hash4.0 +FILES+= jobid1.0 +FILES+= jobid2.0 +FILES+= lineno.0 lineno.0.stdout +FILES+= local1.0 +FILES+= local2.0 +FILES+= local3.0 +FILES+= local4.0 +FILES+= locale1.0 +FILES+= printf1.0 +FILES+= printf2.0 +FILES+= printf3.0 +FILES+= printf4.0 +FILES+= read1.0 read1.0.stdout +FILES+= read2.0 +FILES+= read3.0 read3.0.stdout +FILES+= read4.0 read4.0.stdout +FILES+= read5.0 +FILES+= read6.0 +FILES+= read7.0 +FILES+= return1.0 +FILES+= return2.1 +FILES+= return3.1 +FILES+= return4.0 +FILES+= return5.0 +FILES+= return6.4 +FILES+= return7.4 +FILES+= return8.0 +FILES+= set1.0 +FILES+= set2.0 +FILES+= trap1.0 +FILES+= trap10.0 +FILES+= trap11.0 +FILES+= trap12.0 +FILES+= trap13.0 +FILES+= trap14.0 +FILES+= trap2.0 +FILES+= trap3.0 +FILES+= trap4.0 +FILES+= trap5.0 +FILES+= trap6.0 +FILES+= trap7.0 +FILES+= trap8.0 +FILES+= trap9.0 +FILES+= type1.0 type1.0.stderr +FILES+= type2.0 +FILES+= type3.0 +FILES+= unalias.0 +FILES+= var-assign.0 +FILES+= var-assign2.0 +FILES+= wait1.0 +FILES+= wait2.0 +FILES+= wait3.0 +FILES+= wait4.0 +FILES+= wait5.0 +FILES+= wait6.0 +FILES+= wait7.0 +FILES+= wait8.0 +FILES+= wait9.127 +FILES+= wait10.0 + +.include Added: head/bin/sh/tests/errors/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/errors/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.include + +FILESDIR= ${TESTSBASE}/bin/sh/errors +KYUAFILE= no + +FILES= assignment-error1.0 +FILES+= assignment-error2.0 +FILES+= backquote-error1.0 +FILES+= backquote-error2.0 +FILES+= bad-binary1.126 +FILES+= bad-keyword1.0 +FILES+= bad-parm-exp1.0 +FILES+= bad-parm-exp2.2 bad-parm-exp2.2.stderr +FILES+= bad-parm-exp3.2 bad-parm-exp3.2.stderr +FILES+= bad-parm-exp4.2 bad-parm-exp4.2.stderr +FILES+= bad-parm-exp5.2 bad-parm-exp5.2.stderr +FILES+= bad-parm-exp6.2 bad-parm-exp6.2.stderr +FILES+= option-error.0 +FILES+= redirection-error.0 +FILES+= redirection-error2.2 +FILES+= redirection-error3.0 +FILES+= redirection-error4.0 +FILES+= redirection-error5.0 +FILES+= redirection-error6.0 +FILES+= redirection-error7.0 +FILES+= write-error1.0 + +.include Added: head/bin/sh/tests/execution/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,53 @@ +# $FreeBSD$ + +.include + +FILESDIR= ${TESTSBASE}/bin/sh/execution +KYUAFILE= no + +FILES= bg1.0 +FILES+= bg2.0 +FILES+= bg3.0 +FILES+= bg4.0 +FILES+= bg5.0 +FILES+= bg6.0 bg6.0.stdout +FILES+= bg7.0 +FILES+= bg8.0 +FILES+= bg9.0 +FILES+= bg10.0 bg10.0.stdout +FILES+= fork1.0 +FILES+= fork2.0 +FILES+= fork3.0 +FILES+= func1.0 +FILES+= func2.0 +FILES+= func3.0 +FILES+= hash1.0 +FILES+= int-cmd1.0 +FILES+= killed1.0 +FILES+= killed2.0 +FILES+= not1.0 +FILES+= not2.0 +FILES+= path1.0 +FILES+= redir1.0 +FILES+= redir2.0 +FILES+= redir3.0 +FILES+= redir4.0 +FILES+= redir5.0 +FILES+= redir6.0 +FILES+= redir7.0 +FILES+= set-n1.0 +FILES+= set-n2.0 +FILES+= set-n3.0 +FILES+= set-n4.0 +FILES+= set-x1.0 +FILES+= set-x2.0 +FILES+= set-x3.0 +FILES+= shellproc1.0 +FILES+= subshell1.0 subshell1.0.stdout +FILES+= subshell2.0 +FILES+= subshell3.0 +FILES+= subshell4.0 +FILES+= unknown1.0 +FILES+= var-assign1.0 + +.include Added: head/bin/sh/tests/expansion/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,86 @@ +# $FreeBSD$ + +.include + +FILESDIR= ${TESTSBASE}/bin/sh/expansion +KYUAFILE= no + +FILES= arith1.0 +FILES+= arith2.0 +FILES+= arith3.0 +FILES+= arith4.0 +FILES+= arith5.0 +FILES+= arith6.0 +FILES+= arith7.0 +FILES+= arith8.0 +FILES+= arith9.0 +FILES+= arith10.0 +FILES+= arith11.0 +FILES+= arith12.0 +FILES+= arith13.0 +FILES+= assign1.0 +FILES+= cmdsubst1.0 +FILES+= cmdsubst2.0 +FILES+= cmdsubst3.0 +FILES+= cmdsubst4.0 +FILES+= cmdsubst5.0 +FILES+= cmdsubst6.0 +FILES+= cmdsubst7.0 +FILES+= cmdsubst8.0 +FILES+= cmdsubst9.0 +FILES+= cmdsubst10.0 +FILES+= cmdsubst11.0 +FILES+= cmdsubst12.0 +FILES+= cmdsubst13.0 +FILES+= cmdsubst14.0 +FILES+= cmdsubst15.0 +FILES+= cmdsubst16.0 +FILES+= cmdsubst17.0 +FILES+= export1.0 +FILES+= export2.0 +FILES+= export3.0 +FILES+= heredoc1.0 +FILES+= heredoc2.0 +FILES+= ifs1.0 +FILES+= ifs2.0 +FILES+= ifs3.0 +FILES+= ifs4.0 +FILES+= length1.0 +FILES+= length2.0 +FILES+= length3.0 +FILES+= length4.0 +FILES+= length5.0 +FILES+= length6.0 +FILES+= length7.0 +FILES+= length8.0 +FILES+= local1.0 +FILES+= local2.0 +FILES+= pathname1.0 +FILES+= pathname2.0 +FILES+= pathname3.0 +FILES+= pathname4.0 +FILES+= plus-minus1.0 +FILES+= plus-minus2.0 +FILES+= plus-minus3.0 +FILES+= plus-minus4.0 +FILES+= plus-minus5.0 +FILES+= plus-minus6.0 +FILES+= plus-minus7.0 +FILES+= plus-minus8.0 +FILES+= question1.0 +FILES+= readonly1.0 +FILES+= set-u1.0 +FILES+= set-u2.0 +FILES+= set-u3.0 +FILES+= tilde1.0 +FILES+= tilde2.0 +FILES+= trim1.0 +FILES+= trim2.0 +FILES+= trim3.0 +FILES+= trim4.0 +FILES+= trim5.0 +FILES+= trim6.0 +FILES+= trim7.0 +FILES+= trim8.0 + +.include Copied and modified: head/bin/sh/tests/legacy_test.sh (from r258552, head/tools/regression/bin/sh/regress.sh) ============================================================================== --- head/tools/regression/bin/sh/regress.sh Mon Nov 25 13:30:06 2013 (r258552, copy source) +++ head/bin/sh/tests/legacy_test.sh Wed Dec 11 04:09:17 2013 (r259210) @@ -1,10 +1,13 @@ # $FreeBSD$ -if [ -z "${SH}" ]; then - echo '${SH} is not set, please correct and re-run.' - exit 1 -fi -export SH=${SH} +: ${SH:="__SH__"} +export SH + +# TODO(jmmv): The Kyua TAP interface should be passing us the value of +# "srcdir" as an environment variable, just as it does with the ATF +# interface in the form of a configuration variable. For now, just try +# to guess this. +: ${TESTS_DATA:=$(dirname ${0})} COUNTER=1 @@ -17,6 +20,7 @@ do_test() { rm tmp.stdout tmp.stderr return fi + sed -I '' -e "s|^${TESTS_DATA}|.|" tmp.stderr for i in stdout stderr; do if [ -f ${1}.${i} ]; then if ! cmp -s tmp.${i} ${1}.${i}; then @@ -34,7 +38,7 @@ do_test() { rm tmp.stdout tmp.stderr } -TESTS=$(find -Es . -regex ".*\.[0-9]+") +TESTS=$(find -Es ${TESTS_DATA} -regex ".*\.[0-9]+") printf "1..%d\n" $(echo ${TESTS} | wc -w) for i in ${TESTS} ; do Added: head/bin/sh/tests/parameters/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parameters/Makefile Wed Dec 11 04:09:17 2013 (r259210) @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.include + +FILESDIR= ${TESTSBASE}/bin/sh/parameters +KYUAFILE= no + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 04:31:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19F6A16C; Wed, 11 Dec 2013 04:31:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 060301201; Wed, 11 Dec 2013 04:31:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB4Veh3084907; Wed, 11 Dec 2013 04:31:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB4Ve2b084905; Wed, 11 Dec 2013 04:31:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201312110431.rBB4Ve2b084905@svn.freebsd.org> From: Mark Johnston Date: Wed, 11 Dec 2013 04:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259211 - in head/sys/cddl/contrib/opensolaris/uts: intel/dtrace powerpc/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 04:31:41 -0000 Author: markj Date: Wed Dec 11 04:31:40 2013 New Revision: 259211 URL: http://svnweb.freebsd.org/changeset/base/259211 Log: Correct the check for errors from proc_rwmem(). MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Wed Dec 11 04:09:17 2013 (r259210) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Wed Dec 11 04:31:40 2013 (r259211) @@ -75,7 +75,7 @@ proc_ops(int op, proc_t *p, void *kaddr, uio.uio_td = curthread; uio.uio_rw = op; PHOLD(p); - if (proc_rwmem(p, &uio) < 0) { + if (proc_rwmem(p, &uio) != 0) { PRELE(p); return (-1); } Modified: head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Dec 11 04:09:17 2013 (r259210) +++ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Wed Dec 11 04:31:40 2013 (r259211) @@ -60,7 +60,7 @@ proc_ops(int op, proc_t *p, void *kaddr, uio.uio_td = curthread; uio.uio_rw = op; PHOLD(p); - if (proc_rwmem(p, &uio) < 0) { + if (proc_rwmem(p, &uio) != 0) { PRELE(p); return (-1); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 05:32:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0956E64; Wed, 11 Dec 2013 05:32:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9162316EF; Wed, 11 Dec 2013 05:32:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB5WTiC006662; Wed, 11 Dec 2013 05:32:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB5WTk0006661; Wed, 11 Dec 2013 05:32:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312110532.rBB5WTk0006661@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Dec 2013 05:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259212 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 05:32:29 -0000 Author: imp Date: Wed Dec 11 05:32:29 2013 New Revision: 259212 URL: http://svnweb.freebsd.org/changeset/base/259212 Log: Fix one race and one fence post error. When the TX buffer was completely full, we'd not complete any of the mbufs due to the fence post error (this creates a large leak). When this is fixed, we still leak, but at a much smaller rate due to a race between ateintr and atestart_locked as well as an asymmetry where atestart_locked is called from elsewhere. Ensure that we free in-flight packets that have completed there as well. Also remove needless check for NULL on mb, checked earlier in the loop and simplify a redundant if. MFC after: 3 days Modified: head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Wed Dec 11 04:31:40 2013 (r259211) +++ head/sys/arm/at91/if_ate.c Wed Dec 11 05:32:29 2013 (r259212) @@ -947,10 +947,8 @@ ate_intr(void *xsc) } while (!done); - if (mb != NULL) { - ifp->if_ipackets++; - (*ifp->if_input)(ifp, mb); - } + ifp->if_ipackets++; + (*ifp->if_input)(ifp, mb); } } @@ -974,16 +972,14 @@ ate_intr(void *xsc) sc->tx_descs[sc->txtail + 1].status |= ETHB_TX_USED; } - while (sc->txtail != sc->txhead && - sc->tx_descs[sc->txtail].status & ETHB_TX_USED ) { - + while ((sc->tx_descs[sc->txtail].status & ETHB_TX_USED) && + sc->sent_mbuf[sc->txtail] != NULL) { bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txtail], BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]); m_freem(sc->sent_mbuf[sc->txtail]); sc->tx_descs[sc->txtail].addr = 0; sc->sent_mbuf[sc->txtail] = NULL; - ifp->if_opackets++; sc->txtail = NEXT_TX_IDX(sc, sc->txtail); } @@ -1118,12 +1114,10 @@ atestart_locked(struct ifnet *ifp) * xmit packets. We use OACTIVE to indicate "we can stuff more * into our buffers (clear) or not (set)." */ - if (!sc->is_emacb) { - /* RM9200 has only two hardware entries */ - if (!sc->is_emacb && (RD4(sc, ETH_TSR) & ETH_TSR_BNQ) == 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - return; - } + /* RM9200 has only two hardware entries */ + if (!sc->is_emacb && (RD4(sc, ETH_TSR) & ETH_TSR_BNQ) == 0) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + return; } IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -1146,6 +1140,21 @@ atestart_locked(struct ifnet *ifp) m_freem(m); continue; } + + /* + * There's a small race between the loop in ate_intr finishing + * and the check above to see if the packet was finished, as well + * as when atestart gets called via other paths. Loose the race + * gracefully and free the mbuf... + */ + if (sc->sent_mbuf[sc->txhead] != NULL) { + bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txtail], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]); + m_free(sc->sent_mbuf[sc->txhead]); + ifp->if_opackets++; + } + sc->sent_mbuf[sc->txhead] = m; bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txhead], From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 06:28:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4F17C84; Wed, 11 Dec 2013 06:28:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1F041B5D; Wed, 11 Dec 2013 06:28:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB6Sia7025338; Wed, 11 Dec 2013 06:28:44 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB6SiBZ025337; Wed, 11 Dec 2013 06:28:44 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201312110628.rBB6SiBZ025337@svn.freebsd.org> From: Neel Natu Date: Wed, 11 Dec 2013 06:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259213 - head/sys/amd64/vmm/io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 06:28:44 -0000 Author: neel Date: Wed Dec 11 06:28:44 2013 New Revision: 259213 URL: http://svnweb.freebsd.org/changeset/base/259213 Log: Fix typo when initializing the vlapic version register ('<<' instead of '<'). Modified: head/sys/amd64/vmm/io/vlapic.c Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Wed Dec 11 05:32:29 2013 (r259212) +++ head/sys/amd64/vmm/io/vlapic.c Wed Dec 11 06:28:44 2013 (r259213) @@ -260,7 +260,7 @@ vlapic_init_ipi(struct vlapic *vlapic) { struct LAPIC *lapic = &vlapic->apic; lapic->version = VLAPIC_VERSION; - lapic->version |= (VLAPIC_MAXLVT_ENTRIES < MAXLVTSHIFT); + lapic->version |= (VLAPIC_MAXLVT_ENTRIES << MAXLVTSHIFT); lapic->dfr = 0xffffffff; lapic->svr = APIC_SVR_VECTOR; vlapic_mask_lvts(&lapic->lvt_timer, VLAPIC_MAXLVT_ENTRIES+1); From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 07:34:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7995A7A; Wed, 11 Dec 2013 07:34:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2A4112D6; Wed, 11 Dec 2013 07:34:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB7YYYd051119; Wed, 11 Dec 2013 07:34:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB7YYsh051118; Wed, 11 Dec 2013 07:34:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312110734.rBB7YYsh051118@svn.freebsd.org> From: Dimitry Andric Date: Wed, 11 Dec 2013 07:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259214 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 07:34:34 -0000 Author: dim Date: Wed Dec 11 07:34:34 2013 New Revision: 259214 URL: http://svnweb.freebsd.org/changeset/base/259214 Log: MFC r259100: Pull in r196658 from upstream clang trunk: CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. [LLVM] PR18098. This should fix clang "Broken module found, compilation aborted" errors when building the qt4-based dvbcut port. Reported by: se Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Wed Dec 11 06:28:44 2013 (r259213) +++ stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Wed Dec 11 07:34:34 2013 (r259214) @@ -454,10 +454,9 @@ void CodeGenVTables::EmitThunk(GlobalDec } else { // Normal thunk body generation. CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk); + if (UseAvailableExternallyLinkage) + ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } - - if (UseAvailableExternallyLinkage) - ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD, From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 07:34:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B834A7B; Wed, 11 Dec 2013 07:34:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03F4412D7; Wed, 11 Dec 2013 07:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB7YYMM051125; Wed, 11 Dec 2013 07:34:34 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB7YY68051124; Wed, 11 Dec 2013 07:34:34 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312110734.rBB7YY68051124@svn.freebsd.org> From: Dimitry Andric Date: Wed, 11 Dec 2013 07:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259214 - in stable: 10/contrib/llvm/tools/clang/lib/CodeGen 9/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 07:34:35 -0000 Author: dim Date: Wed Dec 11 07:34:34 2013 New Revision: 259214 URL: http://svnweb.freebsd.org/changeset/base/259214 Log: MFC r259100: Pull in r196658 from upstream clang trunk: CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. [LLVM] PR18098. This should fix clang "Broken module found, compilation aborted" errors when building the qt4-based dvbcut port. Reported by: se Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp ============================================================================== --- stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Wed Dec 11 06:28:44 2013 (r259213) +++ stable/10/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Wed Dec 11 07:34:34 2013 (r259214) @@ -454,10 +454,9 @@ void CodeGenVTables::EmitThunk(GlobalDec } else { // Normal thunk body generation. CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk); + if (UseAvailableExternallyLinkage) + ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } - - if (UseAvailableExternallyLinkage) - ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD, From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 07:43:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D8D0F8B; Wed, 11 Dec 2013 07:43:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EDB013AC; Wed, 11 Dec 2013 07:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB7hVRp054577; Wed, 11 Dec 2013 07:43:31 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB7hVqf054576; Wed, 11 Dec 2013 07:43:31 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312110743.rBB7hVqf054576@svn.freebsd.org> From: Dimitry Andric Date: Wed, 11 Dec 2013 07:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259216 - in stable: 10/contrib/gcc/config/i386 9/contrib/gcc/config/i386 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 07:43:31 -0000 Author: dim Date: Wed Dec 11 07:43:30 2013 New Revision: 259216 URL: http://svnweb.freebsd.org/changeset/base/259216 Log: MFC r259111: Use correct casts in gcc's emmintrin.h for the first arguments of the following builtin functions: * __builtin_ia32_pslldi128() takes __v4si instead of __v8hi * __builtin_ia32_psllqi128() takes __v2di instead of __v8hi * __builtin_ia32_psradi128() takes __v4si instead of __v8hi This should fix the following errors when building the LINT kernel with gcc: sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of '__builtin_ia32_psradi128' sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of '__builtin_ia32_pslldi128' Modified: stable/10/contrib/gcc/config/i386/emmintrin.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/gcc/config/i386/emmintrin.h Directory Properties: stable/9/contrib/gcc/ (props changed) Modified: stable/10/contrib/gcc/config/i386/emmintrin.h ============================================================================== --- stable/10/contrib/gcc/config/i386/emmintrin.h Wed Dec 11 07:41:28 2013 (r259215) +++ stable/10/contrib/gcc/config/i386/emmintrin.h Wed Dec 11 07:43:30 2013 (r259216) @@ -1126,9 +1126,9 @@ _mm_slli_epi64 (__m128i __A, int __B) #define _mm_slli_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) #define _mm_slli_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_pslldi128 ((__v4si)(__A), __B)) #define _mm_slli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psllqi128 ((__v2di)(__A), __B)) #endif #if 0 @@ -1147,7 +1147,7 @@ _mm_srai_epi32 (__m128i __A, int __B) #define _mm_srai_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) #define _mm_srai_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psradi128 ((__v4si)(__A), __B)) #endif #if 0 From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 07:43:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 495ABF8A; Wed, 11 Dec 2013 07:43:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B05113AB; Wed, 11 Dec 2013 07:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB7hUI1054571; Wed, 11 Dec 2013 07:43:30 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB7hU64054570; Wed, 11 Dec 2013 07:43:30 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312110743.rBB7hU64054570@svn.freebsd.org> From: Dimitry Andric Date: Wed, 11 Dec 2013 07:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259216 - in stable: 10/contrib/gcc/config/i386 9/contrib/gcc/config/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 07:43:31 -0000 Author: dim Date: Wed Dec 11 07:43:30 2013 New Revision: 259216 URL: http://svnweb.freebsd.org/changeset/base/259216 Log: MFC r259111: Use correct casts in gcc's emmintrin.h for the first arguments of the following builtin functions: * __builtin_ia32_pslldi128() takes __v4si instead of __v8hi * __builtin_ia32_psllqi128() takes __v2di instead of __v8hi * __builtin_ia32_psradi128() takes __v4si instead of __v8hi This should fix the following errors when building the LINT kernel with gcc: sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of '__builtin_ia32_psradi128' sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of '__builtin_ia32_pslldi128' Modified: stable/9/contrib/gcc/config/i386/emmintrin.h Directory Properties: stable/9/contrib/gcc/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/gcc/config/i386/emmintrin.h Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/gcc/config/i386/emmintrin.h ============================================================================== --- stable/9/contrib/gcc/config/i386/emmintrin.h Wed Dec 11 07:41:28 2013 (r259215) +++ stable/9/contrib/gcc/config/i386/emmintrin.h Wed Dec 11 07:43:30 2013 (r259216) @@ -1126,9 +1126,9 @@ _mm_slli_epi64 (__m128i __A, int __B) #define _mm_slli_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) #define _mm_slli_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_pslldi128 ((__v4si)(__A), __B)) #define _mm_slli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psllqi128 ((__v2di)(__A), __B)) #endif #if 0 @@ -1147,7 +1147,7 @@ _mm_srai_epi32 (__m128i __A, int __B) #define _mm_srai_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) #define _mm_srai_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psradi128 ((__v4si)(__A), __B)) #endif #if 0 From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 08:46:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C483E2D7; Wed, 11 Dec 2013 08:46:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0F5C1AAA; Wed, 11 Dec 2013 08:46:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBB8kJvc076732; Wed, 11 Dec 2013 08:46:19 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBB8kJnp076730; Wed, 11 Dec 2013 08:46:19 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201312110846.rBB8kJnp076730@svn.freebsd.org> From: Robert Watson Date: Wed, 11 Dec 2013 08:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259217 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 08:46:19 -0000 Author: rwatson Date: Wed Dec 11 08:46:18 2013 New Revision: 259217 URL: http://svnweb.freebsd.org/changeset/base/259217 Log: Re-add jkh to the access file as his commit bit is being returned from safekeeping by core. As he has been away for a while, I'll be wearing the notional mentor hat (for a bit) to help him find his feet again -- in some ways this seems a bit silly, but on the other hand jkh has not yet had a chance to experience the dreaded 'mergeinfo' and I probably can be helpful in this regard (and others?)! Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Wed Dec 11 07:43:30 2013 (r259216) +++ svnadmin/conf/access Wed Dec 11 08:46:18 2013 (r259217) @@ -115,6 +115,7 @@ jhb jhibbits jilles jimharris +jkh jkim jlh jmallett Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Dec 11 07:43:30 2013 (r259216) +++ svnadmin/conf/mentors Wed Dec 11 08:46:18 2013 (r259217) @@ -20,6 +20,7 @@ edavis davidch eri mlaier Co-mentor: thompsa erwin delphij jceel wkoszek Co-mentor: cognet +jkh rwatson jmmv rpaulo jonathan rwatson jwd rmacklem From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 10:39:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD62EC31 for ; Wed, 11 Dec 2013 10:39:18 +0000 (UTC) Received: from ost.citrin.ru (ost.citrin.ru [193.169.234.215]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9500E163E for ; Wed, 11 Dec 2013 10:39:18 +0000 (UTC) Received: from citrin.office.vega.ru (citrin.office.vega.ru [10.100.124.49]) (Authenticated sender: citrin@citrin.ru) by ost.citrin.ru (Postfix) with ESMTPSA id 91928CEA7C1 for ; Wed, 11 Dec 2013 10:39:16 +0000 (UTC) Message-ID: <52A840D4.9020407@citrin.ru> Date: Wed, 11 Dec 2013 14:39:16 +0400 From: Anton Yuzhaninov User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130516 Thunderbird/17.0.6 MIME-Version: 1.0 To: svn-src-all@freebsd.org Subject: Re: svn commit: r259150 - head/sys/dev/cxgbe References: <201312100007.rBA074Qq055579@svn.freebsd.org> <20131210192650.GK4615@FreeBSD.org> <52A76BBE.5030903@FreeBSD.org> In-Reply-To: <52A76BBE.5030903@FreeBSD.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 10:39:18 -0000 On 12/10/13 23:30, Alexander Motin wrote: >> A> New Revision: 259150 >> A> URL: http://svnweb.freebsd.org/changeset/base/259150 >> A> >> A> Log: >> A> Print out the full PCIe link negotiation during dmesg. >> >> Shouldn't this be done with common code for all drivers >> on PCI bus(es)? >> >> This is definitely useful for all devices, not to cxgbe(4) only. > > Why not just read `pciconf -lc` output for that? 1. pciconf output is cryptic. At least units of measurement should be added. e. g. current output: cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link x4(x4) speed 5.0(5.0) ASPM disabled(L0s/L1) better to print like: cap 10[a0] = PCI-Express 2 endpoint max data 256(512) FLR link width x4(x4) speed 5.0 GT/s (5.0 GT/s) ASPM disabled(L0s/L1) 2. It is not obvious for system administrators, that pciconf should be used to inquire link speed. This feature is not documented in handbook or man pages. 3. I agree, that adding more noise to dmesg is not good, but if current bandwidth is not enough for optimal work of the device - error should be printed in dmesg. Example can be found in sys/dev/ixgbe/ixgbe.c if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && (hw->bus.speed == ixgbe_bus_speed_2500)) { device_printf(dev, "PCI-Express bandwidth available" " for this card\n is not sufficient for" " optimal performance.\n"); device_printf(dev, "For optimal performance a x8 " "PCIE, or x4 PCIE 2 slot is required.\n"); } 4. Similar speed check will be useful for many devices, not only for ixgbe or cxgbe and should be done in some generic way. From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 13:20:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2BE23C83; Wed, 11 Dec 2013 13:20:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 172BC18D7; Wed, 11 Dec 2013 13:20:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBDKaG3076937; Wed, 11 Dec 2013 13:20:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBDKWDw076917; Wed, 11 Dec 2013 13:20:32 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312111320.rBBDKWDw076917@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 11 Dec 2013 13:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259218 - in head/sys/dev/usb: . controller template X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 13:20:36 -0000 Author: hselasky Date: Wed Dec 11 13:20:32 2013 New Revision: 259218 URL: http://svnweb.freebsd.org/changeset/base/259218 Log: USB method structures for USB controllers and USB pipes should be constant and does not need to be modified. This also saves a small amount of RAM. Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/dwc_otg.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uhci.c head/sys/dev/usb/controller/uss820dci.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/template/usb_template.c head/sys/dev/usb/usb_bus.h head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/usbdi.h Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/at91dci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -103,11 +103,11 @@ SYSCTL_INT(_hw_usb_at91dci, OID_AUTO, de /* prototypes */ -struct usb_bus_methods at91dci_bus_methods; -struct usb_pipe_methods at91dci_device_bulk_methods; -struct usb_pipe_methods at91dci_device_ctrl_methods; -struct usb_pipe_methods at91dci_device_intr_methods; -struct usb_pipe_methods at91dci_device_isoc_fs_methods; +static const struct usb_bus_methods at91dci_bus_methods; +static const struct usb_pipe_methods at91dci_device_bulk_methods; +static const struct usb_pipe_methods at91dci_device_ctrl_methods; +static const struct usb_pipe_methods at91dci_device_intr_methods; +static const struct usb_pipe_methods at91dci_device_isoc_fs_methods; static at91dci_cmd_t at91dci_setup_rx; static at91dci_cmd_t at91dci_data_rx; @@ -1515,7 +1515,7 @@ at91dci_device_bulk_start(struct usb_xfe at91dci_start_standard_chain(xfer); } -struct usb_pipe_methods at91dci_device_bulk_methods = +static const struct usb_pipe_methods at91dci_device_bulk_methods = { .open = at91dci_device_bulk_open, .close = at91dci_device_bulk_close, @@ -1552,7 +1552,7 @@ at91dci_device_ctrl_start(struct usb_xfe at91dci_start_standard_chain(xfer); } -struct usb_pipe_methods at91dci_device_ctrl_methods = +static const struct usb_pipe_methods at91dci_device_ctrl_methods = { .open = at91dci_device_ctrl_open, .close = at91dci_device_ctrl_close, @@ -1589,7 +1589,7 @@ at91dci_device_intr_start(struct usb_xfe at91dci_start_standard_chain(xfer); } -struct usb_pipe_methods at91dci_device_intr_methods = +static const struct usb_pipe_methods at91dci_device_intr_methods = { .open = at91dci_device_intr_open, .close = at91dci_device_intr_close, @@ -1671,7 +1671,7 @@ at91dci_device_isoc_fs_start(struct usb_ at91dci_start_standard_chain(xfer); } -struct usb_pipe_methods at91dci_device_isoc_fs_methods = +static const struct usb_pipe_methods at91dci_device_isoc_fs_methods = { .open = at91dci_device_isoc_fs_open, .close = at91dci_device_isoc_fs_close, @@ -2318,7 +2318,7 @@ at91dci_set_hw_power_sleep(struct usb_bu } } -struct usb_bus_methods at91dci_bus_methods = +static const struct usb_bus_methods at91dci_bus_methods = { .endpoint_init = &at91dci_ep_init, .xfer_setup = &at91dci_xfer_setup, Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/atmegadci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -96,9 +96,9 @@ SYSCTL_INT(_hw_usb_atmegadci, OID_AUTO, /* prototypes */ -struct usb_bus_methods atmegadci_bus_methods; -struct usb_pipe_methods atmegadci_device_non_isoc_methods; -struct usb_pipe_methods atmegadci_device_isoc_fs_methods; +static const struct usb_bus_methods atmegadci_bus_methods; +static const struct usb_pipe_methods atmegadci_device_non_isoc_methods; +static const struct usb_pipe_methods atmegadci_device_isoc_fs_methods; static atmegadci_cmd_t atmegadci_setup_rx; static atmegadci_cmd_t atmegadci_data_rx; @@ -1410,7 +1410,7 @@ atmegadci_device_non_isoc_start(struct u atmegadci_start_standard_chain(xfer); } -struct usb_pipe_methods atmegadci_device_non_isoc_methods = +static const struct usb_pipe_methods atmegadci_device_non_isoc_methods = { .open = atmegadci_device_non_isoc_open, .close = atmegadci_device_non_isoc_close, @@ -1496,7 +1496,7 @@ atmegadci_device_isoc_fs_start(struct us atmegadci_start_standard_chain(xfer); } -struct usb_pipe_methods atmegadci_device_isoc_fs_methods = +static const struct usb_pipe_methods atmegadci_device_isoc_fs_methods = { .open = atmegadci_device_isoc_fs_open, .close = atmegadci_device_isoc_fs_close, @@ -2140,7 +2140,7 @@ atmegadci_set_hw_power_sleep(struct usb_ } } -struct usb_bus_methods atmegadci_bus_methods = +static const struct usb_bus_methods atmegadci_bus_methods = { .endpoint_init = &atmegadci_ep_init, .xfer_setup = &atmegadci_xfer_setup, Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/avr32dci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -94,9 +94,9 @@ SYSCTL_INT(_hw_usb_avr32dci, OID_AUTO, d /* prototypes */ -struct usb_bus_methods avr32dci_bus_methods; -struct usb_pipe_methods avr32dci_device_non_isoc_methods; -struct usb_pipe_methods avr32dci_device_isoc_fs_methods; +static const struct usb_bus_methods avr32dci_bus_methods; +static const struct usb_pipe_methods avr32dci_device_non_isoc_methods; +static const struct usb_pipe_methods avr32dci_device_isoc_fs_methods; static avr32dci_cmd_t avr32dci_setup_rx; static avr32dci_cmd_t avr32dci_data_rx; @@ -1340,7 +1340,7 @@ avr32dci_device_non_isoc_start(struct us avr32dci_start_standard_chain(xfer); } -struct usb_pipe_methods avr32dci_device_non_isoc_methods = +static const struct usb_pipe_methods avr32dci_device_non_isoc_methods = { .open = avr32dci_device_non_isoc_open, .close = avr32dci_device_non_isoc_close, @@ -1425,7 +1425,7 @@ avr32dci_device_isoc_fs_start(struct usb avr32dci_start_standard_chain(xfer); } -struct usb_pipe_methods avr32dci_device_isoc_fs_methods = +static const struct usb_pipe_methods avr32dci_device_isoc_fs_methods = { .open = avr32dci_device_isoc_fs_open, .close = avr32dci_device_isoc_fs_close, @@ -2084,7 +2084,7 @@ avr32dci_set_hw_power_sleep(struct usb_b } } -struct usb_bus_methods avr32dci_bus_methods = +static const struct usb_bus_methods avr32dci_bus_methods = { .endpoint_init = &avr32dci_ep_init, .xfer_setup = &avr32dci_xfer_setup, Modified: head/sys/dev/usb/controller/dwc_otg.c ============================================================================== --- head/sys/dev/usb/controller/dwc_otg.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/dwc_otg.c Wed Dec 11 13:20:32 2013 (r259218) @@ -122,9 +122,9 @@ SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, de /* prototypes */ -struct usb_bus_methods dwc_otg_bus_methods; -struct usb_pipe_methods dwc_otg_device_non_isoc_methods; -struct usb_pipe_methods dwc_otg_device_isoc_methods; +static const struct usb_bus_methods dwc_otg_bus_methods; +static const struct usb_pipe_methods dwc_otg_device_non_isoc_methods; +static const struct usb_pipe_methods dwc_otg_device_isoc_methods; static dwc_otg_cmd_t dwc_otg_setup_rx; static dwc_otg_cmd_t dwc_otg_data_rx; @@ -3327,7 +3327,7 @@ dwc_otg_device_non_isoc_start(struct usb dwc_otg_start_standard_chain(xfer); } -struct usb_pipe_methods dwc_otg_device_non_isoc_methods = +static const struct usb_pipe_methods dwc_otg_device_non_isoc_methods = { .open = dwc_otg_device_non_isoc_open, .close = dwc_otg_device_non_isoc_close, @@ -3422,7 +3422,7 @@ dwc_otg_device_isoc_start(struct usb_xfe dwc_otg_start_standard_chain(xfer); } -struct usb_pipe_methods dwc_otg_device_isoc_methods = +static const struct usb_pipe_methods dwc_otg_device_isoc_methods = { .open = dwc_otg_device_isoc_open, .close = dwc_otg_device_isoc_close, @@ -4201,7 +4201,7 @@ dwc_otg_device_suspend(struct usb_device USB_BUS_UNLOCK(udev->bus); } -struct usb_bus_methods dwc_otg_bus_methods = +static const struct usb_bus_methods dwc_otg_bus_methods = { .endpoint_init = &dwc_otg_ep_init, .xfer_setup = &dwc_otg_xfer_setup, Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/ehci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -119,12 +119,12 @@ static void ehci_dump_sqh(ehci_softc_t * #define EHCI_INTR_ENDPT 1 -extern struct usb_bus_methods ehci_bus_methods; -extern struct usb_pipe_methods ehci_device_bulk_methods; -extern struct usb_pipe_methods ehci_device_ctrl_methods; -extern struct usb_pipe_methods ehci_device_intr_methods; -extern struct usb_pipe_methods ehci_device_isoc_fs_methods; -extern struct usb_pipe_methods ehci_device_isoc_hs_methods; +static const struct usb_bus_methods ehci_bus_methods; +static const struct usb_pipe_methods ehci_device_bulk_methods; +static const struct usb_pipe_methods ehci_device_ctrl_methods; +static const struct usb_pipe_methods ehci_device_intr_methods; +static const struct usb_pipe_methods ehci_device_isoc_fs_methods; +static const struct usb_pipe_methods ehci_device_isoc_hs_methods; static void ehci_do_poll(struct usb_bus *); static void ehci_device_done(struct usb_xfer *, usb_error_t); @@ -1275,7 +1275,7 @@ done: static uint8_t ehci_check_transfer(struct usb_xfer *xfer) { - struct usb_pipe_methods *methods = xfer->endpoint->methods; + const struct usb_pipe_methods *methods = xfer->endpoint->methods; ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); uint32_t status; @@ -1756,7 +1756,7 @@ static void ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last) { struct ehci_std_temp temp; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; ehci_qh_t *qh; ehci_qtd_t *td; uint32_t qh_endp; @@ -2164,7 +2164,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, stru static void ehci_device_done(struct usb_xfer *xfer, usb_error_t error) { - struct usb_pipe_methods *methods = xfer->endpoint->methods; + const struct usb_pipe_methods *methods = xfer->endpoint->methods; ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus); USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -2258,7 +2258,7 @@ ehci_device_bulk_start(struct usb_xfer * EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD); } -struct usb_pipe_methods ehci_device_bulk_methods = +static const struct usb_pipe_methods ehci_device_bulk_methods = { .open = ehci_device_bulk_open, .close = ehci_device_bulk_close, @@ -2299,7 +2299,7 @@ ehci_device_ctrl_start(struct usb_xfer * ehci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ehci_device_ctrl_methods = +static const struct usb_pipe_methods ehci_device_ctrl_methods = { .open = ehci_device_ctrl_open, .close = ehci_device_ctrl_close, @@ -2380,7 +2380,7 @@ ehci_device_intr_start(struct usb_xfer * ehci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ehci_device_intr_methods = +static const struct usb_pipe_methods ehci_device_intr_methods = { .open = ehci_device_intr_open, .close = ehci_device_intr_close, @@ -2672,7 +2672,7 @@ ehci_device_isoc_fs_start(struct usb_xfe ehci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ehci_device_isoc_fs_methods = +static const struct usb_pipe_methods ehci_device_isoc_fs_methods = { .open = ehci_device_isoc_fs_open, .close = ehci_device_isoc_fs_close, @@ -2952,7 +2952,7 @@ ehci_device_isoc_hs_start(struct usb_xfe ehci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ehci_device_isoc_hs_methods = +static const struct usb_pipe_methods ehci_device_isoc_hs_methods = { .open = ehci_device_isoc_hs_open, .close = ehci_device_isoc_hs_close, @@ -3759,7 +3759,7 @@ ehci_device_resume(struct usb_device *ud { ehci_softc_t *sc = EHCI_BUS2SC(udev->bus); struct usb_xfer *xfer; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; DPRINTF("\n"); @@ -3793,7 +3793,7 @@ ehci_device_suspend(struct usb_device *u { ehci_softc_t *sc = EHCI_BUS2SC(udev->bus); struct usb_xfer *xfer; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; DPRINTF("\n"); @@ -3872,7 +3872,7 @@ ehci_set_hw_power(struct usb_bus *bus) return; } -struct usb_bus_methods ehci_bus_methods = +static const struct usb_bus_methods ehci_bus_methods = { .endpoint_init = ehci_ep_init, .xfer_setup = ehci_xfer_setup, Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/musb_otg.c Wed Dec 11 13:20:32 2013 (r259218) @@ -99,11 +99,11 @@ SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, de /* prototypes */ -struct usb_bus_methods musbotg_bus_methods; -struct usb_pipe_methods musbotg_device_bulk_methods; -struct usb_pipe_methods musbotg_device_ctrl_methods; -struct usb_pipe_methods musbotg_device_intr_methods; -struct usb_pipe_methods musbotg_device_isoc_methods; +static const struct usb_bus_methods musbotg_bus_methods; +static const struct usb_pipe_methods musbotg_device_bulk_methods; +static const struct usb_pipe_methods musbotg_device_ctrl_methods; +static const struct usb_pipe_methods musbotg_device_intr_methods; +static const struct usb_pipe_methods musbotg_device_isoc_methods; /* Control transfers: Device mode */ static musbotg_cmd_t musbotg_dev_ctrl_setup_rx; @@ -3335,7 +3335,7 @@ musbotg_device_bulk_start(struct usb_xfe musbotg_start_standard_chain(xfer); } -struct usb_pipe_methods musbotg_device_bulk_methods = +static const struct usb_pipe_methods musbotg_device_bulk_methods = { .open = musbotg_device_bulk_open, .close = musbotg_device_bulk_close, @@ -3372,7 +3372,7 @@ musbotg_device_ctrl_start(struct usb_xfe musbotg_start_standard_chain(xfer); } -struct usb_pipe_methods musbotg_device_ctrl_methods = +static const struct usb_pipe_methods musbotg_device_ctrl_methods = { .open = musbotg_device_ctrl_open, .close = musbotg_device_ctrl_close, @@ -3409,7 +3409,7 @@ musbotg_device_intr_start(struct usb_xfe musbotg_start_standard_chain(xfer); } -struct usb_pipe_methods musbotg_device_intr_methods = +static const struct usb_pipe_methods musbotg_device_intr_methods = { .open = musbotg_device_intr_open, .close = musbotg_device_intr_close, @@ -3498,7 +3498,7 @@ musbotg_device_isoc_start(struct usb_xfe musbotg_start_standard_chain(xfer); } -struct usb_pipe_methods musbotg_device_isoc_methods = +static const struct usb_pipe_methods musbotg_device_isoc_methods = { .open = musbotg_device_isoc_open, .close = musbotg_device_isoc_close, @@ -4218,7 +4218,7 @@ musbotg_set_hw_power_sleep(struct usb_bu } } -struct usb_bus_methods musbotg_bus_methods = +static const struct usb_bus_methods musbotg_bus_methods = { .endpoint_init = &musbotg_ep_init, .get_dma_delay = &musbotg_get_dma_delay, Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/ohci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -111,11 +111,11 @@ static void ohci_dump_itds(ohci_itd_t *) #define OHCI_INTR_ENDPT 1 -extern struct usb_bus_methods ohci_bus_methods; -extern struct usb_pipe_methods ohci_device_bulk_methods; -extern struct usb_pipe_methods ohci_device_ctrl_methods; -extern struct usb_pipe_methods ohci_device_intr_methods; -extern struct usb_pipe_methods ohci_device_isoc_methods; +static const struct usb_bus_methods ohci_bus_methods; +static const struct usb_pipe_methods ohci_device_bulk_methods; +static const struct usb_pipe_methods ohci_device_ctrl_methods; +static const struct usb_pipe_methods ohci_device_intr_methods; +static const struct usb_pipe_methods ohci_device_isoc_methods; static void ohci_do_poll(struct usb_bus *bus); static void ohci_device_done(struct usb_xfer *xfer, usb_error_t error); @@ -1393,7 +1393,7 @@ static void ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last) { struct ohci_std_temp temp; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; ohci_ed_t *ed; ohci_td_t *td; uint32_t ed_flags; @@ -1632,7 +1632,7 @@ ohci_root_intr(ohci_softc_t *sc) static void ohci_device_done(struct usb_xfer *xfer, usb_error_t error) { - struct usb_pipe_methods *methods = xfer->endpoint->methods; + const struct usb_pipe_methods *methods = xfer->endpoint->methods; ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus); ohci_ed_t *ed; @@ -1698,7 +1698,7 @@ ohci_device_bulk_start(struct usb_xfer * ohci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ohci_device_bulk_methods = +static const struct usb_pipe_methods ohci_device_bulk_methods = { .open = ohci_device_bulk_open, .close = ohci_device_bulk_close, @@ -1739,7 +1739,7 @@ ohci_device_ctrl_start(struct usb_xfer * ohci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ohci_device_ctrl_methods = +static const struct usb_pipe_methods ohci_device_ctrl_methods = { .open = ohci_device_ctrl_open, .close = ohci_device_ctrl_close, @@ -1811,7 +1811,7 @@ ohci_device_intr_start(struct usb_xfer * ohci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ohci_device_intr_methods = +static const struct usb_pipe_methods ohci_device_intr_methods = { .open = ohci_device_intr_open, .close = ohci_device_intr_close, @@ -2019,7 +2019,7 @@ ohci_device_isoc_start(struct usb_xfer * ohci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods ohci_device_isoc_methods = +static const struct usb_pipe_methods ohci_device_isoc_methods = { .open = ohci_device_isoc_open, .close = ohci_device_isoc_close, @@ -2598,7 +2598,7 @@ ohci_device_resume(struct usb_device *ud { struct ohci_softc *sc = OHCI_BUS2SC(udev->bus); struct usb_xfer *xfer; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; ohci_ed_t *ed; DPRINTF("\n"); @@ -2636,7 +2636,7 @@ ohci_device_suspend(struct usb_device *u { struct ohci_softc *sc = OHCI_BUS2SC(udev->bus); struct usb_xfer *xfer; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; ohci_ed_t *ed; DPRINTF("\n"); @@ -2720,7 +2720,7 @@ ohci_set_hw_power(struct usb_bus *bus) return; } -struct usb_bus_methods ohci_bus_methods = +static const struct usb_bus_methods ohci_bus_methods = { .endpoint_init = ohci_ep_init, .xfer_setup = ohci_xfer_setup, Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/uhci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -151,11 +151,11 @@ struct uhci_std_temp { uint8_t last_frame; }; -extern struct usb_bus_methods uhci_bus_methods; -extern struct usb_pipe_methods uhci_device_bulk_methods; -extern struct usb_pipe_methods uhci_device_ctrl_methods; -extern struct usb_pipe_methods uhci_device_intr_methods; -extern struct usb_pipe_methods uhci_device_isoc_methods; +static const struct usb_bus_methods uhci_bus_methods; +static const struct usb_pipe_methods uhci_device_bulk_methods; +static const struct usb_pipe_methods uhci_device_ctrl_methods; +static const struct usb_pipe_methods uhci_device_intr_methods; +static const struct usb_pipe_methods uhci_device_isoc_methods; static uint8_t uhci_restart(uhci_softc_t *sc); static void uhci_do_poll(struct usb_bus *); @@ -1840,7 +1840,7 @@ uhci_setup_standard_chain(struct usb_xfe static void uhci_device_done(struct usb_xfer *xfer, usb_error_t error) { - struct usb_pipe_methods *methods = xfer->endpoint->methods; + const struct usb_pipe_methods *methods = xfer->endpoint->methods; uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus); uhci_qh_t *qh; @@ -1935,7 +1935,7 @@ uhci_device_bulk_start(struct usb_xfer * uhci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods uhci_device_bulk_methods = +static const struct usb_pipe_methods uhci_device_bulk_methods = { .open = uhci_device_bulk_open, .close = uhci_device_bulk_close, @@ -1997,7 +1997,7 @@ uhci_device_ctrl_start(struct usb_xfer * uhci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods uhci_device_ctrl_methods = +static const struct usb_pipe_methods uhci_device_ctrl_methods = { .open = uhci_device_ctrl_open, .close = uhci_device_ctrl_close, @@ -2084,7 +2084,7 @@ uhci_device_intr_start(struct usb_xfer * uhci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods uhci_device_intr_methods = +static const struct usb_pipe_methods uhci_device_intr_methods = { .open = uhci_device_intr_open, .close = uhci_device_intr_close, @@ -2292,7 +2292,7 @@ uhci_device_isoc_start(struct usb_xfer * uhci_transfer_intr_enqueue(xfer); } -struct usb_pipe_methods uhci_device_isoc_methods = +static const struct usb_pipe_methods uhci_device_isoc_methods = { .open = uhci_device_isoc_open, .close = uhci_device_isoc_close, @@ -3076,7 +3076,7 @@ uhci_device_resume(struct usb_device *ud { struct uhci_softc *sc = UHCI_BUS2SC(udev->bus); struct usb_xfer *xfer; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; uhci_qh_t *qh; DPRINTF("\n"); @@ -3118,7 +3118,7 @@ uhci_device_suspend(struct usb_device *u { struct uhci_softc *sc = UHCI_BUS2SC(udev->bus); struct usb_xfer *xfer; - struct usb_pipe_methods *methods; + const struct usb_pipe_methods *methods; uhci_qh_t *qh; DPRINTF("\n"); @@ -3213,7 +3213,7 @@ uhci_set_hw_power(struct usb_bus *bus) } -struct usb_bus_methods uhci_bus_methods = +static const struct usb_bus_methods uhci_bus_methods = { .endpoint_init = uhci_ep_init, .xfer_setup = uhci_xfer_setup, Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/uss820dci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -94,11 +94,11 @@ SYSCTL_INT(_hw_usb_uss820dci, OID_AUTO, /* prototypes */ -struct usb_bus_methods uss820dci_bus_methods; -struct usb_pipe_methods uss820dci_device_bulk_methods; -struct usb_pipe_methods uss820dci_device_ctrl_methods; -struct usb_pipe_methods uss820dci_device_intr_methods; -struct usb_pipe_methods uss820dci_device_isoc_fs_methods; +static const struct usb_bus_methods uss820dci_bus_methods; +static const struct usb_pipe_methods uss820dci_device_bulk_methods; +static const struct usb_pipe_methods uss820dci_device_ctrl_methods; +static const struct usb_pipe_methods uss820dci_device_intr_methods; +static const struct usb_pipe_methods uss820dci_device_isoc_fs_methods; static uss820dci_cmd_t uss820dci_setup_rx; static uss820dci_cmd_t uss820dci_data_rx; @@ -1571,7 +1571,7 @@ uss820dci_device_bulk_start(struct usb_x uss820dci_start_standard_chain(xfer); } -struct usb_pipe_methods uss820dci_device_bulk_methods = +static const struct usb_pipe_methods uss820dci_device_bulk_methods = { .open = uss820dci_device_bulk_open, .close = uss820dci_device_bulk_close, @@ -1608,7 +1608,7 @@ uss820dci_device_ctrl_start(struct usb_x uss820dci_start_standard_chain(xfer); } -struct usb_pipe_methods uss820dci_device_ctrl_methods = +static const struct usb_pipe_methods uss820dci_device_ctrl_methods = { .open = uss820dci_device_ctrl_open, .close = uss820dci_device_ctrl_close, @@ -1645,7 +1645,7 @@ uss820dci_device_intr_start(struct usb_x uss820dci_start_standard_chain(xfer); } -struct usb_pipe_methods uss820dci_device_intr_methods = +static const struct usb_pipe_methods uss820dci_device_intr_methods = { .open = uss820dci_device_intr_open, .close = uss820dci_device_intr_close, @@ -1727,7 +1727,7 @@ uss820dci_device_isoc_fs_start(struct us uss820dci_start_standard_chain(xfer); } -struct usb_pipe_methods uss820dci_device_isoc_fs_methods = +static const struct usb_pipe_methods uss820dci_device_isoc_fs_methods = { .open = uss820dci_device_isoc_fs_open, .close = uss820dci_device_isoc_fs_close, @@ -2376,7 +2376,7 @@ uss820dci_set_hw_power_sleep(struct usb_ } } -struct usb_bus_methods uss820dci_bus_methods = +static const struct usb_bus_methods uss820dci_bus_methods = { .endpoint_init = &uss820dci_ep_init, .xfer_setup = &uss820dci_xfer_setup, Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/controller/xhci.c Wed Dec 11 13:20:32 2013 (r259218) @@ -160,7 +160,7 @@ static void xhci_ctx_set_le64(struct xhc static uint64_t xhci_ctx_get_le64(struct xhci_softc *sc, volatile uint64_t *ptr); #endif -extern struct usb_bus_methods xhci_bus_methods; +static const struct usb_bus_methods xhci_bus_methods; #ifdef USB_DEBUG static void @@ -3069,7 +3069,7 @@ xhci_device_generic_start(struct usb_xfe usbd_transfer_timeout_ms(xfer, &xhci_timeout, xfer->timeout); } -struct usb_pipe_methods xhci_device_generic_methods = +static const struct usb_pipe_methods xhci_device_generic_methods = { .open = xhci_device_generic_open, .close = xhci_device_generic_close, @@ -4235,7 +4235,7 @@ xhci_set_endpoint_mode(struct usb_device } } -struct usb_bus_methods xhci_bus_methods = { +static const struct usb_bus_methods xhci_bus_methods = { .endpoint_init = xhci_ep_init, .endpoint_uninit = xhci_ep_uninit, .xfer_setup = xhci_xfer_setup, Modified: head/sys/dev/usb/template/usb_template.c ============================================================================== --- head/sys/dev/usb/template/usb_template.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/template/usb_template.c Wed Dec 11 13:20:32 2013 (r259218) @@ -846,7 +846,7 @@ usb_hw_ep_resolve(struct usb_device *ude struct usb_hw_ep_scratch *ues; struct usb_hw_ep_scratch_sub *ep; const struct usb_hw_ep_profile *pf; - struct usb_bus_methods *methods; + const struct usb_bus_methods *methods; struct usb_device_descriptor *dd; uint16_t mps; Modified: head/sys/dev/usb/usb_bus.h ============================================================================== --- head/sys/dev/usb/usb_bus.h Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/usb_bus.h Wed Dec 11 13:20:32 2013 (r259218) @@ -97,7 +97,7 @@ struct usb_bus { struct usb_dma_parent_tag dma_parent_tag[1]; struct usb_dma_tag dma_tags[USB_BUS_DMA_TAG_MAX]; #endif - struct usb_bus_methods *methods; /* filled by HC driver */ + const struct usb_bus_methods *methods; /* filled by HC driver */ struct usb_device **devices; struct ifnet *ifp; /* only for USB Packet Filter */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/usb_device.c Wed Dec 11 13:20:32 2013 (r259218) @@ -376,7 +376,7 @@ usb_init_endpoint(struct usb_device *ude struct usb_endpoint_ss_comp_descriptor *ecomp, struct usb_endpoint *ep) { - struct usb_bus_methods *methods; + const struct usb_bus_methods *methods; usb_stream_t x; methods = udev->bus->methods; Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/usb_device.h Wed Dec 11 13:20:32 2013 (r259218) @@ -139,7 +139,7 @@ struct usb_hw_ep_scratch { struct usb_hw_ep_scratch_sub *ep_max; struct usb_config_descriptor *cd; struct usb_device *udev; - struct usb_bus_methods *methods; + const struct usb_bus_methods *methods; uint8_t bmOutAlloc[(USB_EP_MAX + 15) / 16]; uint8_t bmInAlloc[(USB_EP_MAX + 15) / 16]; }; Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/usb_hub.c Wed Dec 11 13:20:32 2013 (r259218) @@ -2541,7 +2541,7 @@ usbd_set_power_mode(struct usb_device *u uint8_t usbd_filter_power_mode(struct usb_device *udev, uint8_t power_mode) { - struct usb_bus_methods *mtod; + const struct usb_bus_methods *mtod; int8_t temp; mtod = udev->bus->methods; Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/usb_transfer.c Wed Dec 11 13:20:32 2013 (r259218) @@ -160,7 +160,7 @@ usbd_update_max_frame_size(struct usb_xf usb_timeout_t usbd_get_dma_delay(struct usb_device *udev) { - struct usb_bus_methods *mtod; + const struct usb_bus_methods *mtod; uint32_t temp; mtod = udev->bus->methods; Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Wed Dec 11 08:46:18 2013 (r259217) +++ head/sys/dev/usb/usbdi.h Wed Dec 11 13:20:32 2013 (r259218) @@ -140,7 +140,7 @@ struct usb_endpoint { struct usb_endpoint_descriptor *edesc; struct usb_endpoint_ss_comp_descriptor *ecomp; - struct usb_pipe_methods *methods; /* set by HC driver */ + const struct usb_pipe_methods *methods; /* set by HC driver */ uint16_t isoc_next; From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 14:54:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C238B14; Wed, 11 Dec 2013 14:54:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18EEE1285; Wed, 11 Dec 2013 14:54:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBEswCq013676; Wed, 11 Dec 2013 14:54:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBEswxF013675; Wed, 11 Dec 2013 14:54:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312111454.rBBEswxF013675@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Dec 2013 14:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259219 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 14:54:59 -0000 Author: eadler Date: Wed Dec 11 14:54:58 2013 New Revision: 259219 URL: http://svnweb.freebsd.org/changeset/base/259219 Log: calendar(1): use strlcpy instead of strncpy use strlcpy instead of strncpy which avoids non-null-termination if the string is MAXPATHLEN bytes or longer. Modified: head/usr.bin/calendar/calcpp.c Modified: head/usr.bin/calendar/calcpp.c ============================================================================== --- head/usr.bin/calendar/calcpp.c Wed Dec 11 13:20:32 2013 (r259218) +++ head/usr.bin/calendar/calcpp.c Wed Dec 11 14:54:58 2013 (r259219) @@ -133,7 +133,7 @@ tokenscpp(char *buf, char *string) s = p; while(!isspace((unsigned char)*p)) p++; - strncpy(string, s, MAXPATHLEN); + strlcpy(string, s, MAXPATHLEN); return(T_DEFINE); } else if ((p = strstr(buf, "#ifndef")) != NULL) { p += 8; From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 15:32:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 185A88DD; Wed, 11 Dec 2013 15:32:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 047EE1637; Wed, 11 Dec 2013 15:32:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBFWS9U029103; Wed, 11 Dec 2013 15:32:28 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBFWSbS029102; Wed, 11 Dec 2013 15:32:28 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201312111532.rBBFWSbS029102@svn.freebsd.org> From: Warner Losh Date: Wed, 11 Dec 2013 15:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259220 - head/sys/arm/at91 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 15:32:29 -0000 Author: imp Date: Wed Dec 11 15:32:28 2013 New Revision: 259220 URL: http://svnweb.freebsd.org/changeset/base/259220 Log: Loose -> Lose so this sentence makes sense. MFC after: 3 days Modified: head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Wed Dec 11 14:54:58 2013 (r259219) +++ head/sys/arm/at91/if_ate.c Wed Dec 11 15:32:28 2013 (r259220) @@ -1144,7 +1144,7 @@ atestart_locked(struct ifnet *ifp) /* * There's a small race between the loop in ate_intr finishing * and the check above to see if the packet was finished, as well - * as when atestart gets called via other paths. Loose the race + * as when atestart gets called via other paths. Lose the race * gracefully and free the mbuf... */ if (sc->sent_mbuf[sc->txhead] != NULL) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 17:18:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE3BBD8D; Wed, 11 Dec 2013 17:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CA5D211FC; Wed, 11 Dec 2013 17:18:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBHIAYH065187; Wed, 11 Dec 2013 17:18:10 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBHIAgM065186; Wed, 11 Dec 2013 17:18:10 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201312111718.rBBHIAgM065186@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 11 Dec 2013 17:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259221 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 17:18:10 -0000 Author: gnn Date: Wed Dec 11 17:18:10 2013 New Revision: 259221 URL: http://svnweb.freebsd.org/changeset/base/259221 Log: Fix a panic when booting with kernels that have FREEBBSD_COMPAT 4, 5, 6 or 43 by only thunking the data parameter for old ioctls compatability ioctls instead of doing it for all of them. Submitted by: jhb@ Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Dec 11 15:32:28 2013 (r259220) +++ head/sys/dev/vt/vt_core.c Wed Dec 11 17:18:10 2013 (r259221) @@ -1321,9 +1321,12 @@ vtterm_ioctl(struct terminal *tm, u_long case _IO('c', 110): cmd = CONS_SETKBD; break; + default: + goto skip_thunk; } ival = IOCPARM_IVAL(data); data = (caddr_t)&ival; +skip_thunk: #endif switch (cmd) { From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 17:40:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96CE3557; Wed, 11 Dec 2013 17:40:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8384E14C9; Wed, 11 Dec 2013 17:40:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBHea7A073967; Wed, 11 Dec 2013 17:40:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBHeaOP073966; Wed, 11 Dec 2013 17:40:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312111740.rBBHeaOP073966@svn.freebsd.org> From: Alexander Motin Date: Wed, 11 Dec 2013 17:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259222 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 17:40:36 -0000 Author: mav Date: Wed Dec 11 17:40:35 2013 New Revision: 259222 URL: http://svnweb.freebsd.org/changeset/base/259222 Log: Destroy mtx lock when failed to allocate memory during attach. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/sys/dev/ahci/ahciem.c Modified: head/sys/dev/ahci/ahciem.c ============================================================================== --- head/sys/dev/ahci/ahciem.c Wed Dec 11 17:18:10 2013 (r259221) +++ head/sys/dev/ahci/ahciem.c Wed Dec 11 17:40:35 2013 (r259222) @@ -85,8 +85,10 @@ ahci_em_attach(device_t dev) mtx_init(&enc->mtx, "AHCI enclosure lock", NULL, MTX_DEF); rid = 0; if (!(enc->r_memc = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &rid, RF_ACTIVE))) + &rid, RF_ACTIVE))) { + mtx_destroy(&enc->mtx); return (ENXIO); + } enc->capsem = ATA_INL(enc->r_memc, 0); rid = 1; if (!(enc->r_memt = bus_alloc_resource_any(dev, SYS_RES_MEMORY, From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 19:25:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5ECF4E37; Wed, 11 Dec 2013 19:25:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3EF931F6C; Wed, 11 Dec 2013 19:25:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBJPJOq012557; Wed, 11 Dec 2013 19:25:19 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBJPI4S012549; Wed, 11 Dec 2013 19:25:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312111925.rBBJPI4S012549@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Dec 2013 19:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259223 - in stable/10: sbin/fsck_ffs sbin/growfs sys/fs/ext2fs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 19:25:19 -0000 Author: pfg Date: Wed Dec 11 19:25:17 2013 New Revision: 259223 URL: http://svnweb.freebsd.org/changeset/base/259223 Log: MFC r256448, r257029; Make di_blocks unsigned in UFS1 as is the case already for UFS2. Most of the code between UFS1 and UFS2 is shared so this change is pretty safe. Not only this makes UFS1 and 2 consistent but it also matches what NetBSD and MacOS X have for some years now. UFS2: make di_extsize unsigned. di_extsize is the EA size and as such it should be unsigned. Adjust related types for consistency. Reviewed by: mckusick Modified: stable/10/sbin/fsck_ffs/ea.c stable/10/sbin/growfs/debug.c stable/10/sys/fs/ext2fs/ext2_vnops.c stable/10/sys/ufs/ffs/ffs_vnops.c stable/10/sys/ufs/ufs/dinode.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_ffs/ea.c ============================================================================== --- stable/10/sbin/fsck_ffs/ea.c Wed Dec 11 17:40:35 2013 (r259222) +++ stable/10/sbin/fsck_ffs/ea.c Wed Dec 11 19:25:17 2013 (r259223) @@ -65,7 +65,7 @@ eascan(struct inodesc *idesc, struct ufs char dbuf[DIRBLKSIZ]; printf("Inode %ju extsize %ju\n", - (intmax_t)idesc->id_number, (intmax_t)dp->di_extsize); + (intmax_t)idesc->id_number, (uintmax_t)dp->di_extsize); if (dp->di_extsize == 0) return 0; if (dp->di_extsize <= sblock.fs_fsize) Modified: stable/10/sbin/growfs/debug.c ============================================================================== --- stable/10/sbin/growfs/debug.c Wed Dec 11 17:40:35 2013 (r259222) +++ stable/10/sbin/growfs/debug.c Wed Dec 11 19:25:17 2013 (r259223) @@ -765,7 +765,7 @@ dbg_dump_ufs2_ino(struct fs *sb, const c fprintf(dbg_log, "gen int32_t 0x%08x\n", ino->di_gen); fprintf(dbg_log, "kernflags u_int32_t 0x%08x\n", ino->di_kernflags); fprintf(dbg_log, "flags u_int32_t 0x%08x\n", ino->di_flags); - fprintf(dbg_log, "extsize int32_t 0x%08x\n", ino->di_extsize); + fprintf(dbg_log, "extsize u_int32_t 0x%08x\n", ino->di_extsize); /* XXX: What do we do with di_extb[NXADDR]? */ Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Wed Dec 11 17:40:35 2013 (r259222) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Wed Dec 11 19:25:17 2013 (r259223) @@ -1689,7 +1689,7 @@ ext2_ind_read(struct vop_read_args *ap) NOCRED, blkoffset + uio->uio_resid, seqcount, 0, &bp); } else if (seqcount > 1) { - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, &bp); } else Modified: stable/10/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 17:40:35 2013 (r259222) +++ stable/10/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:25:17 2013 (r259223) @@ -531,7 +531,7 @@ ffs_read(ap) * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn_flags(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, GB_UNMAPPED, &bp); } else { @@ -956,7 +956,7 @@ ffs_extread(struct vnode *vp, struct uio * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = sblksize(fs, dp->di_extsize, nextlbn); + u_int nextsize = sblksize(fs, dp->di_extsize, nextlbn); nextlbn = -1 - nextlbn; error = breadn(vp, -1 - lbn, @@ -1218,7 +1218,8 @@ ffs_rdextattr(u_char **p, struct vnode * struct fs *fs; struct uio luio; struct iovec liovec; - int easize, error; + u_int easize; + int error; u_char *eae; ip = VTOI(vp); Modified: stable/10/sys/ufs/ufs/dinode.h ============================================================================== --- stable/10/sys/ufs/ufs/dinode.h Wed Dec 11 17:40:35 2013 (r259222) +++ stable/10/sys/ufs/ufs/dinode.h Wed Dec 11 19:25:17 2013 (r259223) @@ -141,7 +141,7 @@ struct ufs2_dinode { u_int32_t di_gen; /* 80: Generation number. */ u_int32_t di_kernflags; /* 84: Kernel flags. */ u_int32_t di_flags; /* 88: Status flags (chflags). */ - int32_t di_extsize; /* 92: External attributes block. */ + u_int32_t di_extsize; /* 92: External attributes size. */ ufs2_daddr_t di_extb[NXADDR];/* 96: External attributes block. */ ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */ ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */ @@ -179,7 +179,7 @@ struct ufs1_dinode { ufs1_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ ufs1_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ u_int32_t di_flags; /* 100: Status flags (chflags). */ - int32_t di_blocks; /* 104: Blocks actually held. */ + u_int32_t di_blocks; /* 104: Blocks actually held. */ u_int32_t di_gen; /* 108: Generation number. */ u_int32_t di_uid; /* 112: File owner. */ u_int32_t di_gid; /* 116: File group. */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 19:25:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8026EF6D; Wed, 11 Dec 2013 19:25:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 603CC1F74; Wed, 11 Dec 2013 19:25:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBJPeOM012628; Wed, 11 Dec 2013 19:25:40 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBJPd0m012620; Wed, 11 Dec 2013 19:25:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312111925.rBBJPd0m012620@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Dec 2013 19:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259224 - in stable/9: sbin/fsck_ffs sbin/growfs sys/fs/ext2fs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 19:25:40 -0000 Author: pfg Date: Wed Dec 11 19:25:38 2013 New Revision: 259224 URL: http://svnweb.freebsd.org/changeset/base/259224 Log: MFC r256448, r257029; Make di_blocks unsigned in UFS1 as is the case already for UFS2. Most of the code between UFS1 and UFS2 is shared so this change is pretty safe. Not only this makes UFS1 and 2 consistent but it also matches what NetBSD and MacOS X have for some years now. UFS2: make di_extsize unsigned. di_extsize is the EA size and as such it should be unsigned. Adjust related types for consistency. Reviewed by: mckusick Modified: stable/9/sbin/fsck_ffs/ea.c stable/9/sbin/growfs/debug.c stable/9/sys/fs/ext2fs/ext2_vnops.c stable/9/sys/ufs/ffs/ffs_vnops.c stable/9/sys/ufs/ufs/dinode.h Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/fsck_ffs/ (props changed) stable/9/sbin/growfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sbin/fsck_ffs/ea.c ============================================================================== --- stable/9/sbin/fsck_ffs/ea.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sbin/fsck_ffs/ea.c Wed Dec 11 19:25:38 2013 (r259224) @@ -65,7 +65,7 @@ eascan(struct inodesc *idesc, struct ufs char dbuf[DIRBLKSIZ]; printf("Inode %ju extsize %ju\n", - (intmax_t)idesc->id_number, (intmax_t)dp->di_extsize); + (intmax_t)idesc->id_number, (uintmax_t)dp->di_extsize); if (dp->di_extsize == 0) return 0; if (dp->di_extsize <= sblock.fs_fsize) Modified: stable/9/sbin/growfs/debug.c ============================================================================== --- stable/9/sbin/growfs/debug.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sbin/growfs/debug.c Wed Dec 11 19:25:38 2013 (r259224) @@ -765,7 +765,7 @@ dbg_dump_ufs2_ino(struct fs *sb, const c fprintf(dbg_log, "gen int32_t 0x%08x\n", ino->di_gen); fprintf(dbg_log, "kernflags u_int32_t 0x%08x\n", ino->di_kernflags); fprintf(dbg_log, "flags u_int32_t 0x%08x\n", ino->di_flags); - fprintf(dbg_log, "extsize int32_t 0x%08x\n", ino->di_extsize); + fprintf(dbg_log, "extsize u_int32_t 0x%08x\n", ino->di_extsize); /* XXX: What do we do with di_extb[NXADDR]? */ Modified: stable/9/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vnops.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sys/fs/ext2fs/ext2_vnops.c Wed Dec 11 19:25:38 2013 (r259224) @@ -1694,7 +1694,7 @@ ext2_ind_read(struct vop_read_args *ap) error = cluster_read(vp, ip->i_size, lbn, size, NOCRED, blkoffset + uio->uio_resid, seqcount, &bp); else if (seqcount > 1) { - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, &bp); } else Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:25:38 2013 (r259224) @@ -530,7 +530,7 @@ ffs_read(ap) * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn_flags(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, GB_UNMAPPED, &bp); } else { @@ -956,7 +956,7 @@ ffs_extread(struct vnode *vp, struct uio * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = sblksize(fs, dp->di_extsize, nextlbn); + u_int nextsize = sblksize(fs, dp->di_extsize, nextlbn); nextlbn = -1 - nextlbn; error = breadn(vp, -1 - lbn, @@ -1218,7 +1218,8 @@ ffs_rdextattr(u_char **p, struct vnode * struct fs *fs; struct uio luio; struct iovec liovec; - int easize, error; + u_int easize; + int error; u_char *eae; ip = VTOI(vp); Modified: stable/9/sys/ufs/ufs/dinode.h ============================================================================== --- stable/9/sys/ufs/ufs/dinode.h Wed Dec 11 19:25:17 2013 (r259223) +++ stable/9/sys/ufs/ufs/dinode.h Wed Dec 11 19:25:38 2013 (r259224) @@ -141,7 +141,7 @@ struct ufs2_dinode { u_int32_t di_gen; /* 80: Generation number. */ u_int32_t di_kernflags; /* 84: Kernel flags. */ u_int32_t di_flags; /* 88: Status flags (chflags). */ - int32_t di_extsize; /* 92: External attributes block. */ + u_int32_t di_extsize; /* 92: External attributes size. */ ufs2_daddr_t di_extb[NXADDR];/* 96: External attributes block. */ ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */ ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */ @@ -179,7 +179,7 @@ struct ufs1_dinode { ufs1_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ ufs1_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ u_int32_t di_flags; /* 100: Status flags (chflags). */ - int32_t di_blocks; /* 104: Blocks actually held. */ + u_int32_t di_blocks; /* 104: Blocks actually held. */ u_int32_t di_gen; /* 108: Generation number. */ u_int32_t di_uid; /* 112: File owner. */ u_int32_t di_gid; /* 116: File group. */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 19:26:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9538515B; Wed, 11 Dec 2013 19:26:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80CD41F8B; Wed, 11 Dec 2013 19:26:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBJQvxv012825; Wed, 11 Dec 2013 19:26:57 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBJQuos012821; Wed, 11 Dec 2013 19:26:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312111926.rBBJQuos012821@svn.freebsd.org> From: Glen Barber Date: Wed, 11 Dec 2013 19:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259225 - in stable/10: release share/man/man7 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 19:26:57 -0000 Author: gjb Date: Wed Dec 11 19:26:56 2013 New Revision: 259225 URL: http://svnweb.freebsd.org/changeset/base/259225 Log: MFC r257805, r257806, r257807, r257942: r257805: Add a 'mini-memstick.img' release target, which will use the 'bootonly.iso' components to create a smaller memory stick image. This is useful for system recovery, where a full memstick.img image is not necessarily needed (or wanted). In addition, it is possible to do bootonly-style installation, where the base.txz, kernel.txz, etc. are fetched from a remote source. Provide backwards-compatible target (mini-memstick), to keep in sync with the targets documented in release/Makefile. r257806: Remove extra target from 'memstick' that I forgot to remove before previous commit. r257807: Update release(7) to include 'mini-memstick'. r257942: Fix a few style nits. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile stable/10/release/release.sh stable/10/share/man/man7/release.7 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Wed Dec 11 19:25:38 2013 (r259224) +++ stable/10/release/Makefile Wed Dec 11 19:26:56 2013 (r259225) @@ -6,6 +6,7 @@ # cdrom: Builds release CD-ROM media (disc1.iso) # dvdrom: Builds release DVD-ROM media (dvd1.iso) # memstick: Builds memory stick image (memstick.img) +# mini-memstick: Builds minimal memory stick image (mini-memstick.img) # ftp: Sets up FTP distribution area (ftp) # release: Build all media and FTP distribution area # install: Copies all release media into ${DESTDIR} @@ -84,7 +85,9 @@ IMAGES+= dvd1.iso .endif .if exists(${.CURDIR}/${TARGET}/make-memstick.sh) RELEASE_TARGETS+= memstick.img +RELEASE_TARGETS+= mini-memstick.img IMAGES+= memstick.img +IMAGES+= mini-memstick.img .endif CLEANFILES= packagesystem *.txz MANIFEST system ${IMAGES} @@ -208,6 +211,10 @@ memstick: memstick.img memstick.img: system sh ${.CURDIR}/${TARGET}/make-memstick.sh release ${.TARGET} +mini-memstick: mini-memstick.img +mini-memstick.img: system + sh ${.CURDIR}/${TARGET}/make-memstick.sh bootonly ${.TARGET} + packagesystem: base.txz kernel.txz ${EXTRA_PACKAGES} sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST touch ${.TARGET} Modified: stable/10/release/release.sh ============================================================================== --- stable/10/release/release.sh Wed Dec 11 19:25:38 2013 (r259224) +++ stable/10/release/release.sh Wed Dec 11 19:26:56 2013 (r259225) @@ -111,10 +111,10 @@ fi # instead of their values. DOCPORTS= if [ "x${NOPORTS}" != "x" ]; then - DOCPORTS="NOPORTS=yes " + DOCPORTS="NOPORTS=yes " fi if [ "x${NODOC}" != "x" ]; then - DOCPORTS="${DOCPORTS}NODOC=yes" + DOCPORTS="${DOCPORTS}NODOC=yes" fi # The aggregated build-time flags based upon variables defined within @@ -137,7 +137,7 @@ RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCO # Force src checkout if configured FORCE_SRC_KEY= if [ "x${SRC_FORCE_CHECKOUT}" != "x" ]; then - FORCE_SRC_KEY="--force" + FORCE_SRC_KEY="--force" fi if [ ! ${CHROOTDIR} ]; then Modified: stable/10/share/man/man7/release.7 ============================================================================== --- stable/10/share/man/man7/release.7 Wed Dec 11 19:25:38 2013 (r259224) +++ stable/10/share/man/man7/release.7 Wed Dec 11 19:26:56 2013 (r259225) @@ -292,6 +292,11 @@ Requires that the .Pq memory disk device driver be present in the kernel .Pq either by being compiled in or available as a module . +.It Cm mini-memstick +Similar to +.Cm memstick , +with the exception that the installation distribution sets +are not included. .It Cm ftp Creates a directory named .Pa ftp From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 19:30:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8590A3BE; Wed, 11 Dec 2013 19:30:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7098F1FB1; Wed, 11 Dec 2013 19:30:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBJUSrQ015482; Wed, 11 Dec 2013 19:30:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBJURC4015474; Wed, 11 Dec 2013 19:30:27 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312111930.rBBJURC4015474@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Dec 2013 19:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r259226 - in stable/8: sbin/fsck_ffs sbin/growfs sys/ufs/ffs sys/ufs/ufs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 19:30:28 -0000 Author: pfg Date: Wed Dec 11 19:30:27 2013 New Revision: 259226 URL: http://svnweb.freebsd.org/changeset/base/259226 Log: MFC r256448, r257029; Make di_blocks unsigned in UFS1 as is the case already for UFS2. Most of the code between UFS1 and UFS2 is shared so this change is pretty safe. Not only this makes UFS1 and 2 consistent but it also matches what NetBSD and MacOS X have for some years now. UFS2: make di_extsize unsigned. di_extsize is the EA size and as such it should be unsigned. Adjust related types for consistency. Reviewed by: mckusick Modified: stable/8/sbin/fsck_ffs/ea.c stable/8/sbin/growfs/debug.c stable/8/sys/ufs/ffs/ffs_vnops.c stable/8/sys/ufs/ufs/dinode.h Directory Properties: stable/8/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/ufs/ (props changed) Modified: stable/8/sbin/fsck_ffs/ea.c ============================================================================== --- stable/8/sbin/fsck_ffs/ea.c Wed Dec 11 19:26:56 2013 (r259225) +++ stable/8/sbin/fsck_ffs/ea.c Wed Dec 11 19:30:27 2013 (r259226) @@ -65,7 +65,7 @@ eascan(struct inodesc *idesc, struct ufs char dbuf[DIRBLKSIZ]; printf("Inode %ju extsize %ju\n", - (intmax_t)idesc->id_number, (intmax_t)dp->di_extsize); + (intmax_t)idesc->id_number, (uintmax_t)dp->di_extsize); if (dp->di_extsize == 0) return 0; if (dp->di_extsize <= sblock.fs_fsize) Modified: stable/8/sbin/growfs/debug.c ============================================================================== --- stable/8/sbin/growfs/debug.c Wed Dec 11 19:26:56 2013 (r259225) +++ stable/8/sbin/growfs/debug.c Wed Dec 11 19:30:27 2013 (r259226) @@ -798,7 +798,7 @@ dbg_dump_ufs2_ino(struct fs *sb, const c fprintf(dbg_log, "gen int32_t 0x%08x\n", ino->di_gen); fprintf(dbg_log, "kernflags u_int32_t 0x%08x\n", ino->di_kernflags); fprintf(dbg_log, "flags u_int32_t 0x%08x\n", ino->di_flags); - fprintf(dbg_log, "extsize int32_t 0x%08x\n", ino->di_extsize); + fprintf(dbg_log, "extsize u_int32_t 0x%08x\n", ino->di_extsize); /* XXX: What do we do with di_extb[NXADDR]? */ Modified: stable/8/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:26:56 2013 (r259225) +++ stable/8/sys/ufs/ffs/ffs_vnops.c Wed Dec 11 19:30:27 2013 (r259226) @@ -539,7 +539,7 @@ ffs_read(ap) * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = blksize(fs, ip, nextlbn); + u_int nextsize = blksize(fs, ip, nextlbn); error = breadn(vp, lbn, size, &nextlbn, &nextsize, 1, NOCRED, &bp); } else { @@ -938,7 +938,7 @@ ffs_extread(struct vnode *vp, struct uio * arguments point to arrays of the size specified in * the 6th argument. */ - int nextsize = sblksize(fs, dp->di_extsize, nextlbn); + u_int nextsize = sblksize(fs, dp->di_extsize, nextlbn); nextlbn = -1 - nextlbn; error = breadn(vp, -1 - lbn, @@ -1201,7 +1201,8 @@ ffs_rdextattr(u_char **p, struct vnode * struct fs *fs; struct uio luio; struct iovec liovec; - int easize, error; + u_int easize; + int error; u_char *eae; ip = VTOI(vp); Modified: stable/8/sys/ufs/ufs/dinode.h ============================================================================== --- stable/8/sys/ufs/ufs/dinode.h Wed Dec 11 19:26:56 2013 (r259225) +++ stable/8/sys/ufs/ufs/dinode.h Wed Dec 11 19:30:27 2013 (r259226) @@ -141,7 +141,7 @@ struct ufs2_dinode { int32_t di_gen; /* 80: Generation number. */ u_int32_t di_kernflags; /* 84: Kernel flags. */ u_int32_t di_flags; /* 88: Status flags (chflags). */ - int32_t di_extsize; /* 92: External attributes block. */ + u_int32_t di_extsize; /* 92: External attributes size. */ ufs2_daddr_t di_extb[NXADDR];/* 96: External attributes block. */ ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */ ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */ @@ -180,7 +180,7 @@ struct ufs1_dinode { ufs1_daddr_t di_db[NDADDR]; /* 40: Direct disk blocks. */ ufs1_daddr_t di_ib[NIADDR]; /* 88: Indirect disk blocks. */ u_int32_t di_flags; /* 100: Status flags (chflags). */ - int32_t di_blocks; /* 104: Blocks actually held. */ + u_int32_t di_blocks; /* 104: Blocks actually held. */ int32_t di_gen; /* 108: Generation number. */ u_int32_t di_uid; /* 112: File owner. */ u_int32_t di_gid; /* 116: File group. */ From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 20:56:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DBFE9C5; Wed, 11 Dec 2013 20:56:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 098E116E6; Wed, 11 Dec 2013 20:56:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBKuNr6047468; Wed, 11 Dec 2013 20:56:23 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBKuNJo047467; Wed, 11 Dec 2013 20:56:23 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312112056.rBBKuNJo047467@svn.freebsd.org> From: Andreas Tobler Date: Wed, 11 Dec 2013 20:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259227 - stable/10/sys/powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 20:56:24 -0000 Author: andreast Date: Wed Dec 11 20:56:23 2013 New Revision: 259227 URL: http://svnweb.freebsd.org/changeset/base/259227 Log: MFC r258503 Limit the large page size to 16MB for now. Modified: stable/10/sys/powerpc/pseries/mmu_phyp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/pseries/mmu_phyp.c ============================================================================== --- stable/10/sys/powerpc/pseries/mmu_phyp.c Wed Dec 11 19:30:27 2013 (r259226) +++ stable/10/sys/powerpc/pseries/mmu_phyp.c Wed Dec 11 20:56:23 2013 (r259227) @@ -165,6 +165,11 @@ mphyp_bootstrap(mmu_t mmup, vm_offset_t nptlp--; } } + + /* For now we allow shift only to be <= 0x18. */ + if (shift >= 0x18) + shift = 0x18; + moea64_large_page_shift = shift; moea64_large_page_size = 1 << shift; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 21:19:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 812F3225; Wed, 11 Dec 2013 21:19:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4B818CB; Wed, 11 Dec 2013 21:19:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBLJ5TF055408; Wed, 11 Dec 2013 21:19:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBLJ55r055406; Wed, 11 Dec 2013 21:19:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312112119.rBBLJ55r055406@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Dec 2013 21:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259228 - in head/sys/x86: include x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 21:19:05 -0000 Author: jhb Date: Wed Dec 11 21:19:04 2013 New Revision: 259228 URL: http://svnweb.freebsd.org/changeset/base/259228 Log: Use fixed-width types for all fields in MP Table structures and pack all the structures. While here, move a helper struct only used in the kernel parser out of this header since it is not part of the MP specification itself. Modified: head/sys/x86/include/mptable.h head/sys/x86/x86/mptable.c Modified: head/sys/x86/include/mptable.h ============================================================================== --- head/sys/x86/include/mptable.h Wed Dec 11 20:56:23 2013 (r259227) +++ head/sys/x86/include/mptable.h Wed Dec 11 21:19:04 2013 (r259228) @@ -30,47 +30,50 @@ enum busTypes { NOBUS = 0, + CBUS = 1, + CBUSII = 2, EISA = 3, ISA = 6, MCA = 9, PCI = 13, + XPRESS = 18, MAX_BUSTYPE = 18, UNKNOWN_BUSTYPE = 0xff }; /* MP Floating Pointer Structure */ typedef struct MPFPS { - char signature[4]; - u_int32_t pap; - u_char length; - u_char spec_rev; - u_char checksum; - u_char config_type; - u_char mpfb2; - u_char mpfb3; - u_char mpfb4; - u_char mpfb5; -} *mpfps_t; + uint8_t signature[4]; + uint32_t pap; + uint8_t length; + uint8_t spec_rev; + uint8_t checksum; + uint8_t config_type; + uint8_t mpfb2; + uint8_t mpfb3; + uint8_t mpfb4; + uint8_t mpfb5; +} __packed *mpfps_t; #define MPFB2_IMCR_PRESENT 0x80 #define MPFB2_MUL_CLK_SRCS 0x40 /* MP Configuration Table Header */ typedef struct MPCTH { - char signature[4]; - u_short base_table_length; - u_char spec_rev; - u_char checksum; - u_char oem_id[8]; - u_char product_id[12]; - u_int32_t oem_table_pointer; - u_short oem_table_size; - u_short entry_count; - u_int32_t apic_address; - u_short extended_table_length; - u_char extended_table_checksum; - u_char reserved; -} *mpcth_t; + uint8_t signature[4]; + uint16_t base_table_length; + uint8_t spec_rev; + uint8_t checksum; + uint8_t oem_id[8]; + uint8_t product_id[12]; + uint32_t oem_table_pointer; + uint16_t oem_table_size; + uint16_t entry_count; + uint32_t apic_address; + uint16_t extended_table_length; + uint8_t extended_table_checksum; + uint8_t reserved; +} __packed *mpcth_t; /* Base table entries */ @@ -81,44 +84,44 @@ typedef struct MPCTH { #define MPCT_ENTRY_LOCAL_INT 4 typedef struct PROCENTRY { - u_char type; - u_char apic_id; - u_char apic_version; - u_char cpu_flags; - u_int32_t cpu_signature; - u_int32_t feature_flags; - u_int32_t reserved1; - u_int32_t reserved2; -} *proc_entry_ptr; + uint8_t type; + uint8_t apic_id; + uint8_t apic_version; + uint8_t cpu_flags; + uint32_t cpu_signature; + uint32_t feature_flags; + uint32_t reserved1; + uint32_t reserved2; +} __packed *proc_entry_ptr; #define PROCENTRY_FLAG_EN 0x01 #define PROCENTRY_FLAG_BP 0x02 typedef struct BUSENTRY { - u_char type; - u_char bus_id; - char bus_type[6]; -} *bus_entry_ptr; + uint8_t type; + uint8_t bus_id; + uint8_t bus_type[6]; +} __packed *bus_entry_ptr; typedef struct IOAPICENTRY { - u_char type; - u_char apic_id; - u_char apic_version; - u_char apic_flags; - u_int32_t apic_address; -} *io_apic_entry_ptr; + uint8_t type; + uint8_t apic_id; + uint8_t apic_version; + uint8_t apic_flags; + uint32_t apic_address; +} __packed *io_apic_entry_ptr; #define IOAPICENTRY_FLAG_EN 0x01 typedef struct INTENTRY { - u_char type; - u_char int_type; - u_short int_flags; - u_char src_bus_id; - u_char src_bus_irq; - u_char dst_apic_id; - u_char dst_apic_int; -} *int_entry_ptr; + uint8_t type; + uint8_t int_type; + uint16_t int_flags; + uint8_t src_bus_id; + uint8_t src_bus_irq; + uint8_t dst_apic_id; + uint8_t dst_apic_int; +} __packed *int_entry_ptr; #define INTENTRY_TYPE_INT 0 #define INTENTRY_TYPE_NMI 1 @@ -137,45 +140,45 @@ typedef struct INTENTRY { /* Extended table entries */ typedef struct EXTENTRY { - u_char type; - u_char length; -} *ext_entry_ptr; + uint8_t type; + uint8_t length; +} __packed *ext_entry_ptr; #define MPCT_EXTENTRY_SAS 0x80 #define MPCT_EXTENTRY_BHD 0x81 #define MPCT_EXTENTRY_CBASM 0x82 typedef struct SASENTRY { - u_char type; - u_char length; - u_char bus_id; - u_char address_type; + uint8_t type; + uint8_t length; + uint8_t bus_id; + uint8_t address_type; uint64_t address_base; uint64_t address_length; -} __attribute__((__packed__)) *sas_entry_ptr; +} __packed *sas_entry_ptr; #define SASENTRY_TYPE_IO 0 #define SASENTRY_TYPE_MEMORY 1 #define SASENTRY_TYPE_PREFETCH 2 typedef struct BHDENTRY { - u_char type; - u_char length; - u_char bus_id; - u_char bus_info; - u_char parent_bus; - u_char reserved[3]; -} *bhd_entry_ptr; + uint8_t type; + uint8_t length; + uint8_t bus_id; + uint8_t bus_info; + uint8_t parent_bus; + uint8_t reserved[3]; +} __packed *bhd_entry_ptr; #define BHDENTRY_INFO_SUBTRACTIVE_DECODE 0x1 typedef struct CBASMENTRY { - u_char type; - u_char length; - u_char bus_id; - u_char address_mod; - u_int predefined_range; -} *cbasm_entry_ptr; + uint8_t type; + uint8_t length; + uint8_t bus_id; + uint8_t address_mod; + uint32_t predefined_range; +} __packed *cbasm_entry_ptr; #define CBASMENTRY_ADDRESS_MOD_ADD 0x0 #define CBASMENTRY_ADDRESS_MOD_SUBTRACT 0x1 @@ -183,13 +186,6 @@ typedef struct CBASMENTRY { #define CBASMENTRY_RANGE_ISA_IO 0 #define CBASMENTRY_RANGE_VGA_IO 1 -/* descriptions of MP table entries */ -typedef struct BASETABLE_ENTRY { - u_char type; - u_char length; - char name[16]; -} basetable_entry; - #ifdef _KERNEL struct mptable_hostb_softc { #ifdef NEW_PCIB Modified: head/sys/x86/x86/mptable.c ============================================================================== --- head/sys/x86/x86/mptable.c Wed Dec 11 20:56:23 2013 (r259227) +++ head/sys/x86/x86/mptable.c Wed Dec 11 21:19:04 2013 (r259228) @@ -78,6 +78,13 @@ __FBSDID("$FreeBSD$"); typedef void mptable_entry_handler(u_char *entry, void *arg); typedef void mptable_extended_entry_handler(ext_entry_ptr entry, void *arg); +/* descriptions of MP table entries */ +typedef struct BASETABLE_ENTRY { + uint8_t type; + uint8_t length; + uint8_t name[16]; +} basetable_entry; + static basetable_entry basetable_entry_types[] = { {0, 20, "Processor"}, From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 21:21:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 061414F7; Wed, 11 Dec 2013 21:21:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E58A51940; Wed, 11 Dec 2013 21:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBLL3FG058099; Wed, 11 Dec 2013 21:21:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBLL3Hr058098; Wed, 11 Dec 2013 21:21:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312112121.rBBLL3Hr058098@svn.freebsd.org> From: John Baldwin Date: Wed, 11 Dec 2013 21:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259229 - head/usr.sbin/mptable X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 21:21:04 -0000 Author: jhb Date: Wed Dec 11 21:21:03 2013 New Revision: 259229 URL: http://svnweb.freebsd.org/changeset/base/259229 Log: - Use instead of duplicating its definitions. - Switch to mmaping the table from RAM instead of reading it out of /dev/mem via read(2). Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c ============================================================================== --- head/usr.sbin/mptable/mptable.c Wed Dec 11 21:19:04 2013 (r259228) +++ head/usr.sbin/mptable/mptable.c Wed Dec 11 21:21:03 2013 (r259229) @@ -43,9 +43,12 @@ static const char rcsid[] = #define OEM_PROCESSING_READY_NOT #include +#include +#include #include #include #include +#include #include #include #include @@ -74,23 +77,8 @@ static const char rcsid[] = #define GROPE_AREA2 0x90000 #define GROPE_SIZE 0x10000 -#define PROCENTRY_FLAG_EN 0x01 -#define PROCENTRY_FLAG_BP 0x02 -#define IOAPICENTRY_FLAG_EN 0x01 - #define MAXPNSTR 132 -enum busTypes { - CBUS = 1, - CBUSII = 2, - EISA = 3, - ISA = 6, - PCI = 13, - XPRESS = 18, - MAX_BUSTYPE = 18, - UNKNOWN_BUSTYPE = 0xff -}; - typedef struct BUSTYPENAME { u_char type; char name[ 7 ]; @@ -129,140 +117,25 @@ static const char *whereStrings[] = { "GROPE AREA #2" }; -typedef struct TABLE_ENTRY { - u_char type; - u_char length; - char name[ 32 ]; -} tableEntry; - -static const tableEntry extendedtableEntryTypes[] = -{ - { 128, 20, "System Address Space" }, - { 129, 8, "Bus Hierarchy" }, - { 130, 8, "Compatibility Bus Address" } -}; - -/* MP Floating Pointer Structure */ -typedef struct MPFPS { - char signature[ 4 ]; - u_int32_t pap; - u_char length; - u_char spec_rev; - u_char checksum; - u_char mpfb1; - u_char mpfb2; - u_char mpfb3; - u_char mpfb4; - u_char mpfb5; -} mpfps_t; - -/* MP Configuration Table Header */ -typedef struct MPCTH { - char signature[ 4 ]; - u_short base_table_length; - u_char spec_rev; - u_char checksum; - u_char oem_id[ 8 ]; - u_char product_id[ 12 ]; - u_int32_t oem_table_pointer; - u_short oem_table_size; - u_short entry_count; - u_int32_t apic_address; - u_short extended_table_length; - u_char extended_table_checksum; - u_char reserved; -} mpcth_t; - - -typedef struct PROCENTRY { - u_char type; - u_char apicID; - u_char apicVersion; - u_char cpuFlags; - u_int32_t cpuSignature; - u_int32_t featureFlags; - u_int32_t reserved1; - u_int32_t reserved2; -} ProcEntry; - -typedef struct BUSENTRY { - u_char type; - u_char busID; - char busType[ 6 ]; -} BusEntry; - -typedef struct IOAPICENTRY { - u_char type; - u_char apicID; - u_char apicVersion; - u_char apicFlags; - u_int32_t apicAddress; -} IOApicEntry; - -typedef struct INTENTRY { - u_char type; - u_char intType; - u_short intFlags; - u_char srcBusID; - u_char srcBusIRQ; - u_char dstApicID; - u_char dstApicINT; -} IntEntry; - - -/* - * extended entry type structures - */ - -typedef struct SASENTRY { - u_char type; - u_char length; - u_char busID; - u_char addressType; - u_int64_t addressBase; - u_int64_t addressLength; -} __attribute__((__packed__)) SasEntry; - - -typedef struct BHDENTRY { - u_char type; - u_char length; - u_char busID; - u_char busInfo; - u_char busParent; - u_char reserved[ 3 ]; -} BhdEntry; - - -typedef struct CBASMENTRY { - u_char type; - u_char length; - u_char busID; - u_char addressMod; - u_int predefinedRange; -} CbasmEntry; - - - static void apic_probe( u_int32_t* paddr, int* where ); static void MPConfigDefault( int featureByte ); -static void MPFloatingPointer( u_int32_t paddr, int where, mpfps_t* mpfps ); +static void MPFloatingPointer( u_int32_t paddr, int where, mpfps_t* mpfpsp ); static void MPConfigTableHeader( u_int32_t pap ); -static int readType( void ); static void seekEntry( u_int32_t addr ); static void readEntry( void* entry, int size ); +static void *mapEntry( u_int32_t addr, int size ); -static void processorEntry( void ); -static void busEntry( void ); -static void ioApicEntry( void ); -static void intEntry( void ); - -static void sasEntry( void ); -static void bhdEntry( void ); -static void cbasmEntry( void ); +static void processorEntry( proc_entry_ptr entry ); +static void busEntry( bus_entry_ptr entry ); +static void ioApicEntry( io_apic_entry_ptr entry ); +static void intEntry( int_entry_ptr entry ); + +static void sasEntry( sas_entry_ptr entry ); +static void bhdEntry( bhd_entry_ptr entry ); +static void cbasmEntry( cbasm_entry_ptr entry ); static void doDmesg( void ); static void pnstr( char* s, int c ); @@ -360,10 +233,10 @@ main( int argc, char *argv[] ) puts( SEP_LINE ); /* check whether an MP config table exists */ - if ( (defaultConfig = mpfps.mpfb1) ) + if ( (defaultConfig = mpfps->config_type) ) MPConfigDefault( defaultConfig ); else - MPConfigTableHeader( mpfps.pap ); + MPConfigTableHeader( mpfps->pap ); /* do a dmesg output */ if ( dmesg ) @@ -524,12 +397,12 @@ apic_probe( u_int32_t* paddr, int* where * */ static void -MPFloatingPointer( u_int32_t paddr, int where, mpfps_t* mpfps ) +MPFloatingPointer( u_int32_t paddr, int where, mpfps_t* mpfpsp ) { - - /* read in mpfps structure*/ - seekEntry( paddr ); - readEntry( mpfps, sizeof( mpfps_t ) ); + mpfps_t mpfps; + + /* map in mpfps structure*/ + *mpfpsp = mpfps = mapEntry( paddr, sizeof( mpfps ) ); /* show its contents */ printf( "MP Floating Pointer Structure:\n\n" ); @@ -576,7 +449,7 @@ MPFloatingPointer( u_int32_t paddr, int } /* bit 7 is IMCRP */ - printf( " mode:\t\t\t\t%s\n", (mpfps->mpfb2 & 0x80) ? + printf( " mode:\t\t\t\t%s\n", (mpfps->mpfb2 & MPFB2_IMCR_PRESENT) ? "PIC" : "Virtual Wire" ); /* MP feature bytes 3-5 are expected to be ZERO */ @@ -652,59 +525,53 @@ MPConfigDefault( int featureByte ) static void MPConfigTableHeader( u_int32_t pap ) { - u_int32_t paddr; mpcth_t cth; int x; int totalSize; - int count, c; - int type; + int c; int oldtype, entrytype; + u_int8_t *entry; if ( pap == 0 ) { printf( "MP Configuration Table Header MISSING!\n" ); exit( 1 ); } - /* convert physical address to virtual address */ - paddr = pap; - - /* read in cth structure */ - seekEntry( paddr ); - readEntry( &cth, sizeof( cth ) ); + /* map in cth structure */ + cth = mapEntry( pap, sizeof( *cth ) ); printf( "MP Config Table Header:\n\n" ); printf( " physical address:\t\t0x%08x\n", pap ); printf( " signature:\t\t\t'" ); - pnstr( cth.signature, 4 ); + pnstr( cth->signature, 4 ); printf( "'\n" ); - printf( " base table length:\t\t%d\n", cth.base_table_length ); + printf( " base table length:\t\t%d\n", cth->base_table_length ); - printf( " version:\t\t\t1.%1d\n", cth.spec_rev ); - printf( " checksum:\t\t\t0x%02x\n", cth.checksum ); + printf( " version:\t\t\t1.%1d\n", cth->spec_rev ); + printf( " checksum:\t\t\t0x%02x\n", cth->checksum ); printf( " OEM ID:\t\t\t'" ); - pnstr( cth.oem_id, 8 ); + pnstr( cth->oem_id, 8 ); printf( "'\n" ); printf( " Product ID:\t\t\t'" ); - pnstr( cth.product_id, 12 ); + pnstr( cth->product_id, 12 ); printf( "'\n" ); - printf( " OEM table pointer:\t\t0x%08x\n", cth.oem_table_pointer ); - printf( " OEM table size:\t\t%d\n", cth.oem_table_size ); + printf( " OEM table pointer:\t\t0x%08x\n", cth->oem_table_pointer ); + printf( " OEM table size:\t\t%d\n", cth->oem_table_size ); - printf( " entry count:\t\t\t%d\n", cth.entry_count ); + printf( " entry count:\t\t\t%d\n", cth->entry_count ); - printf( " local APIC address:\t\t0x%08x\n", cth.apic_address ); + printf( " local APIC address:\t\t0x%08x\n", cth->apic_address ); - printf( " extended table length:\t%d\n", cth.extended_table_length ); - printf( " extended table checksum:\t%d\n", cth.extended_table_checksum ); + printf( " extended table length:\t%d\n", cth->extended_table_length ); + printf( " extended table checksum:\t%d\n", cth->extended_table_checksum ); - totalSize = cth.base_table_length - sizeof( struct MPCTH ); - count = cth.entry_count; + totalSize = cth->base_table_length - sizeof( struct MPCTH ); puts( SEP_LINE ); @@ -723,101 +590,99 @@ MPConfigTableHeader( u_int32_t pap ) nintr = 0; oldtype = -1; - for (c = count; c; c--) { - entrytype = readType(); + entry = mapEntry(pap + sizeof(*cth), cth->base_table_length); + for (c = cth->entry_count; c; c--) { + entrytype = *entry; if (entrytype != oldtype) printf("--\n"); if (entrytype < oldtype) printf("MPTABLE OUT OF ORDER!\n"); switch (entrytype) { - case 0: - if (oldtype != 0) + case MPCT_ENTRY_PROCESSOR: + if (oldtype != MPCT_ENTRY_PROCESSOR) printf( "Processors:\tAPIC ID\tVersion\tState" "\t\tFamily\tModel\tStep\tFlags\n" ); - oldtype = 0; - processorEntry(); + processorEntry((proc_entry_ptr)entry); + entry += sizeof(struct PROCENTRY); break; - case 1: - if (oldtype != 1) + case MPCT_ENTRY_BUS: + if (oldtype != MPCT_ENTRY_BUS) printf( "Bus:\t\tBus ID\tType\n" ); - oldtype = 1; - busEntry(); + busEntry((bus_entry_ptr)entry); + entry += sizeof(struct BUSENTRY); break; - case 2: - if (oldtype != 2) + case MPCT_ENTRY_IOAPIC: + if (oldtype != MPCT_ENTRY_IOAPIC) printf( "I/O APICs:\tAPIC ID\tVersion\tState\t\tAddress\n" ); - oldtype = 2; - ioApicEntry(); + ioApicEntry((io_apic_entry_ptr)entry); + entry += sizeof(struct IOAPICENTRY); break; - case 3: - if (oldtype != 3) + case MPCT_ENTRY_INT: + if (oldtype != MPCT_ENTRY_INT) printf( "I/O Ints:\tType\tPolarity Trigger\tBus ID\t IRQ\tAPIC ID\tPIN#\n" ); - oldtype = 3; - intEntry(); + intEntry((int_entry_ptr)entry); + entry += sizeof(struct INTENTRY); break; - case 4: - if (oldtype != 4) + case MPCT_ENTRY_LOCAL_INT: + if (oldtype != MPCT_ENTRY_LOCAL_INT) printf( "Local Ints:\tType\tPolarity Trigger\tBus ID\t IRQ\tAPIC ID\tPIN#\n" ); - oldtype = 4; - intEntry(); + intEntry((int_entry_ptr)entry); + entry += sizeof(struct INTENTRY); break; default: printf("MPTABLE HOSED! record type = %d\n", entrytype); exit(1); } + oldtype = entrytype; } #if defined( EXTENDED_PROCESSING_READY ) /* process any extended data */ - if ( (totalSize = cth.extended_table_length) ) { + if ( cth->extended_table_length ) { + ext_entry_ptr ext_entry, end; + puts( SEP_LINE ); printf( "MP Config Extended Table Entries:\n\n" ); - while ( totalSize > 0 ) { - switch ( type = readType() ) { - case 128: - sasEntry(); + ext_entry = mapEntry(pap + cth->base_table_length, + cth->extended_table_length); + end = (ext_entry_ptr)((char *)ext_entry + cth->extended_table_length); + while (ext_entry < end) { + switch (ext_entry->type) { + case MPCT_EXTENTRY_SAS: + sasEntry((sas_entry_ptr)ext_entry); break; - case 129: - bhdEntry(); + case MPCT_EXTENTRY_BHD: + bhdEntry((bhd_entry_ptr)ext_entry); break; - case 130: - cbasmEntry(); + case MPCT_EXTENTRY_CBASM: + cbasmEntry((cbasm_entry_ptr)ext_entry); break; default: printf( "Extended Table HOSED!\n" ); exit( 1 ); } - totalSize -= extendedtableEntryTypes[ type-128 ].length; + ext_entry = (ext_entry_ptr)((char *)ext_entry + ext_entry->length); } } #endif /* EXTENDED_PROCESSING_READY */ /* process any OEM data */ - if ( cth.oem_table_pointer && (cth.oem_table_size > 0) ) { + if ( cth->oem_table_pointer && (cth->oem_table_size > 0) ) { #if defined( OEM_PROCESSING_READY ) # error your on your own here! - /* convert OEM table pointer to virtual address */ - poemtp = (u_int32_t)cth.oem_table_pointer; - - /* read in oem table structure */ - if ( (oemdata = (void*)malloc( cth.oem_table_size )) == NULL ) - err( 1, "oem malloc" ); - - seekEntry( poemtp ); - readEntry( oemdata, cth.oem_table_size ); + /* map in oem table structure */ + oemdata = mapEntry( cth->oem_table_pointer, cth->oem_table_size); /** process it */ - - free( oemdata ); #else printf( "\nyou need to modify the source to handle OEM data!\n\n" ); #endif /* OEM_PROCESSING_READY */ @@ -828,11 +693,11 @@ MPConfigTableHeader( u_int32_t pap ) #if defined( RAW_DUMP ) { int ofd; - u_char dumpbuf[ 4096 ]; + void *dumpbuf; ofd = open( "/tmp/mpdump", O_CREAT | O_RDWR, 0666 ); - seekEntry( paddr ); - readEntry( dumpbuf, 1024 ); + + dumpbuf = mapEntry( paddr, 1024 ); write( ofd, dumpbuf, 1024 ); close( ofd ); } @@ -843,24 +708,6 @@ MPConfigTableHeader( u_int32_t pap ) /* * */ -static int -readType( void ) -{ - u_char type; - - if ( read( pfd, &type, sizeof( u_char ) ) != sizeof( u_char ) ) - err( 1, "type read; pfd: %d", pfd ); - - if ( lseek( pfd, -1, SEEK_CUR ) < 0 ) - err( 1, "type seek" ); - - return (int)type; -} - - -/* - * - */ static void seekEntry( u_int32_t addr ) { @@ -879,31 +726,37 @@ readEntry( void* entry, int size ) err( 1, "readEntry" ); } +static void * +mapEntry( u_int32_t addr, int size ) +{ + void *p; + + p = mmap( NULL, size, PROT_READ, MAP_SHARED, pfd, addr ); + if (p == MAP_FAILED) + err( 1, "mapEntry" ); + return (p); +} static void -processorEntry( void ) +processorEntry( proc_entry_ptr entry ) { - ProcEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); /* count it */ ++ncpu; - printf( "\t\t%2d", entry.apicID ); - printf( "\t 0x%2x", entry.apicVersion ); + printf( "\t\t%2d", entry->apic_id ); + printf( "\t 0x%2x", entry->apic_version ); printf( "\t %s, %s", - (entry.cpuFlags & PROCENTRY_FLAG_BP) ? "BSP" : "AP", - (entry.cpuFlags & PROCENTRY_FLAG_EN) ? "usable" : "unusable" ); + (entry->cpu_flags & PROCENTRY_FLAG_BP) ? "BSP" : "AP", + (entry->cpu_flags & PROCENTRY_FLAG_EN) ? "usable" : "unusable" ); printf( "\t %d\t %d\t %d", - (entry.cpuSignature >> 8) & 0x0f, - (entry.cpuSignature >> 4) & 0x0f, - entry.cpuSignature & 0x0f ); + (entry->cpu_signature >> 8) & 0x0f, + (entry->cpu_signature >> 4) & 0x0f, + entry->cpu_signature & 0x0f ); - printf( "\t 0x%04x\n", entry.featureFlags ); + printf( "\t 0x%04x\n", entry->feature_flags ); } @@ -924,50 +777,42 @@ lookupBusType( char* name ) static void -busEntry( void ) +busEntry( bus_entry_ptr entry ) { int x; char name[ 8 ]; char c; - BusEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); /* count it */ ++nbus; - printf( "\t\t%2d", entry.busID ); - printf( "\t " ); pnstr( entry.busType, 6 ); printf( "\n" ); + printf( "\t\t%2d", entry->bus_id ); + printf( "\t " ); pnstr( entry->bus_type, 6 ); printf( "\n" ); for ( x = 0; x < 6; ++x ) { - if ( (c = entry.busType[ x ]) == ' ' ) + if ( (c = entry->bus_type[ x ]) == ' ' ) break; name[ x ] = c; } name[ x ] = '\0'; - busses[ entry.busID ] = lookupBusType( name ); + busses[ entry->bus_id ] = lookupBusType( name ); } static void -ioApicEntry( void ) +ioApicEntry( io_apic_entry_ptr entry ) { - IOApicEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); /* count it */ ++napic; - printf( "\t\t%2d", entry.apicID ); - printf( "\t 0x%02x", entry.apicVersion ); + printf( "\t\t%2d", entry->apic_id ); + printf( "\t 0x%02x", entry->apic_version ); printf( "\t %s", - (entry.apicFlags & IOAPICENTRY_FLAG_EN) ? "usable" : "unusable" ); - printf( "\t\t 0x%x\n", entry.apicAddress ); + (entry->apic_flags & IOAPICENTRY_FLAG_EN) ? "usable" : "unusable" ); + printf( "\t\t 0x%x\n", entry->apic_address ); - apics[ entry.apicID ] = entry.apicID; + apics[ entry->apic_id ] = entry->apic_id; } @@ -983,53 +828,45 @@ static const char *triggerMode[] = { }; static void -intEntry( void ) +intEntry( int_entry_ptr entry ) { - IntEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); /* count it */ - if ( (int)entry.type == 3 ) + if ( entry->type == MPCT_ENTRY_INT ) ++nintr; - printf( "\t\t%s", intTypes[ (int)entry.intType ] ); + printf( "\t\t%s", intTypes[ entry->int_type ] ); - printf( "\t%9s", polarityMode[ (int)entry.intFlags & 0x03 ] ); - printf( "%12s", triggerMode[ ((int)entry.intFlags >> 2) & 0x03 ] ); + printf( "\t%9s", polarityMode[ entry->int_flags & INTENTRY_FLAGS_POLARITY ] ); + printf( "%12s", triggerMode[ (entry->int_flags & INTENTRY_FLAGS_TRIGGER) >> 2 ] ); - printf( "\t %5d", (int)entry.srcBusID ); - if ( busses[ (int)entry.srcBusID ] == PCI ) + printf( "\t %5d", entry->src_bus_id ); + if ( busses[ entry->src_bus_id ] == PCI ) printf( "\t%2d:%c", - ((int)entry.srcBusIRQ >> 2) & 0x1f, - ((int)entry.srcBusIRQ & 0x03) + 'A' ); + (entry->src_bus_irq >> 2) & 0x1f, + (entry->src_bus_irq & 0x03) + 'A' ); else - printf( "\t %3d", (int)entry.srcBusIRQ ); - printf( "\t %6d", (int)entry.dstApicID ); - printf( "\t %3d\n", (int)entry.dstApicINT ); + printf( "\t %3d", entry->src_bus_irq ); + printf( "\t %6d", entry->dst_apic_id ); + printf( "\t %3d\n", entry->dst_apic_int ); } static void -sasEntry( void ) +sasEntry( sas_entry_ptr entry ) { - SasEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); - printf( "--\n%s\n", extendedtableEntryTypes[entry.type - 128].name ); - printf( " bus ID: %d", entry.busID ); + printf( "--\nSystem Address Space\n"); + printf( " bus ID: %d", entry->bus_id ); printf( " address type: " ); - switch ( entry.addressType ) { - case 0: + switch ( entry->address_type ) { + case SASENTRY_TYPE_IO: printf( "I/O address\n" ); break; - case 1: + case SASENTRY_TYPE_MEMORY: printf( "memory address\n" ); break; - case 2: + case SASENTRY_TYPE_PREFETCH: printf( "prefetch address\n" ); break; default: @@ -1037,39 +874,32 @@ sasEntry( void ) break; } - printf( " address base: 0x%llx\n", (long long)entry.addressBase ); - printf( " address range: 0x%llx\n", (long long)entry.addressLength ); + printf( " address base: 0x%jx\n", (uintmax_t)entry->address_base ); + printf( " address range: 0x%jx\n", (uintmax_t)entry->address_length ); } static void -bhdEntry( void ) +bhdEntry( bhd_entry_ptr entry ) { - BhdEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); - printf( "--\n%s\n", extendedtableEntryTypes[entry.type - 128].name ); - printf( " bus ID: %d", entry.busID ); - printf( " bus info: 0x%02x", entry.busInfo ); - printf( " parent bus ID: %d\n", entry.busParent ); + printf( "--\nBus Hierarchy\n" ); + printf( " bus ID: %d", entry->bus_id ); + printf( " bus info: 0x%02x", entry->bus_info ); + printf( " parent bus ID: %d\n", entry->parent_bus ); } static void -cbasmEntry( void ) +cbasmEntry( cbasm_entry_ptr entry ) { - CbasmEntry entry; - - /* read it into local memory */ - readEntry( &entry, sizeof( entry ) ); - printf( "--\n%s\n", extendedtableEntryTypes[entry.type - 128].name ); - printf( " bus ID: %d", entry.busID ); - printf( " address modifier: %s\n", (entry.addressMod & 0x01) ? - "subtract" : "add" ); - printf( " predefined range: 0x%08x\n", entry.predefinedRange ); + printf( "--\nCompatibility Bus Address\n" ); + printf( " bus ID: %d", entry->bus_id ); + printf( " address modifier: %s\n", + (entry->address_mod & CBASMENTRY_ADDRESS_MOD_SUBTRACT) ? + "subtract" : "add" ); + printf( " predefined range: 0x%08x\n", entry->predefined_range ); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 21:37:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D89089BB; Wed, 11 Dec 2013 21:37:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A9A571A76; Wed, 11 Dec 2013 21:37:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBLbWOI062394; Wed, 11 Dec 2013 21:37:32 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBLbW7S062393; Wed, 11 Dec 2013 21:37:32 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312112137.rBBLbW7S062393@svn.freebsd.org> From: Andreas Tobler Date: Wed, 11 Dec 2013 21:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259230 - stable/10/sys/powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 21:37:32 -0000 Author: andreast Date: Wed Dec 11 21:37:32 2013 New Revision: 259230 URL: http://svnweb.freebsd.org/changeset/base/259230 Log: MFC r258615 Take care to handle the full 16 byte buffer in the get/put routines. Also, skip the VTERM header once when receiving data from the hypervisor call when we have a HVTERMPROT connection. Modified: stable/10/sys/powerpc/pseries/phyp_console.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/pseries/phyp_console.c ============================================================================== --- stable/10/sys/powerpc/pseries/phyp_console.c Wed Dec 11 21:21:03 2013 (r259229) +++ stable/10/sys/powerpc/pseries/phyp_console.c Wed Dec 11 21:37:32 2013 (r259230) @@ -286,6 +286,7 @@ static int uart_phyp_get(struct uart_phyp_softc *sc, void *buffer, size_t bufsize) { int err; + int hdr = 0; uart_lock(&sc->sc_mtx); if (sc->inbuflen == 0) { @@ -296,6 +297,7 @@ uart_phyp_get(struct uart_phyp_softc *sc uart_unlock(&sc->sc_mtx); return (-1); } + hdr = 1; } if (sc->inbuflen == 0) { @@ -305,6 +307,14 @@ uart_phyp_get(struct uart_phyp_softc *sc if (bufsize > sc->inbuflen) bufsize = sc->inbuflen; + + if ((sc->protocol == HVTERMPROT) && (hdr == 1)) { + sc->inbuflen = sc->inbuflen - 4; + /* The VTERM protocol has a 4 byte header, skip it here. */ + memmove(&sc->phyp_inbuf.str[0], &sc->phyp_inbuf.str[4], + sc->inbuflen); + } + memcpy(buffer, sc->phyp_inbuf.str, bufsize); sc->inbuflen -= bufsize; if (sc->inbuflen > 0) @@ -320,32 +330,40 @@ uart_phyp_put(struct uart_phyp_softc *sc { uint16_t seqno; uint64_t len = 0; + int err; + union { - uint64_t u64; - char bytes[8]; + uint64_t u64[2]; + char bytes[16]; } cbuf; uart_lock(&sc->sc_mtx); switch (sc->protocol) { case HVTERM1: - if (bufsize > 8) - bufsize = 8; + if (bufsize > 16) + bufsize = 16; memcpy(&cbuf, buffer, bufsize); len = bufsize; break; case HVTERMPROT: - if (bufsize > 4) - bufsize = 4; + if (bufsize > 12) + bufsize = 12; seqno = sc->outseqno++; cbuf.bytes[0] = VS_DATA_PACKET_HEADER; - cbuf.bytes[1] = 4 + bufsize; /* total length */ + cbuf.bytes[1] = 4 + bufsize; /* total length, max 16 bytes */ cbuf.bytes[2] = (seqno >> 8) & 0xff; cbuf.bytes[3] = seqno & 0xff; memcpy(&cbuf.bytes[4], buffer, bufsize); len = 4 + bufsize; break; } - phyp_hcall(H_PUT_TERM_CHAR, sc->vtermid, len, cbuf.u64, 0); + + do { + err = phyp_hcall(H_PUT_TERM_CHAR, sc->vtermid, len, cbuf.u64[0], + cbuf.u64[1]); + DELAY(100); + } while (err == H_BUSY); + uart_unlock(&sc->sc_mtx); return (bufsize); From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 21:41:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99753B33; Wed, 11 Dec 2013 21:41:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 852A21AD3; Wed, 11 Dec 2013 21:41:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBLfLV8065190; Wed, 11 Dec 2013 21:41:21 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBLfLOT065189; Wed, 11 Dec 2013 21:41:21 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312112141.rBBLfLOT065189@svn.freebsd.org> From: Andreas Tobler Date: Wed, 11 Dec 2013 21:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259231 - stable/10/sys/powerpc/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 21:41:21 -0000 Author: andreast Date: Wed Dec 11 21:41:21 2013 New Revision: 259231 URL: http://svnweb.freebsd.org/changeset/base/259231 Log: MFC r258778 Add a printf to inform about the logical memory block size which is in use by the system. This might give a hint why a pSeries system is not booting. Modified: stable/10/sys/powerpc/ofw/ofw_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_machdep.c Wed Dec 11 21:37:32 2013 (r259230) +++ stable/10/sys/powerpc/ofw/ofw_machdep.c Wed Dec 11 21:41:21 2013 (r259231) @@ -282,6 +282,7 @@ parse_drconf_memory(int *msz, int *asz, res = OF_getprop(phandle, "ibm,lmb-size", lmb_size, sizeof(lmb_size)); if (res == -1) return (0); + printf("Logical Memory Block size: %d MB\n", lmb_size[1] >> 20); /* Parse the /ibm,dynamic-memory. The first position gives the # of entries. The next two words From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 21:48:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39FA8FAB; Wed, 11 Dec 2013 21:48:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2694B1B2E; Wed, 11 Dec 2013 21:48:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBLm5dA066055; Wed, 11 Dec 2013 21:48:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBLm5vP066054; Wed, 11 Dec 2013 21:48:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312112148.rBBLm5vP066054@svn.freebsd.org> From: Alexander Motin Date: Wed, 11 Dec 2013 21:48:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259232 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 21:48:05 -0000 Author: mav Date: Wed Dec 11 21:48:04 2013 New Revision: 259232 URL: http://svnweb.freebsd.org/changeset/base/259232 Log: Create own free list for each of the first 32 possible allocation sizes. In case of 4K allocation quantum that means for allocations up to 128K. With growth of memory fragmentation these lists may grow to quite a large sizes (tenths and hundreds of thousands items). Having in one list items of different sizes in worst case may require full linear list traversal, that may be very expensive. Having lists for items of single size means that unless user specify some alignment or border requirements (that are very rare cases) first item found on the list should satisfy the request. While running SPEC NFS benchmark on top of ZFS on 24-core machine with 84GB RAM this change reduces CPU time spent in vmem_xalloc() from 8% and lock congestion spinning around it from 20% to invisible levels. And that all is by the cost of just 26 more pointers per vmem instance. If at some point our kernel will start to actively use KVA allocations with odd sizes above 128K, something may need to be done to bigger lists also. Modified: head/sys/kern/subr_vmem.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Dec 11 21:41:21 2013 (r259231) +++ head/sys/kern/subr_vmem.c Wed Dec 11 21:48:04 2013 (r259232) @@ -70,7 +70,10 @@ __FBSDID("$FreeBSD$"); #include #include -#define VMEM_MAXORDER (sizeof(vmem_size_t) * NBBY) +#define VMEM_OPTORDER 5 +#define VMEM_OPTVALUE (1 << VMEM_OPTORDER) +#define VMEM_MAXORDER \ + (VMEM_OPTVALUE - 1 + sizeof(vmem_size_t) * NBBY - VMEM_OPTORDER) #define VMEM_HASHSIZE_MIN 16 #define VMEM_HASHSIZE_MAX 131072 @@ -200,8 +203,10 @@ static LIST_HEAD(, vmem) vmem_list = LIS #define VMEM_CROSS_P(addr1, addr2, boundary) \ ((((addr1) ^ (addr2)) & -(boundary)) != 0) -#define ORDER2SIZE(order) ((vmem_size_t)1 << (order)) -#define SIZE2ORDER(size) ((int)flsl(size) - 1) +#define ORDER2SIZE(order) ((order) < VMEM_OPTVALUE ? ((order) + 1) : \ + (vmem_size_t)1 << ((order) - (VMEM_OPTVALUE - VMEM_OPTORDER - 1))) +#define SIZE2ORDER(size) ((size) <= VMEM_OPTVALUE ? ((size) - 1) : \ + (flsl(size) + (VMEM_OPTVALUE - VMEM_OPTORDER - 2))) /* * Maximum number of boundary tags that may be required to satisfy an @@ -334,11 +339,14 @@ bt_free(vmem_t *vm, bt_t *bt) /* * freelist[0] ... [1, 1] - * freelist[1] ... [2, 3] - * freelist[2] ... [4, 7] - * freelist[3] ... [8, 15] + * freelist[1] ... [2, 2] * : - * freelist[n] ... [(1 << n), (1 << (n + 1)) - 1] + * freelist[29] ... [30, 30] + * freelist[30] ... [31, 31] + * freelist[31] ... [32, 63] + * freelist[33] ... [64, 127] + * : + * freelist[n] ... [(1 << (n - 26)), (1 << (n - 25)) - 1] * : */ @@ -979,6 +987,7 @@ vmem_init(vmem_t *vm, const char *name, int i; MPASS(quantum > 0); + MPASS((quantum & (quantum - 1)) == 0); bzero(vm, sizeof(*vm)); @@ -988,8 +997,7 @@ vmem_init(vmem_t *vm, const char *name, LIST_INIT(&vm->vm_freetags); strlcpy(vm->vm_name, name, sizeof(vm->vm_name)); vm->vm_quantum_mask = quantum - 1; - vm->vm_quantum_shift = SIZE2ORDER(quantum); - MPASS(ORDER2SIZE(vm->vm_quantum_shift) == quantum); + vm->vm_quantum_shift = flsl(quantum) - 1; vm->vm_nbusytag = 0; vm->vm_size = 0; vm->vm_inuse = 0; From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 22:00:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2142B9DF; Wed, 11 Dec 2013 22:00:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D2521D6B; Wed, 11 Dec 2013 22:00:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBM03Or070394; Wed, 11 Dec 2013 22:00:03 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBM03RY070392; Wed, 11 Dec 2013 22:00:03 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312112200.rBBM03RY070392@svn.freebsd.org> From: Andreas Tobler Date: Wed, 11 Dec 2013 22:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259233 - stable/10/sys/powerpc/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 22:00:04 -0000 Author: andreast Date: Wed Dec 11 22:00:03 2013 New Revision: 259233 URL: http://svnweb.freebsd.org/changeset/base/259233 Log: MFC r259007 Increase PHYS_AVAIL_SZ because on pSeries machines we can have many logical regions which represent the total amount of memory. The size of these regions is not the physical size of the chip but it is a logical one and it is given by the OpenFirmware, it is selectable at boot time and varies between 16MB and 256MB in my case. There is an 'automatic' option which would select the size as 64MB in case you have around 16GB of RAM. To make sure we can allocate RAM with the automatic option bump this value of PHYS_AVAIL_SZ to 256. Modified: stable/10/sys/powerpc/include/pmap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/include/pmap.h ============================================================================== --- stable/10/sys/powerpc/include/pmap.h Wed Dec 11 21:48:04 2013 (r259232) +++ stable/10/sys/powerpc/include/pmap.h Wed Dec 11 22:00:03 2013 (r259233) @@ -240,7 +240,11 @@ boolean_t pmap_mmu_install(char *name, i #define vtophys(va) pmap_kextract((vm_offset_t)(va)) -#define PHYS_AVAIL_SZ 128 +#define PHYS_AVAIL_SZ 256 /* Allows up to 16GB Ram on pSeries with + * logical memory block size of 64MB. + * For more Ram increase the lmb or this value. + */ + extern vm_offset_t phys_avail[PHYS_AVAIL_SZ]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 22:26:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D85D166; Wed, 11 Dec 2013 22:26:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 586821F29; Wed, 11 Dec 2013 22:26:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBMQArf081057; Wed, 11 Dec 2013 22:26:10 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBMQAtG081056; Wed, 11 Dec 2013 22:26:10 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312112226.rBBMQAtG081056@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Wed, 11 Dec 2013 22:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259234 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 22:26:10 -0000 Author: dumbbell Date: Wed Dec 11 22:26:09 2013 New Revision: 259234 URL: http://svnweb.freebsd.org/changeset/base/259234 Log: MFC r259101: drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes This fixes radeon_agp_init() and gtt_size is now correct. However, this is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't implemented yet. Submitted by: tijl@ Modified: stable/10/sys/dev/drm2/radeon/radeon_agp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/radeon_agp.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_agp.c Wed Dec 11 22:00:03 2013 (r259233) +++ stable/10/sys/dev/drm2/radeon/radeon_agp.c Wed Dec 11 22:26:09 2013 (r259234) @@ -153,11 +153,11 @@ int radeon_agp_init(struct radeon_device return ret; } - if (rdev->ddev->agp->info.ai_aperture_size < 32) { + if ((rdev->ddev->agp->info.ai_aperture_size >> 20) < 32) { drm_agp_release(rdev->ddev); dev_warn(rdev->dev, "AGP aperture too small (%zuM) " "need at least 32M, disabling AGP\n", - rdev->ddev->agp->info.ai_aperture_size); + rdev->ddev->agp->info.ai_aperture_size >> 20); return -EINVAL; } @@ -246,7 +246,7 @@ int radeon_agp_init(struct radeon_device } rdev->mc.agp_base = rdev->ddev->agp->info.ai_aperture_base; - rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size << 20; + rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size; rdev->mc.gtt_start = rdev->mc.agp_base; rdev->mc.gtt_end = rdev->mc.gtt_start + rdev->mc.gtt_size - 1; dev_info(rdev->dev, "GTT: %juM 0x%08jX - 0x%08jX\n", From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 22:36:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2D953EE; Wed, 11 Dec 2013 22:36:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C9371FDE; Wed, 11 Dec 2013 22:36:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBMaM4w084721; Wed, 11 Dec 2013 22:36:22 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBMaLcZ084710; Wed, 11 Dec 2013 22:36:21 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312112236.rBBMaLcZ084710@svn.freebsd.org> From: Andreas Tobler Date: Wed, 11 Dec 2013 22:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259235 - in stable/10/sys: conf dev/tsec powerpc/aim powerpc/include powerpc/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 22:36:22 -0000 Author: andreast Date: Wed Dec 11 22:36:20 2013 New Revision: 259235 URL: http://svnweb.freebsd.org/changeset/base/259235 Log: MFC r257991, r257992, 257993, 258504 r257991: Consolidate Apple firmware hacks and improve them by switching on the presence of mac-io devices in the tree, which uniquely identifies Apple hardware. r257992: Allow OF_decode_addr() to also be able to map resources on big-endian devices. To this end, make PCI device detection rely on the device_type field rather than name, as per the standard. r257993: Make tsec work with the device tree present on the RB800. The previous code assumed that the MDIO bus was a direct child of the Ethernet interface. It may not be and indeed on many device trees is not. While here, add proper locking for MII transactions, which may be on a bus shared by several MACs. r258504: Save and restore the trap vectors when doing OF calls on pSeries machines. It turned out that on pSeries machines the call into OF modified the trap vectors and this made further behaviour unpredictable. With this commit I'm now able to boot multi user on a network booted environment on my IntelliStation 285. This is a POWER5+ machine. Modified: stable/10/sys/conf/files.powerpc stable/10/sys/dev/tsec/if_tsec.c stable/10/sys/dev/tsec/if_tsec.h stable/10/sys/dev/tsec/if_tsec_fdt.c stable/10/sys/dev/tsec/if_tsecreg.h stable/10/sys/powerpc/aim/machdep.c stable/10/sys/powerpc/include/ofw_machdep.h stable/10/sys/powerpc/ofw/ofw_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/conf/files.powerpc Wed Dec 11 22:36:20 2013 (r259235) @@ -140,7 +140,7 @@ powerpc/mpc85xx/mpc85xx.c optional mpc85 powerpc/mpc85xx/nexus.c optional mpc85xx powerpc/mpc85xx/pci_fdt.c optional pci mpc85xx powerpc/ofw/ofw_cpu.c optional aim -powerpc/ofw/ofw_machdep.c optional aim +powerpc/ofw/ofw_machdep.c standard powerpc/ofw/ofw_pci.c optional pci aim powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim Modified: stable/10/sys/dev/tsec/if_tsec.c ============================================================================== --- stable/10/sys/dev/tsec/if_tsec.c Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/dev/tsec/if_tsec.c Wed Dec 11 22:36:20 2013 (r259235) @@ -111,6 +111,8 @@ DRIVER_MODULE(miibus, tsec, miibus_drive MODULE_DEPEND(tsec, ether, 1, 1, 1); MODULE_DEPEND(tsec, miibus, 1, 1, 1); +struct mtx tsec_phy_mtx; + int tsec_attach(struct tsec_softc *sc) { @@ -121,6 +123,10 @@ tsec_attach(struct tsec_softc *sc) int error = 0; int i; + /* Initialize global (because potentially shared) MII lock */ + if (!mtx_initialized(&tsec_phy_mtx)) + mtx_init(&tsec_phy_mtx, "tsec mii", NULL, MTX_DEF); + /* Reset all TSEC counters */ TSEC_TX_RX_COUNTERS_INIT(sc); @@ -406,21 +412,24 @@ tsec_init_locked(struct tsec_softc *sc) */ TSEC_WRITE(sc, TSEC_REG_TBIPA, 5); + TSEC_PHY_LOCK(sc); + /* Step 6: Reset the management interface */ - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_RESETMGMT); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_RESETMGMT); /* Step 7: Setup the MII Mgmt clock speed */ - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_CLKDIV28); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMCFG, TSEC_MIIMCFG_CLKDIV28); /* Step 8: Read MII Mgmt indicator register and check for Busy = 0 */ timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & + while (--timeout && (TSEC_PHY_READ(sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) { if_printf(ifp, "tsec_init_locked(): Mgmt busy timeout\n"); return; } + TSEC_PHY_UNLOCK(sc); /* Step 9: Setup the MII Mgmt */ mii_mediachg(sc->tsec_mii); @@ -1561,22 +1570,27 @@ tsec_miibus_readreg(device_t dev, int ph { struct tsec_softc *sc; uint32_t timeout; + int rv; sc = device_get_softc(dev); - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMADD, (phy << 8) | reg); - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCOM, 0); - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCOM, TSEC_MIIMCOM_READCYCLE); + TSEC_PHY_LOCK(); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMCOM, 0); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMCOM, TSEC_MIIMCOM_READCYCLE); timeout = TSEC_READ_RETRY; - while (--timeout && TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & + while (--timeout && TSEC_PHY_READ(sc, TSEC_REG_MIIMIND) & (TSEC_MIIMIND_NOTVALID | TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); if (timeout == 0) device_printf(dev, "Timeout while reading from PHY!\n"); - return (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMSTAT)); + rv = TSEC_PHY_READ(sc, TSEC_REG_MIIMSTAT); + TSEC_PHY_UNLOCK(); + + return (rv); } int @@ -1587,13 +1601,15 @@ tsec_miibus_writereg(device_t dev, int p sc = device_get_softc(dev); - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMADD, (phy << 8) | reg); - TSEC_WRITE(sc->phy_sc, TSEC_REG_MIIMCON, value); + TSEC_PHY_LOCK(); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg); + TSEC_PHY_WRITE(sc, TSEC_REG_MIIMCON, value); timeout = TSEC_READ_RETRY; - while (--timeout && (TSEC_READ(sc->phy_sc, TSEC_REG_MIIMIND) & + while (--timeout && (TSEC_READ(sc, TSEC_REG_MIIMIND) & TSEC_MIIMIND_BUSY)) DELAY(TSEC_READ_DELAY); + TSEC_PHY_UNLOCK(); if (timeout == 0) device_printf(dev, "Timeout while writing to PHY!\n"); Modified: stable/10/sys/dev/tsec/if_tsec.h ============================================================================== --- stable/10/sys/dev/tsec/if_tsec.h Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/dev/tsec/if_tsec.h Wed Dec 11 22:36:20 2013 (r259235) @@ -133,7 +133,8 @@ struct tsec_softc { struct mbuf *frame; int phyaddr; - struct tsec_softc *phy_sc; + bus_space_tag_t phy_bst; + bus_space_handle_t phy_bsh; }; /* interface to get/put generic objects */ @@ -253,6 +254,14 @@ struct tsec_softc { #define TSEC_WRITE(sc, reg, val) \ bus_space_write_4((sc)->sc_bas.bst, (sc)->sc_bas.bsh, (reg), (val)) +extern struct mtx tsec_phy_mtx; +#define TSEC_PHY_LOCK(sc) mtx_lock(&tsec_phy_mtx) +#define TSEC_PHY_UNLOCK(sc) mtx_unlock(&tsec_phy_mtx) +#define TSEC_PHY_READ(sc, reg) \ + bus_space_read_4((sc)->phy_bst, (sc)->phy_bsh, (reg)) +#define TSEC_PHY_WRITE(sc, reg, val) \ + bus_space_write_4((sc)->phy_bst, (sc)->phy_bsh, (reg), (val)) + /* Lock for transmitter */ #define TSEC_TRANSMIT_LOCK(sc) do { \ mtx_assert(&(sc)->receive_lock, MA_NOTOWNED); \ Modified: stable/10/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- stable/10/sys/dev/tsec/if_tsec_fdt.c Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/dev/tsec/if_tsec_fdt.c Wed Dec 11 22:36:20 2013 (r259235) @@ -110,6 +110,10 @@ tsec_fdt_probe(device_t dev) struct tsec_softc *sc; uint32_t id; + if (ofw_bus_get_type(dev) == NULL || + strcmp(ofw_bus_get_type(dev), "network") != 0) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "gianfar")) return (ENXIO); @@ -148,6 +152,7 @@ static int tsec_fdt_attach(device_t dev) { struct tsec_softc *sc; + phandle_t phy; int error = 0; sc = device_get_softc(dev); @@ -155,9 +160,14 @@ tsec_fdt_attach(device_t dev) sc->node = ofw_bus_get_node(dev); /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, sc->dev, &sc->phyaddr, - (void **)&sc->phy_sc) != 0) + if (OF_getencprop(sc->node, "phy-handle", &phy, sizeof(phy)) <= 0) { + device_printf(dev, "PHY not found in device tree"); return (ENXIO); + } + + phy = OF_xref_phandle(phy); + OF_decode_addr(OF_parent(phy), 0, &sc->phy_bst, &sc->phy_bsh); + OF_getencprop(phy, "reg", &sc->phyaddr, sizeof(sc->phyaddr)); /* Init timer */ callout_init(&sc->tsec_callout, 1); @@ -324,6 +334,13 @@ tsec_get_hwaddr(struct tsec_softc *sc, u return; } + /* Also try the mac-address property, which is second-best */ + i = OF_getprop(sc->node, "mac-address", (void *)hw.addr, 6); + if (i == 6 && (hw.reg[0] != 0 || hw.reg[1] != 0)) { + bcopy(hw.addr, addr, 6); + return; + } + /* * Fall back -- use the currently programmed address in the hope that * it was set be firmware... Modified: stable/10/sys/dev/tsec/if_tsecreg.h ============================================================================== --- stable/10/sys/dev/tsec/if_tsecreg.h Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/dev/tsec/if_tsecreg.h Wed Dec 11 22:36:20 2013 (r259235) @@ -77,12 +77,13 @@ * register */ #define TSEC_REG_HAFDUP 0x50c /* Half-duplex register */ #define TSEC_REG_MAXFRM 0x510 /* Maximum frame length register */ -#define TSEC_REG_MIIMCFG 0x520 /* MII Management configuration register */ -#define TSEC_REG_MIIMCOM 0x524 /* MII Management command register */ -#define TSEC_REG_MIIMADD 0x528 /* MII Management address register */ -#define TSEC_REG_MIIMCON 0x52c /* MII Management control register */ -#define TSEC_REG_MIIMSTAT 0x530 /* MII Management status register */ -#define TSEC_REG_MIIMIND 0x534 /* MII Management indicator register */ +#define TSEC_REG_MIIBASE 0x520 /* MII Management base, rest offsets */ +#define TSEC_REG_MIIMCFG 0x0 /* MII Management configuration register */ +#define TSEC_REG_MIIMCOM 0x4 /* MII Management command register */ +#define TSEC_REG_MIIMADD 0x8 /* MII Management address register */ +#define TSEC_REG_MIIMCON 0xc /* MII Management control register */ +#define TSEC_REG_MIIMSTAT 0x10 /* MII Management status register */ +#define TSEC_REG_MIIMIND 0x14 /* MII Management indicator register */ #define TSEC_REG_IFSTAT 0x53c /* Interface status register */ #define TSEC_REG_MACSTNADDR1 0x540 /* Station address register, part 1 */ #define TSEC_REG_MACSTNADDR2 0x544 /* Station address register, part 2 */ Modified: stable/10/sys/powerpc/aim/machdep.c ============================================================================== --- stable/10/sys/powerpc/aim/machdep.c Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/powerpc/aim/machdep.c Wed Dec 11 22:36:20 2013 (r259235) @@ -123,6 +123,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -249,6 +250,7 @@ extern void *dblow, *dbsize; extern void *imisstrap, *imisssize; extern void *dlmisstrap, *dlmisssize; extern void *dsmisstrap, *dsmisssize; +char save_trap_init[0x2f00]; /* EXC_LAST */ uintptr_t powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel, @@ -273,6 +275,9 @@ powerpc_init(vm_offset_t startkernel, vm trap_offset = 0; cacheline_warn = 0; + /* Save trap vectors. */ + ofw_save_trap_vec(save_trap_init); + #ifdef WII /* * The Wii loader doesn't pass us any environment so, mdp Modified: stable/10/sys/powerpc/include/ofw_machdep.h ============================================================================== --- stable/10/sys/powerpc/include/ofw_machdep.h Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/powerpc/include/ofw_machdep.h Wed Dec 11 22:36:20 2013 (r259235) @@ -47,5 +47,6 @@ void OF_reboot(void); void ofw_mem_regions(struct mem_region **, int *, struct mem_region **, int *); void ofw_quiesce(void); /* Must be called before VM is up! */ +void ofw_save_trap_vec(char *); #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: stable/10/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_machdep.c Wed Dec 11 22:26:09 2013 (r259234) +++ stable/10/sys/powerpc/ofw/ofw_machdep.c Wed Dec 11 22:36:20 2013 (r259235) @@ -59,18 +59,43 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static struct mem_region OFmem[PHYS_AVAIL_SZ], OFavail[PHYS_AVAIL_SZ]; static struct mem_region OFfree[PHYS_AVAIL_SZ]; +static int apple_hacks; + +#ifdef AIM extern register_t ofmsr[5]; extern void *openfirmware_entry; static void *fdt; int ofw_real_mode; +extern char save_trap_init[0x2f00]; /* EXC_LAST */ +char save_trap_of[0x2f00]; /* EXC_LAST */ int ofwcall(void *); static int openfirmware(void *args); +__inline void +ofw_save_trap_vec(char *save_trap_vec) +{ + if (apple_hacks) + return; + + bcopy((void *)EXC_RST, save_trap_vec, EXC_LAST - EXC_RST); +} + +static __inline void +ofw_restore_trap_vec(char *restore_trap_vec) +{ + if (apple_hacks) + return; + + bcopy(restore_trap_vec, (void *)EXC_RST, EXC_LAST - EXC_RST); + __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); +} + /* * Saved SPRG0-3 from OpenFirmware. Will be restored prior to the callback. */ @@ -79,6 +104,9 @@ register_t ofw_sprg0_save; static __inline void ofw_sprg_prepare(void) { + if (!apple_hacks) + return; + /* * Assume that interrupt are disabled at this point, or * SPRG1-3 could be trashed @@ -98,6 +126,9 @@ ofw_sprg_prepare(void) static __inline void ofw_sprg_restore(void) { + if (!apple_hacks) + return; + /* * Note that SPRG1-3 contents are irrelevant. They are scratch * registers used in the early portion of trap handling when @@ -107,6 +138,7 @@ ofw_sprg_restore(void) */ __asm __volatile("mtsprg0 %0" :: "r"(ofw_sprg0_save)); } +#endif /* * Memory region utilities: determine if two regions overlap, @@ -178,15 +210,10 @@ parse_ofw_memory(phandle_t node, const c /* * On Apple hardware, address_cells is always 1 for "available", - * even when it is explicitly set to 2. Then all memory above 4 GB - * should be added by hand to the available list. Detect Apple hardware - * by seeing if ofw_real_mode is set -- only Apple seems to use - * virtual-mode OF. + * even when it is explicitly set to 2. All memory above 4 GB + * also needs to be added by hand to the available list. */ - if (strcmp(prop, "available") == 0 && !ofw_real_mode) - apple_hack_mode = 1; - - if (apple_hack_mode) + if (strcmp(prop, "available") == 0 && apple_hacks) address_cells = 1; /* @@ -241,7 +268,7 @@ parse_ofw_memory(phandle_t node, const c sz = j*sizeof(output[0]); #ifdef __powerpc64__ - if (apple_hack_mode) { + if (strcmp(prop, "available") == 0 && apple_hacks) { /* Add in regions above 4 GB to the available list */ struct mem_region himem[16]; int hisz; @@ -435,6 +462,7 @@ ofw_mem_regions(struct mem_region **memp *availsz = fsz; } +#ifdef AIM void OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *)) { @@ -481,6 +509,9 @@ OF_bootstrap() OF_init(fdt); } + /* Apple firmware has some bugs. Check for a "mac-io" alias. */ + apple_hacks = (OF_finddevice("mac-io") != -1) ? 1 : 0; + return (status); } @@ -516,6 +547,12 @@ openfirmware_core(void *args) ofw_sprg_prepare(); + /* Save trap vectors */ + ofw_save_trap_vec(save_trap_of); + + /* Restore initially saved trap vectors */ + ofw_restore_trap_vec(save_trap_init); + #if defined(AIM) && !defined(__powerpc64__) /* * Clear battable[] translations @@ -527,6 +564,10 @@ openfirmware_core(void *args) #endif result = ofwcall(args); + + /* Restore trap vecotrs */ + ofw_restore_trap_vec(save_trap_of); + ofw_sprg_restore(); intr_restore(oldmsr); @@ -603,6 +644,8 @@ OF_reboot() for (;;); /* just in case */ } +#endif /* AIM */ + void OF_getetheraddr(device_t dev, u_char *addr) { @@ -623,7 +666,7 @@ OF_getetheraddr(device_t dev, u_char *ad static void OF_get_addr_props(phandle_t node, uint32_t *addrp, uint32_t *sizep, int *pcip) { - char name[16]; + char type[64]; uint32_t addr, size; int pci, res; @@ -635,10 +678,10 @@ OF_get_addr_props(phandle_t node, uint32 size = 1; pci = 0; if (addr == 3 && size == 2) { - res = OF_getprop(node, "name", name, sizeof(name)); + res = OF_getprop(node, "device_type", type, sizeof(type)); if (res != -1) { - name[sizeof(name) - 1] = '\0'; - pci = (strcmp(name, "pci") == 0) ? 1 : 0; + type[sizeof(type) - 1] = '\0'; + pci = (strcmp(type, "pci") == 0) ? 1 : 0; } } if (addrp != NULL) @@ -672,8 +715,13 @@ OF_decode_addr(phandle_t dev, int regno, if (tag == NULL || handle == NULL) return (EINVAL); + /* Assume big-endian unless we find a PCI device */ + *tag = &bs_be_tag; + /* Get the requested register. */ OF_get_addr_props(bridge, &naddr, &nsize, &pci); + if (pci) + *tag = &bs_le_tag; res = OF_getprop(dev, (pci) ? "assigned-addresses" : "reg", cell, sizeof(cell)); if (res == -1) @@ -701,6 +749,8 @@ OF_decode_addr(phandle_t dev, int regno, parent = OF_parent(bridge); while (parent != 0) { OF_get_addr_props(parent, &nbridge, NULL, &pcib); + if (pcib) + *tag = &bs_le_tag; res = OF_getprop(bridge, "ranges", cell, sizeof(cell)); if (res == -1) goto next; @@ -741,7 +791,6 @@ OF_decode_addr(phandle_t dev, int regno, OF_get_addr_props(bridge, &naddr, &nsize, &pci); } - *tag = &bs_le_tag; return (bus_space_map(*tag, addr, size, prefetch ? BUS_SPACE_MAP_PREFETCHABLE : 0, handle)); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 23:05:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44F98BC4; Wed, 11 Dec 2013 23:05:06 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id EFE2011E4; Wed, 11 Dec 2013 23:05:05 +0000 (UTC) Received: from rnote.ddteam.net (144-60-135-95.pool.ukrtel.net [95.135.60.144]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id 05DCCC4927; Thu, 12 Dec 2013 01:04:57 +0200 (EET) Date: Thu, 12 Dec 2013 01:04:43 +0200 From: Aleksandr Rybalko To: "George V. Neville-Neil" , John Baldwin Subject: Re: svn commit: r259221 - head/sys/dev/vt Message-Id: <20131212010443.2ab8e926.ray@freebsd.org> In-Reply-To: <201312111718.rBBHIAgM065186@svn.freebsd.org> References: <201312111718.rBBHIAgM065186@svn.freebsd.org> Organization: FreeBSD.ORG X-Mailer: Sylpheed 3.1.2 (GTK+ 2.24.5; amd64-portbld-freebsd9.0) X-Operating-System: FreeBSD 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 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 23:05:06 -0000 On Wed, 11 Dec 2013 17:18:10 +0000 (UTC) "George V. Neville-Neil" wrote: > Author: gnn > Date: Wed Dec 11 17:18:10 2013 > New Revision: 259221 > URL: http://svnweb.freebsd.org/changeset/base/259221 > > Log: > Fix a panic when booting with kernels that have FREEBBSD_COMPAT > 4, 5, 6 or 43 by only thunking the data parameter for old ioctls > compatability ioctls instead of doing it for all of them. > > Submitted by: jhb@ > > Modified: > head/sys/dev/vt/vt_core.c > > Modified: head/sys/dev/vt/vt_core.c > ============================================================================== > --- head/sys/dev/vt/vt_core.c Wed Dec 11 15:32:28 2013 > (r259220) +++ head/sys/dev/vt/vt_core.c Wed Dec 11 17:18:10 > 2013 (r259221) @@ -1321,9 +1321,12 @@ vtterm_ioctl(struct > terminal *tm, u_long case _IO('c', 110): > cmd = CONS_SETKBD; > break; > + default: > + goto skip_thunk; > } > ival = IOCPARM_IVAL(data); > data = (caddr_t)&ival; > +skip_thunk: > #endif > > switch (cmd) { Many thanks George and John! Next time I will just copy old code instead of try to optimize it :-D Thanks! WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 23:06:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EC7DD1E; Wed, 11 Dec 2013 23:06:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A1F211F5; Wed, 11 Dec 2013 23:06:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBN643M095396; Wed, 11 Dec 2013 23:06:04 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBN64HJ095395; Wed, 11 Dec 2013 23:06:04 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312112306.rBBN64HJ095395@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Wed, 11 Dec 2013 23:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259236 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 23:06:04 -0000 Author: dumbbell Date: Wed Dec 11 23:06:03 2013 New Revision: 259236 URL: http://svnweb.freebsd.org/changeset/base/259236 Log: MFC r259104: drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSD The code was unmodified compared to Linux and returned the amount of received bytes from the i2c bus. This led to non-working i2c bus and failure to eg. read monitor's EDID, if connected to DisplayPort. Tested by: Mikaël Urankar Modified: stable/10/sys/dev/drm2/radeon/atombios_dp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/atombios_dp.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/atombios_dp.c Wed Dec 11 22:36:20 2013 (r259235) +++ stable/10/sys/dev/drm2/radeon/atombios_dp.c Wed Dec 11 23:06:03 2013 (r259236) @@ -272,7 +272,7 @@ int radeon_dp_i2c_aux_ch(device_t dev, i case AUX_I2C_REPLY_ACK: if (mode == MODE_I2C_READ) *read_byte = reply[0]; - return ret; + return (0); /* Return ret on Linux. */ case AUX_I2C_REPLY_NACK: DRM_DEBUG_KMS("aux_i2c nack\n"); return -EREMOTEIO; From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 23:15:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE4CA3E7; Wed, 11 Dec 2013 23:15:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C9E2812CA; Wed, 11 Dec 2013 23:15:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBNFJCh099268; Wed, 11 Dec 2013 23:15:19 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBNFJ23099267; Wed, 11 Dec 2013 23:15:19 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312112315.rBBNFJ23099267@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Wed, 11 Dec 2013 23:15:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259237 - stable/10/sys/dev/drm2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 23:15:20 -0000 Author: dumbbell Date: Wed Dec 11 23:15:19 2013 New Revision: 259237 URL: http://svnweb.freebsd.org/changeset/base/259237 Log: MFC r258930: drm: Read PCIER_LINK_CAP/PCIER_LINK_CAP2 from the PCI bridge Before this fix, capabilities were read from vgapci and were incorrect. Modified: stable/10/sys/dev/drm2/drm_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_pci.c ============================================================================== --- stable/10/sys/dev/drm2/drm_pci.c Wed Dec 11 23:06:03 2013 (r259236) +++ stable/10/sys/dev/drm2/drm_pci.c Wed Dec 11 23:15:19 2013 (r259237) @@ -134,7 +134,11 @@ int drm_pcie_get_speed_cap_mask(struct d if (!drm_device_is_pcie(dev)) return -EINVAL; - root = device_get_parent(dev->device); + root = + device_get_parent( /* pcib */ + device_get_parent( /* `-- pci */ + device_get_parent( /* `-- vgapci */ + dev->device))); /* `-- drmn */ pos = 0; pci_find_cap(root, PCIY_EXPRESS, &pos); From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 23:28:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DE3654; Wed, 11 Dec 2013 23:28:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9491365; Wed, 11 Dec 2013 23:28:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBNSWvk003150; Wed, 11 Dec 2013 23:28:32 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBNSVhI003147; Wed, 11 Dec 2013 23:28:31 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201312112328.rBBNSVhI003147@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Dec 2013 23:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259238 - in stable/10/sys/fs: nfs nfsclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 23:28:32 -0000 Author: rmacklem Date: Wed Dec 11 23:28:31 2013 New Revision: 259238 URL: http://svnweb.freebsd.org/changeset/base/259238 Log: MFC: r257901 Fix an NFSv4.1 client specific case where a forced dismount would hang. The hang occurred in nfsv4_setsequence() when it couldn't find an available session slot and is fixed by checking for a forced dismount in progress and just returning for this case. Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c stable/10/sys/fs/nfs/nfs_var.h stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/10/sys/fs/nfs/nfs_commonsubs.c Wed Dec 11 23:15:19 2013 (r259237) +++ stable/10/sys/fs/nfs/nfs_commonsubs.c Wed Dec 11 23:28:31 2013 (r259238) @@ -3693,8 +3693,8 @@ nfsv4_seqsess_cacherep(uint32_t slotid, * Generate the xdr for an NFSv4.1 Sequence Operation. */ APPLESTATIC void -nfsv4_setsequence(struct nfsrv_descript *nd, struct nfsclsession *sep, - int dont_replycache) +nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, + struct nfsclsession *sep, int dont_replycache) { uint32_t *tl, slotseq = 0; int i, maxslot, slotpos; @@ -3717,9 +3717,21 @@ nfsv4_setsequence(struct nfsrv_descript } bitval <<= 1; } - if (slotpos == -1) + if (slotpos == -1) { + /* + * If a forced dismount is in progress, just return. + * This RPC attempt will fail when it calls + * newnfs_request(). + */ + if ((nmp->nm_mountp->mnt_kern_flag & MNTK_UNMOUNTF) + != 0) { + mtx_unlock(&sep->nfsess_mtx); + return; + } + /* Wake up once/sec, to check for a forced dismount. */ (void)mtx_sleep(&sep->nfsess_slots, &sep->nfsess_mtx, - PZERO, "nfsclseq", 0); + PZERO, "nfsclseq", hz); + } } while (slotpos == -1); /* Now, find the highest slot in use. (nfsc_slots is 64bits) */ bitval = 1; Modified: stable/10/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/10/sys/fs/nfs/nfs_var.h Wed Dec 11 23:15:19 2013 (r259237) +++ stable/10/sys/fs/nfs/nfs_var.h Wed Dec 11 23:28:31 2013 (r259238) @@ -265,7 +265,8 @@ int nfsv4_getipaddr(struct nfsrv_descrip int nfsv4_seqsession(uint32_t, uint32_t, uint32_t, struct nfsslot *, struct mbuf **, uint16_t); void nfsv4_seqsess_cacherep(uint32_t, struct nfsslot *, struct mbuf *); -void nfsv4_setsequence(struct nfsrv_descript *, struct nfsclsession *, int); +void nfsv4_setsequence(struct nfsmount *, struct nfsrv_descript *, + struct nfsclsession *, int); void nfsv4_freeslot(struct nfsclsession *, int); /* nfs_clcomsubs.c */ Modified: stable/10/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Wed Dec 11 23:15:19 2013 (r259237) +++ stable/10/sys/fs/nfsclient/nfs_clcomsubs.c Wed Dec 11 23:28:31 2013 (r259238) @@ -203,10 +203,11 @@ nfscl_reqstart(struct nfsrv_descript *nd NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(NFSV4OP_SEQUENCE); if (sep == NULL) - nfsv4_setsequence(nd, NFSMNT_MDSSESSION(nmp), + nfsv4_setsequence(nmp, nd, + NFSMNT_MDSSESSION(nmp), nfs_bigreply[procnum]); else - nfsv4_setsequence(nd, sep, + nfsv4_setsequence(nmp, nd, sep, nfs_bigreply[procnum]); } if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh > 0) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 00:27:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83694989; Thu, 12 Dec 2013 00:27:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55642181F; Thu, 12 Dec 2013 00:27:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC0RNCZ025672; Thu, 12 Dec 2013 00:27:23 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC0RN9k025671; Thu, 12 Dec 2013 00:27:23 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201312120027.rBC0RN9k025671@svn.freebsd.org> From: Alan Somers Date: Thu, 12 Dec 2013 00:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259240 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 00:27:23 -0000 Author: asomers Date: Thu Dec 12 00:27:22 2013 New Revision: 259240 URL: http://svnweb.freebsd.org/changeset/base/259240 Log: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c When a da or ada device dissappears, outstanding IOs fail with ENXIO, not EIO. The check for EIO was probably copied from Illumos, where that is indeed the correct errno. Without this change, pulling a busy drive from a zpool would usually turn it into UNAVAIL, even though pulling an idle drive would turn it into REMOVED. With this change, it is REMOVED every time. Also, vdev_geom_io_intr shouldn't do zfs_post_remove, because that results in devd getting two resource.fs.zfs.removed events. The comment said that the event had to be sent directly instead of through the async removal thread because "the DE engine is using this information to discard prevoius I/O errors". However, the fact that vdev_geom_io_intr was never actually sending the events until now, and that vdev_geom_orphan never sent them at all, and that vdev_geom_orphan usually gets called about 2 seconds after the actual removal, means that FreeBSD's userland can cope with a late event just fine. Approved by: ken (mentor) Sponsored by: Spectra Logic Corporation MFC after: 4 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 12 00:01:45 2013 (r259239) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 12 00:27:22 2013 (r259240) @@ -770,20 +770,12 @@ vdev_geom_io_intr(struct bio *bp) */ vd->vdev_notrim = B_TRUE; } - if (zio->io_error == EIO && !vd->vdev_remove_wanted) { + if (zio->io_error == ENXIO && !vd->vdev_remove_wanted) { /* * If provider's error is set we assume it is being * removed. */ if (bp->bio_to->error != 0) { - /* - * We post the resource as soon as possible, instead of - * when the async removal actually happens, because the - * DE is using this information to discard previous I/O - * errors. - */ - /* XXX: zfs_post_remove() can sleep. */ - zfs_post_remove(zio->io_spa, vd); vd->vdev_remove_wanted = B_TRUE; spa_async_request(zio->io_spa, SPA_ASYNC_REMOVE); } else if (!vd->vdev_delayed_close) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 00:27:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A9BC98A; Thu, 12 Dec 2013 00:27:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 565011820; Thu, 12 Dec 2013 00:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC0RSjV025715; Thu, 12 Dec 2013 00:27:28 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC0RSeJ025714; Thu, 12 Dec 2013 00:27:28 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312120027.rBC0RSeJ025714@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 12 Dec 2013 00:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259241 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 00:27:28 -0000 Author: np Date: Thu Dec 12 00:27:27 2013 New Revision: 259241 URL: http://svnweb.freebsd.org/changeset/base/259241 Log: MFC r259145: Unstaticize t4_list and t4_uld_list. This works around a clang annoyance[1] and allows kgdb to find these symbols. [1] http://lists.freebsd.org/pipermail/freebsd-hackers/2012-November/041166.html Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Thu Dec 12 00:27:22 2013 (r259240) +++ stable/10/sys/dev/cxgbe/t4_main.c Thu Dec 12 00:27:27 2013 (r259241) @@ -161,10 +161,10 @@ MALLOC_DEFINE(M_CXGBE, "cxgbe", "Chelsio * then ADAPTER_LOCK, then t4_uld_list_lock. */ static struct sx t4_list_lock; -static SLIST_HEAD(, adapter) t4_list; +SLIST_HEAD(, adapter) t4_list; #ifdef TCP_OFFLOAD static struct sx t4_uld_list_lock; -static SLIST_HEAD(, uld_info) t4_uld_list; +SLIST_HEAD(, uld_info) t4_uld_list; #endif /* From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 02:03:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BFA6E0C; Thu, 12 Dec 2013 02:03:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 872BA1F52; Thu, 12 Dec 2013 02:03:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC23gRq060420; Thu, 12 Dec 2013 02:03:42 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC23gm1060419; Thu, 12 Dec 2013 02:03:42 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201312120203.rBC23gm1060419@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 12 Dec 2013 02:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259242 - stable/10/contrib/gcclibs/libcpp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 02:03:42 -0000 Author: mdf Date: Thu Dec 12 02:03:42 2013 New Revision: 259242 URL: http://svnweb.freebsd.org/changeset/base/259242 Log: MFC r258658: Fix a segfault / internal compiler error. Among other causes, when gcc throws a warning before parsing any tokens, the cur_token pointer is at the beginning of malloc'd memory. Dereferencing cur_token[-1] can cause a segfault. Code taken from OpenBSD http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/gcc/libcpp/errors.c which was a more complete fix than the one I originally coded. Modified: stable/10/contrib/gcclibs/libcpp/errors.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcclibs/libcpp/errors.c ============================================================================== --- stable/10/contrib/gcclibs/libcpp/errors.c Thu Dec 12 00:27:27 2013 (r259241) +++ stable/10/contrib/gcclibs/libcpp/errors.c Thu Dec 12 02:03:42 2013 (r259242) @@ -153,7 +153,20 @@ cpp_error (cpp_reader * pfile, int level } else { - src_loc = pfile->cur_token[-1].src_loc; + /* Find actual previous token. */ + cpp_token *t; + + if (pfile->cur_token != pfile->cur_run->base) + t = pfile->cur_token - 1; + else + { + if (pfile->cur_run->prev != NULL) + t = pfile->cur_run->prev->limit; + else + t = NULL; + } + /* Retrieve corresponding source location, unless we failed. */ + src_loc = t ? t->src_loc : 0; } if (_cpp_begin_message (pfile, level, src_loc, 0)) From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 02:05:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61116F57; Thu, 12 Dec 2013 02:05:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0731F63; Thu, 12 Dec 2013 02:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC250k2060656; Thu, 12 Dec 2013 02:05:00 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC250iP060654; Thu, 12 Dec 2013 02:05:00 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201312120205.rBC250iP060654@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 12 Dec 2013 02:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259243 - stable/9/contrib/gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 02:05:00 -0000 Author: mdf Date: Thu Dec 12 02:04:59 2013 New Revision: 259243 URL: http://svnweb.freebsd.org/changeset/base/259243 Log: MFC r258658: Fix a segfault / internal compiler error. Among other causes, when gcc throws a warning before parsing any tokens, the cur_token pointer is at the beginning of malloc'd memory. Dereferencing cur_token[-1] can cause a segfault. Code taken from OpenBSD http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/gcc/libcpp/errors.c which was a more complete fix than the one I originally coded. Modified: stable/9/contrib/gcclibs/libcpp/errors.c Directory Properties: stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/errors.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/errors.c Thu Dec 12 02:03:42 2013 (r259242) +++ stable/9/contrib/gcclibs/libcpp/errors.c Thu Dec 12 02:04:59 2013 (r259243) @@ -153,7 +153,20 @@ cpp_error (cpp_reader * pfile, int level } else { - src_loc = pfile->cur_token[-1].src_loc; + /* Find actual previous token. */ + cpp_token *t; + + if (pfile->cur_token != pfile->cur_run->base) + t = pfile->cur_token - 1; + else + { + if (pfile->cur_run->prev != NULL) + t = pfile->cur_run->prev->limit; + else + t = NULL; + } + /* Retrieve corresponding source location, unless we failed. */ + src_loc = t ? t->src_loc : 0; } if (_cpp_begin_message (pfile, level, src_loc, 0)) From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 03:04:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C4E1845; Thu, 12 Dec 2013 03:04:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28E521305; Thu, 12 Dec 2013 03:04:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC341x0082629; Thu, 12 Dec 2013 03:04:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC340cW082628; Thu, 12 Dec 2013 03:04:00 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312120304.rBC340cW082628@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 12 Dec 2013 03:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259244 - head/sys/ia64/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 03:04:01 -0000 Author: marcel Date: Thu Dec 12 03:04:00 2013 New Revision: 259244 URL: http://svnweb.freebsd.org/changeset/base/259244 Log: Allow pmap_remove_pages() to be called for physical maps not associated with the current thread. Obtained from: alc@ Modified: head/sys/ia64/ia64/pmap.c Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Thu Dec 12 02:04:59 2013 (r259243) +++ head/sys/ia64/ia64/pmap.c Thu Dec 12 03:04:00 2013 (r259244) @@ -2103,19 +2103,16 @@ pmap_remove_pages(pmap_t pmap) { struct pv_chunk *pc, *npc; struct ia64_lpte *pte; + pmap_t oldpmap; pv_entry_t pv; vm_offset_t va; vm_page_t m; u_long inuse, bitmask; int allfree, bit, field, idx; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: %s called with non-current pmap\n", - __func__); - return; - } rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); + oldpmap = pmap_switch(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; for (field = 0; field < _NPCM; field++) { @@ -2155,8 +2152,9 @@ pmap_remove_pages(pmap_t pmap) free_pv_chunk(pc); } } - rw_wunlock(&pvh_global_lock); + pmap_switch(oldpmap); PMAP_UNLOCK(pmap); + rw_wunlock(&pvh_global_lock); } /* From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 04:12:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89578F92; Thu, 12 Dec 2013 04:12:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B2F21750; Thu, 12 Dec 2013 04:12:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC4CKrc007850; Thu, 12 Dec 2013 04:12:20 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC4CJNZ007847; Thu, 12 Dec 2013 04:12:19 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312120412.rBC4CJNZ007847@svn.freebsd.org> From: Justin Hibbits Date: Thu, 12 Dec 2013 04:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259245 - head/sys/powerpc/aim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 04:12:20 -0000 Author: jhibbits Date: Thu Dec 12 04:12:19 2013 New Revision: 259245 URL: http://svnweb.freebsd.org/changeset/base/259245 Log: FBT now does work fully on PowerPC. MFC after: 2 weeks Modified: head/sys/powerpc/aim/trap.c head/sys/powerpc/aim/trap_subr32.S head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Thu Dec 12 03:04:00 2013 (r259244) +++ head/sys/powerpc/aim/trap.c Thu Dec 12 04:12:19 2013 (r259245) @@ -297,7 +297,7 @@ trap(struct trapframe *frame) #ifdef KDTRACE_HOOKS case EXC_PGM: if (frame->srr1 & EXC_PGM_TRAP) { - if (*(uintptr_t *)frame->srr0 == 0x7c810808) { + if (*(uint32_t *)frame->srr0 == 0x7c810808) { if (dtrace_invop_jump_addr != NULL) { dtrace_invop_jump_addr(frame); return; Modified: head/sys/powerpc/aim/trap_subr32.S ============================================================================== --- head/sys/powerpc/aim/trap_subr32.S Thu Dec 12 03:04:00 2013 (r259244) +++ head/sys/powerpc/aim/trap_subr32.S Thu Dec 12 04:12:19 2013 (r259245) @@ -883,8 +883,8 @@ CNAME(dblow): mfcr %r29 /* save CR in r29 */ mfsrr1 %r1 mtcr %r1 - bf 17,1f /* branch if privileged */ - + bf 17,2f /* branch if privileged */ +1: /* Unprivileged case */ mtcr %r29 /* put the condition register back */ mfsprg2 %r29 /* ... and r29 */ @@ -893,7 +893,17 @@ CNAME(dblow): li %r1, 0 /* How to get the vector from LR */ bla generictrap /* and we look like a generic trap */ -1: +2: +#ifdef KDTRACE_HOOKS + /* Privileged, so drop to KDB */ + mfsrr0 %r1 + lwz %r4,0(%r1) + /* Check if it's a DTrace trap. */ + li %r3,0x0808 + addis %r3,%r3,0x7c81 + cmplw %cr0,%r3,%r4 + beq %cr0,1b +#endif /* Privileged, so drop to KDB */ GET_CPUINFO(%r1) stw %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Thu Dec 12 03:04:00 2013 (r259244) +++ head/sys/powerpc/aim/trap_subr64.S Thu Dec 12 04:12:19 2013 (r259245) @@ -789,8 +789,9 @@ CNAME(dblow): mfcr %r29 /* save CR in r29 */ mfsrr1 %r1 mtcr %r1 - bf 17,1f /* branch if privileged */ + bf 17,2f /* branch if privileged */ +1: /* Unprivileged case */ mtcr %r29 /* put the condition register back */ mfsprg2 %r29 /* ... and r29 */ @@ -799,8 +800,17 @@ CNAME(dblow): li %r1, 0 /* How to get the vector from LR */ bla generictrap /* and we look like a generic trap */ -1: +2: +#ifdef KDTRACE_HOOKS /* Privileged, so drop to KDB */ + mfsrr0 %r1 + lwz %r4,0(%r1) + /* Check if it's a DTrace trap. */ + li %r3,0x0808 + addis %r3,%r3,0x7c81 + cmplw %cr0,%r3,%r4 + beq %cr0,1b +#endif GET_CPUINFO(%r1) std %r27,(PC_DBSAVE+CPUSAVE_R27)(%r1) /* free r27 */ std %r28,(PC_DBSAVE+CPUSAVE_R28)(%r1) /* free r28 */ From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 05:49:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BF3F50B; Thu, 12 Dec 2013 05:49:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47D801DFC; Thu, 12 Dec 2013 05:49:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC5nSHl040760; Thu, 12 Dec 2013 05:49:28 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC5nSWN040759; Thu, 12 Dec 2013 05:49:28 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312120549.rBC5nSWN040759@svn.freebsd.org> From: Glen Barber Date: Thu, 12 Dec 2013 05:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259246 - head/release/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 05:49:28 -0000 Author: gjb Date: Thu Dec 12 05:49:27 2013 New Revision: 259246 URL: http://svnweb.freebsd.org/changeset/base/259246 Log: Prevent release build errors found during snapshot builds where if NOPORTS=1, pkg-stage.sh cannot build the ports-mgmt/pkg port if WITH_DVD=1. MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/scripts/pkg-stage.sh Modified: head/release/scripts/pkg-stage.sh ============================================================================== --- head/release/scripts/pkg-stage.sh Thu Dec 12 04:12:19 2013 (r259245) +++ head/release/scripts/pkg-stage.sh Thu Dec 12 05:49:27 2013 (r259246) @@ -24,6 +24,11 @@ fi REVISION="${2}" . "${1}" || exit 1 +# If NOPORTS is set for the release, do not attempt to build pkg(8). +if [ ! -f /usr/ports/Makefile ]; then + exit 0 +fi + if [ ! -x /usr/local/sbin/pkg ]; then /usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean fi From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 08:23:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9ED04DD; Thu, 12 Dec 2013 08:23:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C574F17EA; Thu, 12 Dec 2013 08:23:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC8NSkl005668; Thu, 12 Dec 2013 08:23:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC8NSfk005667; Thu, 12 Dec 2013 08:23:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312120823.rBC8NSfk005667@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Dec 2013 08:23:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259247 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 08:23:28 -0000 Author: mav Date: Thu Dec 12 08:23:28 2013 New Revision: 259247 URL: http://svnweb.freebsd.org/changeset/base/259247 Log: Fix bug introduced at r256607. We have to recalculate bp_resid here since sizes of original and completed requests may differ due to end of media. Bisected by: pho Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Thu Dec 12 05:49:27 2013 (r259246) +++ head/sys/geom/geom_dev.c Thu Dec 12 08:23:28 2013 (r259247) @@ -487,7 +487,7 @@ g_dev_done(struct bio *bp2) bp = bp2->bio_parent; bp->bio_error = bp2->bio_error; bp->bio_completed = bp2->bio_completed; - bp->bio_resid = bp2->bio_resid; + bp->bio_resid = bp->bio_length - bp2->bio_completed; if (bp2->bio_error != 0) { g_trace(G_T_BIO, "g_dev_done(%p) had error %d", bp2, bp2->bio_error); From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 08:34:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99BC678F; Thu, 12 Dec 2013 08:34:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 85A1318B3; Thu, 12 Dec 2013 08:34:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC8YqAt009334; Thu, 12 Dec 2013 08:34:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC8YqZQ009333; Thu, 12 Dec 2013 08:34:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201312120834.rBC8YqZQ009333@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 12 Dec 2013 08:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259248 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 08:34:52 -0000 Author: hselasky Date: Thu Dec 12 08:34:51 2013 New Revision: 259248 URL: http://svnweb.freebsd.org/changeset/base/259248 Log: Set chain bit correctly. This will fix some problems sending and receiving Zero Length Packets, ZLPs. See comment in code for more information. MFC after: 1 week Reported by: Kohji Okuno Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Dec 12 08:23:28 2013 (r259247) +++ head/sys/dev/usb/controller/xhci.c Thu Dec 12 08:34:51 2013 (r259248) @@ -1892,7 +1892,16 @@ restart: td->td_trb[x].dwTrb2 = htole32(dword); dword = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK) | - XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT; + XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_IOC_BIT | + /* + * CHAIN-BIT: Ensure that a multi-TRB IN-endpoint + * frame only receives a single short packet event + * by setting the CHAIN bit in the LINK field. In + * addition some XHCI controllers have problems + * sending a ZLP unless the CHAIN-BIT is set in + * the LINK TRB. + */ + XHCI_TRB_3_CHAIN_BIT; td->td_trb[x].dwTrb3 = htole32(dword); @@ -1930,7 +1939,7 @@ restart: } /* clear TD SIZE to zero, hence this is the last TRB */ - /* remove chain bit because this is the last TRB in the chain */ + /* remove chain bit because this is the last data TRB in the chain */ td->td_trb[td->ntrb - 1].dwTrb2 &= ~htole32(XHCI_TRB_2_TDSZ_SET(15)); td->td_trb[td->ntrb - 1].dwTrb3 &= ~htole32(XHCI_TRB_3_CHAIN_BIT); From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 08:48:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79556CCB; Thu, 12 Dec 2013 08:48:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 647211984; Thu, 12 Dec 2013 08:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC8mkaf013265; Thu, 12 Dec 2013 08:48:46 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC8mkVB013264; Thu, 12 Dec 2013 08:48:46 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201312120848.rBC8mkVB013264@svn.freebsd.org> From: David Chisnall Date: Thu, 12 Dec 2013 08:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259249 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 08:48:46 -0000 Author: theraven Date: Thu Dec 12 08:48:45 2013 New Revision: 259249 URL: http://svnweb.freebsd.org/changeset/base/259249 Log: Fix the version string in dts emission. Reported by: Patrick Wildt MFC after: 1 week Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Thu Dec 12 08:34:51 2013 (r259248) +++ head/usr.bin/dtc/fdt.cc Thu Dec 12 08:48:45 2013 (r259249) @@ -1181,7 +1181,7 @@ void device_tree::write_dts(int fd) { FILE *file = fdopen(fd, "w"); - fputs("/dtc-v1/;\n\n", file); + fputs("/dts-v1/;\n\n", file); if (!reservations.empty()) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 08:55:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 074F4EB1; Thu, 12 Dec 2013 08:55:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E79A91A35; Thu, 12 Dec 2013 08:55:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBC8tOa2016420; Thu, 12 Dec 2013 08:55:24 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBC8tO02016419; Thu, 12 Dec 2013 08:55:24 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201312120855.rBC8tO02016419@svn.freebsd.org> From: David Chisnall Date: Thu, 12 Dec 2013 08:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259250 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 08:55:25 -0000 Author: theraven Date: Thu Dec 12 08:55:24 2013 New Revision: 259250 URL: http://svnweb.freebsd.org/changeset/base/259250 Log: Some more cleanups and bug fixes in dtc for property printing / parsing. Submitted by: Patrick Wildt Modified: head/usr.bin/dtc/fdt.cc Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Thu Dec 12 08:48:45 2013 (r259249) +++ head/usr.bin/dtc/fdt.cc Thu Dec 12 08:55:24 2013 (r259250) @@ -137,7 +137,7 @@ property_value::resolve_type() break; } } - if (is_all_printable && (bytes > nuls)) + if ((is_all_printable && (bytes > nuls)) || bytes == 0) { type = STRING; if (nuls > 0) @@ -204,7 +204,7 @@ property_value::write_as_bytes(FILE *fil putc('[', file); for (byte_buffer::iterator i=byte_data.begin(), e=byte_data.end(); i!=e ; i++) { - fprintf(file, "%hhx", *i); + fprintf(file, "%02hhx", *i); if (i+1 != e) { putc(' ', file); @@ -367,6 +367,11 @@ property::property(input_buffer &structs return; } key = string(name_buffer); + + // If we're empty, do not push anything as value. + if (!length) + return; + // Read the value uint8_t byte; property_value v; From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 11:05:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7CCADEF; Thu, 12 Dec 2013 11:05:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9412D1471; Thu, 12 Dec 2013 11:05:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCB5m55064302; Thu, 12 Dec 2013 11:05:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCB5mEs064301; Thu, 12 Dec 2013 11:05:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201312121105.rBCB5mEs064301@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Dec 2013 11:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259254 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 11:05:48 -0000 Author: mav Date: Thu Dec 12 11:05:48 2013 New Revision: 259254 URL: http://svnweb.freebsd.org/changeset/base/259254 Log: Fix long known bug with handling device aliases residing not in devfs root. Historically creation of device aliases created symbolic links using only name of target device as a link target, not considering current directory. Fix that by adding number of "../" chunks to the terget device name, required to get out of the current directory to devfs root first. MFC after: 1 month Modified: head/sys/fs/devfs/devfs_devs.c Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Thu Dec 12 10:57:16 2013 (r259253) +++ head/sys/fs/devfs/devfs_devs.c Thu Dec 12 11:05:48 2013 (r259254) @@ -486,9 +486,9 @@ devfs_populate_loop(struct devfs_mount * { struct cdev_priv *cdp; struct devfs_dirent *de; - struct devfs_dirent *dd; + struct devfs_dirent *dd, *dt; struct cdev *pdev; - int de_flags, j; + int de_flags, depth, j; char *q, *s; sx_assert(&dm->dm_lock, SX_XLOCKED); @@ -589,9 +589,17 @@ devfs_populate_loop(struct devfs_mount * de->de_mode = 0755; de->de_dirent->d_type = DT_LNK; pdev = cdp->cdp_c.si_parent; - j = strlen(pdev->si_name) + 1; + dt = dd; + depth = 0; + while (dt != dm->dm_rootdir && + (dt = devfs_parent_dirent(dt)) != NULL) + depth++; + j = depth * 3 + strlen(pdev->si_name) + 1; de->de_symlink = malloc(j, M_DEVFS, M_WAITOK); - bcopy(pdev->si_name, de->de_symlink, j); + de->de_symlink[0] = 0; + while (depth-- > 0) + strcat(de->de_symlink, "../"); + strcat(de->de_symlink, pdev->si_name); } else { de->de_uid = cdp->cdp_c.si_uid; de->de_gid = cdp->cdp_c.si_gid; From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 12:17:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A04612D; Thu, 12 Dec 2013 12:17:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 857EE1A9F; Thu, 12 Dec 2013 12:17:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCCHLNO090435; Thu, 12 Dec 2013 12:17:21 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCCHLwu090433; Thu, 12 Dec 2013 12:17:21 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312121217.rBCCHLwu090433@svn.freebsd.org> From: Andreas Tobler Date: Thu, 12 Dec 2013 12:17:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259255 - stable/10/sys/dev/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 12:17:21 -0000 Author: andreast Date: Thu Dec 12 12:17:20 2013 New Revision: 259255 URL: http://svnweb.freebsd.org/changeset/base/259255 Log: MFC: r256932, r256938, r256953 r256932: Add a new function (OF_getencprop()) that undoes the transformation applied by encode-int. Specifically, it takes a set of 32-bit cell values and changes them to host byte order. Most non-string instances of OF_getprop() should be using this function, which is a no-op on big-endian platforms. r256938: A few other common cases for encode-int decoding: OF_getencprop_alloc() and OF_searchencprop(). I thought about using the element size parameter to OF_getprop_alloc() to do endian-switching automatically, but it breaks use with structs and a *lot* of FDT code (which can hopefully be moved to these new APIs). r256953: Fix build. Modified: stable/10/sys/dev/ofw/openfirm.c stable/10/sys/dev/ofw/openfirm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ofw/openfirm.c ============================================================================== --- stable/10/sys/dev/ofw/openfirm.c Thu Dec 12 11:05:48 2013 (r259254) +++ stable/10/sys/dev/ofw/openfirm.c Thu Dec 12 12:17:20 2013 (r259255) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -280,6 +281,21 @@ OF_getprop(phandle_t package, const char return (OFW_GETPROP(ofw_obj, package, propname, buf, buflen)); } +ssize_t +OF_getencprop(phandle_t node, const char *propname, pcell_t *buf, size_t len) +{ + ssize_t retval; + int i; + + KASSERT(len % 4 == 0, ("Need a multiple of 4 bytes")); + + retval = OF_getprop(node, propname, buf, len); + for (i = 0; i < len/4; i++) + buf[i] = be32toh(buf[i]); + + return (retval); +} + /* * Recursively search the node and its parent for the given property, working * downward from the node to the device tree root. Returns the value of the @@ -296,6 +312,17 @@ OF_searchprop(phandle_t node, const char return (-1); } +ssize_t +OF_searchencprop(phandle_t node, const char *propname, void *buf, size_t len) +{ + ssize_t rv; + + for (; node != 0; node = OF_parent(node)) + if ((rv = OF_getencprop(node, propname, buf, len)) != -1) + return (rv); + return (-1); +} + /* * Store the value of a property of a package into newly allocated memory * (using the M_OFWPROP malloc pool and M_WAITOK). elsz is the size of a @@ -320,6 +347,26 @@ OF_getprop_alloc(phandle_t package, cons return (len / elsz); } +ssize_t +OF_getencprop_alloc(phandle_t package, const char *name, int elsz, void **buf) +{ + ssize_t retval; + pcell_t *cell; + int i; + + KASSERT(elsz % 4 == 0, ("Need a multiple of 4 bytes")); + + retval = OF_getprop_alloc(package, name, elsz, buf); + if (retval == -1) + return (retval); + + cell = *buf; + for (i = 0; i < retval*elsz/4; i++) + cell[i] = be32toh(cell[i]); + + return (retval); +} + /* Get the next property of a package. */ int OF_nextprop(phandle_t package, const char *previous, char *buf, size_t size) Modified: stable/10/sys/dev/ofw/openfirm.h ============================================================================== --- stable/10/sys/dev/ofw/openfirm.h Thu Dec 12 11:05:48 2013 (r259254) +++ stable/10/sys/dev/ofw/openfirm.h Thu Dec 12 12:17:20 2013 (r259255) @@ -105,11 +105,17 @@ phandle_t OF_parent(phandle_t node); ssize_t OF_getproplen(phandle_t node, const char *propname); ssize_t OF_getprop(phandle_t node, const char *propname, void *buf, size_t len); +ssize_t OF_getencprop(phandle_t node, const char *prop, pcell_t *buf, + size_t len); /* Same as getprop, but maintains endianness */ int OF_hasprop(phandle_t node, const char *propname); ssize_t OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len); +ssize_t OF_searchencprop(phandle_t node, const char *propname, + void *buf, size_t len); ssize_t OF_getprop_alloc(phandle_t node, const char *propname, int elsz, void **buf); +ssize_t OF_getencprop_alloc(phandle_t node, const char *propname, + int elsz, void **buf); int OF_nextprop(phandle_t node, const char *propname, char *buf, size_t len); int OF_setprop(phandle_t node, const char *name, const void *buf, From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 12:29:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A75358F; Thu, 12 Dec 2013 12:29:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1C7E31C95; Thu, 12 Dec 2013 12:29:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCCTZXs094368; Thu, 12 Dec 2013 12:29:35 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCCTZSY094367; Thu, 12 Dec 2013 12:29:35 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312121229.rBCCTZSY094367@svn.freebsd.org> From: Andreas Tobler Date: Thu, 12 Dec 2013 12:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259256 - stable/10/sys/powerpc/powerpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 12:29:36 -0000 Author: andreast Date: Thu Dec 12 12:29:35 2013 New Revision: 259256 URL: http://svnweb.freebsd.org/changeset/base/259256 Log: MFC: r258722, r258757 r258722: Give some output about the CPU clock on IBMPOWER machines, currently read from OF. Linux does it similar, means they also read the OF values and display them. r258757: Use the Open Firmware-based CPU frequency determination as a generic fallback if we can't measure CPU frequency. This is also useful on a variety of embedded systems using FDT. Modified: stable/10/sys/powerpc/powerpc/cpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/10/sys/powerpc/powerpc/cpu.c Thu Dec 12 12:17:20 2013 (r259255) +++ stable/10/sys/powerpc/powerpc/cpu.c Thu Dec 12 12:29:35 2013 (r259256) @@ -74,6 +74,8 @@ #include #include +#include + static void cpu_6xx_setup(int cpuid, uint16_t vers); static void cpu_970_setup(int cpuid, uint16_t vers); static void cpu_booke_setup(int cpuid, uint16_t vers); @@ -273,6 +275,9 @@ cpu_est_clockrate(int cpu_id, uint64_t * { uint16_t vers; register_t msr; + phandle_t cpu, dev, root; + int res = 0; + char buf[8]; vers = mfpvr() >> 16; msr = mfmsr(); @@ -316,9 +321,40 @@ cpu_est_clockrate(int cpu_id, uint64_t * mtmsr(msr); return (0); + + default: + root = OF_peer(0); + if (root == 0) + return (ENXIO); + + dev = OF_child(root); + while (dev != 0) { + res = OF_getprop(dev, "name", buf, sizeof(buf)); + if (res > 0 && strcmp(buf, "cpus") == 0) + break; + dev = OF_peer(dev); + } + cpu = OF_child(dev); + while (cpu != 0) { + res = OF_getprop(cpu, "device_type", buf, + sizeof(buf)); + if (res > 0 && strcmp(buf, "cpu") == 0) + break; + cpu = OF_peer(cpu); + } + if (cpu == 0) + return (ENOENT); + if (OF_getprop(cpu, "ibm,extended-clock-frequency", + cps, sizeof(*cps)) >= 0) { + return (0); + } else if (OF_getprop(cpu, "clock-frequency", cps, + sizeof(cell_t)) >= 0) { + *cps >>= 32; + return (0); + } else { + return (ENOENT); + } } - - return (ENXIO); } void From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 12:36:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 363FBBB3; Thu, 12 Dec 2013 12:36:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 206811D71; Thu, 12 Dec 2013 12:36:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCCafIa097601; Thu, 12 Dec 2013 12:36:41 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCCaeTG097595; Thu, 12 Dec 2013 12:36:40 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312121236.rBCCaeTG097595@svn.freebsd.org> From: Andreas Tobler Date: Thu, 12 Dec 2013 12:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259257 - in stable/10/sys: conf powerpc/ofw powerpc/pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 12:36:42 -0000 Author: andreast Date: Thu Dec 12 12:36:40 2013 New Revision: 259257 URL: http://svnweb.freebsd.org/changeset/base/259257 Log: MFC: r258051, r258052 r258052: Following the approach with ACPI DMAR on x86, split IOMMU handling into a variant PCI bus instead of trying to shoehorn it into the PCI host bridge adapter. Besides matching better the architecture on other platforms, this also allows systems with multiple partitionable endpoints per PCI host bridge to work correctly. r258051: Actually add IOMMU domain to the list of known mappings. This fixes a bug where multiple devices in the same IOMMU domain would be allocated conflicting mappings unless they also shared a DMA tag. Added: stable/10/sys/powerpc/ofw/ofw_pcibus.h - copied unchanged from r258052, head/sys/powerpc/ofw/ofw_pcibus.h stable/10/sys/powerpc/pseries/plpar_pcibus.c - copied unchanged from r258052, head/sys/powerpc/pseries/plpar_pcibus.c Modified: stable/10/sys/conf/files.powerpc stable/10/sys/powerpc/ofw/ofw_pcibus.c stable/10/sys/powerpc/pseries/plpar_iommu.c stable/10/sys/powerpc/pseries/rtas_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.powerpc ============================================================================== --- stable/10/sys/conf/files.powerpc Thu Dec 12 12:29:35 2013 (r259256) +++ stable/10/sys/conf/files.powerpc Thu Dec 12 12:36:40 2013 (r259257) @@ -232,6 +232,7 @@ powerpc/pseries/phyp_llan.c optional lla powerpc/pseries/phyp_vscsi.c optional pseries powerpc64 scbus powerpc/pseries/platform_chrp.c optional pseries powerpc/pseries/plpar_iommu.c optional pseries powerpc64 +powerpc/pseries/plpar_pcibus.c optional pseries powerpc64 pci powerpc/pseries/rtas_dev.c optional pseries powerpc/pseries/rtas_pci.c optional pseries pci powerpc/pseries/vdevice.c optional pseries powerpc64 Modified: stable/10/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- stable/10/sys/powerpc/ofw/ofw_pcibus.c Thu Dec 12 12:29:35 2013 (r259256) +++ stable/10/sys/powerpc/ofw/ofw_pcibus.c Thu Dec 12 12:36:40 2013 (r259257) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ofw_pcibus.h" #include "pcib_if.h" #include "pci_if.h" @@ -85,12 +86,7 @@ static device_method_t ofw_pcibus_method DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), - { 0, 0 } -}; - -struct ofw_pcibus_devinfo { - struct pci_devinfo opd_dinfo; - struct ofw_bus_devinfo opd_obdinfo; + DEVMETHOD_END }; static devclass_t pci_devclass; @@ -195,6 +191,7 @@ ofw_pcibus_enum_devtree(device_t dev, u_ pci_freecfg((struct pci_devinfo *)dinfo); continue; } + dinfo->opd_dma_tag = NULL; pci_add_child(dev, (struct pci_devinfo *)dinfo); /* @@ -274,6 +271,7 @@ ofw_pcibus_enum_bus(device_t dev, u_int if (dinfo == NULL) continue; + dinfo->opd_dma_tag = NULL; dinfo->opd_obdinfo.obd_node = -1; dinfo->opd_obdinfo.obd_name = NULL; Copied: stable/10/sys/powerpc/ofw/ofw_pcibus.h (from r258052, head/sys/powerpc/ofw/ofw_pcibus.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/ofw/ofw_pcibus.h Thu Dec 12 12:36:40 2013 (r259257, copy of r258052, head/sys/powerpc/ofw/ofw_pcibus.h) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * 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$ + */ + +#ifndef POWERPC_OFW_OFW_PCIBUS_H +#define POWERPC_OFW_OFW_PCIBUS_H + +#include +#include + +#include +#include +#include + +/* + * Export class definition for inheritance purposes + */ +DECLARE_CLASS(ofw_pcibus_driver); /* PCI Bus Enumerators */ + +struct ofw_pcibus_devinfo { + struct pci_devinfo opd_dinfo; + struct ofw_bus_devinfo opd_obdinfo; + bus_dma_tag_t opd_dma_tag; +}; + +#endif // POWERPC_OFW_OFW_PCIBUS_H + Modified: stable/10/sys/powerpc/pseries/plpar_iommu.c ============================================================================== --- stable/10/sys/powerpc/pseries/plpar_iommu.c Thu Dec 12 12:29:35 2013 (r259256) +++ stable/10/sys/powerpc/pseries/plpar_iommu.c Thu Dec 12 12:36:40 2013 (r259257) @@ -115,6 +115,8 @@ phyp_iommu_set_dma_tag(device_t dev, dev (((uint64_t)(dmawindow[dma_acells + 1]) << 32) | dmawindow[dma_acells + 2]); + if (bootverbose) + device_printf(dev, "Mapping IOMMU domain %#x\n", dmawindow[0]); window->map = NULL; SLIST_FOREACH(i, &iommu_map_head, entries) { if (i->iobn == dmawindow[0]) { @@ -134,6 +136,7 @@ phyp_iommu_set_dma_tag(device_t dev, dev window->map->vmem = vmem_create("IOMMU mappings", PAGE_SIZE, trunc_page(VMEM_ADDR_MAX) - PAGE_SIZE, PAGE_SIZE, 0, M_BESTFIT | M_NOWAIT); + SLIST_INSERT_HEAD(&iommu_map_head, window->map, entries); } /* Copied: stable/10/sys/powerpc/pseries/plpar_pcibus.c (from r258052, head/sys/powerpc/pseries/plpar_pcibus.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/powerpc/pseries/plpar_pcibus.c Thu Dec 12 12:36:40 2013 (r259257, copy of r258052, head/sys/powerpc/pseries/plpar_pcibus.c) @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2011 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +#include +#include + +#include "pci_if.h" +#include "iommu_if.h" + +static int plpar_pcibus_probe(device_t); +static bus_dma_tag_t plpar_pcibus_get_dma_tag(device_t dev, device_t child); + +/* + * Driver methods. + */ +static device_method_t plpar_pcibus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, plpar_pcibus_probe), + + /* IOMMU functions */ + DEVMETHOD(bus_get_dma_tag, plpar_pcibus_get_dma_tag), + DEVMETHOD(iommu_map, phyp_iommu_map), + DEVMETHOD(iommu_unmap, phyp_iommu_unmap), + + DEVMETHOD_END +}; + +static devclass_t pci_devclass; +DEFINE_CLASS_1(pci, plpar_pcibus_driver, plpar_pcibus_methods, + sizeof(struct pci_softc), ofw_pcibus_driver); +DRIVER_MODULE(plpar_pcibus, pcib, plpar_pcibus_driver, pci_devclass, 0, 0); + +static int +plpar_pcibus_probe(device_t dev) +{ + phandle_t rtas; + + if (ofw_bus_get_node(dev) == -1 || !rtas_exists()) + return (ENXIO); + + rtas = OF_finddevice("/rtas"); + if (!OF_hasprop(rtas, "ibm,hypertas-functions")) + return (ENXIO); + + device_set_desc(dev, "POWER Hypervisor PCI bus"); + + return (BUS_PROBE_SPECIFIC); +} + +static bus_dma_tag_t +plpar_pcibus_get_dma_tag(device_t dev, device_t child) +{ + struct ofw_pcibus_devinfo *dinfo; + + while (device_get_parent(child) != dev) + child = device_get_parent(child); + + dinfo = device_get_ivars(child); + + if (dinfo->opd_dma_tag != NULL) + return (dinfo->opd_dma_tag); + + bus_dma_tag_create(bus_get_dma_tag(dev), + 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, + BUS_SPACE_MAXSIZE, 0, NULL, NULL, &dinfo->opd_dma_tag); + phyp_iommu_set_dma_tag(dev, child, dinfo->opd_dma_tag); + + return (dinfo->opd_dma_tag); +} + Modified: stable/10/sys/powerpc/pseries/rtas_pci.c ============================================================================== --- stable/10/sys/powerpc/pseries/rtas_pci.c Thu Dec 12 12:29:35 2013 (r259256) +++ stable/10/sys/powerpc/pseries/rtas_pci.c Thu Dec 12 12:36:40 2013 (r259257) @@ -74,11 +74,6 @@ static void rtaspci_write_config(device u_int, u_int32_t, int); /* - * IOMMU LPAR interface - */ -static bus_dma_tag_t rtaspci_get_dma_tag(device_t dev, device_t child); - -/* * Driver methods. */ static device_method_t rtaspci_methods[] = { @@ -90,19 +85,11 @@ static device_method_t rtaspci_methods[] DEVMETHOD(pcib_read_config, rtaspci_read_config), DEVMETHOD(pcib_write_config, rtaspci_write_config), - /* IOMMU functions */ - DEVMETHOD(bus_get_dma_tag, rtaspci_get_dma_tag), -#ifdef __powerpc64__ - DEVMETHOD(iommu_map, phyp_iommu_map), - DEVMETHOD(iommu_unmap, phyp_iommu_unmap), -#endif - DEVMETHOD_END }; struct rtaspci_softc { struct ofw_pci_softc pci_sc; - bus_dma_tag_t dma_tag; cell_t read_pci_config, write_pci_config; cell_t ex_read_pci_config, ex_write_pci_config; @@ -149,15 +136,6 @@ rtaspci_attach(device_t dev) OF_getprop(ofw_bus_get_node(dev), "ibm,pci-config-space-type", &sc->sc_extended_config, sizeof(sc->sc_extended_config)); - bus_dma_tag_create(bus_get_dma_tag(dev), - 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, - NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED, - BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->dma_tag); -#ifdef __powerpc64__ - if (!(mfmsr() & PSL_HV)) - phyp_iommu_set_dma_tag(dev, dev, sc->dma_tag); -#endif - return (ofw_pci_attach(dev)); } @@ -225,12 +203,3 @@ rtaspci_write_config(device_t dev, u_int width, val, &pcierror); } -static bus_dma_tag_t -rtaspci_get_dma_tag(device_t dev, device_t child) -{ - struct rtaspci_softc *sc; - - sc = device_get_softc(dev); - return (sc->dma_tag); -} - From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 13:00:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9EB8D4; Thu, 12 Dec 2013 13:00:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A66901F32; Thu, 12 Dec 2013 13:00:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCD082s005633; Thu, 12 Dec 2013 13:00:08 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCD08Df005630; Thu, 12 Dec 2013 13:00:08 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201312121300.rBCD08Df005630@svn.freebsd.org> From: Andreas Tobler Date: Thu, 12 Dec 2013 13:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259258 - in stable/10/sys/powerpc: ofw pseries X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 13:00:08 -0000 Author: andreast Date: Thu Dec 12 13:00:07 2013 New Revision: 259258 URL: http://svnweb.freebsd.org/changeset/base/259258 Log: MFC: r258427, r258694 r258694: Make RTAS calls, which call setfault() to recover from machine checks, preserve any existing fault buffer. RTAS calls are meant to be safe from interrupt context (and are indeed used there to implement the xics PIC driver). Without this, calling into RTAS in interrupt context would have the effect of clearing any existing onfault state of the interrupted thread, potentially leading to a panic. r258427: For PCI<->PCI bridges, #address-cells may be 3. Allow this when parsing the ibm,dma-window properties. This is especially a concern when #ibm,dma-address-cells is not specified and we have to use the regular #address-cells property. Modified: stable/10/sys/powerpc/ofw/rtas.c stable/10/sys/powerpc/pseries/plpar_iommu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/powerpc/ofw/rtas.c ============================================================================== --- stable/10/sys/powerpc/ofw/rtas.c Thu Dec 12 12:36:40 2013 (r259257) +++ stable/10/sys/powerpc/ofw/rtas.c Thu Dec 12 13:00:07 2013 (r259258) @@ -192,7 +192,7 @@ int rtas_call_method(cell_t token, int nargs, int nreturns, ...) { vm_offset_t argsptr; - faultbuf env; + faultbuf env, *oldfaultbuf; va_list ap; struct { cell_t token; @@ -221,6 +221,7 @@ rtas_call_method(cell_t token, int nargs /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); + oldfaultbuf = curthread->td_pcb->pcb_onfault; if (!setfault(env)) { __asm __volatile ("sync"); result = rtascall(argsptr, rtas_private_data); @@ -228,7 +229,7 @@ rtas_call_method(cell_t token, int nargs } else { result = RTAS_HW_ERROR; } - curthread->td_pcb->pcb_onfault = 0; + curthread->td_pcb->pcb_onfault = oldfaultbuf; __asm __volatile ("sync"); rtas_real_unmap(argsptr, &args, sizeof(args)); Modified: stable/10/sys/powerpc/pseries/plpar_iommu.c ============================================================================== --- stable/10/sys/powerpc/pseries/plpar_iommu.c Thu Dec 12 12:36:40 2013 (r259257) +++ stable/10/sys/powerpc/pseries/plpar_iommu.c Thu Dec 12 13:00:07 2013 (r259258) @@ -73,8 +73,9 @@ phyp_iommu_set_dma_tag(device_t dev, dev { device_t p; phandle_t node; - cell_t dma_acells, dma_scells, dmawindow[5]; + cell_t dma_acells, dma_scells, dmawindow[6]; struct iommu_map *i; + int cell; for (p = child; p != NULL; p = device_get_parent(p)) { if (ofw_bus_has_prop(p, "ibm,my-dma-window")) @@ -104,16 +105,17 @@ phyp_iommu_set_dma_tag(device_t dev, dev struct dma_window *window = malloc(sizeof(struct dma_window), M_PHYPIOMMU, M_WAITOK); - if (dma_acells == 1) - window->start = dmawindow[1]; - else - window->start = ((uint64_t)(dmawindow[1]) << 32) | dmawindow[2]; - if (dma_scells == 1) - window->end = window->start + dmawindow[dma_acells + 1]; - else - window->end = window->start + - (((uint64_t)(dmawindow[dma_acells + 1]) << 32) | - dmawindow[dma_acells + 2]); + window->start = 0; + for (cell = 1; cell < 1 + dma_acells; cell++) { + window->start <<= 32; + window->start |= dmawindow[cell]; + } + window->end = 0; + for (; cell < 1 + dma_acells + dma_scells; cell++) { + window->end <<= 32; + window->end |= dmawindow[cell]; + } + window->end += window->start; if (bootverbose) device_printf(dev, "Mapping IOMMU domain %#x\n", dmawindow[0]); From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 14:49:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BE27A5; Thu, 12 Dec 2013 14:49:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 480F117D1; Thu, 12 Dec 2013 14:49:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCEnRoK045691; Thu, 12 Dec 2013 14:49:27 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCEnRRQ045690; Thu, 12 Dec 2013 14:49:27 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201312121449.rBCEnRRQ045690@svn.freebsd.org> From: Aleksandr Rybalko Date: Thu, 12 Dec 2013 14:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259261 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 14:49:27 -0000 Author: ray Date: Thu Dec 12 14:49:26 2013 New Revision: 259261 URL: http://svnweb.freebsd.org/changeset/base/259261 Log: Do not try to probe/attach if attempt to add fbd child are failed. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/drm2/drm_fb_helper.c Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:37:25 2013 (r259260) +++ head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:49:26 2013 (r259261) @@ -1043,7 +1043,10 @@ int drm_fb_helper_single_fb_probe(struct kdev = fb_helper->dev->device; fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); - ret = device_probe_and_attach(fbd); + if (fbd != NULL) + ret = device_probe_and_attach(fbd); + else + ret = ENODEV; #ifdef DEV_VT if (ret != 0) DRM_ERROR("Failed to attach fbd device: %d\n", ret); From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 15:05:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 249BE70A; Thu, 12 Dec 2013 15:05:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D750194D; Thu, 12 Dec 2013 15:05:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCF52DM052493; Thu, 12 Dec 2013 15:05:02 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCF502g052425; Thu, 12 Dec 2013 15:05:00 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201312121505.rBCF502g052425@svn.freebsd.org> From: Tijl Coosemans Date: Thu, 12 Dec 2013 15:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259262 - in stable/9/usr.bin/m4: . TEST lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 15:05:02 -0000 Author: tijl Date: Thu Dec 12 15:04:59 2013 New Revision: 259262 URL: http://svnweb.freebsd.org/changeset/base/259262 Log: MFC r226422, r227241, r228063, r228697, r228698, r228701, r234310, r234850, r250226, r250926. This brings m4 up to date with the version in head and fixes the eval command when called with a 2nd and 3rd argument. The only differences remaining are related to the updated flex and byacc in head. PR: bin/166994 Added: stable/9/usr.bin/m4/lib/ - copied from r228063, head/usr.bin/m4/lib/ stable/9/usr.bin/m4/parser.y - copied, changed from r228697, head/usr.bin/m4/parser.y stable/9/usr.bin/m4/tokenizer.l - copied, changed from r228697, head/usr.bin/m4/tokenizer.l Modified: stable/9/usr.bin/m4/Makefile stable/9/usr.bin/m4/TEST/ack.m4 stable/9/usr.bin/m4/TEST/hanoi.m4 stable/9/usr.bin/m4/TEST/hash.m4 stable/9/usr.bin/m4/TEST/sqroot.m4 stable/9/usr.bin/m4/TEST/string.m4 stable/9/usr.bin/m4/TEST/test.m4 stable/9/usr.bin/m4/eval.c stable/9/usr.bin/m4/expr.c stable/9/usr.bin/m4/extern.h stable/9/usr.bin/m4/gnum4.c stable/9/usr.bin/m4/look.c stable/9/usr.bin/m4/m4.1 stable/9/usr.bin/m4/main.c stable/9/usr.bin/m4/mdef.h stable/9/usr.bin/m4/misc.c stable/9/usr.bin/m4/pathnames.h stable/9/usr.bin/m4/stdd.h stable/9/usr.bin/m4/trace.c Directory Properties: stable/9/usr.bin/m4/ (props changed) Modified: stable/9/usr.bin/m4/Makefile ============================================================================== --- stable/9/usr.bin/m4/Makefile Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/Makefile Thu Dec 12 15:04:59 2013 (r259262) @@ -5,10 +5,21 @@ # if you want the paste & spaste macros. PROG= m4 -CFLAGS+=-DEXTENDED +CFLAGS+=-DEXTENDED -I${.CURDIR}/lib +DPADD= ${LIBY} ${LIBL} ${LIBM} +LDADD= -ly -ll -lm +# clang needs 1 while with gcc we can use 2 +#WARNS= 1 -SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c +SRCS= eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y tokenizer.l +.PATH: ${.CURDIR}/lib +SRCS+= ohash_create_entry.c ohash_delete.c ohash_do.c ohash_entries.c \ + ohash_enum.c ohash_init.c ohash_int.h ohash_interval.c \ + ohash_lookup_interval.c ohash_lookup_memory.c ohash_qlookup.c \ + ohash_qlookupi.c -WARNS?= 0 +tokenizer.o: parser.h + +CLEANFILES+= parser.c parser.h tokenizer.o .include Modified: stable/9/usr.bin/m4/TEST/ack.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/ack.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/ack.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: ack.m4,v 1.2 1996/06/26 05:36:18 deraadt Exp $ +# $OpenBSD: ack.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: ack.m4,v 1.4 1995/09/28 05:37:54 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/hanoi.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/hanoi.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/hanoi.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: hanoi.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hanoi.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hanoi.m4,v 1.4 1995/09/28 05:37:56 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/hash.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/hash.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/hash.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: hash.m4,v 1.2 1996/06/26 05:36:19 deraadt Exp $ +# $OpenBSD: hash.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: hash.m4,v 1.4 1995/09/28 05:37:58 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/sqroot.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/sqroot.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/sqroot.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: sqroot.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: sqroot.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: sqroot.m4,v 1.4 1995/09/28 05:38:01 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/string.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/string.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/string.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: string.m4,v 1.2 1996/06/26 05:36:20 deraadt Exp $ +# $OpenBSD: string.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: string.m4,v 1.4 1995/09/28 05:38:03 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/TEST/test.m4 ============================================================================== --- stable/9/usr.bin/m4/TEST/test.m4 Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/TEST/test.m4 Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -# $OpenBSD: test.m4,v 1.2 1996/06/26 05:36:21 deraadt Exp $ +# $OpenBSD: test.m4,v 1.3 2003/06/03 02:56:11 millert Exp $ # $NetBSD: test.m4,v 1.4 1995/09/28 05:38:05 tls Exp $ # # Copyright (c) 1989, 1993 @@ -15,7 +15,7 @@ # 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. -# 4. Neither the name of the University nor the names of its contributors +# 3. Neither the name of the University nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # Modified: stable/9/usr.bin/m4/eval.c ============================================================================== --- stable/9/usr.bin/m4/eval.c Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/eval.c Thu Dec 12 15:04:59 2013 (r259262) @@ -1,4 +1,4 @@ -/* $OpenBSD: eval.c,v 1.44 2002/04/26 16:15:16 espie Exp $ */ +/* $OpenBSD: eval.c,v 1.70 2012/04/12 17:00:11 espie Exp $ */ /* $NetBSD: eval.c,v 1.7 1996/11/10 21:21:29 pk Exp $ */ /* @@ -16,7 +16,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,19 +33,10 @@ * SUCH DAMAGE. */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)eval.c 8.2 (Berkeley) 4/27/95"; -#else -#if 0 -static char rcsid[] = "$OpenBSD: eval.c,v 1.44 2002/04/26 16:15:16 espie Exp $"; -#endif -#endif -#endif /* not lint */ - #include __FBSDID("$FreeBSD$"); + /* * eval.c * Facility: m4 macro processor @@ -53,21 +44,21 @@ __FBSDID("$FreeBSD$"); */ #include +#include #include +#include #include +#include #include #include #include #include #include -#include #include "mdef.h" #include "stdd.h" #include "extern.h" #include "pathnames.h" -#define BUILTIN_MARKER "__builtin_" - static void dodefn(const char *); static void dopushdef(const char *, const char *); static void dodump(const char *[], int); @@ -75,10 +66,9 @@ static void dotrace(const char *[], int, static void doifelse(const char *[], int); static int doincl(const char *); static int dopaste(const char *); -static void gnu_dochq(const char *[], int); static void dochq(const char *[], int); -static void gnu_dochc(const char *[], int); static void dochc(const char *[], int); +static void dom4wrap(const char *); static void dodiv(int); static void doundiv(const char *[], int); static void dosub(const char *[], int); @@ -86,7 +76,7 @@ static void map(char *, const char *, co static const char *handledash(char *, char *, const char *); static void expand_builtin(const char *[], int, int); static void expand_macro(const char *[], int); -static void dump_one_def(ndptr); +static void dump_one_def(const char *, struct macro_definition *); unsigned long expansion_id; @@ -95,7 +85,7 @@ unsigned long expansion_id; * argc - number of elements in argv. * argv - element vector : * argv[0] = definition of a user - * macro or nil if built-in. + * macro or NULL if built-in. * argv[1] = name of the macro or * built-in. * argv[2] = parameters to user-defined @@ -110,21 +100,20 @@ unsigned long expansion_id; * argc is 3 for macro-or-builtin() and 2 for macro-or-builtin */ void -eval(const char *argv[], int argc, int td) +eval(const char *argv[], int argc, int td, int is_traced) { - ssize_t mark = -1; + size_t mark = SIZE_MAX; expansion_id++; if (td & RECDEF) - errx(1, "%s at line %lu: expanding recursive definition for %s", - CURRENT_NAME, CURRENT_LINE, argv[1]); - if (traced_macros && is_traced(argv[1])) + m4errx(1, "expanding recursive definition for %s.", argv[1]); + if (is_traced) mark = trace(argv, argc, infile+ilevel); if (td == MACRTYPE) expand_macro(argv, argc); else expand_builtin(argv, argc, td); - if (mark != -1) + if (mark != SIZE_MAX) finish_trace(mark); } @@ -150,9 +139,12 @@ expand_builtin(const char *argv[], int a * have macro-or-builtin() type call. We adjust * argc to avoid further checking.. */ - ac = argc; + /* we keep the initial value for those built-ins that differentiate + * between builtin() and builtin. + */ + ac = argc; - if (argc == 3 && !*(argv[2])) + if (argc == 3 && !*(argv[2]) && !mimic_gnu) argc--; switch (td & TYPEMASK) { @@ -184,9 +176,27 @@ expand_builtin(const char *argv[], int a * doexpr - evaluate arithmetic * expression */ + { + int base = 10; + int maxdigits = 0; + const char *errstr; + + if (argc > 3) { + base = strtonum(argv[3], 2, 36, &errstr); + if (errstr) { + m4errx(1, "expr: base %s invalid.", argv[3]); + } + } + if (argc > 4) { + maxdigits = strtonum(argv[4], 0, INT_MAX, &errstr); + if (errstr) { + m4errx(1, "expr: maxdigits %s invalid.", argv[4]); + } + } if (argc > 2) - pbnum(expr(argv[2])); + pbnumbase(expr(argv[2]), base, maxdigits); break; + } case IFELTYPE: if (argc > 4) @@ -200,7 +210,7 @@ expand_builtin(const char *argv[], int a * another definition */ if (argc > 3) { - if (lookup(argv[2]) != nil) + if (lookup_macro_definition(argv[2]) != NULL) pbstr(argv[3]); else if (argc > 4) pbstr(argv[4]); @@ -238,7 +248,7 @@ expand_builtin(const char *argv[], int a * dosys - execute system command */ if (argc > 2) { - fflush(NULL); + fflush(stdout); sysval = system(argv[2]); } break; @@ -255,12 +265,18 @@ expand_builtin(const char *argv[], int a case ESYSCMDTYPE: if (argc > 2) doesyscmd(argv[2]); - break; + break; case INCLTYPE: if (argc > 2) - if (!doincl(argv[2])) - err(1, "%s at line %lu: include(%s)", - CURRENT_NAME, CURRENT_LINE, argv[2]); + if (!doincl(argv[2])) { + if (mimic_gnu) { + warn("%s at line %lu: include(%s)", + CURRENT_NAME, CURRENT_LINE, argv[2]); + exit_code = 1; + } else + err(1, "%s at line %lu: include(%s)", + CURRENT_NAME, CURRENT_LINE, argv[2]); + } break; case SINCTYPE: @@ -271,7 +287,7 @@ expand_builtin(const char *argv[], int a case PASTTYPE: if (argc > 2) if (!dopaste(argv[2])) - err(1, "%s at line %lu: paste(%s)", + err(1, "%s at line %lu: paste(%s)", CURRENT_NAME, CURRENT_LINE, argv[2]); break; @@ -279,19 +295,16 @@ expand_builtin(const char *argv[], int a if (argc > 2) (void) dopaste(argv[2]); break; + case FORMATTYPE: + doformat(argv, argc); + break; #endif case CHNQTYPE: - if (mimic_gnu) - gnu_dochq(argv, ac); - else - dochq(argv, argc); + dochq(argv, ac); break; case CHNCTYPE: - if (mimic_gnu) - gnu_dochc(argv, ac); - else - dochc(argv, argc); + dochc(argv, argc); break; case SUBSTYPE: @@ -314,7 +327,7 @@ expand_builtin(const char *argv[], int a pbstr(rquote); pbstr(argv[n]); pbstr(lquote); - putback(COMMA); + pushback(COMMA); } pbstr(rquote); pbstr(argv[3]); @@ -350,7 +363,7 @@ expand_builtin(const char *argv[], int a */ if (argc > 2) for (n = 2; n < argc; n++) - remhash(argv[n], ALL); + macro_undefine(argv[n]); break; case POPDTYPE: @@ -361,7 +374,7 @@ expand_builtin(const char *argv[], int a */ if (argc > 2) for (n = 2; n < argc; n++) - remhash(argv[n], TOP); + macro_popdef(argv[n]); break; case MKTMTYPE: @@ -395,7 +408,7 @@ expand_builtin(const char *argv[], int a if (argc > 3) { char *temp; - temp = xalloc(strlen(argv[2])+1); + temp = xalloc(strlen(argv[2])+1, NULL); if (argc > 4) map(temp, argv[2], argv[3], argv[4]); else @@ -441,7 +454,8 @@ expand_builtin(const char *argv[], int a * dom4wrap - set up for * wrap-up/wind-down activity */ - m4wraps = (argc > 2) ? xstrdup(argv[2]) : null; + if (argc > 2) + dom4wrap(argv[2]); break; case EXITTYPE: @@ -488,8 +502,7 @@ expand_builtin(const char *argv[], int a pbstr(lquote); break; default: - errx(1, "%s at line %lu: eval: major botch.", - CURRENT_NAME, CURRENT_LINE); + m4errx(1, "eval: major botch."); break; } } @@ -512,7 +525,7 @@ expand_macro(const char *argv[], int arg p--; /* last character of defn */ while (p > t) { if (*(p - 1) != ARGFLAG) - PUTBACK(*p); + PUSHBACK(*p); else { switch (*p) { @@ -536,10 +549,10 @@ expand_macro(const char *argv[], int arg if (argc > 2) { for (n = argc - 1; n > 2; n--) { pbstr(argv[n]); - putback(COMMA); + pushback(COMMA); } pbstr(argv[2]); - } + } break; case '@': if (argc > 2) { @@ -547,7 +560,7 @@ expand_macro(const char *argv[], int arg pbstr(rquote); pbstr(argv[n]); pbstr(lquote); - putback(COMMA); + pushback(COMMA); } pbstr(rquote); pbstr(argv[2]); @@ -555,8 +568,8 @@ expand_macro(const char *argv[], int arg } break; default: - PUTBACK(*p); - PUTBACK('$'); + PUSHBACK(*p); + PUSHBACK('$'); break; } p--; @@ -564,42 +577,20 @@ expand_macro(const char *argv[], int arg p--; } if (p == t) /* do last character */ - PUTBACK(*p); + PUSHBACK(*p); } + /* * dodefine - install definition in the table */ void dodefine(const char *name, const char *defn) { - ndptr p; - int n; - - if (!*name) - errx(1, "%s at line %lu: null definition.", CURRENT_NAME, - CURRENT_LINE); - if ((p = lookup(name)) == nil) - p = addent(name); - else if (p->defn != null) - free((char *) p->defn); - if (strncmp(defn, BUILTIN_MARKER, sizeof(BUILTIN_MARKER)-1) == 0) { - n = builtin_type(defn+sizeof(BUILTIN_MARKER)-1); - if (n != -1) { - p->type = n & TYPEMASK; - if ((n & NOARGS) == 0) - p->type |= NEEDARGS; - p->defn = null; - return; - } - } - if (!*defn) - p->defn = null; + if (!*name && !mimic_gnu) + m4errx(1, "null definition."); else - p->defn = xstrdup(defn); - p->type = MACRTYPE; - if (STREQ(name, defn)) - p->type |= RECDEF; + macro_define(name, defn); } /* @@ -609,16 +600,15 @@ dodefine(const char *name, const char *d static void dodefn(const char *name) { - ndptr p; - const char *real; + struct macro_definition *p; - if ((p = lookup(name)) != nil) { - if (p->defn != null) { + if ((p = lookup_macro_definition(name)) != NULL) { + if ((p->type & TYPEMASK) == MACRTYPE) { pbstr(rquote); pbstr(p->defn); pbstr(lquote); - } else if ((real = builtin_realname(p->type)) != NULL) { - pbstr(real); + } else { + pbstr(p->defn); pbstr(BUILTIN_MARKER); } } @@ -634,40 +624,28 @@ dodefn(const char *name) static void dopushdef(const char *name, const char *defn) { - ndptr p; - - if (!*name) - errx(1, "%s at line %lu: null definition", CURRENT_NAME, - CURRENT_LINE); - p = addent(name); - if (!*defn) - p->defn = null; + if (!*name && !mimic_gnu) + m4errx(1, "null definition."); else - p->defn = xstrdup(defn); - p->type = MACRTYPE; - if (STREQ(name, defn)) - p->type |= RECDEF; + macro_pushdef(name, defn); } /* * dump_one_def - dump the specified definition. */ static void -dump_one_def(ndptr p) +dump_one_def(const char *name, struct macro_definition *p) { - const char *real; - + if (!traceout) + traceout = stderr; if (mimic_gnu) { if ((p->type & TYPEMASK) == MACRTYPE) - fprintf(traceout, "%s:\t%s\n", p->name, p->defn); + fprintf(traceout, "%s:\t%s\n", name, p->defn); else { - real = builtin_realname(p->type); - if (real == NULL) - real = null; - fprintf(traceout, "%s:\t<%s>\n", p->name, real); - } + fprintf(traceout, "%s:\t<%s>\n", name, p->defn); + } } else - fprintf(traceout, "`%s'\t`%s'\n", p->name, p->defn); + fprintf(traceout, "`%s'\t`%s'\n", name, p->defn); } /* @@ -679,17 +657,14 @@ static void dodump(const char *argv[], int argc) { int n; - ndptr p; + struct macro_definition *p; if (argc > 2) { for (n = 2; n < argc; n++) - if ((p = lookup(argv[n])) != nil) - dump_one_def(p); - } else { - for (n = 0; n < HASHSIZE; n++) - for (p = hashtab[n]; p != nil; p = p->nxtptr) - dump_one_def(p); - } + if ((p = lookup_macro_definition(argv[n])) != NULL) + dump_one_def(argv[n], p); + } else + macro_for_all(dump_one_def); } /* @@ -734,15 +709,10 @@ static int doincl(const char *ifile) { if (ilevel + 1 == MAXINP) - errx(1, "%s at line %lu: too many include files.", - CURRENT_NAME, CURRENT_LINE); + m4errx(1, "too many include files."); if (fopen_trypath(infile+ilevel+1, ifile) != NULL) { ilevel++; - if ((inname[ilevel] = strdup(ifile)) == NULL) - err(1, NULL); - inlineno[ilevel] = 1; bbase[ilevel] = bufbase = bp; - emitline(); return (1); } else return (0); @@ -760,97 +730,74 @@ dopaste(const char *pfile) int c; if ((pf = fopen(pfile, "r")) != NULL) { - fprintf(active, "#line 1 \"%s\"\n", pfile); + if (synch_lines) + fprintf(active, "#line 1 \"%s\"\n", pfile); while ((c = getc(pf)) != EOF) putc(c, active); (void) fclose(pf); - emitline(); + emit_synchline(); return (1); } else return (0); } #endif +/* + * dochq - change quote characters + */ static void -gnu_dochq(const char *argv[], int ac) +dochq(const char *argv[], int ac) { - /* In gnu-m4 mode, the only way to restore quotes is to have no - * arguments at all. */ if (ac == 2) { - lquote[0] = LQUOTE, lquote[1] = EOS; - rquote[0] = RQUOTE, rquote[1] = EOS; + lquote[0] = LQUOTE; lquote[1] = EOS; + rquote[0] = RQUOTE; rquote[1] = EOS; } else { strlcpy(lquote, argv[2], sizeof(lquote)); - if(ac > 3) + if (ac > 3) { strlcpy(rquote, argv[3], sizeof(rquote)); - else - rquote[0] = EOS; + } else { + rquote[0] = ECOMMT; rquote[1] = EOS; + } } } /* - * dochq - change quote characters + * dochc - change comment characters */ static void -dochq(const char *argv[], int argc) -{ - if (argc > 2) { - if (*argv[2]) - strlcpy(lquote, argv[2], sizeof(lquote)); - else { - lquote[0] = LQUOTE; - lquote[1] = EOS; - } - if (argc > 3) { - if (*argv[3]) - strlcpy(rquote, argv[3], sizeof(rquote)); - } else - strcpy(rquote, lquote); - } else { - lquote[0] = LQUOTE, lquote[1] = EOS; - rquote[0] = RQUOTE, rquote[1] = EOS; - } -} - -static void -gnu_dochc(const char *argv[], int ac) +dochc(const char *argv[], int argc) { - /* In gnu-m4 mode, no arguments mean no comment - * arguments at all. */ - if (ac == 2) { +/* XXX Note that there is no difference between no argument and a single + * empty argument. + */ + if (argc == 2) { scommt[0] = EOS; ecommt[0] = EOS; } else { - if (*argv[2]) - strlcpy(scommt, argv[2], sizeof(scommt)); - else - scommt[0] = SCOMMT, scommt[1] = EOS; - if(ac > 3 && *argv[3]) + strlcpy(scommt, argv[2], sizeof(scommt)); + if (argc == 3) { + ecommt[0] = ECOMMT; ecommt[1] = EOS; + } else { strlcpy(ecommt, argv[3], sizeof(ecommt)); - else - ecommt[0] = ECOMMT, ecommt[1] = EOS; + } } } + /* - * dochc - change comment characters + * dom4wrap - expand text at EOF */ static void -dochc(const char *argv[], int argc) +dom4wrap(const char *text) { - if (argc > 2) { - if (*argv[2]) - strlcpy(scommt, argv[2], sizeof(scommt)); - if (argc > 3) { - if (*argv[3]) - strlcpy(ecommt, argv[3], sizeof(ecommt)); - } + if (wrapindex >= maxwraps) { + if (maxwraps == 0) + maxwraps = 16; else - ecommt[0] = ECOMMT, ecommt[1] = EOS; - } - else { - scommt[0] = SCOMMT, scommt[1] = EOS; - ecommt[0] = ECOMMT, ecommt[1] = EOS; + maxwraps *= 2; + m4wraps = xrealloc(m4wraps, maxwraps * sizeof(*m4wraps), + "too many m4wraps"); } + m4wraps[wrapindex++] = xstrdup(text); } /* @@ -867,14 +814,14 @@ dodiv(int n) resizedivs(n + 10); else n = 0; /* bitbucket */ - } + } if (n < 0) n = 0; /* bitbucket */ if (outfile[n] == NULL) { char fname[] = _PATH_DIVNAME; - if ((fd = mkstemp(fname)) < 0 || + if ((fd = mkstemp(fname)) < 0 || (outfile[n] = fdopen(fd, "w+")) == NULL) err(1, "%s: cannot divert", fname); if (unlink(fname) == -1) @@ -895,10 +842,15 @@ doundiv(const char *argv[], int argc) if (argc > 2) { for (ind = 2; ind < argc; ind++) { - n = atoi(argv[ind]); - if (n > 0 && n < maxout && outfile[n] != NULL) - getdiv(n); - + const char *errstr; + n = strtonum(argv[ind], 1, INT_MAX, &errstr); + if (errstr) { + if (errno == EINVAL && mimic_gnu) + getdivfile(argv[ind]); + } else { + if (n < maxout && outfile[n] != NULL) + getdiv(n); + } } } else @@ -931,7 +883,7 @@ dosub(const char *argv[], int argc) #endif if (fc >= ap && fc < ap + strlen(ap)) for (k = fc + nc - 1; k >= fc; k--) - putback(*k); + pushback(*k); } /* @@ -939,25 +891,11 @@ dosub(const char *argv[], int argc) * map every character of s1 that is specified in from * into s3 and replace in s. (source s1 remains untouched) * - * This is a standard implementation of map(s,from,to) function of ICON - * language. Within mapvec, we replace every character of "from" with - * the corresponding character in "to". If "to" is shorter than "from", - * than the corresponding entries are null, which means that those - * characters dissapear altogether. Furthermore, imagine - * map(dest, "sourcestring", "srtin", "rn..*") type call. In this case, - * `s' maps to `r', `r' maps to `n' and `n' maps to `*'. Thus, `s' - * ultimately maps to `*'. In order to achieve this effect in an efficient - * manner (i.e. without multiple passes over the destination string), we - * loop over mapvec, starting with the initial source character. if the - * character value (dch) in this location is different than the source - * character (sch), sch becomes dch, once again to index into mapvec, until - * the character value stabilizes (i.e. sch = dch, in other words - * mapvec[n] == n). Even if the entry in the mapvec is null for an ordinary - * character, it will stabilize, since mapvec[0] == 0 at all times. At the - * end, we restore mapvec* back to normal where mapvec[n] == n for - * 0 <= n <= 127. This strategy, along with the restoration of mapvec, is - * about 5 times faster than any algorithm that makes multiple passes over - * destination string. + * This is derived from the a standard implementation of map(s,from,to) + * function of ICON language. Within mapvec, we replace every character + * of "from" with the corresponding character in "to". + * If "to" is shorter than "from", than the corresponding entries are null, + * which means that those characters dissapear altogether. */ static void map(char *dest, const char *src, const char *from, const char *to) @@ -966,6 +904,8 @@ map(char *dest, const char *src, const c unsigned char sch, dch; static char frombis[257]; static char tobis[257]; + int i; + char seen[256]; static unsigned char mapvec[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, @@ -1000,17 +940,21 @@ map(char *dest, const char *src, const c * create a mapping between "from" and * "to" */ - while (*from) - mapvec[(unsigned char)(*from++)] = (*to) ? - (unsigned char)(*to++) : 0; + for (i = 0; i < 256; i++) + seen[i] = 0; + while (*from) { + if (!seen[(unsigned char)(*from)]) { + mapvec[(unsigned char)(*from)] = (unsigned char)(*to); + seen[(unsigned char)(*from)] = 1; + } + from++; + if (*to) + to++; + } while (*src) { sch = (unsigned char)(*src++); dch = mapvec[sch]; - while (dch != sch) { - sch = dch; - dch = mapvec[sch]; - } if ((*dest = (char)dch)) dest++; } @@ -1040,12 +984,23 @@ handledash(char *buffer, char *end, cons while(*src) { if (src[1] == '-' && src[2]) { unsigned char i; - for (i = (unsigned char)src[0]; - i <= (unsigned char)src[2]; i++) { - *p++ = i; - if (p == end) { - *p = '\0'; - return buffer; + if ((unsigned char)src[0] <= (unsigned char)src[2]) { + for (i = (unsigned char)src[0]; + i <= (unsigned char)src[2]; i++) { + *p++ = i; + if (p == end) { + *p = '\0'; + return buffer; + } + } + } else { + for (i = (unsigned char)src[0]; + i >= (unsigned char)src[2]; i--) { + *p++ = i; + if (p == end) { + *p = '\0'; + return buffer; + } } } src += 3; Modified: stable/9/usr.bin/m4/expr.c ============================================================================== --- stable/9/usr.bin/m4/expr.c Thu Dec 12 14:49:26 2013 (r259261) +++ stable/9/usr.bin/m4/expr.c Thu Dec 12 15:04:59 2013 (r259262) @@ -1,641 +1,47 @@ -/* $OpenBSD: expr.c,v 1.14 2002/04/26 16:15:16 espie Exp $ */ -/* $NetBSD: expr.c,v 1.7 1995/09/28 05:37:31 tls Exp $ */ - +/* $OpenBSD: expr.c,v 1.18 2010/09/07 19:58:09 marco Exp $ */ /* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ozan Yigit at York University. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * Copyright (c) 2004 Marc Espie * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * 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. */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)expr.c 8.2 (Berkeley) 4/29/95"; -#else -#if 0 -static char rcsid[] = "$OpenBSD: expr.c,v 1.14 2002/04/26 16:15:16 espie Exp $"; -#endif -#endif -#endif /* not lint */ - #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include +#include #include +#include #include "mdef.h" #include "extern.h" -/* - * expression evaluator: performs a standard recursive - * descent parse to evaluate any expression permissible - * within the following grammar: - * - * expr : query EOS - * query : lor - * | lor "?" query ":" query - * lor : land { "||" land } - * land : bor { "&&" bor } - * bor : xor { "|" xor } - * xor : band { "^" eqrel } - * band : eqrel { "&" eqrel } - * eqrel : nerel { ("==" | "!=") nerel } - * nerel : shift { ("<" | ">" | "<=" | ">=") shift } - * shift : primary { ("<<" | ">>") primary } - * primary : term { ("+" | "-") term } - * term : exp { ("*" | "/" | "%") exp } - * exp : unary { "**" unary } - * unary : factor - * | ("+" | "-" | "~" | "!") unary - * factor : constant *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 16:18:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE8CB2B3; Thu, 12 Dec 2013 16:18:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 98A151FD8; Thu, 12 Dec 2013 16:18:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCGIkMP078952; Thu, 12 Dec 2013 16:18:46 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCGIjhs078943; Thu, 12 Dec 2013 16:18:45 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121618.rBCGIjhs078943@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 16:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r259263 - in stable/8/contrib/libstdc++: include/debug include/ext libsupc++ src X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 16:18:46 -0000 Author: pfg Date: Thu Dec 12 16:18:45 2013 New Revision: 259263 URL: http://svnweb.freebsd.org/changeset/base/259263 Log: MFC r241959: Fix a number of other clang warnings in libstdc++, which could appear when building other C++ software with it. Also fix one actual bug in libsupc++, which was exposed by such a warning. This latter fix is the only functional change. This is required for newer versions of gcc and clang which have stricter warnings about parenthesis in C++ programs. Modified: stable/8/contrib/libstdc++/include/debug/safe_iterator.tcc stable/8/contrib/libstdc++/include/ext/ropeimpl.h stable/8/contrib/libstdc++/libsupc++/tinfo.cc stable/8/contrib/libstdc++/src/locale.cc stable/8/contrib/libstdc++/src/strstream.cc stable/8/contrib/libstdc++/src/tree.cc Directory Properties: stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/include/debug/safe_iterator.tcc ============================================================================== --- stable/8/contrib/libstdc++/include/debug/safe_iterator.tcc Thu Dec 12 15:04:59 2013 (r259262) +++ stable/8/contrib/libstdc++/include/debug/safe_iterator.tcc Thu Dec 12 16:18:45 2013 (r259263) @@ -54,8 +54,8 @@ namespace __gnu_debug static_cast(_M_sequence)->begin(); std::pair __dist = this->_M_get_distance(__begin, *this); - bool __ok = (__dist.second == __dp_exact && __dist.first >= -__n - || __dist.second != __dp_exact && __dist.first > 0); + bool __ok = ((__dist.second == __dp_exact && __dist.first >= -__n) + || (__dist.second != __dp_exact && __dist.first > 0)); return __ok; } else @@ -64,8 +64,8 @@ namespace __gnu_debug static_cast(_M_sequence)->end(); std::pair __dist = this->_M_get_distance(*this, __end); - bool __ok = (__dist.second == __dp_exact && __dist.first >= __n - || __dist.second != __dp_exact && __dist.first > 0); + bool __ok = ((__dist.second == __dp_exact && __dist.first >= __n) + || (__dist.second != __dp_exact && __dist.first > 0)); return __ok; } } Modified: stable/8/contrib/libstdc++/include/ext/ropeimpl.h ============================================================================== --- stable/8/contrib/libstdc++/include/ext/ropeimpl.h Thu Dec 12 15:04:59 2013 (r259262) +++ stable/8/contrib/libstdc++/include/ext/ropeimpl.h Thu Dec 12 16:18:45 2013 (r259263) @@ -1143,7 +1143,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) } else { - char* __kind; + const char* __kind; switch (__r->_M_tag) { Modified: stable/8/contrib/libstdc++/libsupc++/tinfo.cc ============================================================================== --- stable/8/contrib/libstdc++/libsupc++/tinfo.cc Thu Dec 12 15:04:59 2013 (r259262) +++ stable/8/contrib/libstdc++/libsupc++/tinfo.cc Thu Dec 12 16:18:45 2013 (r259263) @@ -499,9 +499,9 @@ __do_dyncast (ptrdiff_t src2dst, result.whole2dst = __sub_kind (result.whole2dst | result2.whole2dst); } - else if ((result.dst_ptr != 0 & result2.dst_ptr != 0) - || (result.dst_ptr != 0 & result2_ambig) - || (result2.dst_ptr != 0 & result_ambig)) + else if ((result.dst_ptr != 0 && result2.dst_ptr != 0) + || (result.dst_ptr != 0 && result2_ambig) + || (result2.dst_ptr != 0 && result_ambig)) { // Found two different DST_TYPE bases, or a valid one and a set of // ambiguous ones, must disambiguate. See whether SRC_PTR is Modified: stable/8/contrib/libstdc++/src/locale.cc ============================================================================== --- stable/8/contrib/libstdc++/src/locale.cc Thu Dec 12 15:04:59 2013 (r259262) +++ stable/8/contrib/libstdc++/src/locale.cc Thu Dec 12 16:18:45 2013 (r259263) @@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) locale::_S_normalize_category(category __cat) { int __ret = 0; - if (__cat == none || (__cat & all) && !(__cat & ~all)) + if (__cat == none || ((__cat & all) && !(__cat & ~all))) __ret = __cat; else { Modified: stable/8/contrib/libstdc++/src/strstream.cc ============================================================================== --- stable/8/contrib/libstdc++/src/strstream.cc Thu Dec 12 15:04:59 2013 (r259262) +++ stable/8/contrib/libstdc++/src/strstream.cc Thu Dec 12 16:18:45 2013 (r259263) @@ -311,10 +311,12 @@ _GLIBCXX_BEGIN_NAMESPACE(std) strstreambuf::_M_free(char* p) { if (p) - if (_M_free_fun) - _M_free_fun(p); - else - delete[] p; + { + if (_M_free_fun) + _M_free_fun(p); + else + delete[] p; + } } void Modified: stable/8/contrib/libstdc++/src/tree.cc ============================================================================== --- stable/8/contrib/libstdc++/src/tree.cc Thu Dec 12 15:04:59 2013 (r259262) +++ stable/8/contrib/libstdc++/src/tree.cc Thu Dec 12 16:18:45 2013 (r259263) @@ -316,17 +316,21 @@ _GLIBCXX_BEGIN_NAMESPACE(std) else __z->_M_parent->_M_right = __x; if (__leftmost == __z) - if (__z->_M_right == 0) // __z->_M_left must be null also - __leftmost = __z->_M_parent; - // makes __leftmost == _M_header if __z == __root - else - __leftmost = _Rb_tree_node_base::_S_minimum(__x); + { + if (__z->_M_right == 0) // __z->_M_left must be null also + __leftmost = __z->_M_parent; + // makes __leftmost == _M_header if __z == __root + else + __leftmost = _Rb_tree_node_base::_S_minimum(__x); + } if (__rightmost == __z) - if (__z->_M_left == 0) // __z->_M_right must be null also - __rightmost = __z->_M_parent; - // makes __rightmost == _M_header if __z == __root - else // __x == __z->_M_left - __rightmost = _Rb_tree_node_base::_S_maximum(__x); + { + if (__z->_M_left == 0) // __z->_M_right must be null also + __rightmost = __z->_M_parent; + // makes __rightmost == _M_header if __z == __root + else // __x == __z->_M_left + __rightmost = _Rb_tree_node_base::_S_maximum(__x); + } } if (__y->_M_color != _S_red) { From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 17:48:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BA5C1C2; Thu, 12 Dec 2013 17:48:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8835C1745; Thu, 12 Dec 2013 17:48:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCHmX93011091; Thu, 12 Dec 2013 17:48:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCHmXdR011090; Thu, 12 Dec 2013 17:48:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312121748.rBCHmXdR011090@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 12 Dec 2013 17:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259265 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 17:48:33 -0000 Author: bz Date: Thu Dec 12 17:48:33 2013 New Revision: 259265 URL: http://svnweb.freebsd.org/changeset/base/259265 Log: Use correct value pointing to previously selected FDT DTB. Reviewed by: brooks Sponsored by: DARPA, AFRL MFC after: 1 week Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Thu Dec 12 16:58:45 2013 (r259264) +++ head/sys/mips/beri/beri_machdep.c Thu Dec 12 17:48:33 2013 (r259265) @@ -178,7 +178,7 @@ platform_start(__register_t a0, __regist if (OF_install(OFW_FDT, 0) == FALSE) while (1); - if (OF_init(&fdt_static_dtb) != 0) + if (OF_init((void *)dtbp) != 0) while (1); #endif From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 17:59:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84C514FB; Thu, 12 Dec 2013 17:59:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64DFB180B; Thu, 12 Dec 2013 17:59:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCHxA80014635; Thu, 12 Dec 2013 17:59:10 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCHx98F014632; Thu, 12 Dec 2013 17:59:09 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201312121759.rBCHx98F014632@svn.freebsd.org> From: Bryan Drewery Date: Thu, 12 Dec 2013 17:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259266 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 17:59:10 -0000 Author: bdrewery (ports committer) Date: Thu Dec 12 17:59:09 2013 New Revision: 259266 URL: http://svnweb.freebsd.org/changeset/base/259266 Log: Fix multi-repository support by properly respecting 'enabled' flag. This will read the REPOS_DIR env/config setting (default is /etc/pkg and /usr/local/etc/pkg/repos) and use the last enabled repository. This can be changed in the environment using a comma-separated list, or in /usr/local/etc/pkg.conf with JSON array syntax of: REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"] Approved by: bapt MFC after: 1 week Modified: head/usr.sbin/pkg/config.c head/usr.sbin/pkg/config.h head/usr.sbin/pkg/pkg.7 Modified: head/usr.sbin/pkg/config.c ============================================================================== --- head/usr.sbin/pkg/config.c Thu Dec 12 17:48:33 2013 (r259265) +++ head/usr.sbin/pkg/config.c Thu Dec 12 17:59:09 2013 (r259266) @@ -32,8 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -51,11 +53,17 @@ __FBSDID("$FreeBSD$"); #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ +struct config_value { + char *value; + STAILQ_ENTRY(config_value) next; +}; + struct config_entry { uint8_t type; const char *key; const char *val; char *value; + STAILQ_HEAD(, config_value) *list; bool envset; }; @@ -65,6 +73,7 @@ static struct config_entry c[] = { "PACKAGESITE", URL_SCHEME_PREFIX "http://pkg.FreeBSD.org/${ABI}/latest", NULL, + NULL, false, }, [ABI] = { @@ -72,6 +81,7 @@ static struct config_entry c[] = { "ABI", NULL, NULL, + NULL, false, }, [MIRROR_TYPE] = { @@ -79,6 +89,7 @@ static struct config_entry c[] = { "MIRROR_TYPE", "SRV", NULL, + NULL, false, }, [ASSUME_ALWAYS_YES] = { @@ -86,6 +97,7 @@ static struct config_entry c[] = { "ASSUME_ALWAYS_YES", "NO", NULL, + NULL, false, }, [SIGNATURE_TYPE] = { @@ -93,6 +105,7 @@ static struct config_entry c[] = { "SIGNATURE_TYPE", NULL, NULL, + NULL, false, }, [FINGERPRINTS] = { @@ -100,6 +113,15 @@ static struct config_entry c[] = { "FINGERPRINTS", NULL, NULL, + NULL, + false, + }, + [REPOS_DIR] = { + PKG_CONFIG_LIST, + "REPOS_DIR", + NULL, + NULL, + NULL, false, }, }; @@ -474,17 +496,34 @@ subst_packagesite(const char *abi) c[PACKAGESITE].value = strdup(sbuf_data(newval)); } +static int +boolstr_to_bool(const char *str) +{ + if (str != NULL && (strcasecmp(str, "true") == 0 || + strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0 || + str[0] == '1')) + return (true); + + return (false); +} + static void config_parse(yaml_document_t *doc, yaml_node_t *node, pkg_conf_file_t conftype) { + yaml_node_item_t *item; yaml_node_pair_t *pair; - yaml_node_t *key, *val; + yaml_node_t *key, *val, *item_val; struct sbuf *buf = sbuf_new_auto(); + struct config_entry *temp_config; + struct config_value *cv; int i; size_t j; pair = node->data.mapping.pairs.start; + /* Temporary config for configs that may be disabled. */ + temp_config = calloc(CONFIG_SIZE, sizeof(struct config_entry)); + while (pair < node->data.mapping.pairs.top) { key = yaml_document_get_node(doc, pair->key); val = yaml_document_get_node(doc, pair->value); @@ -530,7 +569,12 @@ config_parse(yaml_document_t *doc, yaml_ else if (strcasecmp(key->data.scalar.value, "fingerprints") == 0) sbuf_cpy(buf, "FINGERPRINTS"); - else { /* Skip unknown entries for future use. */ + else if (strcasecmp(key->data.scalar.value, + "enabled") == 0) { + /* Skip disabled repos. */ + if (!boolstr_to_bool(val->data.scalar.value)) + goto cleanup; + } else { /* Skip unknown entries for future use. */ ++pair; continue; } @@ -554,10 +598,58 @@ config_parse(yaml_document_t *doc, yaml_ continue; } - c[i].value = strdup(val->data.scalar.value); + /* Parse sequence value ["item1", "item2"] */ + switch (c[i].type) { + case PKG_CONFIG_LIST: + if (val->type != YAML_SEQUENCE_NODE) { + fprintf(stderr, "Skipping invalid array " + "value for %s.\n", c[i].key); + ++pair; + continue; + } + item = val->data.sequence.items.start; + temp_config[i].list = + malloc(sizeof(*temp_config[i].list)); + STAILQ_INIT(temp_config[i].list); + + while (item < val->data.sequence.items.top) { + item_val = yaml_document_get_node(doc, *item); + if (item_val->type != YAML_SCALAR_NODE) { + ++item; + continue; + } + cv = malloc(sizeof(struct config_value)); + cv->value = + strdup(item_val->data.scalar.value); + STAILQ_INSERT_TAIL(temp_config[i].list, cv, + next); + ++item; + } + break; + default: + /* Normal string value. */ + temp_config[i].value = strdup(val->data.scalar.value); + break; + } ++pair; } + /* Repo is enabled, copy over all settings from temp_config. */ + for (i = 0; i < CONFIG_SIZE; i++) { + if (c[i].envset) + continue; + switch (c[i].type) { + case PKG_CONFIG_LIST: + c[i].list = temp_config[i].list; + break; + default: + c[i].value = temp_config[i].value; + break; + } + } + +cleanup: + free(temp_config); sbuf_delete(buf); } @@ -632,23 +724,84 @@ read_conf_file(const char *confpath, pkg return (0); } +static int +load_repositories(const char *repodir) +{ + struct dirent *ent; + DIR *d; + char *p; + size_t n; + char path[MAXPATHLEN]; + int ret; + + ret = 0; + + if ((d = opendir(repodir)) == NULL) + return (1); + + while ((ent = readdir(d))) { + /* Trim out 'repos'. */ + if ((n = strlen(ent->d_name)) <= 5) + continue; + p = &ent->d_name[n - 5]; + if (strcmp(p, ".conf") == 0) { + snprintf(path, sizeof(path), "%s%s%s", + repodir, + repodir[strlen(repodir) - 1] == '/' ? "" : "/", + ent->d_name); + if (access(path, F_OK) == 0 && + read_conf_file(path, CONFFILE_REPO)) { + ret = 1; + goto cleanup; + } + } + } + +cleanup: + closedir(d); + + return (ret); +} + int config_init(void) { - const char *val; + char *val; int i; const char *localbase; + char *env_list_item; char confpath[MAXPATHLEN]; + struct config_value *cv; char abi[BUFSIZ]; for (i = 0; i < CONFIG_SIZE; i++) { val = getenv(c[i].key); if (val != NULL) { - c[i].val = val; c[i].envset = true; + switch (c[i].type) { + case PKG_CONFIG_LIST: + /* Split up comma-separated items from env. */ + c[i].list = malloc(sizeof(*c[i].list)); + STAILQ_INIT(c[i].list); + for (env_list_item = strtok(val, ","); + env_list_item != NULL; + env_list_item = strtok(NULL, ",")) { + cv = + malloc(sizeof(struct config_value)); + cv->value = + strdup(env_list_item); + STAILQ_INSERT_TAIL(c[i].list, cv, + next); + } + break; + default: + c[i].val = val; + break; + } } } + /* Read LOCALBASE/etc/pkg.conf first. */ localbase = getenv("LOCALBASE") ? getenv("LOCALBASE") : _LOCALBASE; snprintf(confpath, sizeof(confpath), "%s/etc/pkg.conf", localbase); @@ -657,10 +810,22 @@ config_init(void) CONFFILE_PKG)) goto finalize; - snprintf(confpath, sizeof(confpath), "/etc/pkg/FreeBSD.conf"); - if (access(confpath, F_OK) == 0 && read_conf_file(confpath, - CONFFILE_REPO)) - goto finalize; + /* Then read in all repos from REPOS_DIR list of directories. */ + if (c[REPOS_DIR].list == NULL) { + c[REPOS_DIR].list = malloc(sizeof(*c[REPOS_DIR].list)); + STAILQ_INIT(c[REPOS_DIR].list); + cv = malloc(sizeof(struct config_value)); + cv->value = strdup("/etc/pkg"); + STAILQ_INSERT_TAIL(c[REPOS_DIR].list, cv, next); + cv = malloc(sizeof(struct config_value)); + if (asprintf(&cv->value, "%s/etc/pkg/repos", localbase) < 0) + goto finalize; + STAILQ_INSERT_TAIL(c[REPOS_DIR].list, cv, next); + } + + STAILQ_FOREACH(cv, c[REPOS_DIR].list, next) + if (load_repositories(cv->value)) + goto finalize; finalize: if (c[ABI].val == NULL && c[ABI].value == NULL) { @@ -704,10 +869,7 @@ config_bool(pkg_config_key k, bool *val) else value = c[k].val; - if (strcasecmp(value, "true") == 0 || - strcasecmp(value, "yes") == 0 || - strcasecmp(value, "on") == 0 || - *value == '1') + if (boolstr_to_bool(value)) *val = true; return (0); Modified: head/usr.sbin/pkg/config.h ============================================================================== --- head/usr.sbin/pkg/config.h Thu Dec 12 17:48:33 2013 (r259265) +++ head/usr.sbin/pkg/config.h Thu Dec 12 17:59:09 2013 (r259266) @@ -39,12 +39,14 @@ typedef enum { ASSUME_ALWAYS_YES, SIGNATURE_TYPE, FINGERPRINTS, + REPOS_DIR, CONFIG_SIZE } pkg_config_key; typedef enum { PKG_CONFIG_STRING=0, PKG_CONFIG_BOOL, + PKG_CONFIG_LIST, } pkg_config_t; typedef enum { Modified: head/usr.sbin/pkg/pkg.7 ============================================================================== --- head/usr.sbin/pkg/pkg.7 Thu Dec 12 17:48:33 2013 (r259265) +++ head/usr.sbin/pkg/pkg.7 Thu Dec 12 17:59:09 2013 (r259266) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 19, 2013 +.Dd December 12, 2013 .Dt PKG 7 .Os .Sh NAME @@ -152,6 +152,7 @@ MIRROR_TYPE: "srv", SIGNATURE_TYPE: "none", FINGERPRINTS: "/usr/share/keys/pkg", ASSUME_ALWAYS_YES: "yes" +REPOS_DIR: ["/etc/pkg", "/usr/local/etc/pkg/repos"] .Ed .Pp Reference @@ -194,14 +195,20 @@ The URL that .Xr pkg 8 and other packages will be fetched from. +.It Ev REPOS_DIR +Comma-separated list of directories that should be searched for repository +configuration files. .El .Sh FILES Configuration is read from the files in the listed order. -The first enabled repository is the one used for bootstrapping +This path can be changed by setting +.Sy REPOS_DIR . +The last enabled repository is the one used for bootstrapping .Xr pkg 8 . .Bl -tag -width "/usr/local/etc/pkg/repos/*.conf" .It Pa /usr/local/etc/pkg.conf .It Pa /etc/pkg/FreeBSD.conf +.It Pa /usr/local/etc/pkg/repos/*.conf .El .Sh EXAMPLES Some examples are listed here. From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 18:08:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 254D0A16; Thu, 12 Dec 2013 18:08:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 063051901; Thu, 12 Dec 2013 18:08:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCI8VBw018607; Thu, 12 Dec 2013 18:08:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCI8V3X018604; Thu, 12 Dec 2013 18:08:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201312121808.rBCI8V3X018604@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 12 Dec 2013 18:08:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259267 - in head/sys: boot/fdt/dts mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 18:08:32 -0000 Author: bz Date: Thu Dec 12 18:08:31 2013 New Revision: 259267 URL: http://svnweb.freebsd.org/changeset/base/259267 Log: Add an FDT DTS and MDROOT kernel configuration for BERI on NetFPGA. At this point we only support one CPU, the PIC, and a UART console. Reviewed by: brooks Sponsored by: DARPA, AFRL MFC after: 5 days Added: head/sys/boot/fdt/dts/beri-netfpga.dts (contents, props changed) head/sys/mips/conf/BERI_NETFPGA_MDROOT (contents, props changed) Added: head/sys/boot/fdt/dts/beri-netfpga.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/beri-netfpga.dts Thu Dec 12 18:08:31 2013 (r259267) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2012-2013 Robert N. M. Watson + * Copyright (c) 2013 SRI International + * Copyright (c) 2013 Bjoern A. Zeeb + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-11-C-0249) + * ("MRC2"), as part of the DARPA MRC research programme. + * + * 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$ + */ + +/dts-v1/; + +/* + * Device names here have been largely made up on the spot, especially for the + * "compatible" strings, and might want to be revised. + */ + +/ { + model = "SRI/Cambridge Beri (NetFPGA)"; + compatible = "sri-cambridge,beri-netfpga"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <1>; + + /* + * Secondary CPUs all start disabled and use the + * spin-table enable method. cpu-release-addr must be + * specified for each cpu other than cpu@0. Values of + * cpu-release-addr grow down from 0x100000 (kernel). + */ + status = "disabled"; + enable-method = "spin-table"; + + cpu@0 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <0>; + status = "okay"; + }; + +/* + cpu@1 { + device-type = "cpu"; + compatible = "sri-cambridge,beri"; + + reg = <1>; + // XXX: should we need cached prefix? + cpu-release-addr = <0xffffffff 0x800fffe0>; + }; +*/ + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + /* + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so + * we use mips4k coprocessor 0 interrupt management directly. + */ + compatible = "simple-bus", "mips,mips4k"; + ranges = <>; + + memory { + device_type = "memory"; + reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0 + }; + + beripic: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = <0 1 2 3 4>; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + }; + + serial0: serial@7f002100 { + compatible = "ns16550"; + reg = <0x7f002100 0x20>; + reg-shift = <2>; + clock-frequency = <100000000>; + interrupts = <8>; + interrupt-parent = <&beripic>; + }; + }; + + aliases { + serial0 = &serial0; + }; + + chosen { + stdin = "serial0"; + stdout = "serial0"; + bootargs = "-v"; + }; +}; Added: head/sys/mips/conf/BERI_NETFPGA_MDROOT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/BERI_NETFPGA_MDROOT Thu Dec 12 18:08:31 2013 (r259267) @@ -0,0 +1,28 @@ +# +# BERI_NETFPGA_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured in its NetFPGA reference +# configuration. +# +# $FreeBSD$ +# + +include "BERI_TEMPLATE" + +ident BERI_NETFPGA_MDROOT + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beri-netfpga.dts + +device uart + +# +# This kernel configuration uses an embedded memory root file system. +# Adjust the following path and size based on local requirements. +# +options MD_ROOT # MD is a potential root device +options MD_ROOT_SIZE=26112 # 25.5MB +options ROOTDEVNAME=\"ufs:md0\" +#makeoptions MFS_IMAGE=/foo/baz/baz/mdroot.img + +# end From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 18:15:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9D1BDDA; Thu, 12 Dec 2013 18:15:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2F1D19ED; Thu, 12 Dec 2013 18:15:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCIFauQ022120; Thu, 12 Dec 2013 18:15:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCIFX9b022103; Thu, 12 Dec 2013 18:15:33 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121815.rBCIFX9b022103@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 18:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259268 - in stable/10/contrib: gcc gcc/config/rs6000 gcc/cp gcc/doc gcclibs/libcpp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 18:15:37 -0000 Author: pfg Date: Thu Dec 12 18:15:32 2013 New Revision: 259268 URL: http://svnweb.freebsd.org/changeset/base/259268 Log: MFC r258081, r258138, r258143, r258179, r258157, r258204, 258205, r258206, r258207, r258321 This is a series of commits inspired on Google's gcc-4.2.1 for Android that were taken from the gcc pre-4.3 under the GPLv2. gcc: Backport fixes for -W parentheses in C++ This fixes GCC 19564. gcc: merge rs6000 change from FSF pre-gcc43 Don't set MASK_PPC_GFXOPT for 8540 or 8548. Merge vrp-tree fix from gcc-4.3 Fix missed conversion from / to >> (GCC PR32521) Merge in GCCr120505 to include definition of TREE_OVERFLOW_P gcc: warn about integer overflow in constant expressions in the C++ frontend. gcc: Add a new option -Wvla to warn variable length array. libcpp: preprocessor speedup patches from upstream gcc. gcc: add femit-struct-debug support to reduce Reduce dwarf debug size gcc: Fix postreload-gcse treatment of call-clobbered registers. gcc: Record some previous commits in the ChangeLog.gcc43 file. Modified: stable/10/contrib/gcc/ChangeLog.gcc43 stable/10/contrib/gcc/c-common.c stable/10/contrib/gcc/c-common.h stable/10/contrib/gcc/c-decl.c stable/10/contrib/gcc/c-opts.c stable/10/contrib/gcc/c-typeck.c stable/10/contrib/gcc/c.opt stable/10/contrib/gcc/config/rs6000/rs6000.c stable/10/contrib/gcc/cp/cp-lang.c stable/10/contrib/gcc/cp/cp-tree.h stable/10/contrib/gcc/cp/decl.c stable/10/contrib/gcc/cp/parser.c stable/10/contrib/gcc/cp/pt.c stable/10/contrib/gcc/cp/semantics.c stable/10/contrib/gcc/cp/tree.c stable/10/contrib/gcc/cp/typeck.c stable/10/contrib/gcc/doc/invoke.texi stable/10/contrib/gcc/dwarf2out.c stable/10/contrib/gcc/flags.h stable/10/contrib/gcc/langhooks-def.h stable/10/contrib/gcc/langhooks.h stable/10/contrib/gcc/opts.c stable/10/contrib/gcc/postreload-gcse.c stable/10/contrib/gcc/regs.h stable/10/contrib/gcc/rtlanal.c stable/10/contrib/gcc/tree-vrp.c stable/10/contrib/gcc/tree.h stable/10/contrib/gcclibs/libcpp/files.c stable/10/contrib/gcclibs/libcpp/internal.h stable/10/contrib/gcclibs/libcpp/lex.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/10/contrib/gcc/ChangeLog.gcc43 Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/ChangeLog.gcc43 Thu Dec 12 18:15:32 2013 (r259268) @@ -1,9 +1,35 @@ -2007-06-05 Joerg Wunsch (r23479) +2007-08-08 Andrew Haley (r128087) + + * config/arm/libunwind.S (UNWIND_WRAPPER _Unwind_Backtrace): New. + * config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New. + * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New. + +2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. +2007-05-24 Richard Sandiford (r125037) + + * postreload-gcse.c (reg_changed_after_insn_p): New function. + (oprs_unchanged_p): Use it to check all registers in a REG. + (record_opr_changes): Look for clobbers in CALL_INSN_FUNCTION_USAGE. + (reg_set_between_after_reload_p): Delete. + (reg_used_between_after_reload_p): Likewise. + (reg_set_or_used_since_bb_start): Likewise. + (eliminate_partially_redundant_load): Use reg_changed_after_insn_p + and reg_used_between_p instead of reg_set_or_used_since_bb_start. + Use reg_set_between_p instead of reg_set_between_after_reload_p. + * rtlanal.c (reg_set_p): Check whether REG overlaps + regs_invalidated_by_call, rather than just checking the + membership of REGNO (REG). + +2007-05-03 Ian Lance Taylor (r124381) + + * config/rs6000/rs6000.c (rs6000_override_options): Don't set + MASK_PPC_GFXOPT for 8540 or 8548. + 2007-05-01 Dwarakanath Rajagopal (r124341) * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of @@ -22,6 +48,57 @@ alignment for amdfam10 architecture. Increasing the max loop alignment to 24 bytes. +2007-04-16 Lawrence Crowl + + * doc/invoke.texi (Debugging Options): Add documentation for the + -femit-struct-debug options -femit-struct-debug-baseonly, + -femit-struct-debug-reduced, and + -femit-struct-debug-detailed[=...]. + + * c-opts.c (c_common_handle_option): Add + OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced, + and OPT_femit_struct_debug_detailed_. + * c.opt: Add specifications for + -femit-struct-debug-baseonly, -femit-struct-debug-reduced, + and -femit-struct-debug-detailed[=...]. + * opts.c (set_struct_debug_option): Parse the + -femit-struct-debug-... options. + * opts.c (matches_main_base, main_input_basename, + main_input_baselength, base_of_path, matches_main_base): Add + variables and functions to compare header base name to compilation + unit base name. + * opts.c (should_emit_struct_debug): Add to determine to emit a + structure based on the option. + (dump_struct_debug) Also disabled function to debug this + function. + * opts.c (handle_options): Save the base name of the + compilation unit. + + * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. + This hook indicates if a type is generic. Set it by default + to "never generic". + * langhooks.h (struct lang_hooks_for_types): Add a new hook + to determine if a struct type is generic or not. + * cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook. + * cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook. + * cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook + with live C++ hook. + + * flags.h (enum debug_info_usage): Add an enumeration to describe + a program's use of a structure type. + * dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter + to indicate the program's usage of the type. Filter structs based + on the -femit-struct-debug-... specification. + (gen_type_die): Split into two routines, gen_type_die and + gen_type_die_with_usage. gen_type_die is now a wrapper + that assumes direct usage. + (gen_type_die_with_usage): Replace calls to gen_type_die + with gen_type_die_with_usage adding the program usage of + the referenced type. + (dwarf2out_imported_module_or_decl): Suppress struct debug + information using should_emit_struct_debug when appropriate. + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -44,6 +121,19 @@ * config/i386/i386.c (override_options): Likewise. * doc/invoke.texi: Likewise. +2007-03-12 Seongbae Park + + * c-decl.c (warn_variable_length_array): New function. + Refactored from grokdeclarator to handle warn_vla + and handle unnamed array case. + (grokdeclarator): Refactored VLA warning case. + * c.opt (Wvla): New flag. + +2007-03-11 Ian Lance Taylor (r122831 - partial) + + * tree-vrp.c (vrp_int_const_binop): Handle PLUS_EXPR and + the *_DIV_EXPR codes correctly with overflow infinities. + 2007-02-09 Dwarakanath Rajagopal (r121763) * config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10. @@ -232,6 +322,17 @@ * config.gcc: Support core2 processor. +2006-12-13 Ian Lance Taylor (r119855) + + PR c++/19564 + PR c++/19756 + * c-typeck.c (parser_build_binary_op): Move parentheses warnings + to warn_about_parentheses in c-common.c. + * c-common.c (warn_about_parentheses): New function. + * c-common.h (warn_about_parentheses): Declare. + * doc/invoke.texi (Warning Options): Update -Wparentheses + description. + 2006-12-02 H.J. Lu (r119454 - partial) PR target/30040 @@ -270,6 +371,35 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-10-31 Geoffrey Keating (r118356) + + * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on + inline static functions in c99 mode. + + PR 16622 + * doc/extend.texi (Inline): Update. + * c-tree.h (struct language_function): Remove field 'extern_inline'. + * c-decl.c (current_extern_inline): Delete. + (pop_scope): Adjust test for an undefined nested function. + Add warning about undeclared inline function. + (diagnose_mismatched_decls): Update comments. Disallow overriding + of inline functions in a translation unit in C99. Allow inline + declarations in C99 at any time. + (merge_decls): Boolize variables. Handle C99 'extern inline' + semantics. + (grokdeclarator): Set DECL_EXTERNAL here for functions. Handle + C99 inline semantics. + (start_function): Don't clear current_extern_inline. Don't set + DECL_EXTERNAL. + (c_push_function_context): Don't push current_extern_inline. + (c_pop_function_context): Don't restore current_extern_inline. + + PR 11377 + * c-typeck.c (build_external_ref): Warn about static variables + used in extern inline functions. + * c-decl.c (start_decl): Warn about static variables declared + in extern inline functions. + 2006-10-27 Vladimir Makarov (r118090) * config/i386/i386.h (TARGET_GEODE): Modified: stable/10/contrib/gcc/c-common.c ============================================================================== --- stable/10/contrib/gcc/c-common.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/c-common.c Thu Dec 12 18:15:32 2013 (r259268) @@ -2585,9 +2585,13 @@ c_common_truthvalue_conversion (tree exp break; case MODIFY_EXPR: - if (!TREE_NO_WARNING (expr)) - warning (OPT_Wparentheses, - "suggest parentheses around assignment used as truth value"); + if (!TREE_NO_WARNING (expr) + && warn_parentheses) + { + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); + TREE_NO_WARNING (expr) = 1; + } break; default: @@ -6471,5 +6475,87 @@ warn_array_subscript_with_type_char (tre warning (OPT_Wchar_subscripts, "array subscript has type %"); } +/* Implement -Wparentheses for the unexpected C precedence rules, to + cover cases like x + y << z which readers are likely to + misinterpret. We have seen an expression in which CODE is a binary + operator used to combine expressions headed by CODE_LEFT and + CODE_RIGHT. CODE_LEFT and CODE_RIGHT may be ERROR_MARK, which + means that that side of the expression was not formed using a + binary operator, or it was enclosed in parentheses. */ + +void +warn_about_parentheses (enum tree_code code, enum tree_code code_left, + enum tree_code code_right) +{ + if (!warn_parentheses) + return; + + if (code == LSHIFT_EXPR || code == RSHIFT_EXPR) + { + if (code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around + or - inside shift"); + } + + if (code == TRUTH_ORIF_EXPR) + { + if (code_left == TRUTH_ANDIF_EXPR + || code_right == TRUTH_ANDIF_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around && within ||"); + } + + if (code == BIT_IOR_EXPR) + { + if (code_left == BIT_AND_EXPR || code_left == BIT_XOR_EXPR + || code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == BIT_AND_EXPR || code_right == BIT_XOR_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around arithmetic in operand of |"); + /* Check cases like x|y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of |"); + } + + if (code == BIT_XOR_EXPR) + { + if (code_left == BIT_AND_EXPR + || code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == BIT_AND_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around arithmetic in operand of ^"); + /* Check cases like x^y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of ^"); + } + + if (code == BIT_AND_EXPR) + { + if (code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around + or - in operand of &"); + /* Check cases like x&y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of &"); + } + + /* Similarly, check for cases like 1<=i<=10 that are probably errors. */ + if (TREE_CODE_CLASS (code) == tcc_comparison + && (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison)) + warning (OPT_Wparentheses, "comparisons like X<=Y<=Z do not " + "have their mathematical meaning"); +} + #include "gt-c-common.h" Modified: stable/10/contrib/gcc/c-common.h ============================================================================== --- stable/10/contrib/gcc/c-common.h Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/c-common.h Thu Dec 12 18:15:32 2013 (r259268) @@ -850,6 +850,9 @@ extern int complete_array_type (tree *, extern tree builtin_type_for_size (int, bool); extern void warn_array_subscript_with_type_char (tree); +extern void warn_about_parentheses (enum tree_code, enum tree_code, + enum tree_code); + /* In c-gimplify.c */ extern void c_genericize (tree); Modified: stable/10/contrib/gcc/c-decl.c ============================================================================== --- stable/10/contrib/gcc/c-decl.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/c-decl.c Thu Dec 12 18:15:32 2013 (r259268) @@ -3931,6 +3931,61 @@ check_bitfield_type_and_width (tree *typ } + +/* Print warning about variable length array if necessary. */ + +static void +warn_variable_length_array (const char *name, tree size) +{ + int ped = !flag_isoc99 && pedantic && warn_vla != 0; + int const_size = TREE_CONSTANT (size); + + if (ped) + { + if (const_size) + { + if (name) + pedwarn ("ISO C90 forbids array %qs whose size " + "can%'t be evaluated", + name); + else + pedwarn ("ISO C90 forbids array whose size " + "can%'t be evaluated"); + } + else + { + if (name) + pedwarn ("ISO C90 forbids variable length array %qs", + name); + else + pedwarn ("ISO C90 forbids variable length array"); + } + } + else if (warn_vla > 0) + { + if (const_size) + { + if (name) + warning (OPT_Wvla, + "the size of array %qs can" + "%'t be evaluated", name); + else + warning (OPT_Wvla, + "the size of array can %'t be evaluated"); + } + else + { + if (name) + warning (OPT_Wvla, + "variable length array %qs is used", + name); + else + warning (OPT_Wvla, + "variable length array is used"); + } + } +} + /* Given declspecs and a declarator, determine the name and type of the object declared and construct a ..._DECL node for it. @@ -4329,17 +4384,7 @@ grokdeclarator (const struct c_declarato nonconstant even if it is (eg) a const variable with known value. */ size_varies = 1; - - if (!flag_isoc99 && pedantic) - { - if (TREE_CONSTANT (size)) - pedwarn ("ISO C90 forbids array %qs whose size " - "can%'t be evaluated", - name); - else - pedwarn ("ISO C90 forbids variable-size array %qs", - name); - } + warn_variable_length_array (orig_name, size); if (warn_variable_decl) warning (0, "variable-sized array %qs", name); } Modified: stable/10/contrib/gcc/c-opts.c ============================================================================== --- stable/10/contrib/gcc/c-opts.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/c-opts.c Thu Dec 12 18:15:32 2013 (r259268) @@ -818,6 +818,18 @@ c_common_handle_option (size_t scode, co flag_gen_declaration = 1; break; + case OPT_femit_struct_debug_baseonly: + set_struct_debug_option ("base"); + break; + + case OPT_femit_struct_debug_reduced: + set_struct_debug_option ("dir:ord:sys,dir:gen:any,ind:base"); + break; + + case OPT_femit_struct_debug_detailed_: + set_struct_debug_option (arg); + break; + case OPT_idirafter: add_path (xstrdup (arg), AFTER, 0, true); break; Modified: stable/10/contrib/gcc/c-typeck.c ============================================================================== --- stable/10/contrib/gcc/c-typeck.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/c-typeck.c Thu Dec 12 18:15:32 2013 (r259268) @@ -2631,73 +2631,7 @@ parser_build_binary_op (enum tree_code c /* Check for cases such as x+y< Detailed reduced debug info for structs + idirafter C ObjC C++ ObjC++ Joined Separate -idirafter Add to the end of the system include path Modified: stable/10/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- stable/10/contrib/gcc/config/rs6000/rs6000.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/config/rs6000/rs6000.c Thu Dec 12 18:15:32 2013 (r259268) @@ -1171,11 +1171,9 @@ rs6000_override_options (const char *def {"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, - {"8540", PROCESSOR_PPC8540, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, /* 8548 has a dummy entry for now. */ - {"8548", PROCESSOR_PPC8540, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"970", PROCESSOR_POWER4, POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, Modified: stable/10/contrib/gcc/cp/cp-lang.c ============================================================================== --- stable/10/contrib/gcc/cp/cp-lang.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/cp-lang.c Thu Dec 12 18:15:32 2013 (r259268) @@ -44,6 +44,8 @@ static void cp_init_ts (void); #define LANG_HOOKS_NAME "GNU C++" #undef LANG_HOOKS_INIT #define LANG_HOOKS_INIT cxx_init +#undef LANG_HOOKS_GENERIC_TYPE_P +#define LANG_HOOKS_GENERIC_TYPE_P class_tmpl_impl_spec_p #undef LANG_HOOKS_DECL_PRINTABLE_NAME #define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name #undef LANG_HOOKS_FOLD_OBJ_TYPE_REF Modified: stable/10/contrib/gcc/cp/cp-tree.h ============================================================================== --- stable/10/contrib/gcc/cp/cp-tree.h Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/cp-tree.h Thu Dec 12 18:15:32 2013 (r259268) @@ -4373,6 +4373,7 @@ extern tree add_stmt_to_compound (tree, extern tree cxx_maybe_build_cleanup (tree); extern void init_tree (void); extern int pod_type_p (tree); +extern bool class_tmpl_impl_spec_p (tree); extern int zero_init_p (tree); extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, @@ -4460,8 +4461,9 @@ extern tree build_x_indirect_ref (tree, extern tree build_indirect_ref (tree, const char *); extern tree build_array_ref (tree, tree); extern tree get_member_function_from_ptrfunc (tree *, tree); -extern tree build_x_binary_op (enum tree_code, tree, tree, - bool *); +extern tree build_x_binary_op (enum tree_code, tree, + enum tree_code, tree, + enum tree_code, bool *); extern tree build_x_unary_op (enum tree_code, tree); extern tree unary_complex_lvalue (enum tree_code, tree); extern tree build_x_conditional_expr (tree, tree, tree); Modified: stable/10/contrib/gcc/cp/decl.c ============================================================================== --- stable/10/contrib/gcc/cp/decl.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/decl.c Thu Dec 12 18:15:32 2013 (r259268) @@ -6702,12 +6702,21 @@ compute_array_index_type (tree name, tre error ("size of array is not an integral constant-expression"); size = integer_one_node; } - else if (pedantic) + else if (pedantic && warn_vla != 0) { if (name) - pedwarn ("ISO C++ forbids variable-size array %qD", name); + pedwarn ("ISO C++ forbids variable length array %qD", name); else - pedwarn ("ISO C++ forbids variable-size array"); + pedwarn ("ISO C++ forbids variable length array"); + } + else if (warn_vla > 0) + { + if (name) + warning (OPT_Wvla, + "variable length array %qD is used", name); + else + warning (OPT_Wvla, + "variable length array is used"); } if (processing_template_decl && !TREE_CONSTANT (size)) Modified: stable/10/contrib/gcc/cp/parser.c ============================================================================== --- stable/10/contrib/gcc/cp/parser.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/parser.c Thu Dec 12 18:15:32 2013 (r259268) @@ -1177,8 +1177,15 @@ typedef enum cp_parser_status_kind typedef struct cp_parser_expression_stack_entry { + /* Left hand side of the binary operation we are currently + parsing. */ tree lhs; + /* Original tree code for left hand side, if it was a binary + expression itself (used for -Wparentheses). */ + enum tree_code lhs_type; + /* Tree code for the binary operation we are parsing. */ enum tree_code tree_type; + /* Precedence of the binary operation we are parsing. */ int prec; } cp_parser_expression_stack_entry; @@ -1536,7 +1543,7 @@ static tree cp_parser_builtin_offsetof /* Statements [gram.stmt.stmt] */ static void cp_parser_statement - (cp_parser *, tree, bool); + (cp_parser *, tree, bool, bool *); static void cp_parser_label_for_labeled_statement (cp_parser *); static tree cp_parser_expression_statement @@ -1546,7 +1553,7 @@ static tree cp_parser_compound_statement static void cp_parser_statement_seq_opt (cp_parser *, tree); static tree cp_parser_selection_statement - (cp_parser *); + (cp_parser *, bool *); static tree cp_parser_condition (cp_parser *); static tree cp_parser_iteration_statement @@ -1559,7 +1566,7 @@ static void cp_parser_declaration_statem (cp_parser *); static tree cp_parser_implicitly_scoped_statement - (cp_parser *); + (cp_parser *, bool *); static void cp_parser_already_scoped_statement (cp_parser *); @@ -5730,12 +5737,13 @@ cp_parser_binary_expression (cp_parser* cp_parser_expression_stack_entry *sp = &stack[0]; tree lhs, rhs; cp_token *token; - enum tree_code tree_type; + enum tree_code tree_type, lhs_type, rhs_type; enum cp_parser_prec prec = PREC_NOT_OPERATOR, new_prec, lookahead_prec; bool overloaded_p; /* Parse the first expression. */ lhs = cp_parser_cast_expression (parser, /*address_p=*/false, cast_p); + lhs_type = ERROR_MARK; for (;;) { @@ -5768,6 +5776,7 @@ cp_parser_binary_expression (cp_parser* /* Extract another operand. It may be the RHS of this expression or the LHS of a new, higher priority expression. */ rhs = cp_parser_simple_cast_expression (parser); + rhs_type = ERROR_MARK; /* Get another operator token. Look up its precedence to avoid building a useless (immediately popped) stack entry for common @@ -5783,8 +5792,10 @@ cp_parser_binary_expression (cp_parser* sp->prec = prec; sp->tree_type = tree_type; sp->lhs = lhs; + sp->lhs_type = lhs_type; sp++; lhs = rhs; + lhs_type = rhs_type; prec = new_prec; new_prec = lookahead_prec; goto get_rhs; @@ -5801,11 +5812,15 @@ cp_parser_binary_expression (cp_parser* prec = sp->prec; tree_type = sp->tree_type; rhs = lhs; + rhs_type = lhs_type; lhs = sp->lhs; + lhs_type = sp->lhs_type; } overloaded_p = false; - lhs = build_x_binary_op (tree_type, lhs, rhs, &overloaded_p); + lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, + &overloaded_p); + lhs_type = tree_type; /* If the binary operator required the use of an overloaded operator, then this expression cannot be an integral constant-expression. @@ -6222,17 +6237,23 @@ cp_parser_builtin_offsetof (cp_parser *p try-block IN_COMPOUND is true when the statement is nested inside a - cp_parser_compound_statement; this matters for certain pragmas. */ + cp_parser_compound_statement; this matters for certain pragmas. + + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in braces + and has an else clause. This is used to implement -Wparentheses. */ static void cp_parser_statement (cp_parser* parser, tree in_statement_expr, - bool in_compound) + bool in_compound, bool *if_p) { tree statement; cp_token *token; location_t statement_location; restart: + if (if_p != NULL) + *if_p = false; /* There is no statement yet. */ statement = NULL_TREE; /* Peek at the next token. */ @@ -6257,7 +6278,7 @@ cp_parser_statement (cp_parser* parser, case RID_IF: case RID_SWITCH: - statement = cp_parser_selection_statement (parser); + statement = cp_parser_selection_statement (parser, if_p); break; case RID_WHILE: @@ -6522,7 +6543,7 @@ cp_parser_statement_seq_opt (cp_parser* break; /* Parse the statement. */ - cp_parser_statement (parser, in_statement_expr, true); + cp_parser_statement (parser, in_statement_expr, true, NULL); } } @@ -6533,14 +6554,22 @@ cp_parser_statement_seq_opt (cp_parser* if ( condition ) statement else statement switch ( condition ) statement - Returns the new IF_STMT or SWITCH_STMT. */ + Returns the new IF_STMT or SWITCH_STMT. + + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in + braces and has an else clause. This is used to implement + -Wparentheses. */ static tree -cp_parser_selection_statement (cp_parser* parser) +cp_parser_selection_statement (cp_parser* parser, bool *if_p) { cp_token *token; enum rid keyword; + if (if_p != NULL) + *if_p = false; + /* Peek at the next token. */ token = cp_parser_require (parser, CPP_KEYWORD, "selection-statement"); @@ -6576,11 +6605,13 @@ cp_parser_selection_statement (cp_parser if (keyword == RID_IF) { + bool nested_if; + /* Add the condition. */ finish_if_stmt_cond (condition, statement); /* Parse the then-clause. */ - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, &nested_if); finish_then_clause (statement); /* If the next token is `else', parse the else-clause. */ @@ -6591,8 +6622,28 @@ cp_parser_selection_statement (cp_parser cp_lexer_consume_token (parser->lexer); begin_else_clause (statement); /* Parse the else-clause. */ - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); finish_else_clause (statement); + + /* If we are currently parsing a then-clause, then + IF_P will not be NULL. We set it to true to + indicate that this if statement has an else clause. + This may trigger the Wparentheses warning below + when we get back up to the parent if statement. */ + if (if_p != NULL) + *if_p = true; + } + else + { + /* This if statement does not have an else clause. If + NESTED_IF is true, then the then-clause is an if + statement which does have an else clause. We warn + about the potential ambiguity. */ + if (nested_if) + warning (OPT_Wparentheses, + ("%Hsuggest explicit braces " + "to avoid ambiguous %"), + EXPR_LOCUS (statement)); } /* Now we're all done with the if-statement. */ @@ -6611,7 +6662,7 @@ cp_parser_selection_statement (cp_parser in_statement = parser->in_statement; parser->in_switch_statement_p = true; parser->in_statement |= IN_SWITCH_STMT; - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); parser->in_switch_statement_p = in_switch_statement_p; parser->in_statement = in_statement; @@ -6789,7 +6840,7 @@ cp_parser_iteration_statement (cp_parser statement = begin_do_stmt (); /* Parse the body of the do-statement. */ parser->in_statement = IN_ITERATION_STMT; - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); parser->in_statement = in_statement; finish_do_body (statement); /* Look for the `while' keyword. */ @@ -7031,13 +7082,21 @@ cp_parser_declaration_statement (cp_pars but ensures that is in its own scope, even if it is not a compound-statement. + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in + braces and has an else clause. This is used to implement + -Wparentheses. + Returns the new statement. */ static tree -cp_parser_implicitly_scoped_statement (cp_parser* parser) +cp_parser_implicitly_scoped_statement (cp_parser* parser, bool *if_p) { tree statement; + if (if_p != NULL) + *if_p = false; + /* Mark if () ; with a special NOP_EXPR. */ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)) { @@ -7053,7 +7112,7 @@ cp_parser_implicitly_scoped_statement (c /* Create a compound-statement. */ statement = begin_compound_stmt (0); /* Parse the dependent-statement. */ - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, if_p); /* Finish the dummy compound-statement. */ finish_compound_stmt (statement); } @@ -7072,7 +7131,7 @@ cp_parser_already_scoped_statement (cp_p { /* If the token is a `{', then we must take special action. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)) - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); else { /* Avoid calling cp_parser_compound_statement, so that we @@ -18645,7 +18704,7 @@ cp_parser_omp_structured_block (cp_parse tree stmt = begin_omp_structured_block (); unsigned int save = cp_parser_begin_omp_structured_block (parser); - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); cp_parser_end_omp_structured_block (parser, save); return finish_omp_structured_block (stmt); @@ -18890,7 +18949,7 @@ cp_parser_omp_for_loop (cp_parser *parse /* Note that the grammar doesn't call for a structured block here, though the loop as a whole is a structured block. */ body = push_stmt_list (); - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); body = pop_stmt_list (body); return finish_omp_for (loc, decl, init, cond, incr, body, pre_body); @@ -18983,7 +19042,7 @@ cp_parser_omp_sections_scope (cp_parser while (1) { - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); tok = cp_lexer_peek_token (parser->lexer); if (tok->pragma_kind == PRAGMA_OMP_SECTION) Modified: stable/10/contrib/gcc/cp/pt.c ============================================================================== --- stable/10/contrib/gcc/cp/pt.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/pt.c Thu Dec 12 18:15:32 2013 (r259268) @@ -9078,7 +9078,13 @@ tsubst_copy_and_build (tree t, return build_x_binary_op (TREE_CODE (t), RECUR (TREE_OPERAND (t, 0)), + (TREE_NO_WARNING (TREE_OPERAND (t, 0)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 0))), RECUR (TREE_OPERAND (t, 1)), + (TREE_NO_WARNING (TREE_OPERAND (t, 1)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 1))), /*overloaded_p=*/NULL); case SCOPE_REF: @@ -9087,7 +9093,14 @@ tsubst_copy_and_build (tree t, case ARRAY_REF: op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0), args, complain, in_decl); - return build_x_binary_op (ARRAY_REF, op1, RECUR (TREE_OPERAND (t, 1)), + return build_x_binary_op (ARRAY_REF, op1, + (TREE_NO_WARNING (TREE_OPERAND (t, 0)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 0))), + RECUR (TREE_OPERAND (t, 1)), + (TREE_NO_WARNING (TREE_OPERAND (t, 1)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 1))), /*overloaded_p=*/NULL); case SIZEOF_EXPR: Modified: stable/10/contrib/gcc/cp/semantics.c ============================================================================== --- stable/10/contrib/gcc/cp/semantics.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/semantics.c Thu Dec 12 18:15:32 2013 (r259268) @@ -587,6 +587,16 @@ maybe_convert_cond (tree cond) /* Do the conversion. */ cond = convert_from_reference (cond); + + if (TREE_CODE (cond) == MODIFY_EXPR + && !TREE_NO_WARNING (cond) + && warn_parentheses) + { + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); + TREE_NO_WARNING (cond) = 1; + } + return condition_conversion (cond); } Modified: stable/10/contrib/gcc/cp/tree.c ============================================================================== --- stable/10/contrib/gcc/cp/tree.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/tree.c Thu Dec 12 18:15:32 2013 (r259268) @@ -1762,6 +1762,14 @@ pod_type_p (tree t) return 1; } +/* Nonzero iff type T is a class template implicit specialization. */ + +bool +class_tmpl_impl_spec_p (tree t) +{ + return CLASS_TYPE_P (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t); +} + /* Returns 1 iff zero initialization of type T means actually storing zeros in it. */ Modified: stable/10/contrib/gcc/cp/typeck.c ============================================================================== --- stable/10/contrib/gcc/cp/typeck.c Thu Dec 12 18:08:31 2013 (r259267) +++ stable/10/contrib/gcc/cp/typeck.c Thu Dec 12 18:15:32 2013 (r259268) @@ -1690,17 +1690,20 @@ rationalize_conditional_expr (enum tree_ are equal, so we know what conditional expression this used to be. */ if (TREE_CODE (t) == MIN_EXPR || TREE_CODE (t) == MAX_EXPR) { + tree op0 = TREE_OPERAND (t, 0); + tree op1 = TREE_OPERAND (t, 1); + /* The following code is incorrect if either operand side-effects. */ - gcc_assert (!TREE_SIDE_EFFECTS (TREE_OPERAND (t, 0)) - && !TREE_SIDE_EFFECTS (TREE_OPERAND (t, 1))); + gcc_assert (!TREE_SIDE_EFFECTS (op0) + && !TREE_SIDE_EFFECTS (op1)); return build_conditional_expr (build_x_binary_op ((TREE_CODE (t) == MIN_EXPR ? LE_EXPR : GE_EXPR), - TREE_OPERAND (t, 0), - TREE_OPERAND (t, 1), + op0, TREE_CODE (op0), + op1, TREE_CODE (op1), /*overloaded_p=*/NULL), - build_unary_op (code, TREE_OPERAND (t, 0), 0), - build_unary_op (code, TREE_OPERAND (t, 1), 0)); + build_unary_op (code, op0, 0), + build_unary_op (code, op1, 0)); } return @@ -2908,8 +2911,8 @@ convert_arguments (tree typelist, tree v conversions on the operands. CODE is the kind of expression to build. */ tree -build_x_binary_op (enum tree_code code, tree arg1, tree arg2, - bool *overloaded_p) +build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, + tree arg2, enum tree_code arg2_code, bool *overloaded_p) { tree orig_arg1; tree orig_arg2; @@ -2933,6 +2936,17 @@ build_x_binary_op (enum tree_code code, expr = build_new_op (code, LOOKUP_NORMAL, arg1, arg2, NULL_TREE, overloaded_p); + /* Check for cases such as x+y< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1318F5A; Thu, 12 Dec 2013 18:16:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B13119FC; Thu, 12 Dec 2013 18:16:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCIGoTw022301; Thu, 12 Dec 2013 18:16:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCIGlhG022281; Thu, 12 Dec 2013 18:16:47 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121816.rBCIGlhG022281@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 18:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259269 - in stable/9/contrib: gcc gcc/config/rs6000 gcc/cp gcc/doc gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 18:16:50 -0000 Author: pfg Date: Thu Dec 12 18:16:46 2013 New Revision: 259269 URL: http://svnweb.freebsd.org/changeset/base/259269 Log: MFC r258081, r258138, r258143, r258179, r258157, r258204, 258205, r258206, r258207, r258321 This is a series of commits inspired on Google's gcc-4.2.1 for Android that were taken from the gcc pre-4.3 under the GPLv2. gcc: Backport fixes for -W parentheses in C++ This fixes GCC 19564. gcc: merge rs6000 change from FSF pre-gcc43 Don't set MASK_PPC_GFXOPT for 8540 or 8548. Merge vrp-tree fix from gcc-4.3 Fix missed conversion from / to >> (GCC PR32521) Merge in GCCr120505 to include definition of TREE_OVERFLOW_P gcc: warn about integer overflow in constant expressions in the C++ frontend. gcc: Add a new option -Wvla to warn variable length array. libcpp: preprocessor speedup patches from upstream gcc. gcc: add femit-struct-debug support to reduce Reduce dwarf debug size gcc: Fix postreload-gcse treatment of call-clobbered registers. gcc: Record some previous commits in the ChangeLog.gcc43 file. Modified: stable/9/contrib/gcc/ChangeLog.gcc43 stable/9/contrib/gcc/c-common.c stable/9/contrib/gcc/c-common.h stable/9/contrib/gcc/c-decl.c stable/9/contrib/gcc/c-opts.c stable/9/contrib/gcc/c-typeck.c stable/9/contrib/gcc/c.opt stable/9/contrib/gcc/config/rs6000/rs6000.c stable/9/contrib/gcc/cp/cp-lang.c stable/9/contrib/gcc/cp/cp-tree.h stable/9/contrib/gcc/cp/decl.c stable/9/contrib/gcc/cp/parser.c stable/9/contrib/gcc/cp/pt.c stable/9/contrib/gcc/cp/semantics.c stable/9/contrib/gcc/cp/tree.c stable/9/contrib/gcc/cp/typeck.c stable/9/contrib/gcc/doc/invoke.texi stable/9/contrib/gcc/dwarf2out.c stable/9/contrib/gcc/flags.h stable/9/contrib/gcc/langhooks-def.h stable/9/contrib/gcc/langhooks.h stable/9/contrib/gcc/opts.c stable/9/contrib/gcc/postreload-gcse.c stable/9/contrib/gcc/regs.h stable/9/contrib/gcc/rtlanal.c stable/9/contrib/gcc/tree-vrp.c stable/9/contrib/gcc/tree.h stable/9/contrib/gcclibs/libcpp/files.c stable/9/contrib/gcclibs/libcpp/internal.h stable/9/contrib/gcclibs/libcpp/lex.c Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcc/ChangeLog.gcc43 ============================================================================== --- stable/9/contrib/gcc/ChangeLog.gcc43 Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/ChangeLog.gcc43 Thu Dec 12 18:16:46 2013 (r259269) @@ -1,9 +1,35 @@ -2007-06-05 Joerg Wunsch (r23479) +2007-08-08 Andrew Haley (r128087) + + * config/arm/libunwind.S (UNWIND_WRAPPER _Unwind_Backtrace): New. + * config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New. + * config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New. + +2007-06-05 Joerg Wunsch (r125346) PR preprocessor/23479 * doc/extend.texi: Document the 0b-prefixed binary integer constant extension. +2007-05-24 Richard Sandiford (r125037) + + * postreload-gcse.c (reg_changed_after_insn_p): New function. + (oprs_unchanged_p): Use it to check all registers in a REG. + (record_opr_changes): Look for clobbers in CALL_INSN_FUNCTION_USAGE. + (reg_set_between_after_reload_p): Delete. + (reg_used_between_after_reload_p): Likewise. + (reg_set_or_used_since_bb_start): Likewise. + (eliminate_partially_redundant_load): Use reg_changed_after_insn_p + and reg_used_between_p instead of reg_set_or_used_since_bb_start. + Use reg_set_between_p instead of reg_set_between_after_reload_p. + * rtlanal.c (reg_set_p): Check whether REG overlaps + regs_invalidated_by_call, rather than just checking the + membership of REGNO (REG). + +2007-05-03 Ian Lance Taylor (r124381) + + * config/rs6000/rs6000.c (rs6000_override_options): Don't set + MASK_PPC_GFXOPT for 8540 or 8548. + 2007-05-01 Dwarakanath Rajagopal (r124341) * doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of @@ -22,6 +48,57 @@ alignment for amdfam10 architecture. Increasing the max loop alignment to 24 bytes. +2007-04-16 Lawrence Crowl + + * doc/invoke.texi (Debugging Options): Add documentation for the + -femit-struct-debug options -femit-struct-debug-baseonly, + -femit-struct-debug-reduced, and + -femit-struct-debug-detailed[=...]. + + * c-opts.c (c_common_handle_option): Add + OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced, + and OPT_femit_struct_debug_detailed_. + * c.opt: Add specifications for + -femit-struct-debug-baseonly, -femit-struct-debug-reduced, + and -femit-struct-debug-detailed[=...]. + * opts.c (set_struct_debug_option): Parse the + -femit-struct-debug-... options. + * opts.c (matches_main_base, main_input_basename, + main_input_baselength, base_of_path, matches_main_base): Add + variables and functions to compare header base name to compilation + unit base name. + * opts.c (should_emit_struct_debug): Add to determine to emit a + structure based on the option. + (dump_struct_debug) Also disabled function to debug this + function. + * opts.c (handle_options): Save the base name of the + compilation unit. + + * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define. + (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. + This hook indicates if a type is generic. Set it by default + to "never generic". + * langhooks.h (struct lang_hooks_for_types): Add a new hook + to determine if a struct type is generic or not. + * cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook. + * cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook. + * cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook + with live C++ hook. + + * flags.h (enum debug_info_usage): Add an enumeration to describe + a program's use of a structure type. + * dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter + to indicate the program's usage of the type. Filter structs based + on the -femit-struct-debug-... specification. + (gen_type_die): Split into two routines, gen_type_die and + gen_type_die_with_usage. gen_type_die is now a wrapper + that assumes direct usage. + (gen_type_die_with_usage): Replace calls to gen_type_die + with gen_type_die_with_usage adding the program usage of + the referenced type. + (dwarf2out_imported_module_or_decl): Suppress struct debug + information using should_emit_struct_debug when appropriate. + 2007-04-12 Richard Guenther (r123736) PR tree-optimization/24689 @@ -44,6 +121,19 @@ * config/i386/i386.c (override_options): Likewise. * doc/invoke.texi: Likewise. +2007-03-12 Seongbae Park + + * c-decl.c (warn_variable_length_array): New function. + Refactored from grokdeclarator to handle warn_vla + and handle unnamed array case. + (grokdeclarator): Refactored VLA warning case. + * c.opt (Wvla): New flag. + +2007-03-11 Ian Lance Taylor (r122831 - partial) + + * tree-vrp.c (vrp_int_const_binop): Handle PLUS_EXPR and + the *_DIV_EXPR codes correctly with overflow infinities. + 2007-02-09 Dwarakanath Rajagopal (r121763) * config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10. @@ -232,6 +322,17 @@ * config.gcc: Support core2 processor. +2006-12-13 Ian Lance Taylor (r119855) + + PR c++/19564 + PR c++/19756 + * c-typeck.c (parser_build_binary_op): Move parentheses warnings + to warn_about_parentheses in c-common.c. + * c-common.c (warn_about_parentheses): New function. + * c-common.h (warn_about_parentheses): Declare. + * doc/invoke.texi (Warning Options): Update -Wparentheses + description. + 2006-12-02 H.J. Lu (r119454 - partial) PR target/30040 @@ -270,6 +371,35 @@ (override_options): Add entries for Core2. (ix86_issue_rate): Add case for Core2. +2006-10-31 Geoffrey Keating (r118356) + + * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on + inline static functions in c99 mode. + + PR 16622 + * doc/extend.texi (Inline): Update. + * c-tree.h (struct language_function): Remove field 'extern_inline'. + * c-decl.c (current_extern_inline): Delete. + (pop_scope): Adjust test for an undefined nested function. + Add warning about undeclared inline function. + (diagnose_mismatched_decls): Update comments. Disallow overriding + of inline functions in a translation unit in C99. Allow inline + declarations in C99 at any time. + (merge_decls): Boolize variables. Handle C99 'extern inline' + semantics. + (grokdeclarator): Set DECL_EXTERNAL here for functions. Handle + C99 inline semantics. + (start_function): Don't clear current_extern_inline. Don't set + DECL_EXTERNAL. + (c_push_function_context): Don't push current_extern_inline. + (c_pop_function_context): Don't restore current_extern_inline. + + PR 11377 + * c-typeck.c (build_external_ref): Warn about static variables + used in extern inline functions. + * c-decl.c (start_decl): Warn about static variables declared + in extern inline functions. + 2006-10-27 Vladimir Makarov (r118090) * config/i386/i386.h (TARGET_GEODE): Modified: stable/9/contrib/gcc/c-common.c ============================================================================== --- stable/9/contrib/gcc/c-common.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-common.c Thu Dec 12 18:16:46 2013 (r259269) @@ -2585,9 +2585,13 @@ c_common_truthvalue_conversion (tree exp break; case MODIFY_EXPR: - if (!TREE_NO_WARNING (expr)) - warning (OPT_Wparentheses, - "suggest parentheses around assignment used as truth value"); + if (!TREE_NO_WARNING (expr) + && warn_parentheses) + { + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); + TREE_NO_WARNING (expr) = 1; + } break; default: @@ -6471,5 +6475,87 @@ warn_array_subscript_with_type_char (tre warning (OPT_Wchar_subscripts, "array subscript has type %"); } +/* Implement -Wparentheses for the unexpected C precedence rules, to + cover cases like x + y << z which readers are likely to + misinterpret. We have seen an expression in which CODE is a binary + operator used to combine expressions headed by CODE_LEFT and + CODE_RIGHT. CODE_LEFT and CODE_RIGHT may be ERROR_MARK, which + means that that side of the expression was not formed using a + binary operator, or it was enclosed in parentheses. */ + +void +warn_about_parentheses (enum tree_code code, enum tree_code code_left, + enum tree_code code_right) +{ + if (!warn_parentheses) + return; + + if (code == LSHIFT_EXPR || code == RSHIFT_EXPR) + { + if (code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around + or - inside shift"); + } + + if (code == TRUTH_ORIF_EXPR) + { + if (code_left == TRUTH_ANDIF_EXPR + || code_right == TRUTH_ANDIF_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around && within ||"); + } + + if (code == BIT_IOR_EXPR) + { + if (code_left == BIT_AND_EXPR || code_left == BIT_XOR_EXPR + || code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == BIT_AND_EXPR || code_right == BIT_XOR_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around arithmetic in operand of |"); + /* Check cases like x|y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of |"); + } + + if (code == BIT_XOR_EXPR) + { + if (code_left == BIT_AND_EXPR + || code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == BIT_AND_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around arithmetic in operand of ^"); + /* Check cases like x^y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of ^"); + } + + if (code == BIT_AND_EXPR) + { + if (code_left == PLUS_EXPR || code_left == MINUS_EXPR + || code_right == PLUS_EXPR || code_right == MINUS_EXPR) + warning (OPT_Wparentheses, + "suggest parentheses around + or - in operand of &"); + /* Check cases like x&y==z */ + if (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison) + warning (OPT_Wparentheses, + "suggest parentheses around comparison in operand of &"); + } + + /* Similarly, check for cases like 1<=i<=10 that are probably errors. */ + if (TREE_CODE_CLASS (code) == tcc_comparison + && (TREE_CODE_CLASS (code_left) == tcc_comparison + || TREE_CODE_CLASS (code_right) == tcc_comparison)) + warning (OPT_Wparentheses, "comparisons like X<=Y<=Z do not " + "have their mathematical meaning"); +} + #include "gt-c-common.h" Modified: stable/9/contrib/gcc/c-common.h ============================================================================== --- stable/9/contrib/gcc/c-common.h Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-common.h Thu Dec 12 18:16:46 2013 (r259269) @@ -850,6 +850,9 @@ extern int complete_array_type (tree *, extern tree builtin_type_for_size (int, bool); extern void warn_array_subscript_with_type_char (tree); +extern void warn_about_parentheses (enum tree_code, enum tree_code, + enum tree_code); + /* In c-gimplify.c */ extern void c_genericize (tree); Modified: stable/9/contrib/gcc/c-decl.c ============================================================================== --- stable/9/contrib/gcc/c-decl.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-decl.c Thu Dec 12 18:16:46 2013 (r259269) @@ -3931,6 +3931,61 @@ check_bitfield_type_and_width (tree *typ } + +/* Print warning about variable length array if necessary. */ + +static void +warn_variable_length_array (const char *name, tree size) +{ + int ped = !flag_isoc99 && pedantic && warn_vla != 0; + int const_size = TREE_CONSTANT (size); + + if (ped) + { + if (const_size) + { + if (name) + pedwarn ("ISO C90 forbids array %qs whose size " + "can%'t be evaluated", + name); + else + pedwarn ("ISO C90 forbids array whose size " + "can%'t be evaluated"); + } + else + { + if (name) + pedwarn ("ISO C90 forbids variable length array %qs", + name); + else + pedwarn ("ISO C90 forbids variable length array"); + } + } + else if (warn_vla > 0) + { + if (const_size) + { + if (name) + warning (OPT_Wvla, + "the size of array %qs can" + "%'t be evaluated", name); + else + warning (OPT_Wvla, + "the size of array can %'t be evaluated"); + } + else + { + if (name) + warning (OPT_Wvla, + "variable length array %qs is used", + name); + else + warning (OPT_Wvla, + "variable length array is used"); + } + } +} + /* Given declspecs and a declarator, determine the name and type of the object declared and construct a ..._DECL node for it. @@ -4329,17 +4384,7 @@ grokdeclarator (const struct c_declarato nonconstant even if it is (eg) a const variable with known value. */ size_varies = 1; - - if (!flag_isoc99 && pedantic) - { - if (TREE_CONSTANT (size)) - pedwarn ("ISO C90 forbids array %qs whose size " - "can%'t be evaluated", - name); - else - pedwarn ("ISO C90 forbids variable-size array %qs", - name); - } + warn_variable_length_array (orig_name, size); if (warn_variable_decl) warning (0, "variable-sized array %qs", name); } Modified: stable/9/contrib/gcc/c-opts.c ============================================================================== --- stable/9/contrib/gcc/c-opts.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-opts.c Thu Dec 12 18:16:46 2013 (r259269) @@ -818,6 +818,18 @@ c_common_handle_option (size_t scode, co flag_gen_declaration = 1; break; + case OPT_femit_struct_debug_baseonly: + set_struct_debug_option ("base"); + break; + + case OPT_femit_struct_debug_reduced: + set_struct_debug_option ("dir:ord:sys,dir:gen:any,ind:base"); + break; + + case OPT_femit_struct_debug_detailed_: + set_struct_debug_option (arg); + break; + case OPT_idirafter: add_path (xstrdup (arg), AFTER, 0, true); break; Modified: stable/9/contrib/gcc/c-typeck.c ============================================================================== --- stable/9/contrib/gcc/c-typeck.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/c-typeck.c Thu Dec 12 18:16:46 2013 (r259269) @@ -2631,73 +2631,7 @@ parser_build_binary_op (enum tree_code c /* Check for cases such as x+y< Detailed reduced debug info for structs + idirafter C ObjC C++ ObjC++ Joined Separate -idirafter Add to the end of the system include path Modified: stable/9/contrib/gcc/config/rs6000/rs6000.c ============================================================================== --- stable/9/contrib/gcc/config/rs6000/rs6000.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/config/rs6000/rs6000.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1171,11 +1171,9 @@ rs6000_override_options (const char *def {"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, - {"8540", PROCESSOR_PPC8540, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, /* 8548 has a dummy entry for now. */ - {"8548", PROCESSOR_PPC8540, - POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_STRICT_ALIGN}, + {"8548", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_STRICT_ALIGN}, {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT}, {"970", PROCESSOR_POWER4, POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64}, Modified: stable/9/contrib/gcc/cp/cp-lang.c ============================================================================== --- stable/9/contrib/gcc/cp/cp-lang.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/cp-lang.c Thu Dec 12 18:16:46 2013 (r259269) @@ -44,6 +44,8 @@ static void cp_init_ts (void); #define LANG_HOOKS_NAME "GNU C++" #undef LANG_HOOKS_INIT #define LANG_HOOKS_INIT cxx_init +#undef LANG_HOOKS_GENERIC_TYPE_P +#define LANG_HOOKS_GENERIC_TYPE_P class_tmpl_impl_spec_p #undef LANG_HOOKS_DECL_PRINTABLE_NAME #define LANG_HOOKS_DECL_PRINTABLE_NAME cxx_printable_name #undef LANG_HOOKS_FOLD_OBJ_TYPE_REF Modified: stable/9/contrib/gcc/cp/cp-tree.h ============================================================================== --- stable/9/contrib/gcc/cp/cp-tree.h Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/cp-tree.h Thu Dec 12 18:16:46 2013 (r259269) @@ -4373,6 +4373,7 @@ extern tree add_stmt_to_compound (tree, extern tree cxx_maybe_build_cleanup (tree); extern void init_tree (void); extern int pod_type_p (tree); +extern bool class_tmpl_impl_spec_p (tree); extern int zero_init_p (tree); extern tree canonical_type_variant (tree); extern tree copy_binfo (tree, tree, tree, @@ -4460,8 +4461,9 @@ extern tree build_x_indirect_ref (tree, extern tree build_indirect_ref (tree, const char *); extern tree build_array_ref (tree, tree); extern tree get_member_function_from_ptrfunc (tree *, tree); -extern tree build_x_binary_op (enum tree_code, tree, tree, - bool *); +extern tree build_x_binary_op (enum tree_code, tree, + enum tree_code, tree, + enum tree_code, bool *); extern tree build_x_unary_op (enum tree_code, tree); extern tree unary_complex_lvalue (enum tree_code, tree); extern tree build_x_conditional_expr (tree, tree, tree); Modified: stable/9/contrib/gcc/cp/decl.c ============================================================================== --- stable/9/contrib/gcc/cp/decl.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/decl.c Thu Dec 12 18:16:46 2013 (r259269) @@ -6702,12 +6702,21 @@ compute_array_index_type (tree name, tre error ("size of array is not an integral constant-expression"); size = integer_one_node; } - else if (pedantic) + else if (pedantic && warn_vla != 0) { if (name) - pedwarn ("ISO C++ forbids variable-size array %qD", name); + pedwarn ("ISO C++ forbids variable length array %qD", name); else - pedwarn ("ISO C++ forbids variable-size array"); + pedwarn ("ISO C++ forbids variable length array"); + } + else if (warn_vla > 0) + { + if (name) + warning (OPT_Wvla, + "variable length array %qD is used", name); + else + warning (OPT_Wvla, + "variable length array is used"); } if (processing_template_decl && !TREE_CONSTANT (size)) Modified: stable/9/contrib/gcc/cp/parser.c ============================================================================== --- stable/9/contrib/gcc/cp/parser.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/parser.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1177,8 +1177,15 @@ typedef enum cp_parser_status_kind typedef struct cp_parser_expression_stack_entry { + /* Left hand side of the binary operation we are currently + parsing. */ tree lhs; + /* Original tree code for left hand side, if it was a binary + expression itself (used for -Wparentheses). */ + enum tree_code lhs_type; + /* Tree code for the binary operation we are parsing. */ enum tree_code tree_type; + /* Precedence of the binary operation we are parsing. */ int prec; } cp_parser_expression_stack_entry; @@ -1536,7 +1543,7 @@ static tree cp_parser_builtin_offsetof /* Statements [gram.stmt.stmt] */ static void cp_parser_statement - (cp_parser *, tree, bool); + (cp_parser *, tree, bool, bool *); static void cp_parser_label_for_labeled_statement (cp_parser *); static tree cp_parser_expression_statement @@ -1546,7 +1553,7 @@ static tree cp_parser_compound_statement static void cp_parser_statement_seq_opt (cp_parser *, tree); static tree cp_parser_selection_statement - (cp_parser *); + (cp_parser *, bool *); static tree cp_parser_condition (cp_parser *); static tree cp_parser_iteration_statement @@ -1559,7 +1566,7 @@ static void cp_parser_declaration_statem (cp_parser *); static tree cp_parser_implicitly_scoped_statement - (cp_parser *); + (cp_parser *, bool *); static void cp_parser_already_scoped_statement (cp_parser *); @@ -5730,12 +5737,13 @@ cp_parser_binary_expression (cp_parser* cp_parser_expression_stack_entry *sp = &stack[0]; tree lhs, rhs; cp_token *token; - enum tree_code tree_type; + enum tree_code tree_type, lhs_type, rhs_type; enum cp_parser_prec prec = PREC_NOT_OPERATOR, new_prec, lookahead_prec; bool overloaded_p; /* Parse the first expression. */ lhs = cp_parser_cast_expression (parser, /*address_p=*/false, cast_p); + lhs_type = ERROR_MARK; for (;;) { @@ -5768,6 +5776,7 @@ cp_parser_binary_expression (cp_parser* /* Extract another operand. It may be the RHS of this expression or the LHS of a new, higher priority expression. */ rhs = cp_parser_simple_cast_expression (parser); + rhs_type = ERROR_MARK; /* Get another operator token. Look up its precedence to avoid building a useless (immediately popped) stack entry for common @@ -5783,8 +5792,10 @@ cp_parser_binary_expression (cp_parser* sp->prec = prec; sp->tree_type = tree_type; sp->lhs = lhs; + sp->lhs_type = lhs_type; sp++; lhs = rhs; + lhs_type = rhs_type; prec = new_prec; new_prec = lookahead_prec; goto get_rhs; @@ -5801,11 +5812,15 @@ cp_parser_binary_expression (cp_parser* prec = sp->prec; tree_type = sp->tree_type; rhs = lhs; + rhs_type = lhs_type; lhs = sp->lhs; + lhs_type = sp->lhs_type; } overloaded_p = false; - lhs = build_x_binary_op (tree_type, lhs, rhs, &overloaded_p); + lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, + &overloaded_p); + lhs_type = tree_type; /* If the binary operator required the use of an overloaded operator, then this expression cannot be an integral constant-expression. @@ -6222,17 +6237,23 @@ cp_parser_builtin_offsetof (cp_parser *p try-block IN_COMPOUND is true when the statement is nested inside a - cp_parser_compound_statement; this matters for certain pragmas. */ + cp_parser_compound_statement; this matters for certain pragmas. + + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in braces + and has an else clause. This is used to implement -Wparentheses. */ static void cp_parser_statement (cp_parser* parser, tree in_statement_expr, - bool in_compound) + bool in_compound, bool *if_p) { tree statement; cp_token *token; location_t statement_location; restart: + if (if_p != NULL) + *if_p = false; /* There is no statement yet. */ statement = NULL_TREE; /* Peek at the next token. */ @@ -6257,7 +6278,7 @@ cp_parser_statement (cp_parser* parser, case RID_IF: case RID_SWITCH: - statement = cp_parser_selection_statement (parser); + statement = cp_parser_selection_statement (parser, if_p); break; case RID_WHILE: @@ -6522,7 +6543,7 @@ cp_parser_statement_seq_opt (cp_parser* break; /* Parse the statement. */ - cp_parser_statement (parser, in_statement_expr, true); + cp_parser_statement (parser, in_statement_expr, true, NULL); } } @@ -6533,14 +6554,22 @@ cp_parser_statement_seq_opt (cp_parser* if ( condition ) statement else statement switch ( condition ) statement - Returns the new IF_STMT or SWITCH_STMT. */ + Returns the new IF_STMT or SWITCH_STMT. + + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in + braces and has an else clause. This is used to implement + -Wparentheses. */ static tree -cp_parser_selection_statement (cp_parser* parser) +cp_parser_selection_statement (cp_parser* parser, bool *if_p) { cp_token *token; enum rid keyword; + if (if_p != NULL) + *if_p = false; + /* Peek at the next token. */ token = cp_parser_require (parser, CPP_KEYWORD, "selection-statement"); @@ -6576,11 +6605,13 @@ cp_parser_selection_statement (cp_parser if (keyword == RID_IF) { + bool nested_if; + /* Add the condition. */ finish_if_stmt_cond (condition, statement); /* Parse the then-clause. */ - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, &nested_if); finish_then_clause (statement); /* If the next token is `else', parse the else-clause. */ @@ -6591,8 +6622,28 @@ cp_parser_selection_statement (cp_parser cp_lexer_consume_token (parser->lexer); begin_else_clause (statement); /* Parse the else-clause. */ - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); finish_else_clause (statement); + + /* If we are currently parsing a then-clause, then + IF_P will not be NULL. We set it to true to + indicate that this if statement has an else clause. + This may trigger the Wparentheses warning below + when we get back up to the parent if statement. */ + if (if_p != NULL) + *if_p = true; + } + else + { + /* This if statement does not have an else clause. If + NESTED_IF is true, then the then-clause is an if + statement which does have an else clause. We warn + about the potential ambiguity. */ + if (nested_if) + warning (OPT_Wparentheses, + ("%Hsuggest explicit braces " + "to avoid ambiguous %"), + EXPR_LOCUS (statement)); } /* Now we're all done with the if-statement. */ @@ -6611,7 +6662,7 @@ cp_parser_selection_statement (cp_parser in_statement = parser->in_statement; parser->in_switch_statement_p = true; parser->in_statement |= IN_SWITCH_STMT; - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); parser->in_switch_statement_p = in_switch_statement_p; parser->in_statement = in_statement; @@ -6789,7 +6840,7 @@ cp_parser_iteration_statement (cp_parser statement = begin_do_stmt (); /* Parse the body of the do-statement. */ parser->in_statement = IN_ITERATION_STMT; - cp_parser_implicitly_scoped_statement (parser); + cp_parser_implicitly_scoped_statement (parser, NULL); parser->in_statement = in_statement; finish_do_body (statement); /* Look for the `while' keyword. */ @@ -7031,13 +7082,21 @@ cp_parser_declaration_statement (cp_pars but ensures that is in its own scope, even if it is not a compound-statement. + If IF_P is not NULL, *IF_P is set to indicate whether the statement + is a (possibly labeled) if statement which is not enclosed in + braces and has an else clause. This is used to implement + -Wparentheses. + Returns the new statement. */ static tree -cp_parser_implicitly_scoped_statement (cp_parser* parser) +cp_parser_implicitly_scoped_statement (cp_parser* parser, bool *if_p) { tree statement; + if (if_p != NULL) + *if_p = false; + /* Mark if () ; with a special NOP_EXPR. */ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)) { @@ -7053,7 +7112,7 @@ cp_parser_implicitly_scoped_statement (c /* Create a compound-statement. */ statement = begin_compound_stmt (0); /* Parse the dependent-statement. */ - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, if_p); /* Finish the dummy compound-statement. */ finish_compound_stmt (statement); } @@ -7072,7 +7131,7 @@ cp_parser_already_scoped_statement (cp_p { /* If the token is a `{', then we must take special action. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)) - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); else { /* Avoid calling cp_parser_compound_statement, so that we @@ -18645,7 +18704,7 @@ cp_parser_omp_structured_block (cp_parse tree stmt = begin_omp_structured_block (); unsigned int save = cp_parser_begin_omp_structured_block (parser); - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); cp_parser_end_omp_structured_block (parser, save); return finish_omp_structured_block (stmt); @@ -18890,7 +18949,7 @@ cp_parser_omp_for_loop (cp_parser *parse /* Note that the grammar doesn't call for a structured block here, though the loop as a whole is a structured block. */ body = push_stmt_list (); - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); body = pop_stmt_list (body); return finish_omp_for (loc, decl, init, cond, incr, body, pre_body); @@ -18983,7 +19042,7 @@ cp_parser_omp_sections_scope (cp_parser while (1) { - cp_parser_statement (parser, NULL_TREE, false); + cp_parser_statement (parser, NULL_TREE, false, NULL); tok = cp_lexer_peek_token (parser->lexer); if (tok->pragma_kind == PRAGMA_OMP_SECTION) Modified: stable/9/contrib/gcc/cp/pt.c ============================================================================== --- stable/9/contrib/gcc/cp/pt.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/pt.c Thu Dec 12 18:16:46 2013 (r259269) @@ -9078,7 +9078,13 @@ tsubst_copy_and_build (tree t, return build_x_binary_op (TREE_CODE (t), RECUR (TREE_OPERAND (t, 0)), + (TREE_NO_WARNING (TREE_OPERAND (t, 0)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 0))), RECUR (TREE_OPERAND (t, 1)), + (TREE_NO_WARNING (TREE_OPERAND (t, 1)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 1))), /*overloaded_p=*/NULL); case SCOPE_REF: @@ -9087,7 +9093,14 @@ tsubst_copy_and_build (tree t, case ARRAY_REF: op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0), args, complain, in_decl); - return build_x_binary_op (ARRAY_REF, op1, RECUR (TREE_OPERAND (t, 1)), + return build_x_binary_op (ARRAY_REF, op1, + (TREE_NO_WARNING (TREE_OPERAND (t, 0)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 0))), + RECUR (TREE_OPERAND (t, 1)), + (TREE_NO_WARNING (TREE_OPERAND (t, 1)) + ? ERROR_MARK + : TREE_CODE (TREE_OPERAND (t, 1))), /*overloaded_p=*/NULL); case SIZEOF_EXPR: Modified: stable/9/contrib/gcc/cp/semantics.c ============================================================================== --- stable/9/contrib/gcc/cp/semantics.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/semantics.c Thu Dec 12 18:16:46 2013 (r259269) @@ -587,6 +587,16 @@ maybe_convert_cond (tree cond) /* Do the conversion. */ cond = convert_from_reference (cond); + + if (TREE_CODE (cond) == MODIFY_EXPR + && !TREE_NO_WARNING (cond) + && warn_parentheses) + { + warning (OPT_Wparentheses, + "suggest parentheses around assignment used as truth value"); + TREE_NO_WARNING (cond) = 1; + } + return condition_conversion (cond); } Modified: stable/9/contrib/gcc/cp/tree.c ============================================================================== --- stable/9/contrib/gcc/cp/tree.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/tree.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1762,6 +1762,14 @@ pod_type_p (tree t) return 1; } +/* Nonzero iff type T is a class template implicit specialization. */ + +bool +class_tmpl_impl_spec_p (tree t) +{ + return CLASS_TYPE_P (t) && CLASSTYPE_TEMPLATE_INSTANTIATION (t); +} + /* Returns 1 iff zero initialization of type T means actually storing zeros in it. */ Modified: stable/9/contrib/gcc/cp/typeck.c ============================================================================== --- stable/9/contrib/gcc/cp/typeck.c Thu Dec 12 18:15:32 2013 (r259268) +++ stable/9/contrib/gcc/cp/typeck.c Thu Dec 12 18:16:46 2013 (r259269) @@ -1690,17 +1690,20 @@ rationalize_conditional_expr (enum tree_ are equal, so we know what conditional expression this used to be. */ if (TREE_CODE (t) == MIN_EXPR || TREE_CODE (t) == MAX_EXPR) { + tree op0 = TREE_OPERAND (t, 0); + tree op1 = TREE_OPERAND (t, 1); + /* The following code is incorrect if either operand side-effects. */ - gcc_assert (!TREE_SIDE_EFFECTS (TREE_OPERAND (t, 0)) - && !TREE_SIDE_EFFECTS (TREE_OPERAND (t, 1))); + gcc_assert (!TREE_SIDE_EFFECTS (op0) + && !TREE_SIDE_EFFECTS (op1)); return build_conditional_expr (build_x_binary_op ((TREE_CODE (t) == MIN_EXPR ? LE_EXPR : GE_EXPR), - TREE_OPERAND (t, 0), - TREE_OPERAND (t, 1), + op0, TREE_CODE (op0), + op1, TREE_CODE (op1), /*overloaded_p=*/NULL), - build_unary_op (code, TREE_OPERAND (t, 0), 0), - build_unary_op (code, TREE_OPERAND (t, 1), 0)); + build_unary_op (code, op0, 0), + build_unary_op (code, op1, 0)); } return @@ -2908,8 +2911,8 @@ convert_arguments (tree typelist, tree v conversions on the operands. CODE is the kind of expression to build. */ tree -build_x_binary_op (enum tree_code code, tree arg1, tree arg2, - bool *overloaded_p) +build_x_binary_op (enum tree_code code, tree arg1, enum tree_code arg1_code, + tree arg2, enum tree_code arg2_code, bool *overloaded_p) { tree orig_arg1; tree orig_arg2; @@ -2933,6 +2936,17 @@ build_x_binary_op (enum tree_code code, expr = build_new_op (code, LOOKUP_NORMAL, arg1, arg2, NULL_TREE, overloaded_p); + /* Check for cases such as x+y< Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5EE633B; Thu, 12 Dec 2013 18:29:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 784B21AC5; Thu, 12 Dec 2013 18:29:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCITbQo026020; Thu, 12 Dec 2013 18:29:37 GMT (envelope-from loos@svn.freebsd.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCITa3f026016; Thu, 12 Dec 2013 18:29:36 GMT (envelope-from loos@svn.freebsd.org) Message-Id: <201312121829.rBCITa3f026016@svn.freebsd.org> From: Luiz Otavio O Souza Date: Thu, 12 Dec 2013 18:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259270 - in head/sys/arm: freescale/imx ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 18:29:37 -0000 Author: loos Date: Thu Dec 12 18:29:36 2013 New Revision: 259270 URL: http://svnweb.freebsd.org/changeset/base/259270 Log: After r256961 ofw_iicbuc.c will be built for any kernel which includes options 'iicbus' and 'fdt'. Remove the (now) unnecessary entries. Verified on BBB (am335x), EFIKA_MX (imx51 - by ray@), DIGI-CCWMX53 (imx53 - kernel build). Approved by: adrian (mentor) Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/ti/files.ti Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Thu Dec 12 18:16:46 2013 (r259269) +++ head/sys/arm/freescale/imx/files.imx51 Thu Dec 12 18:29:36 2013 (r259270) @@ -46,7 +46,6 @@ arm/freescale/imx/imx_wdog.c optional i # i2c arm/freescale/imx/i2c.c optional fsliic -dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Thu Dec 12 18:16:46 2013 (r259269) +++ head/sys/arm/freescale/imx/files.imx53 Thu Dec 12 18:29:36 2013 (r259270) @@ -46,7 +46,6 @@ arm/freescale/imx/imx_wdog.c optional i # i2c arm/freescale/imx/i2c.c optional fsliic -dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Thu Dec 12 18:16:46 2013 (r259269) +++ head/sys/arm/freescale/imx/files.imx6 Thu Dec 12 18:29:36 2013 (r259270) @@ -51,6 +51,5 @@ arm/freescale/imx/imx6_usbphy.c optiona #arm/freescale/imx/imx51_gpio.c optional gpio #dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/i2c.c optional fsliic -#dev/ofw/ofw_iicbus.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/ti/files.ti ============================================================================== --- head/sys/arm/ti/files.ti Thu Dec 12 18:16:46 2013 (r259269) +++ head/sys/arm/ti/files.ti Thu Dec 12 18:29:36 2013 (r259270) @@ -22,7 +22,6 @@ arm/ti/ti_pruss.c standard arm/ti/ti_gpio.c optional gpio arm/ti/ti_i2c.c optional ti_i2c -dev/ofw/ofw_iicbus.c optional iicbus dev/uart/uart_dev_ti8250.c optional uart dev/uart/uart_dev_ns8250.c optional uart From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 19:01:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5144CC8A; Thu, 12 Dec 2013 19:01:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3D2DB1E45; Thu, 12 Dec 2013 19:01:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCJ1pRv039440; Thu, 12 Dec 2013 19:01:51 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCJ1pmL039439; Thu, 12 Dec 2013 19:01:51 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121901.rBCJ1pmL039439@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 19:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259271 - stable/10/contrib/gcclibs/libcpp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:01:51 -0000 Author: pfg Date: Thu Dec 12 19:01:50 2013 New Revision: 259271 URL: http://svnweb.freebsd.org/changeset/base/259271 Log: MFC r258712; libcpp: fix an underflow. Similar fix seen in Apple's gcc42. Obtained from: OpenBSD (Rev 1.2) MFC after: 2 weeks Modified: stable/10/contrib/gcclibs/libcpp/charset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gcclibs/libcpp/charset.c ============================================================================== --- stable/10/contrib/gcclibs/libcpp/charset.c Thu Dec 12 18:29:36 2013 (r259270) +++ stable/10/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:01:50 2013 (r259271) @@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ - if (to.text[to.len - 1] == '\r') + if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else to.text[to.len] = '\n'; From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 19:02:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53F90E24; Thu, 12 Dec 2013 19:02:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3FE8F1E4F; Thu, 12 Dec 2013 19:02:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCJ2JtC039557; Thu, 12 Dec 2013 19:02:19 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCJ2JMs039556; Thu, 12 Dec 2013 19:02:19 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121902.rBCJ2JMs039556@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 19:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259272 - stable/9/contrib/gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:02:19 -0000 Author: pfg Date: Thu Dec 12 19:02:18 2013 New Revision: 259272 URL: http://svnweb.freebsd.org/changeset/base/259272 Log: MFC r258712; libcpp: fix an underflow. Similar fix seen in Apple's gcc42. Obtained from: OpenBSD (Rev 1.2) MFC after: 2 weeks Modified: stable/9/contrib/gcclibs/libcpp/charset.c Directory Properties: stable/9/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/charset.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:01:50 2013 (r259271) +++ stable/9/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:02:18 2013 (r259272) @@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ - if (to.text[to.len - 1] == '\r') + if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else to.text[to.len] = '\n'; From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 19:02:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84712F68; Thu, 12 Dec 2013 19:02:42 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08DD71E57; Thu, 12 Dec 2013 19:02:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBCJ2UsW095290; Thu, 12 Dec 2013 21:02:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBCJ2UsW095290 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBCJ2Uoo095289; Thu, 12 Dec 2013 21:02:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Dec 2013 21:02:30 +0200 From: Konstantin Belousov To: Aleksandr Rybalko Subject: Re: svn commit: r259261 - head/sys/dev/drm2 Message-ID: <20131212190230.GU59496@kib.kiev.ua> References: <201312121449.rBCEnRRQ045690@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BhuKUG3dHSy3oxDJ" Content-Disposition: inline In-Reply-To: <201312121449.rBCEnRRQ045690@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:02:42 -0000 --BhuKUG3dHSy3oxDJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 12, 2013 at 02:49:27PM +0000, Aleksandr Rybalko wrote: > Author: ray > Date: Thu Dec 12 14:49:26 2013 > New Revision: 259261 > URL: http://svnweb.freebsd.org/changeset/base/259261 >=20 > Log: > Do not try to probe/attach if attempt to add fbd child are failed. > =20 > Sponsored by: The FreeBSD Foundation >=20 > Modified: > head/sys/dev/drm2/drm_fb_helper.c >=20 > Modified: head/sys/dev/drm2/drm_fb_helper.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:37:25 2013 (r259260) > +++ head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:49:26 2013 (r259261) > @@ -1043,7 +1043,10 @@ int drm_fb_helper_single_fb_probe(struct > =20 > kdev =3D fb_helper->dev->device; > fbd =3D device_add_child(kdev, "fbd", device_get_unit(kdev)); > - ret =3D device_probe_and_attach(fbd); > + if (fbd !=3D NULL)=20 > + ret =3D device_probe_and_attach(fbd); > + else > + ret =3D ENODEV; This must be -ENODEV, since linux layer operates on negative values for error. The error is negated in the drm layer, which would result in non-existent errno returned to FreeBSD code. Also, the #ifdef __FreeBSD braces in the file are not useful, please remove them. > #ifdef DEV_VT > if (ret !=3D 0) > DRM_ERROR("Failed to attach fbd device: %d\n", ret); --BhuKUG3dHSy3oxDJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSqghFAAoJEJDCuSvBvK1B6X0P/1UOq9aWIYUxjzMDG4HVXa6u +v9WI63f4yCHMKX/HtmZTX5rLI0amcNXXzJ4VFIKyytVEbZWem/5BY7KOUe8tnqK +AR5ArCD5lqRl4jVYPv/L862dXnHQc0P2T3x0kupGETGbA/ImL9QPTUXXJc8deGD i5tcQL6IyxtGFbBgfQMl8XnNkuvCqAt4JmEMi3WVy1neXjzSRobsOzW06hZNVxhb GN3x131o5GoLSP05zjg+VAbE0OtOJrQ78hTvFq6mED7SBIQpXhrSNgdUVuHzQcgm p2it9diWKvOW6O7eRkfVLaYUjnmpXW1ORxCwc2C2QDp7WhdaZXQTpZqT4HoST8Ij 3yWlRvuN1ug1DsAOF6cSXEPTYrp4JThKTDFrIV9FqoNRyevWIghCnxAJJ29yYUij j8psf80Jl510DHRfaAnnxTU2I998r7PpkC3a7FzaSv8J7gLvao2XgE+4cyplN9l+ 0+iB9c07hJ9DC4/rzaxr/MtXegPA+Lp+eBLkdSNztzDLNx+BJ/GBo/4beCfXJEYy /mgoXwBN18XbKgLJhaQ2Hy0zqqxnI8ShtJmCW7BreIorVqS0Vd4yplU5Sb5EAsHy 4n++aljh2rgxjW97fbErAw74v69FhSeX7f3IhWgfoY2Hzhlz6FL7sY1+YJyR2HOY P+IiOmY/gRgCvvaaz3Xb =zl8g -----END PGP SIGNATURE----- --BhuKUG3dHSy3oxDJ-- From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 19:02:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 084D1F6A; Thu, 12 Dec 2013 19:02:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8BDF1E58; Thu, 12 Dec 2013 19:02:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCJ2g0G039642; Thu, 12 Dec 2013 19:02:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCJ2gDZ039641; Thu, 12 Dec 2013 19:02:42 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312121902.rBCJ2gDZ039641@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Dec 2013 19:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r259273 - stable/8/contrib/gcclibs/libcpp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:02:43 -0000 Author: pfg Date: Thu Dec 12 19:02:42 2013 New Revision: 259273 URL: http://svnweb.freebsd.org/changeset/base/259273 Log: MFC r258712; libcpp: fix an underflow. Similar fix seen in Apple's gcc42. Obtained from: OpenBSD (Rev 1.2) MFC after: 2 weeks Modified: stable/8/contrib/gcclibs/libcpp/charset.c Directory Properties: stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/gcclibs/ (props changed) Modified: stable/8/contrib/gcclibs/libcpp/charset.c ============================================================================== --- stable/8/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:02:18 2013 (r259272) +++ stable/8/contrib/gcclibs/libcpp/charset.c Thu Dec 12 19:02:42 2013 (r259273) @@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, c terminate with another \r, not an \n, so that we do not mistake the \r\n sequence for a single DOS line ending and erroneously issue the "No newline at end of file" diagnostic. */ - if (to.text[to.len - 1] == '\r') + if (to.len > 0 && to.text[to.len - 1] == '\r') to.text[to.len] = '\r'; else to.text[to.len] = '\n'; From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 19:18:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55509825 for ; Thu, 12 Dec 2013 19:18:32 +0000 (UTC) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) by mx1.freebsd.org (Postfix) with SMTP id E84C71F7C for ; Thu, 12 Dec 2013 19:18:31 +0000 (UTC) Received: from [98.139.212.152] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 12 Dec 2013 19:12:01 -0000 Received: from [98.139.211.196] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 12 Dec 2013 19:12:01 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 12 Dec 2013 19:12:01 -0000 X-Yahoo-Newman-Id: 108836.94461.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: xhTQvFEVM1mZejc0F0Y0w4Pkk89Kgo5IrHaN4Ld5LMykleU WZmISNuC5jzUTkoPWU1rb2gay_quVV_ux9lI.uTNjKQCEhHCQ7KBUWWUY.7Y ZoyVNvUOzRE2Di.K2DBjTLGdnpuLv1hGRKEFTKk6JMh99Rqa58FKHJXAkwuE tnR5VWilUovUJgVhDZeR_NtjG061py6ayVjCaft1KX1S6O5reGFlBI9DlHC8 QB1dLFcAdEYGZgcAj294To8NUg4KOAvJDmvXukBv7.oiGNzn_L6gweHeEY_i l5IwBieoSA1hadlx0H110_ufdNzFsgulCb0NxIMc2LxmZUZ9xWK71OeLKF0g tzOsfj6RlutILa.AMejert33wdEnNUQQlFoEXlvhFj6pAXo3nPF9SRLjvXSV C_BUekn_JrM6pyy2_WridlFVJlMllw.H8Ma8pGynwhC0Hyb9N0.kV2zBVpU1 288sbJy.qLPExDL1v6xN8nmmzmvugtu_s5tLZ5IYoB0KNYTho7cnhxpEBsyr mdYRgDipXvpYaWwj.tJNYojY3tdGaXcAq.lJd6rxwmQztf0AZOdXC0sPFVDa eYpgmCU0ZZsytJNwfqgRDohXNqMsi.Gm.X3eiNOM8h2lc6hOvTJcgscVtULL hRg7rMYPEyc3b52YLxBmArSUxkg-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.138.105.21]) by smtp205.mail.bf1.yahoo.com with SMTP; 12 Dec 2013 11:12:00 -0800 PST Message-ID: <52AA0A7B.3000909@FreeBSD.org> Date: Thu, 12 Dec 2013 14:11:55 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r259272 - stable/9/contrib/gcclibs/libcpp References: <201312121902.rBCJ2JMs039556@svn.freebsd.org> In-Reply-To: <201312121902.rBCJ2JMs039556@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 19:18:32 -0000 On 12.12.2013 14:02, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Dec 12 19:02:18 2013 > New Revision: 259272 > URL: http://svnweb.freebsd.org/changeset/base/259272 > > Log: > MFC r258712; > > libcpp: fix an underflow. > > Similar fix seen in Apple's gcc42. > > Obtained from: OpenBSD (Rev 1.2) > MFC after: 2 weeks > > Oops.. will obviously not be MFC'd again :-P. From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 20:20:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96DA6BF3; Thu, 12 Dec 2013 20:20:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8175914C3; Thu, 12 Dec 2013 20:20:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCKKkDi066710; Thu, 12 Dec 2013 20:20:46 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCKKk5a066709; Thu, 12 Dec 2013 20:20:46 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312122020.rBCKKk5a066709@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 12 Dec 2013 20:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259274 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 20:20:46 -0000 Author: rodrigc Date: Thu Dec 12 20:20:46 2013 New Revision: 259274 URL: http://svnweb.freebsd.org/changeset/base/259274 Log: Mention BIND removal in release notes. Submitted by: skreuzer Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 12 19:02:42 2013 (r259273) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 12 20:20:46 2013 (r259274) @@ -328,6 +328,13 @@ Userland Changes + BIND has been replaced by &man.unbound.8; for + local dns resolution in the base system. With this change, nslookup + and dig are no longer a part of the base system. Users should + instead use &man.host.1; and &man.drill.1; Alternatively, + nslookup and dig can be obtained by installing the + dns/bind-tools port. + The &man.adduser.8; utility now supports a option to set the mode of a new user's home directory. From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 20:34:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78C66FB5; Thu, 12 Dec 2013 20:34:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 658C515CC; Thu, 12 Dec 2013 20:34:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCKY5MH072456; Thu, 12 Dec 2013 20:34:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCKY5hq072455; Thu, 12 Dec 2013 20:34:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201312122034.rBCKY5hq072455@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Dec 2013 20:34:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259275 - head/usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 20:34:05 -0000 Author: jhb Date: Thu Dec 12 20:34:04 2013 New Revision: 259275 URL: http://svnweb.freebsd.org/changeset/base/259275 Log: Add a command to inject an NMI on a specific vcpu. It is a simple wrapper around the existing vm_inject_nmi(). Reviewed by: grehan, neel Modified: head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Thu Dec 12 20:20:46 2013 (r259274) +++ head/usr.sbin/bhyvectl/bhyvectl.c Thu Dec 12 20:34:04 2013 (r259275) @@ -189,12 +189,14 @@ usage(void) " [--set-mem=]\n" " [--get-lowmem]\n" " [--get-highmem]\n" - " [--get-gpa-pmap]\n", + " [--get-gpa-pmap]\n" + " [--inject-nmi]\n", progname); exit(1); } static int get_stats, getcap, setcap, capval, get_gpa_pmap; +static int inject_nmi; static const char *capname; static int create, destroy, get_lowmem, get_highmem; static uint64_t memsize; @@ -557,6 +559,7 @@ main(int argc, char *argv[]) { "run", NO_ARG, &run, 1 }, { "create", NO_ARG, &create, 1 }, { "destroy", NO_ARG, &destroy, 1 }, + { "inject-nmi", NO_ARG, &inject_nmi, 1 }, { NULL, 0, NULL, 0 } }; @@ -825,6 +828,10 @@ main(int argc, char *argv[]) vmcs_entry_interruption_info); } + if (!error && inject_nmi) { + error = vm_inject_nmi(ctx, vcpu); + } + if (!error && (get_lowmem || get_all)) { gpa = 0; error = vm_get_memory_seg(ctx, gpa, &len, &wired); From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 20:47:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1AF2A26; Thu, 12 Dec 2013 20:47:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CE2A0174F; Thu, 12 Dec 2013 20:47:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCKlIGb076373; Thu, 12 Dec 2013 20:47:18 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCKlIre076372; Thu, 12 Dec 2013 20:47:18 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201312122047.rBCKlIre076372@svn.freebsd.org> From: Devin Teske Date: Thu, 12 Dec 2013 20:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259276 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 20:47:19 -0000 Author: dteske Date: Thu Dec 12 20:47:18 2013 New Revision: 259276 URL: http://svnweb.freebsd.org/changeset/base/259276 Log: I caught the following snippet at the end of my /var/log/bsdinstall_log: === DEBUG: Running installation step: services local: Not in a function /usr/libexec/bsdinstall/services: cannot create : Read-only file system /usr/libexec/bsdinstall/services: /tmp/bsdinstall/etc/rc.conf.services: \ Permission denied === The `local: Not in a function' is obvious, and was introduced by myself in SVN revision 256348. The latter two are caused by the attempt to use "\" to continue the line after using the ">>" redirect. This appears to attempt to write a file with the name " " in the current directory and subsequently attempts to execute the file that was originally intended for writing (which is not executable; hence the `Permission denied'). That was introduced in SVN r228192 about 2 years ago, apparently unnoticed until I started going over the debug outputs very carefully. MFC after: 3 days Modified: head/usr.sbin/bsdinstall/scripts/services Modified: head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- head/usr.sbin/bsdinstall/scripts/services Thu Dec 12 20:34:04 2013 (r259275) +++ head/usr.sbin/bsdinstall/scripts/services Thu Dec 12 20:47:18 2013 (r259276) @@ -50,13 +50,12 @@ DAEMONS=$(dialog --backtitle "FreeBSD In 2>&1 1>&3) exec 3>&- -local havedump= +havedump= for daemon in $DAEMONS; do if [ "$daemon" == "dumpdev" ]; then havedump=1 - echo \# Set dumpdev to \"AUTO\" to enable crash dumps, \ - \"NO\" to disable >> \ - $BSDINSTALL_TMPETC/rc.conf.services + echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \ + 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services echo dumpdev=\"AUTO\" >> $BSDINSTALL_TMPETC/rc.conf.services continue fi From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 21:51:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AD6F6F0; Thu, 12 Dec 2013 21:51:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 761A11C98; Thu, 12 Dec 2013 21:51:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCLpYqv000706; Thu, 12 Dec 2013 21:51:34 GMT (envelope-from rodrigc@svn.freebsd.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCLpY6E000705; Thu, 12 Dec 2013 21:51:34 GMT (envelope-from rodrigc@svn.freebsd.org) Message-Id: <201312122151.rBCLpY6E000705@svn.freebsd.org> From: Craig Rodrigues Date: Thu, 12 Dec 2013 21:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259277 - stable/10/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 21:51:34 -0000 Author: rodrigc Date: Thu Dec 12 21:51:33 2013 New Revision: 259277 URL: http://svnweb.freebsd.org/changeset/base/259277 Log: MFC r259274 Mention BIND removal in release notes. Submitted by: skreuzer Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Directory Properties: stable/10/ (props changed) Modified: stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 12 20:47:18 2013 (r259276) +++ stable/10/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Dec 12 21:51:33 2013 (r259277) @@ -328,6 +328,13 @@ Userland Changes + BIND has been replaced by &man.unbound.8; for + local dns resolution in the base system. With this change, nslookup + and dig are no longer a part of the base system. Users should + instead use &man.host.1; and &man.drill.1; Alternatively, + nslookup and dig can be obtained by installing the + dns/bind-tools port. + The &man.adduser.8; utility now supports a option to set the mode of a new user's home directory. From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 22:01:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11DB0BCC; Thu, 12 Dec 2013 22:01:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F10071D5A; Thu, 12 Dec 2013 22:01:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCM1gup004600; Thu, 12 Dec 2013 22:01:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCM1grq004599; Thu, 12 Dec 2013 22:01:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312122201.rBCM1grq004599@svn.freebsd.org> From: Dimitry Andric Date: Thu, 12 Dec 2013 22:01:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259278 - releng/10.0/contrib/llvm/tools/clang/lib/CodeGen X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 22:01:43 -0000 Author: dim Date: Thu Dec 12 22:01:42 2013 New Revision: 259278 URL: http://svnweb.freebsd.org/changeset/base/259278 Log: Merge r259214 from stable/10 (head r259100): Pull in r196658 from upstream clang trunk: CodeGen: Don't emit linkage on thunks that aren't emitted because they're vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. [LLVM] PR18098. This should fix clang "Broken module found, compilation aborted" errors when building the qt4-based dvbcut port. Reported by: se Approved by: re (glebius) Modified: releng/10.0/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp ============================================================================== --- releng/10.0/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Thu Dec 12 21:51:33 2013 (r259277) +++ releng/10.0/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp Thu Dec 12 22:01:42 2013 (r259278) @@ -454,10 +454,9 @@ void CodeGenVTables::EmitThunk(GlobalDec } else { // Normal thunk body generation. CodeGenFunction(CGM).GenerateThunk(ThunkFn, FnInfo, GD, Thunk); + if (UseAvailableExternallyLinkage) + ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } - - if (UseAvailableExternallyLinkage) - ThunkFn->setLinkage(llvm::GlobalValue::AvailableExternallyLinkage); } void CodeGenVTables::MaybeEmitThunkAvailableExternally(GlobalDecl GD, From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 22:04:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A492EF93; Thu, 12 Dec 2013 22:04:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7661D1D84; Thu, 12 Dec 2013 22:04:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCM4mY7005128; Thu, 12 Dec 2013 22:04:48 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCM4mU7005127; Thu, 12 Dec 2013 22:04:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201312122204.rBCM4mU7005127@svn.freebsd.org> From: Dimitry Andric Date: Thu, 12 Dec 2013 22:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259279 - releng/10.0/contrib/gcc/config/i386 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 22:04:48 -0000 Author: dim Date: Thu Dec 12 22:04:47 2013 New Revision: 259279 URL: http://svnweb.freebsd.org/changeset/base/259279 Log: Merge r259216 from stable/10 (head r259111): Use correct casts in gcc's emmintrin.h for the first arguments of the following builtin functions: * __builtin_ia32_pslldi128() takes __v4si instead of __v8hi * __builtin_ia32_psllqi128() takes __v2di instead of __v8hi * __builtin_ia32_psradi128() takes __v4si instead of __v8hi This should fix the following errors when building the LINT kernel with gcc: sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of '__builtin_ia32_psradi128' sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of '__builtin_ia32_pslldi128' Approved by: re (glebius) Modified: releng/10.0/contrib/gcc/config/i386/emmintrin.h Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/contrib/gcc/config/i386/emmintrin.h ============================================================================== --- releng/10.0/contrib/gcc/config/i386/emmintrin.h Thu Dec 12 22:01:42 2013 (r259278) +++ releng/10.0/contrib/gcc/config/i386/emmintrin.h Thu Dec 12 22:04:47 2013 (r259279) @@ -1126,9 +1126,9 @@ _mm_slli_epi64 (__m128i __A, int __B) #define _mm_slli_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psllwi128 ((__v8hi)(__A), __B)) #define _mm_slli_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_pslldi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_pslldi128 ((__v4si)(__A), __B)) #define _mm_slli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psllqi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psllqi128 ((__v2di)(__A), __B)) #endif #if 0 @@ -1147,7 +1147,7 @@ _mm_srai_epi32 (__m128i __A, int __B) #define _mm_srai_epi16(__A, __B) \ ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) #define _mm_srai_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) + ((__m128i)__builtin_ia32_psradi128 ((__v4si)(__A), __B)) #endif #if 0 From owner-svn-src-all@FreeBSD.ORG Thu Dec 12 22:33:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE72AA7A; Thu, 12 Dec 2013 22:33:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4C11031; Thu, 12 Dec 2013 22:33:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBCMXWFM015942; Thu, 12 Dec 2013 22:33:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBCMXW2Z015941; Thu, 12 Dec 2013 22:33:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201312122233.rBCMXW2Z015941@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 12 Dec 2013 22:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259280 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2013 22:33:32 -0000 Author: glebius Date: Thu Dec 12 22:33:32 2013 New Revision: 259280 URL: http://svnweb.freebsd.org/changeset/base/259280 Log: Somehow stable/10 branch contains correct version, but head doesn't. Modified: head/sbin/growfs/growfs.8 Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Thu Dec 12 22:04:47 2013 (r259279) +++ head/sbin/growfs/growfs.8 Thu Dec 12 22:33:32 2013 (r259280) @@ -116,7 +116,7 @@ The utility first appeared in .Fx 4.4 . The ability to resize mounted filesystems was added in -.Fx 9.2 . +.Fx 10.0 . .Sh AUTHORS .An Christoph Herrmann Aq chm@FreeBSD.org .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 00:56:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD918485; Fri, 13 Dec 2013 00:56:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8A4019CB; Fri, 13 Dec 2013 00:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD0u5kS066381; Fri, 13 Dec 2013 00:56:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD0u5Oq066380; Fri, 13 Dec 2013 00:56:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312130056.rBD0u5Oq066380@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Dec 2013 00:56:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259281 - stable/10/usr.sbin/mtest X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 00:56:05 -0000 Author: eadler Date: Fri Dec 13 00:56:05 2013 New Revision: 259281 URL: http://svnweb.freebsd.org/changeset/base/259281 Log: MFC r259156: mtest(8): use correct macro in mdoc The An macros is used for authors while the Ar macro is used for arguments. AFAIK mcast-addr and ifname are not authors. PR: docs/184649 Modified: stable/10/usr.sbin/mtest/mtest.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/mtest/mtest.8 ============================================================================== --- stable/10/usr.sbin/mtest/mtest.8 Thu Dec 12 22:33:32 2013 (r259280) +++ stable/10/usr.sbin/mtest/mtest.8 Fri Dec 13 00:56:05 2013 (r259281) @@ -131,9 +131,9 @@ to allow traffic from source Print .Ar n source filter entries for -.An mcast-addr +.Ar mcast-addr on interface -.An ifname . +.Ar ifname . .\" .Pp .It Ic f Ar filename From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 01:35:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39F2D921; Fri, 13 Dec 2013 01:35:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2421E1DBC; Fri, 13 Dec 2013 01:35:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD1ZWnt081214; Fri, 13 Dec 2013 01:35:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD1ZWlH081213; Fri, 13 Dec 2013 01:35:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312130135.rBD1ZWlH081213@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Dec 2013 01:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259282 - stable/9/usr.sbin/mtest X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 01:35:32 -0000 Author: eadler Date: Fri Dec 13 01:35:31 2013 New Revision: 259282 URL: http://svnweb.freebsd.org/changeset/base/259282 Log: mtest(8): use correct macro in mdoc The An macros is used for authors while the Ar macro is used for arguments. AFAIK mcast-addr and ifname are not authors. PR: docs/184649 Modified: stable/9/usr.sbin/mtest/mtest.8 Directory Properties: stable/9/usr.sbin/mtest/ (props changed) Modified: stable/9/usr.sbin/mtest/mtest.8 ============================================================================== --- stable/9/usr.sbin/mtest/mtest.8 Fri Dec 13 00:56:05 2013 (r259281) +++ stable/9/usr.sbin/mtest/mtest.8 Fri Dec 13 01:35:31 2013 (r259282) @@ -131,9 +131,9 @@ to allow traffic from source Print .Ar n source filter entries for -.An mcast-addr +.Ar mcast-addr on interface -.An ifname . +.Ar ifname . .\" .Pp .It Ic f Ar filename From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 02:21:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A8EDE1C; Fri, 13 Dec 2013 02:21:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 668861162; Fri, 13 Dec 2013 02:21:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD2LXBn099329; Fri, 13 Dec 2013 02:21:33 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD2LXYd099328; Fri, 13 Dec 2013 02:21:33 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312130221.rBD2LXYd099328@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 02:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259283 - stable/9/contrib/libstdc++/include/std X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 02:21:33 -0000 Author: pfg Date: Fri Dec 13 02:21:32 2013 New Revision: 259283 URL: http://svnweb.freebsd.org/changeset/base/259283 Log: MFC r244673: Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t. This seems to be needed by newer compilers. Modified: stable/9/contrib/libstdc++/include/std/std_limits.h Directory Properties: stable/9/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/libstdc++/include/std/std_limits.h ============================================================================== --- stable/9/contrib/libstdc++/include/std/std_limits.h Fri Dec 13 01:35:31 2013 (r259282) +++ stable/9/contrib/libstdc++/include/std/std_limits.h Fri Dec 13 02:21:32 2013 (r259283) @@ -134,10 +134,11 @@ #define __glibcxx_signed(T) ((T)(-1) < 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << 1) : (T)0) #define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0) + (__glibcxx_signed (T) ? \ + (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits(T) \ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 02:37:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE69C419; Fri, 13 Dec 2013 02:37:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 97CCA124B; Fri, 13 Dec 2013 02:37:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD2bcHp003847; Fri, 13 Dec 2013 02:37:38 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD2bZm6003830; Fri, 13 Dec 2013 02:37:35 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312130237.rBD2bZm6003830@svn.freebsd.org> From: Justin Hibbits Date: Fri, 13 Dec 2013 02:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259284 - in head/sys: conf powerpc/aim powerpc/cpufreq powerpc/include powerpc/powermac powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 02:37:38 -0000 Author: jhibbits Date: Fri Dec 13 02:37:35 2013 New Revision: 259284 URL: http://svnweb.freebsd.org/changeset/base/259284 Log: Add PMU-based CPU frequency scaling. This method is used on most Titanium PowerBooks. MFC after: 1 month Added: head/sys/powerpc/cpufreq/pmufreq.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/include/cpu.h head/sys/powerpc/include/dbdma.h head/sys/powerpc/include/pcpu.h head/sys/powerpc/include/spr.h head/sys/powerpc/powermac/platform_powermac.c head/sys/powerpc/powermac/pmu.c head/sys/powerpc/powermac/pmuvar.h head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powermac/uninorthvar.h head/sys/powerpc/powermac/viareg.h head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/conf/files.powerpc Fri Dec 13 02:37:35 2013 (r259284) @@ -107,6 +107,7 @@ powerpc/booke/pmap.c optional booke powerpc/booke/trap.c optional booke powerpc/cpufreq/dfs.c optional cpufreq powerpc/cpufreq/pcr.c optional cpufreq aim +powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu powerpc/fpu/fpu_add.c optional fpu_emu powerpc/fpu/fpu_compare.c optional fpu_emu powerpc/fpu/fpu_div.c optional fpu_emu Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/aim/mp_cpudep.c Fri Dec 13 02:37:35 2013 (r259284) @@ -322,17 +322,13 @@ cpudep_ap_setup() mtspr(SPR_CELL_TSRL, bsp_state[5]); break; - case MPC7450: - case MPC7455: - case MPC7457: - /* Only MPC745x CPUs have an L3 cache. */ - reg = mpc745x_l3_enable(bsp_state[3]); - - /* Fallthrough */ case MPC7400: case MPC7410: case MPC7447A: case MPC7448: + case MPC7450: + case MPC7455: + case MPC7457: /* XXX: Program the CPU ID into PIR */ __asm __volatile("mtspr 1023,%0" :: "r"(PCPU_GET(cpuid))); @@ -342,6 +338,17 @@ cpudep_ap_setup() mtspr(SPR_HID0, bsp_state[0]); isync(); mtspr(SPR_HID1, bsp_state[1]); isync(); + /* Now enable the L3 cache. */ + switch (vers) { + case MPC7450: + case MPC7455: + case MPC7457: + /* Only MPC745x CPUs have an L3 cache. */ + reg = mpc745x_l3_enable(bsp_state[3]); + default: + break; + } + reg = mpc74xx_l2_enable(bsp_state[2]); reg = mpc74xx_l1d_enable(); reg = mpc74xx_l1i_enable(); Added: head/sys/powerpc/cpufreq/pmufreq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/cpufreq/pmufreq.c Fri Dec 13 02:37:35 2013 (r259284) @@ -0,0 +1,222 @@ +/*- + * Copyright (c) 2011 Justin Hibbits + * Copyright (c) 2009 Nathan Whitehorn + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "cpufreq_if.h" +#include "powerpc/powermac/pmuvar.h" + +struct pmufreq_softc { + device_t dev; + uint32_t minfreq; + uint32_t maxfreq; + uint32_t curfreq; +}; + +static void pmufreq_identify(driver_t *driver, device_t parent); +static int pmufreq_probe(device_t dev); +static int pmufreq_attach(device_t dev); +static int pmufreq_settings(device_t dev, struct cf_setting *sets, int *count); +static int pmufreq_set(device_t dev, const struct cf_setting *set); +static int pmufreq_get(device_t dev, struct cf_setting *set); +static int pmufreq_type(device_t dev, int *type); + +static device_method_t pmufreq_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, pmufreq_identify), + DEVMETHOD(device_probe, pmufreq_probe), + DEVMETHOD(device_attach, pmufreq_attach), + + /* cpufreq interface */ + DEVMETHOD(cpufreq_drv_set, pmufreq_set), + DEVMETHOD(cpufreq_drv_get, pmufreq_get), + DEVMETHOD(cpufreq_drv_type, pmufreq_type), + DEVMETHOD(cpufreq_drv_settings, pmufreq_settings), + + {0, 0} +}; + +static driver_t pmufreq_driver = { + "pmufreq", + pmufreq_methods, + sizeof(struct pmufreq_softc) +}; + +static devclass_t pmufreq_devclass; +DRIVER_MODULE(pmufreq, cpu, pmufreq_driver, pmufreq_devclass, 0, 0); + +static void +pmufreq_identify(driver_t *driver, device_t parent) +{ + phandle_t node; + uint32_t min_freq; + + node = ofw_bus_get_node(parent); + if (OF_getprop(node, "min-clock-frequency", &min_freq, sizeof(min_freq)) == -1) + return; + + /* Make sure we're not being doubly invoked. */ + if (device_find_child(parent, "pmufreq", -1) != NULL) + return; + + /* + * We attach a child for every CPU since settings need to + * be performed on every CPU in the SMP case. + */ + if (BUS_ADD_CHILD(parent, 10, "pmufreq", -1) == NULL) + device_printf(parent, "add pmufreq child failed\n"); +} + +static int +pmufreq_probe(device_t dev) +{ + uint32_t min_freq; + struct pmufreq_softc *sc; + phandle_t node; + + if (resource_disabled("pmufreq", 0)) + return (ENXIO); + + sc = device_get_softc(dev); + node = ofw_bus_get_node(device_get_parent(dev)); + /* + * A scalable MPC7455 has min-clock-frequency/max-clock-frequency as OFW + * properties of the 'cpu' node. + */ + if (OF_getprop(node, "min-clock-frequency", &min_freq, sizeof(min_freq)) == -1) + return (ENXIO); + device_set_desc(dev, "PMU-based frequency scaling"); + return (0); +} + +static int +pmufreq_attach(device_t dev) +{ + struct pmufreq_softc *sc; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + + node = ofw_bus_get_node(device_get_parent(dev)); + OF_getprop(node, "min-clock-frequency", &sc->minfreq, sizeof(sc->minfreq)); + OF_getprop(node, "max-clock-frequency", &sc->maxfreq, sizeof(sc->maxfreq)); + OF_getprop(node, "rounded-clock-frequency", &sc->curfreq, sizeof(sc->curfreq)); + sc->minfreq /= 1000000; + sc->maxfreq /= 1000000; + sc->curfreq /= 1000000; + + cpufreq_register(dev); + return (0); +} + +static int +pmufreq_settings(device_t dev, struct cf_setting *sets, int *count) +{ + struct pmufreq_softc *sc; + + sc = device_get_softc(dev); + if (sets == NULL || count == NULL) + return (EINVAL); + if (*count < 2) + return (E2BIG); + + /* Return a list of valid settings for this driver. */ + memset(sets, CPUFREQ_VAL_UNKNOWN, sizeof(*sets) * 2); + + sets[0].freq = sc->maxfreq; sets[0].dev = dev; + sets[1].freq = sc->minfreq; sets[1].dev = dev; + /* Set high latency for CPU frequency changes, it's a tedious process. */ + sets[0].lat = INT_MAX; + sets[1].lat = INT_MAX; + *count = 2; + + return (0); +} + +static int +pmufreq_set(device_t dev, const struct cf_setting *set) +{ + struct pmufreq_softc *sc; + int speed_sel; + int error; + + if (set == NULL) + return (EINVAL); + + sc = device_get_softc(dev); + + if (set->freq == sc->maxfreq) + speed_sel = 0; + else + speed_sel = 1; + + error = pmu_set_speed(speed_sel); + if (error == 0) + sc->curfreq = set->freq; + + return error; +} + +static int +pmufreq_get(device_t dev, struct cf_setting *set) +{ + struct pmufreq_softc *sc; + + if (set == NULL) + return (EINVAL); + sc = device_get_softc(dev); + + set->freq = sc->curfreq; + set->dev = dev; + + return (0); +} + +static int +pmufreq_type(device_t dev, int *type) +{ + + if (type == NULL) + return (EINVAL); + + *type = CPUFREQ_TYPE_ABSOLUTE; + return (0); +} + Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/include/cpu.h Fri Dec 13 02:37:35 2013 (r259284) @@ -98,4 +98,6 @@ void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *); +void flush_disable_caches(void); + #endif /* _MACHINE_CPU_H_ */ Modified: head/sys/powerpc/include/dbdma.h ============================================================================== --- head/sys/powerpc/include/dbdma.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/include/dbdma.h Fri Dec 13 02:37:35 2013 (r259284) @@ -147,4 +147,7 @@ void dbdma_insert_branch(dbdma_channel_t void dbdma_sync_commands(dbdma_channel_t *chan, bus_dmasync_op_t op); +void dbdma_save_state(dbdma_channel_t *chan); +void dbdma_restore_state(dbdma_channel_t *chan); + #endif /* _MACHINE_DBDMA_H_ */ Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/include/pcpu.h Fri Dec 13 02:37:35 2013 (r259284) @@ -49,7 +49,8 @@ struct pmap; uint32_t pc_ipimask; \ register_t pc_tempsave[CPUSAVE_LEN]; \ register_t pc_disisave[CPUSAVE_LEN]; \ - register_t pc_dbsave[CPUSAVE_LEN]; + register_t pc_dbsave[CPUSAVE_LEN]; \ + void *pc_restore; #define PCPU_MD_AIM32_FIELDS \ /* char __pad[0] */ Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/include/spr.h Fri Dec 13 02:37:35 2013 (r259284) @@ -519,6 +519,8 @@ #define MSSCR0_EMODE 0x00200000 /* 10: MPX bus mode (read-only) */ #define MSSCR0_ABD 0x00100000 /* 11: address bus driven (read-only) */ #define MSSCR0_MBZ 0x000fffff /* 12-31: must be zero */ +#define MSSCR0_L2PFE 0x00000003 /* 30-31: L2 prefetch enable */ +#define SPR_LDSTCR 0x3f8 /* .6. Load/Store Control Register */ #define SPR_L2PM 0x3f8 /* .6. L2 Private Memory Control Register */ #define SPR_L2CR 0x3f9 /* .6. L2 Control Register */ #define L2CR_L2E 0x80000000 /* 0: L2 enable */ @@ -543,12 +545,14 @@ Setting this bit disables instruction caching. */ #define L2CR_L2I 0x00200000 /* 10: L2 global invalidate. */ +#define L2CR_L2IO_7450 0x00010000 /* 11: L2 instruction-only (MPC745x). */ #define L2CR_L2CTL 0x00100000 /* 11: L2 RAM control (ZZ enable). Enables automatic operation of the L2ZZ (low-power mode) signal. */ #define L2CR_L2WT 0x00080000 /* 12: L2 write-through. */ #define L2CR_L2TS 0x00040000 /* 13: L2 test support. */ #define L2CR_L2OH 0x00030000 /* 14-15: L2 output hold. */ +#define L2CR_L2DO_7450 0x00010000 /* 15: L2 data-only (MPC745x). */ #define L2CR_L2SL 0x00008000 /* 16: L2 DLL slow. */ #define L2CR_L2DF 0x00004000 /* 17: L2 differential clock. */ #define L2CR_L2BYP 0x00002000 /* 18: L2 DLL bypass. */ Modified: head/sys/powerpc/powermac/platform_powermac.c ============================================================================== --- head/sys/powerpc/powermac/platform_powermac.c Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powermac/platform_powermac.c Fri Dec 13 02:37:35 2013 (r259284) @@ -376,6 +376,110 @@ powermac_smp_start_cpu(platform_t plat, #endif } +/* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */ +void +flush_disable_caches(void) +{ + register_t msr; + register_t msscr0; + register_t cache_reg; + volatile uint32_t *memp; + uint32_t temp; + int i; + int x; + + msr = mfmsr(); + powerpc_sync(); + mtmsr(msr & ~(PSL_EE | PSL_DR)); + msscr0 = mfspr(SPR_MSSCR0); + msscr0 &= ~MSSCR0_L2PFE; + mtspr(SPR_MSSCR0, msscr0); + powerpc_sync(); + isync(); + __asm__ __volatile__("dssall; sync"); + powerpc_sync(); + isync(); + __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); + __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); + __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); + + /* Lock the L1 Data cache. */ + mtspr(SPR_LDSTCR, mfspr(SPR_LDSTCR) | 0xFF); + powerpc_sync(); + isync(); + + mtspr(SPR_LDSTCR, 0); + + /* + * Perform this in two stages: Flush the cache starting in RAM, then do it + * from ROM. + */ + memp = (volatile uint32_t *)0x00000000; + for (i = 0; i < 128 * 1024; i++) { + temp = *memp; + __asm__ __volatile__("dcbf 0,%0" :: "r"(memp)); + memp += 32/sizeof(*memp); + } + + memp = (volatile uint32_t *)0xfff00000; + x = 0xfe; + + for (; x != 0xff;) { + mtspr(SPR_LDSTCR, x); + for (i = 0; i < 128; i++) { + temp = *memp; + __asm__ __volatile__("dcbf 0,%0" :: "r"(memp)); + memp += 32/sizeof(*memp); + } + x = ((x << 1) | 1) & 0xff; + } + mtspr(SPR_LDSTCR, 0); + + cache_reg = mfspr(SPR_L2CR); + if (cache_reg & L2CR_L2E) { + cache_reg &= ~(L2CR_L2IO_7450 | L2CR_L2DO_7450); + mtspr(SPR_L2CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L2CR, cache_reg | L2CR_L2HWF); + while (mfspr(SPR_L2CR) & L2CR_L2HWF) + ; /* Busy wait for cache to flush */ + powerpc_sync(); + cache_reg &= ~L2CR_L2E; + mtspr(SPR_L2CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L2CR, cache_reg | L2CR_L2I); + powerpc_sync(); + while (mfspr(SPR_L2CR) & L2CR_L2I) + ; /* Busy wait for L2 cache invalidate */ + powerpc_sync(); + } + + cache_reg = mfspr(SPR_L3CR); + if (cache_reg & L3CR_L3E) { + cache_reg &= ~(L3CR_L3IO | L3CR_L3DO); + mtspr(SPR_L3CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L3CR, cache_reg | L3CR_L3HWF); + while (mfspr(SPR_L3CR) & L3CR_L3HWF) + ; /* Busy wait for cache to flush */ + powerpc_sync(); + cache_reg &= ~L3CR_L3E; + mtspr(SPR_L3CR, cache_reg); + powerpc_sync(); + mtspr(SPR_L3CR, cache_reg | L3CR_L3I); + powerpc_sync(); + while (mfspr(SPR_L3CR) & L3CR_L3I) + ; /* Busy wait for L3 cache invalidate */ + powerpc_sync(); + } + + mtspr(SPR_HID0, mfspr(SPR_HID0) & ~HID0_DCE); + powerpc_sync(); + isync(); + + mtmsr(msr); +} + static void powermac_reset(platform_t platform) { Modified: head/sys/powerpc/powermac/pmu.c ============================================================================== --- head/sys/powerpc/powermac/pmu.c Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powermac/pmu.c Fri Dec 13 02:37:35 2013 (r259284) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -43,11 +44,18 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include /* For save_vec() */ #include +#include +#include /* For save_fpu() */ +#include #include #include +#include #include #include +#include #include #include @@ -59,6 +67,11 @@ __FBSDID("$FreeBSD$"); #include "clock_if.h" #include "pmuvar.h" #include "viareg.h" +#include "uninorthvar.h" /* For unin_chip_sleep()/unin_chip_wake() */ + +#define PMU_DEFAULTS PMU_INT_TICK | PMU_INT_ADB | \ + PMU_INT_PCEJECT | PMU_INT_SNDBRT | \ + PMU_INT_BATTERY | PMU_INT_ENVIRONMENT /* * Bus interface @@ -93,6 +106,7 @@ static int pmu_acline_state(SYSCTL_HANDL static int pmu_query_battery(struct pmu_softc *sc, int batt, struct pmu_battstate *info); static int pmu_battquery_sysctl(SYSCTL_HANDLER_ARGS); +static void pmu_sleep_int(void); /* * List of battery-related sysctls we might ask for @@ -115,8 +129,6 @@ static device_method_t pmu_methods[] = DEVMETHOD(device_attach, pmu_attach), DEVMETHOD(device_detach, pmu_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), /* ADB bus interface */ DEVMETHOD(adb_hb_send_raw_packet, pmu_adb_send), @@ -193,7 +205,7 @@ static signed char pm_send_cmd_type[] = 0x02, -1, -1, -1, -1, -1, -1, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -1, -1, 0x01, 0x01, 0x01, -1, -1, -1, -1, -1, - 0x00, 0x00, -1, -1, -1, -1, 0x04, 0x04, + 0x00, 0x00, -1, -1, -1, 0x05, 0x04, 0x04, 0x04, -1, 0x00, -1, -1, -1, -1, -1, 0x00, -1, -1, -1, -1, -1, -1, -1, 0x01, 0x02, -1, -1, -1, -1, -1, -1, @@ -229,7 +241,7 @@ static signed char pm_receive_cmd_type[] 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x03, 0x09, -1, -1, -1, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - -1, -1, -1, -1, -1, -1, 0x01, 0x01, + -1, -1, -1, -1, -1, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, -1, -1, -1, -1, -1, -1, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -357,12 +369,13 @@ pmu_attach(device_t dev) /* Init PMU */ - reg = PMU_INT_TICK | PMU_INT_ADB | PMU_INT_PCEJECT | PMU_INT_SNDBRT; - reg |= PMU_INT_BATTERY; - reg |= PMU_INT_ENVIRONMENT; + pmu_write_reg(sc, vBufB, pmu_read_reg(sc, vBufB) | vPB4); + pmu_write_reg(sc, vDirB, (pmu_read_reg(sc, vDirB) | vPB4) & ~vPB3); + + reg = PMU_DEFAULTS; pmu_send(sc, PMU_SET_IMASK, 1, ®, 16, resp); - pmu_write_reg(sc, vIER, 0x90); /* make sure VIA interrupts are on */ + pmu_write_reg(sc, vIER, 0x94); /* make sure VIA interrupts are on */ pmu_send(sc, PMU_SYSTEM_READY, 1, cmd, 16, resp); pmu_send(sc, PMU_GET_VERSION, 1, cmd, 16, resp); @@ -1018,3 +1031,95 @@ pmu_settime(device_t dev, struct timespe return (0); } +static register_t sprgs[4]; +static register_t srrs[2]; +extern void *ap_pcpu; + +void pmu_sleep_int(void) +{ + static u_quad_t timebase = 0; + jmp_buf resetjb; + struct thread *fputd; + struct thread *vectd; + register_t hid0; + register_t msr; + register_t saved_msr; + + ap_pcpu = pcpup; + + PCPU_SET(restore, &resetjb); + + *(unsigned long *)0x80 = 0x100; + saved_msr = mfmsr(); + fputd = PCPU_GET(fputhread); + vectd = PCPU_GET(vecthread); + if (fputd != NULL) + save_fpu(fputd); + if (vectd != NULL) + save_vec(vectd); + if (setjmp(resetjb) == 0) { + sprgs[0] = mfspr(SPR_SPRG0); + sprgs[1] = mfspr(SPR_SPRG1); + sprgs[2] = mfspr(SPR_SPRG2); + sprgs[3] = mfspr(SPR_SPRG3); + srrs[0] = mfspr(SPR_SRR0); + srrs[1] = mfspr(SPR_SRR1); + timebase = mftb(); + powerpc_sync(); + flush_disable_caches(); + hid0 = mfspr(SPR_HID0); + hid0 = (hid0 & ~(HID0_DOZE | HID0_NAP)) | HID0_SLEEP; + powerpc_sync(); + isync(); + msr = mfmsr() | PSL_POW; + mtspr(SPR_HID0, hid0); + powerpc_sync(); + + while (1) + mtmsr(msr); + } + mttb(timebase); + PCPU_SET(curthread, curthread); + PCPU_SET(curpcb, curthread->td_pcb); + pmap_activate(curthread); + powerpc_sync(); + mtspr(SPR_SPRG0, sprgs[0]); + mtspr(SPR_SPRG1, sprgs[1]); + mtspr(SPR_SPRG2, sprgs[2]); + mtspr(SPR_SPRG3, sprgs[3]); + mtspr(SPR_SRR0, srrs[0]); + mtspr(SPR_SRR1, srrs[1]); + mtmsr(saved_msr); + if (fputd == curthread) + enable_fpu(curthread); + if (vectd == curthread) + enable_vec(curthread); + powerpc_sync(); +} + +int +pmu_set_speed(int low_speed) +{ + struct pmu_softc *sc; + uint8_t sleepcmd[] = {'W', 'O', 'O', 'F', 0}; + uint8_t resp[16]; + + sc = device_get_softc(pmu); + pmu_write_reg(sc, vIER, 0x10); + spinlock_enter(); + mtdec(0x7fffffff); + mb(); + mtdec(0x7fffffff); + + sleepcmd[4] = low_speed; + pmu_send(sc, PMU_CPU_SPEED, 5, sleepcmd, 16, resp); + unin_chip_sleep(NULL, 1); + pmu_sleep_int(); + unin_chip_wake(NULL); + + mtdec(1); /* Force a decrementer exception */ + spinlock_exit(); + pmu_write_reg(sc, vIER, 0x90); + + return (0); +} Modified: head/sys/powerpc/powermac/pmuvar.h ============================================================================== --- head/sys/powerpc/powermac/pmuvar.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powermac/pmuvar.h Fri Dec 13 02:37:35 2013 (r259284) @@ -160,7 +160,8 @@ struct pmu_softc { volatile int sc_autopoll; int sc_batteries; struct cdev *sc_leddev; - int lid_closed; + int lid_closed; + uint8_t saved_regs[9]; }; struct pmu_battstate { @@ -172,4 +173,6 @@ struct pmu_battstate { int voltage; }; +int pmu_set_speed(int low_speed); + #endif /* PMUVAR_H */ Modified: head/sys/powerpc/powermac/uninorth.c ============================================================================== --- head/sys/powerpc/powermac/uninorth.c Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powermac/uninorth.c Fri Dec 13 02:37:35 2013 (r259284) @@ -136,6 +136,13 @@ static driver_t unin_chip_driver = { static devclass_t unin_chip_devclass; +/* + * Assume there is only one unin chip in a PowerMac, so that pmu.c functions can + * suspend the chip after the whole rest of the device tree is suspended, not + * earlier. + */ +static device_t unin_chip; + DRIVER_MODULE(unin, nexus, unin_chip_driver, unin_chip_devclass, 0, 0); /* @@ -210,31 +217,30 @@ unin_chip_add_reg(phandle_t devnode, str } static void -unin_enable_gmac(device_t dev) +unin_update_reg(device_t dev, uint32_t regoff, uint32_t set, uint32_t clr) { - volatile u_int *clkreg; + volatile u_int *reg; struct unin_chip_softc *sc; u_int32_t tmpl; sc = device_get_softc(dev); - clkreg = (void *)(sc->sc_addr + UNIN_CLOCKCNTL); - tmpl = inl(clkreg); - tmpl |= UNIN_CLOCKCNTL_GMAC; - outl(clkreg, tmpl); + reg = (void *)(sc->sc_addr + regoff); + tmpl = inl(reg); + tmpl &= ~clr; + tmpl |= set; + outl(reg, tmpl); } static void -unin_enable_mpic(device_t dev) +unin_enable_gmac(device_t dev) { - volatile u_int *toggle; - struct unin_chip_softc *sc; - u_int32_t tmpl; + unin_update_reg(dev, UNIN_CLOCKCNTL, UNIN_CLOCKCNTL_GMAC, 0); +} - sc = device_get_softc(dev); - toggle = (void *)(sc->sc_addr + UNIN_TOGGLE_REG); - tmpl = inl(toggle); - tmpl |= UNIN_MPIC_RESET | UNIN_MPIC_OUTPUT_ENABLE; - outl(toggle, tmpl); +static void +unin_enable_mpic(device_t dev) +{ + unin_update_reg(dev, UNIN_TOGGLE_REG, UNIN_MPIC_RESET | UNIN_MPIC_OUTPUT_ENABLE, 0); } static int @@ -311,6 +317,9 @@ unin_chip_attach(device_t dev) return (error); } + if (unin_chip == NULL) + unin_chip = dev; + /* * Iterate through the sub-devices */ @@ -631,3 +640,33 @@ unin_chip_get_devinfo(device_t dev, devi return (&dinfo->udi_obdinfo); } +int +unin_chip_wake(device_t dev) +{ + + if (dev == NULL) + dev = unin_chip; + unin_update_reg(dev, UNIN_PWR_MGMT, UNIN_PWR_NORMAL, UNIN_PWR_MASK); + DELAY(10); + unin_update_reg(dev, UNIN_HWINIT_STATE, UNIN_RUNNING, 0); + DELAY(100); + + return (0); +} + +int +unin_chip_sleep(device_t dev, int idle) +{ + if (dev == NULL) + dev = unin_chip; + + unin_update_reg(dev, UNIN_HWINIT_STATE, UNIN_SLEEPING, 0); + DELAY(10); + if (idle) + unin_update_reg(dev, UNIN_PWR_MGMT, UNIN_PWR_IDLE2, UNIN_PWR_MASK); + else + unin_update_reg(dev, UNIN_PWR_MGMT, UNIN_PWR_SLEEP, UNIN_PWR_MASK); + DELAY(10); + + return (0); +} Modified: head/sys/powerpc/powermac/uninorthvar.h ============================================================================== --- head/sys/powerpc/powermac/uninorthvar.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powermac/uninorthvar.h Fri Dec 13 02:37:35 2013 (r259284) @@ -28,6 +28,8 @@ #ifndef _POWERPC_POWERMAC_UNINORTHVAR_H_ #define _POWERPC_POWERMAC_UNINORTHVAR_H_ +#include +#include #include struct uninorth_softc { @@ -76,10 +78,30 @@ struct unin_chip_devinfo { #define UNIN_CLOCKCNTL_GMAC 0x2 /* + * Power management register + */ +#define UNIN_PWR_MGMT 0x30 +#define UNIN_PWR_NORMAL 0x00 +#define UNIN_PWR_IDLE2 0x01 +#define UNIN_PWR_SLEEP 0x02 +#define UNIN_PWR_SAVE 0x03 +#define UNIN_PWR_MASK 0x03 + +/* + * Hardware initialization state register + */ +#define UNIN_HWINIT_STATE 0x70 +#define UNIN_SLEEPING 0x01 +#define UNIN_RUNNING 0x02 + + +/* * Toggle registers */ #define UNIN_TOGGLE_REG 0xe0 #define UNIN_MPIC_RESET 0x2 #define UNIN_MPIC_OUTPUT_ENABLE 0x4 +extern int unin_chip_sleep(device_t dev, int idle); +extern int unin_chip_wake(device_t dev); #endif /* _POWERPC_POWERMAC_UNINORTHVAR_H_ */ Modified: head/sys/powerpc/powermac/viareg.h ============================================================================== --- head/sys/powerpc/powermac/viareg.h Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powermac/viareg.h Fri Dec 13 02:37:35 2013 (r259284) @@ -30,14 +30,16 @@ /* VIA interface registers */ #define vBufB 0x0000 /* register B */ -#define vBufA 0x0200 /* register A */ #define vDirB 0x0400 /* data direction register */ #define vDirA 0x0600 /* data direction register */ +#define vT1C 0x0800 /* Timer 1 counter Lo */ +#define vT1CH 0x0a00 /* Timer 1 counter Hi */ #define vSR 0x1400 /* shift register */ #define vACR 0x1600 /* aux control register */ #define vPCR 0x1800 /* peripheral control register */ #define vIFR 0x1a00 /* interrupt flag register */ #define vIER 0x1c00 /* interrupt enable register */ +#define vBufA 0x1e00 /* register A */ #define vPB 0x0000 #define vPB3 0x08 Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Dec 13 02:21:32 2013 (r259283) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Dec 13 02:37:35 2013 (r259284) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "pic_if.h" @@ -66,10 +67,21 @@ volatile static u_quad_t ap_timebase; static u_int ipi_msg_cnt[32]; static struct mtx ap_boot_mtx; struct pcb stoppcbs[MAXCPU]; +int longfault(faultbuf, int); void machdep_ap_bootstrap(void) { + jmp_buf *restore; + + /* The following is needed for restoring from sleep. */ +#ifdef __powerpc64__ + /* Writing to the time base register is hypervisor-privileged */ + if (mfmsr() & PSL_HV) + mttb(0); +#else + mttb(0); +#endif /* Set up important bits on the CPU (HID registers, etc.) */ cpudep_ap_setup(); @@ -78,6 +90,11 @@ machdep_ap_bootstrap(void) PCPU_SET(awake, 1); __asm __volatile("msync; isync"); + restore = PCPU_GET(restore); + if (restore != NULL) { + longjmp(*restore, 1); + } + while (ap_letgo == 0) ; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 02:47:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73C717D7; Fri, 13 Dec 2013 02:47:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F8B812FC; Fri, 13 Dec 2013 02:47:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD2lgN2007419; Fri, 13 Dec 2013 02:47:42 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD2lgJg007418; Fri, 13 Dec 2013 02:47:42 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312130247.rBD2lgJg007418@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 02:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r259285 - stable/8/contrib/libstdc++/include/std X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 02:47:42 -0000 Author: pfg Date: Fri Dec 13 02:47:41 2013 New Revision: 259285 URL: http://svnweb.freebsd.org/changeset/base/259285 Log: MFC r244673: Fix the __glibcxx_min and __glibcxx_max macros for a signed wchar_t. This seems to be needed by newer compilers. Modified: stable/8/contrib/libstdc++/include/std/std_limits.h Directory Properties: stable/8/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/include/std/std_limits.h ============================================================================== --- stable/8/contrib/libstdc++/include/std/std_limits.h Fri Dec 13 02:37:35 2013 (r259284) +++ stable/8/contrib/libstdc++/include/std/std_limits.h Fri Dec 13 02:47:41 2013 (r259285) @@ -134,10 +134,11 @@ #define __glibcxx_signed(T) ((T)(-1) < 0) #define __glibcxx_min(T) \ - (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0) + (__glibcxx_signed (T) ? (((T)1 << (__glibcxx_digits (T) - 1)) << 1) : (T)0) #define __glibcxx_max(T) \ - (__glibcxx_signed (T) ? ((T)1 << __glibcxx_digits (T)) - 1 : ~(T)0) + (__glibcxx_signed (T) ? \ + (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0) #define __glibcxx_digits(T) \ (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T)) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 03:09:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F9511B8; Fri, 13 Dec 2013 03:09:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 128921584; Fri, 13 Dec 2013 03:09:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD39TJr016017; Fri, 13 Dec 2013 03:09:29 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD39TTm016016; Fri, 13 Dec 2013 03:09:29 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201312130309.rBD39TTm016016@svn.freebsd.org> From: Benjamin Kaduk Date: Fri, 13 Dec 2013 03:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259286 - head/crypto/heimdal/lib/gssapi/krb5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 03:09:30 -0000 Author: bjk (doc committer) Date: Fri Dec 13 03:09:29 2013 New Revision: 259286 URL: http://svnweb.freebsd.org/changeset/base/259286 Log: Apply patch from upstream Heimdal for encoding fix RFC 4402 specifies the implementation of the gss_pseudo_random() function for the krb5 mechanism (and the C bindings therein). The implementation uses a PRF+ function that concatenates the output of individual krb5 pseudo-random operations produced with a counter and seed. The original implementation of this function in Heimdal incorrectly encoded the counter as a little-endian integer, but the RFC specifies the counter encoding as big-endian. The implementation initializes the counter to zero, so the first block of output (16 octets, for the modern AES enctypes 17 and 18) is unchanged. (RFC 4402 specifies that the counter should begin at 1, but both existing implementations begin with zero and it looks like the standard will be re-issued, with test vectors, to begin at zero.) This is upstream's commit f85652af868e64811f2b32b815d4198e7f9017f6, from 13 October, 2013: % Fix krb5's gss_pseudo_random() (n is big-endian) % % The first enctype RFC3961 prf output length's bytes are correct because % the little- and big-endian representations of unsigned zero are the % same. The second block of output was wrong because the counter was not % being encoded as big-endian. % % This change could break applications. But those applications would not % have been interoperating with other implementations anyways (in % particular: MIT's). Approved by: hrs (mentor, src committer) MFC after: 3 days Modified: head/crypto/heimdal/lib/gssapi/krb5/prf.c Modified: head/crypto/heimdal/lib/gssapi/krb5/prf.c ============================================================================== --- head/crypto/heimdal/lib/gssapi/krb5/prf.c Fri Dec 13 02:47:41 2013 (r259285) +++ head/crypto/heimdal/lib/gssapi/krb5/prf.c Fri Dec 13 03:09:29 2013 (r259286) @@ -119,7 +119,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ while(dol > 0) { size_t tsize; - _gsskrb5_encode_om_uint32(num, input.data); + _gsskrb5_encode_be_om_uint32(num, input.data); ret = krb5_crypto_prf(context, crypto, &input, &output); if (ret) { @@ -133,7 +133,7 @@ _gsskrb5_pseudo_random(OM_uint32 *minor_ tsize = min(dol, output.length); memcpy(p, output.data, tsize); - p += output.length; + p += tsize; dol -= tsize; krb5_data_free(&output); num++; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 05:54:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60EC3832; Fri, 13 Dec 2013 05:54:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2C6149F; Fri, 13 Dec 2013 05:54:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD5sQBe075549; Fri, 13 Dec 2013 05:54:26 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD5sQTa075548; Fri, 13 Dec 2013 05:54:26 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312130554.rBD5sQTa075548@svn.freebsd.org> From: Justin Hibbits Date: Fri, 13 Dec 2013 05:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259287 - head/sys/powerpc/cpufreq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 05:54:26 -0000 Author: jhibbits Date: Fri Dec 13 05:54:25 2013 New Revision: 259287 URL: http://svnweb.freebsd.org/changeset/base/259287 Log: Some style(9) fixes MFC after: 1 month X-MFC with: r259284 Modified: head/sys/powerpc/cpufreq/pmufreq.c Modified: head/sys/powerpc/cpufreq/pmufreq.c ============================================================================== --- head/sys/powerpc/cpufreq/pmufreq.c Fri Dec 13 03:09:29 2013 (r259286) +++ head/sys/powerpc/cpufreq/pmufreq.c Fri Dec 13 05:54:25 2013 (r259287) @@ -106,9 +106,9 @@ pmufreq_identify(driver_t *driver, devic static int pmufreq_probe(device_t dev) { - uint32_t min_freq; struct pmufreq_softc *sc; phandle_t node; + uint32_t min_freq; if (resource_disabled("pmufreq", 0)) return (ENXIO); @@ -174,8 +174,7 @@ static int pmufreq_set(device_t dev, const struct cf_setting *set) { struct pmufreq_softc *sc; - int speed_sel; - int error; + int error, speed_sel; if (set == NULL) return (EINVAL); @@ -191,7 +190,7 @@ pmufreq_set(device_t dev, const struct c if (error == 0) sc->curfreq = set->freq; - return error; + return (error); } static int From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 05:54:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD5C0833; Fri, 13 Dec 2013 05:54:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8BD614A0; Fri, 13 Dec 2013 05:54:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD5sUUP075592; Fri, 13 Dec 2013 05:54:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD5sU9Y075591; Fri, 13 Dec 2013 05:54:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130554.rBD5sU9Y075591@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 05:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259288 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 05:54:30 -0000 Author: kib Date: Fri Dec 13 05:54:30 2013 New Revision: 259288 URL: http://svnweb.freebsd.org/changeset/base/259288 Log: MFC r259042: Do not force to run atexit handlers, which text comes from a dso owning the handle passed to __cxa_finalize() but which are registered by other dso, when the process is inside exit(3). Modified: stable/10/lib/libc/stdlib/atexit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/atexit.c ============================================================================== --- stable/10/lib/libc/stdlib/atexit.c Fri Dec 13 05:54:25 2013 (r259287) +++ stable/10/lib/libc/stdlib/atexit.c Fri Dec 13 05:54:30 2013 (r259288) @@ -151,6 +151,8 @@ __cxa_atexit(void (*func)(void *), void #pragma weak __pthread_cxa_finalize void __pthread_cxa_finalize(const struct dl_phdr_info *); +static int global_exit; + /* * Call all handlers registered with __cxa_atexit for the shared * object owning 'dso'. Note: if 'dso' is NULL, then all remaining @@ -164,10 +166,12 @@ __cxa_finalize(void *dso) struct atexit_fn fn; int n, has_phdr; - if (dso != NULL) + if (dso != NULL) { has_phdr = _rtld_addr_phdr(dso, &phdr_info); - else + } else { has_phdr = 0; + global_exit = 1; + } _MUTEX_LOCK(&atexit_mutex); for (p = __atexit; p; p = p->next) { @@ -177,8 +181,9 @@ __cxa_finalize(void *dso) fn = p->fns[n]; if (dso != NULL && dso != fn.fn_dso) { /* wrong DSO ? */ - if (!has_phdr || !__elf_phdr_match_addr( - &phdr_info, fn.fn_ptr.cxa_func)) + if (!has_phdr || global_exit || + !__elf_phdr_match_addr(&phdr_info, + fn.fn_ptr.cxa_func)) continue; } /* @@ -200,6 +205,6 @@ __cxa_finalize(void *dso) if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); - if (has_phdr && &__pthread_cxa_finalize != NULL) + if (has_phdr && !global_exit && &__pthread_cxa_finalize != NULL) __pthread_cxa_finalize(&phdr_info); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 05:54:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A9F02A63; Fri, 13 Dec 2013 05:54:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9584A14A9; Fri, 13 Dec 2013 05:54:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD5swoY075667; Fri, 13 Dec 2013 05:54:58 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD5swkx075666; Fri, 13 Dec 2013 05:54:58 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130554.rBD5swkx075666@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 05:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259289 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 05:54:58 -0000 Author: kib Date: Fri Dec 13 05:54:58 2013 New Revision: 259289 URL: http://svnweb.freebsd.org/changeset/base/259289 Log: MFC r259042: Do not force to run atexit handlers, which text comes from a dso owning the handle passed to __cxa_finalize() but which are registered by other dso, when the process is inside exit(3). Modified: stable/9/lib/libc/stdlib/atexit.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/atexit.c ============================================================================== --- stable/9/lib/libc/stdlib/atexit.c Fri Dec 13 05:54:30 2013 (r259288) +++ stable/9/lib/libc/stdlib/atexit.c Fri Dec 13 05:54:58 2013 (r259289) @@ -151,6 +151,8 @@ __cxa_atexit(void (*func)(void *), void #pragma weak __pthread_cxa_finalize void __pthread_cxa_finalize(const struct dl_phdr_info *); +static int global_exit; + /* * Call all handlers registered with __cxa_atexit for the shared * object owning 'dso'. Note: if 'dso' is NULL, then all remaining @@ -164,10 +166,12 @@ __cxa_finalize(void *dso) struct atexit_fn fn; int n, has_phdr; - if (dso != NULL) + if (dso != NULL) { has_phdr = _rtld_addr_phdr(dso, &phdr_info); - else + } else { has_phdr = 0; + global_exit = 1; + } _MUTEX_LOCK(&atexit_mutex); for (p = __atexit; p; p = p->next) { @@ -177,8 +181,9 @@ __cxa_finalize(void *dso) fn = p->fns[n]; if (dso != NULL && dso != fn.fn_dso) { /* wrong DSO ? */ - if (!has_phdr || !__elf_phdr_match_addr( - &phdr_info, fn.fn_ptr.cxa_func)) + if (!has_phdr || global_exit || + !__elf_phdr_match_addr(&phdr_info, + fn.fn_ptr.cxa_func)) continue; } /* @@ -200,6 +205,6 @@ __cxa_finalize(void *dso) if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); - if (has_phdr && &__pthread_cxa_finalize != NULL) + if (has_phdr && !global_exit && &__pthread_cxa_finalize != NULL) __pthread_cxa_finalize(&phdr_info); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:00:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DABF6DAF; Fri, 13 Dec 2013 06:00:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C68B114E0; Fri, 13 Dec 2013 06:00:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD60iFP078916; Fri, 13 Dec 2013 06:00:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD60icu078913; Fri, 13 Dec 2013 06:00:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130600.rBD60icu078913@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:00:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259290 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:00:44 -0000 Author: kib Date: Fri Dec 13 06:00:44 2013 New Revision: 259290 URL: http://svnweb.freebsd.org/changeset/base/259290 Log: MFC r259043: Build an allocator for the aligned memory on top of the rtld-private malloc. Modified: stable/10/libexec/rtld-elf/rtld.h stable/10/libexec/rtld-elf/xmalloc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.h ============================================================================== --- stable/10/libexec/rtld-elf/rtld.h Fri Dec 13 05:54:58 2013 (r259289) +++ stable/10/libexec/rtld-elf/rtld.h Fri Dec 13 06:00:44 2013 (r259290) @@ -352,6 +352,8 @@ Obj_Entry *map_object(int, const char *, void *xcalloc(size_t, size_t); void *xmalloc(size_t); char *xstrdup(const char *); +void *malloc_aligned(size_t size, size_t align); +void free_aligned(void *ptr); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ Modified: stable/10/libexec/rtld-elf/xmalloc.c ============================================================================== --- stable/10/libexec/rtld-elf/xmalloc.c Fri Dec 13 05:54:58 2013 (r259289) +++ stable/10/libexec/rtld-elf/xmalloc.c Fri Dec 13 06:00:44 2013 (r259290) @@ -67,3 +67,33 @@ xstrdup(const char *str) memcpy(copy, str, len); return (copy); } + +void * +malloc_aligned(size_t size, size_t align) +{ + void *mem, *res; + uintptr_t x; + size_t asize, r; + + r = round(sizeof(void *), align); + asize = round(size, align) + r; + mem = xmalloc(asize); + x = (uintptr_t)mem; + res = (void *)round(x, align); + *(void **)((uintptr_t)res - sizeof(void *)) = mem; + return (res); +} + +void +free_aligned(void *ptr) +{ + void *mem; + uintptr_t x; + + if (ptr == NULL) + return; + x = (uintptr_t)ptr; + x -= sizeof(void *); + mem = *(void **)x; + free(mem); +} From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:01:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D410CEE5; Fri, 13 Dec 2013 06:01:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFECF1530; Fri, 13 Dec 2013 06:01:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD61LS5079083; Fri, 13 Dec 2013 06:01:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD61LkD079081; Fri, 13 Dec 2013 06:01:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130601.rBD61LkD079081@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259291 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:01:21 -0000 Author: kib Date: Fri Dec 13 06:01:21 2013 New Revision: 259291 URL: http://svnweb.freebsd.org/changeset/base/259291 Log: MFC r259043: Build an allocator for the aligned memory on top of the rtld-private malloc. Modified: stable/9/libexec/rtld-elf/rtld.h stable/9/libexec/rtld-elf/xmalloc.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.h ============================================================================== --- stable/9/libexec/rtld-elf/rtld.h Fri Dec 13 06:00:44 2013 (r259290) +++ stable/9/libexec/rtld-elf/rtld.h Fri Dec 13 06:01:21 2013 (r259291) @@ -352,6 +352,8 @@ Obj_Entry *map_object(int, const char *, void *xcalloc(size_t, size_t); void *xmalloc(size_t); char *xstrdup(const char *); +void *malloc_aligned(size_t size, size_t align); +void free_aligned(void *ptr); extern Elf_Addr _GLOBAL_OFFSET_TABLE_[]; extern Elf_Sym sym_zero; /* For resolving undefined weak refs. */ Modified: stable/9/libexec/rtld-elf/xmalloc.c ============================================================================== --- stable/9/libexec/rtld-elf/xmalloc.c Fri Dec 13 06:00:44 2013 (r259290) +++ stable/9/libexec/rtld-elf/xmalloc.c Fri Dec 13 06:01:21 2013 (r259291) @@ -67,3 +67,33 @@ xstrdup(const char *str) memcpy(copy, str, len); return (copy); } + +void * +malloc_aligned(size_t size, size_t align) +{ + void *mem, *res; + uintptr_t x; + size_t asize, r; + + r = round(sizeof(void *), align); + asize = round(size, align) + r; + mem = xmalloc(asize); + x = (uintptr_t)mem; + res = (void *)round(x, align); + *(void **)((uintptr_t)res - sizeof(void *)) = mem; + return (res); +} + +void +free_aligned(void *ptr) +{ + void *mem; + uintptr_t x; + + if (ptr == NULL) + return; + x = (uintptr_t)ptr; + x -= sizeof(void *); + mem = *(void **)x; + free(mem); +} From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:06:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D64A21A3; Fri, 13 Dec 2013 06:06:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1BC41580; Fri, 13 Dec 2013 06:06:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6688K079901; Fri, 13 Dec 2013 06:06:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD668MB079900; Fri, 13 Dec 2013 06:06:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130606.rBD668MB079900@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259292 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:06:09 -0000 Author: kib Date: Fri Dec 13 06:06:08 2013 New Revision: 259292 URL: http://svnweb.freebsd.org/changeset/base/259292 Log: MFC r259044: For variant II static TLS, properly align tls segments. MFC r259072: Cast Elf_Addr to void * to match the free_aligned() argument type. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Dec 13 06:01:21 2013 (r259291) +++ stable/10/libexec/rtld-elf/rtld.c Fri Dec 13 06:06:08 2013 (r259292) @@ -231,6 +231,7 @@ char **main_argv; size_t tls_last_offset; /* Static TLS offset of last module */ size_t tls_last_size; /* Static TLS size of last module */ size_t tls_static_space; /* Static TLS space allocated */ +size_t tls_static_max_align; int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ @@ -4276,19 +4277,22 @@ void * allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcbsize, size_t tcbalign) { Obj_Entry *obj; - size_t size; + size_t size, ralign; char *tls; Elf_Addr *dtv, *olddtv; Elf_Addr segbase, oldsegbase, addr; int i; - size = round(tls_static_space, tcbalign); + ralign = tcbalign; + if (tls_static_max_align > ralign) + ralign = tls_static_max_align; + size = round(tls_static_space, ralign) + round(tcbsize, ralign); assert(tcbsize >= 2*sizeof(Elf_Addr)); - tls = xcalloc(1, size + tcbsize); + tls = malloc_aligned(size, ralign); dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); - segbase = (Elf_Addr)(tls + size); + segbase = (Elf_Addr)(tls + round(tls_static_space, ralign)); ((Elf_Addr*)segbase)[0] = segbase; ((Elf_Addr*)segbase)[1] = (Elf_Addr) dtv; @@ -4340,8 +4344,8 @@ allocate_tls(Obj_Entry *objs, void *oldt void free_tls(void *tls, size_t tcbsize, size_t tcbalign) { - size_t size; Elf_Addr* dtv; + size_t size, ralign; int dtvsize, i; Elf_Addr tlsstart, tlsend; @@ -4349,19 +4353,22 @@ free_tls(void *tls, size_t tcbsize, size * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. */ - size = round(tls_static_space, tcbalign); + ralign = tcbalign; + if (tls_static_max_align > ralign) + ralign = tls_static_max_align; + size = round(tls_static_space, ralign); dtv = ((Elf_Addr**)tls)[1]; dtvsize = dtv[1]; tlsend = (Elf_Addr) tls; tlsstart = tlsend - size; for (i = 0; i < dtvsize; i++) { - if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] > tlsend)) { - free((void*) dtv[i+2]); + if (dtv[i + 2] != 0 && (dtv[i + 2] < tlsstart || dtv[i + 2] > tlsend)) { + free_aligned((void *)dtv[i + 2]); } } - free((void*) tlsstart); + free_aligned((void *)tlsstart); free((void*) dtv); } @@ -4385,11 +4392,7 @@ allocate_module_tls(int index) die(); } - p = malloc(obj->tlssize); - if (p == NULL) { - _rtld_error("Cannot allocate TLS block for index %d", index); - die(); - } + p = malloc_aligned(obj->tlssize, obj->tlsalign); memcpy(p, obj->tlsinit, obj->tlsinitsize); memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize); @@ -4421,9 +4424,11 @@ allocate_tls_offset(Obj_Entry *obj) * leave a small amount of space spare to be used for dynamically * loading modules which use static TLS. */ - if (tls_static_space) { + if (tls_static_space != 0) { if (calculate_tls_end(off, obj->tlssize) > tls_static_space) return false; + } else if (obj->tlsalign > tls_static_max_align) { + tls_static_max_align = obj->tlsalign; } tls_last_offset = obj->tlsoffset = off; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:06:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDF812E4; Fri, 13 Dec 2013 06:06:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8025158A; Fri, 13 Dec 2013 06:06:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD66PVr079981; Fri, 13 Dec 2013 06:06:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD66Pwu079980; Fri, 13 Dec 2013 06:06:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130606.rBD66Pwu079980@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259293 - stable/9/libexec/rtld-elf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:06:25 -0000 Author: kib Date: Fri Dec 13 06:06:25 2013 New Revision: 259293 URL: http://svnweb.freebsd.org/changeset/base/259293 Log: MFC r259044: For variant II static TLS, properly align tls segments. MFC r259072: Cast Elf_Addr to void * to match the free_aligned() argument type. Modified: stable/9/libexec/rtld-elf/rtld.c Directory Properties: stable/9/libexec/rtld-elf/ (props changed) Modified: stable/9/libexec/rtld-elf/rtld.c ============================================================================== --- stable/9/libexec/rtld-elf/rtld.c Fri Dec 13 06:06:08 2013 (r259292) +++ stable/9/libexec/rtld-elf/rtld.c Fri Dec 13 06:06:25 2013 (r259293) @@ -231,6 +231,7 @@ char **main_argv; size_t tls_last_offset; /* Static TLS offset of last module */ size_t tls_last_size; /* Static TLS size of last module */ size_t tls_static_space; /* Static TLS space allocated */ +size_t tls_static_max_align; int tls_dtv_generation = 1; /* Used to detect when dtv size changes */ int tls_max_index = 1; /* Largest module index allocated */ @@ -4281,19 +4282,22 @@ void * allocate_tls(Obj_Entry *objs, void *oldtls, size_t tcbsize, size_t tcbalign) { Obj_Entry *obj; - size_t size; + size_t size, ralign; char *tls; Elf_Addr *dtv, *olddtv; Elf_Addr segbase, oldsegbase, addr; int i; - size = round(tls_static_space, tcbalign); + ralign = tcbalign; + if (tls_static_max_align > ralign) + ralign = tls_static_max_align; + size = round(tls_static_space, ralign) + round(tcbsize, ralign); assert(tcbsize >= 2*sizeof(Elf_Addr)); - tls = xcalloc(1, size + tcbsize); + tls = malloc_aligned(size, ralign); dtv = xcalloc(tls_max_index + 2, sizeof(Elf_Addr)); - segbase = (Elf_Addr)(tls + size); + segbase = (Elf_Addr)(tls + round(tls_static_space, ralign)); ((Elf_Addr*)segbase)[0] = segbase; ((Elf_Addr*)segbase)[1] = (Elf_Addr) dtv; @@ -4345,8 +4349,8 @@ allocate_tls(Obj_Entry *objs, void *oldt void free_tls(void *tls, size_t tcbsize, size_t tcbalign) { - size_t size; Elf_Addr* dtv; + size_t size, ralign; int dtvsize, i; Elf_Addr tlsstart, tlsend; @@ -4354,19 +4358,22 @@ free_tls(void *tls, size_t tcbsize, size * Figure out the size of the initial TLS block so that we can * find stuff which ___tls_get_addr() allocated dynamically. */ - size = round(tls_static_space, tcbalign); + ralign = tcbalign; + if (tls_static_max_align > ralign) + ralign = tls_static_max_align; + size = round(tls_static_space, ralign); dtv = ((Elf_Addr**)tls)[1]; dtvsize = dtv[1]; tlsend = (Elf_Addr) tls; tlsstart = tlsend - size; for (i = 0; i < dtvsize; i++) { - if (dtv[i+2] && (dtv[i+2] < tlsstart || dtv[i+2] > tlsend)) { - free((void*) dtv[i+2]); + if (dtv[i + 2] != 0 && (dtv[i + 2] < tlsstart || dtv[i + 2] > tlsend)) { + free_aligned((void *)dtv[i + 2]); } } - free((void*) tlsstart); + free_aligned((void *)tlsstart); free((void*) dtv); } @@ -4390,11 +4397,7 @@ allocate_module_tls(int index) die(); } - p = malloc(obj->tlssize); - if (p == NULL) { - _rtld_error("Cannot allocate TLS block for index %d", index); - die(); - } + p = malloc_aligned(obj->tlssize, obj->tlsalign); memcpy(p, obj->tlsinit, obj->tlsinitsize); memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize); @@ -4426,9 +4429,11 @@ allocate_tls_offset(Obj_Entry *obj) * leave a small amount of space spare to be used for dynamically * loading modules which use static TLS. */ - if (tls_static_space) { + if (tls_static_space != 0) { if (calculate_tls_end(off, obj->tlssize) > tls_static_space) return false; + } else if (obj->tlsalign > tls_static_max_align) { + tls_static_max_align = obj->tlsalign; } tls_last_offset = obj->tlsoffset = off; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:09:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 860E7496; Fri, 13 Dec 2013 06:09:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 669FC15A3; Fri, 13 Dec 2013 06:09:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD69K0Q080478; Fri, 13 Dec 2013 06:09:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD69JXG080475; Fri, 13 Dec 2013 06:09:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130609.rBD69JXG080475@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:09:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259294 - in stable/10/sys: kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:09:20 -0000 Author: kib Date: Fri Dec 13 06:09:19 2013 New Revision: 259294 URL: http://svnweb.freebsd.org/changeset/base/259294 Log: MFC r257898: Change VFS_PROLOGUE() to evaluate the mp once, convert MNTK_SHARED_WRITES and MNTK_EXTENDED_SHARED tests into inline functions. Modified: stable/10/sys/kern/vfs_lookup.c stable/10/sys/kern/vfs_vnops.c stable/10/sys/sys/mount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_lookup.c ============================================================================== --- stable/10/sys/kern/vfs_lookup.c Fri Dec 13 06:06:25 2013 (r259293) +++ stable/10/sys/kern/vfs_lookup.c Fri Dec 13 06:09:19 2013 (r259294) @@ -424,13 +424,8 @@ needs_exclusive_leaf(struct mount *mp, i * extended shared operations, then use a shared lock for the * leaf node, otherwise use an exclusive lock. */ - if (flags & ISOPEN) { - if (mp != NULL && - (mp->mnt_kern_flag & MNTK_EXTENDED_SHARED)) - return (0); - else - return (1); - } + if ((flags & ISOPEN) != 0) + return (!MNT_EXTENDED_SHARED(mp)); /* * Lookup requests outside of open() that specify LOCKSHARED Modified: stable/10/sys/kern/vfs_vnops.c ============================================================================== --- stable/10/sys/kern/vfs_vnops.c Fri Dec 13 06:06:25 2013 (r259293) +++ stable/10/sys/kern/vfs_vnops.c Fri Dec 13 06:09:19 2013 (r259294) @@ -360,8 +360,8 @@ vn_close(vp, flags, file_cred, td) struct mount *mp; int error, lock_flags; - if (vp->v_type != VFIFO && !(flags & FWRITE) && vp->v_mount != NULL && - vp->v_mount->mnt_kern_flag & MNTK_EXTENDED_SHARED) + if (vp->v_type != VFIFO && (flags & FWRITE) == 0 && + MNT_EXTENDED_SHARED(vp->v_mount)) lock_flags = LK_SHARED; else lock_flags = LK_EXCLUSIVE; Modified: stable/10/sys/sys/mount.h ============================================================================== --- stable/10/sys/sys/mount.h Fri Dec 13 06:06:25 2013 (r259293) +++ stable/10/sys/sys/mount.h Fri Dec 13 06:09:19 2013 (r259294) @@ -362,8 +362,19 @@ void __mnt_vnode_markerfree_act #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ -#define MNT_SHARED_WRITES(mp) (((mp) != NULL) && \ - ((mp)->mnt_kern_flag & MNTK_SHARED_WRITES)) +static inline int +MNT_SHARED_WRITES(struct mount *mp) +{ + + return (mp != NULL && (mp->mnt_kern_flag & MNTK_SHARED_WRITES) != 0); +} + +static inline int +MNT_EXTENDED_SHARED(struct mount *mp) +{ + + return (mp != NULL && (mp->mnt_kern_flag & MNTK_EXTENDED_SHARED) != 0); +} /* * Sysctl CTL_VFS definitions. @@ -636,10 +647,12 @@ struct vfsops { vfs_statfs_t __vfs_statfs; #define VFS_PROLOGUE(MP) do { \ + struct mount *mp__; \ int _enable_stops; \ \ - _enable_stops = ((MP) != NULL && \ - ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + mp__ = (MP); \ + _enable_stops = (mp__ != NULL && \ + (mp__->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) #define VFS_EPILOGUE(MP) \ if (_enable_stops) \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:10:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1B61642; Fri, 13 Dec 2013 06:10:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDE7D15F9; Fri, 13 Dec 2013 06:10:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6AnTm082581; Fri, 13 Dec 2013 06:10:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6An01082580; Fri, 13 Dec 2013 06:10:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130610.rBD6An01082580@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259295 - stable/10/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:10:49 -0000 Author: kib Date: Fri Dec 13 06:10:49 2013 New Revision: 259295 URL: http://svnweb.freebsd.org/changeset/base/259295 Log: MFC r257904: Hide MNT_SHARED_WRITES() and MNT_EXTENDED_SHARED() under the #ifdef _KERNEL braces. Struct mount is only defined for the kernel build. Modified: stable/10/sys/sys/mount.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/mount.h ============================================================================== --- stable/10/sys/sys/mount.h Fri Dec 13 06:09:19 2013 (r259294) +++ stable/10/sys/sys/mount.h Fri Dec 13 06:10:49 2013 (r259295) @@ -362,6 +362,7 @@ void __mnt_vnode_markerfree_act #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ +#ifdef _KERNEL static inline int MNT_SHARED_WRITES(struct mount *mp) { @@ -375,6 +376,7 @@ MNT_EXTENDED_SHARED(struct mount *mp) return (mp != NULL && (mp->mnt_kern_flag & MNTK_EXTENDED_SHARED) != 0); } +#endif /* * Sysctl CTL_VFS definitions. From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:12:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA4397C1; Fri, 13 Dec 2013 06:12:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9C203160D; Fri, 13 Dec 2013 06:12:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6CMwG083420; Fri, 13 Dec 2013 06:12:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6CMM7083417; Fri, 13 Dec 2013 06:12:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130612.rBD6CMM7083417@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259296 - in stable/10/sys: kern vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:12:22 -0000 Author: kib Date: Fri Dec 13 06:12:21 2013 New Revision: 259296 URL: http://svnweb.freebsd.org/changeset/base/259296 Log: MFC r257899: If filesystem declares that it supports shared locking for writes, use shared vnode lock for VOP_PUTPAGES() as well. Modified: stable/10/sys/kern/vnode_if.src stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vnode_if.src ============================================================================== --- stable/10/sys/kern/vnode_if.src Fri Dec 13 06:10:49 2013 (r259295) +++ stable/10/sys/kern/vnode_if.src Fri Dec 13 06:12:21 2013 (r259296) @@ -477,7 +477,7 @@ vop_getpages { }; -%% putpages vp E E E +%% putpages vp L L L vop_putpages { IN struct vnode *vp; Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Fri Dec 13 06:10:49 2013 (r259295) +++ stable/10/sys/vm/vm_pageout.c Fri Dec 13 06:12:21 2013 (r259296) @@ -570,6 +570,7 @@ vm_pageout_launder(struct vm_pagequeue * vm_object_t object; vm_paddr_t pa; vm_page_t m, m_tmp, next; + int lockmode; vm_pagequeue_lock(pq); TAILQ_FOREACH_SAFE(m, &pq->pq_pl, plinks.q, next) { @@ -605,7 +606,9 @@ vm_pageout_launder(struct vm_pagequeue * vm_object_reference_locked(object); VM_OBJECT_WUNLOCK(object); (void)vn_start_write(vp, &mp, V_WAIT); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + lockmode = MNT_SHARED_WRITES(vp->v_mount) ? + LK_SHARED : LK_EXCLUSIVE; + vn_lock(vp, lockmode | LK_RETRY); VM_OBJECT_WLOCK(object); vm_object_page_clean(object, 0, 0, OBJPC_SYNC); VM_OBJECT_WUNLOCK(object); @@ -902,6 +905,7 @@ vm_pageout_scan(struct vm_domain *vmd, i int act_delta; int vnodes_skipped = 0; int maxlaunder; + int lockmode; boolean_t queues_locked; /* @@ -1193,7 +1197,9 @@ vm_pageout_scan(struct vm_domain *vmd, i ("vp %p with NULL v_mount", vp)); vm_object_reference_locked(object); VM_OBJECT_WUNLOCK(object); - if (vget(vp, LK_EXCLUSIVE | LK_TIMELOCK, + lockmode = MNT_SHARED_WRITES(vp->v_mount) ? + LK_SHARED : LK_EXCLUSIVE; + if (vget(vp, lockmode | LK_TIMELOCK, curthread)) { VM_OBJECT_WLOCK(object); ++pageout_lock_miss; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:25:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EDEFC88; Fri, 13 Dec 2013 06:25:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89BB916DA; Fri, 13 Dec 2013 06:25:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6P80h087226; Fri, 13 Dec 2013 06:25:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6P8Nt087225; Fri, 13 Dec 2013 06:25:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130625.rBD6P8Nt087225@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259297 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:25:08 -0000 Author: kib Date: Fri Dec 13 06:25:08 2013 New Revision: 259297 URL: http://svnweb.freebsd.org/changeset/base/259297 Log: MFC r258366: Add assertions to cover all places in the wiring and unwiring code where MAP_ENTRY_IN_TRANSITION is set or cleared. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Fri Dec 13 06:12:21 2013 (r259296) +++ stable/10/sys/vm/vm_map.c Fri Dec 13 06:25:08 2013 (r259297) @@ -2288,6 +2288,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; /* @@ -2356,7 +2359,9 @@ done: } } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, - ("vm_map_unwire: in-transition flag missing")); + ("vm_map_unwire: in-transition flag missing %p", entry)); + KASSERT(entry->wiring_thread == curthread, + ("vm_map_unwire: alien wire %p", entry)); entry->eflags &= ~MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = NULL; if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) { @@ -2456,6 +2461,9 @@ vm_map_wire(vm_map_t map, vm_offset_t st * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; if ((entry->protection & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:25:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45733DE2; Fri, 13 Dec 2013 06:25:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2940616E4; Fri, 13 Dec 2013 06:25:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6PikT087312; Fri, 13 Dec 2013 06:25:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6PikL087311; Fri, 13 Dec 2013 06:25:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130625.rBD6PikL087311@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259298 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:25:44 -0000 Author: kib Date: Fri Dec 13 06:25:43 2013 New Revision: 259298 URL: http://svnweb.freebsd.org/changeset/base/259298 Log: MFC r258366: Add assertions to cover all places in the wiring and unwiring code where MAP_ENTRY_IN_TRANSITION is set or cleared. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Fri Dec 13 06:25:08 2013 (r259297) +++ stable/9/sys/vm/vm_map.c Fri Dec 13 06:25:43 2013 (r259298) @@ -2289,6 +2289,9 @@ vm_map_unwire(vm_map_t map, vm_offset_t * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; /* @@ -2357,7 +2360,9 @@ done: } } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, - ("vm_map_unwire: in-transition flag missing")); + ("vm_map_unwire: in-transition flag missing %p", entry)); + KASSERT(entry->wiring_thread == curthread, + ("vm_map_unwire: alien wire %p", entry)); entry->eflags &= ~MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = NULL; if (entry->eflags & MAP_ENTRY_NEEDS_WAKEUP) { @@ -2457,6 +2462,9 @@ vm_map_wire(vm_map_t map, vm_offset_t st * Mark the entry in case the map lock is released. (See * above.) */ + KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 && + entry->wiring_thread == NULL, + ("owned map entry %p", entry)); entry->eflags |= MAP_ENTRY_IN_TRANSITION; entry->wiring_thread = curthread; if ((entry->protection & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:28:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37790FDD; Fri, 13 Dec 2013 06:28:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09016170B; Fri, 13 Dec 2013 06:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6SIAm087643; Fri, 13 Dec 2013 06:28:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6SIh7087642; Fri, 13 Dec 2013 06:28:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130628.rBD6SIh7087642@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259299 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:28:19 -0000 Author: kib Date: Fri Dec 13 06:28:18 2013 New Revision: 259299 URL: http://svnweb.freebsd.org/changeset/base/259299 Log: MFC r258367: Verify for zero-length requests and act as if it is always successfull without performing any action on the address space. Modified: stable/10/sys/vm/vm_map.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_map.c ============================================================================== --- stable/10/sys/vm/vm_map.c Fri Dec 13 06:25:43 2013 (r259298) +++ stable/10/sys/vm/vm_map.c Fri Dec 13 06:28:18 2013 (r259299) @@ -1876,6 +1876,9 @@ vm_map_protect(vm_map_t map, vm_offset_t struct ucred *cred; vm_prot_t old_prot; + if (start == end) + return (KERN_SUCCESS); + vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2030,12 +2033,16 @@ vm_map_madvise( case MADV_AUTOSYNC: case MADV_NOCORE: case MADV_CORE: + if (start == end) + return (KERN_SUCCESS); modify_map = 1; vm_map_lock(map); break; case MADV_WILLNEED: case MADV_DONTNEED: case MADV_FREE: + if (start == end) + return (KERN_SUCCESS); vm_map_lock_read(map); break; default: @@ -2190,6 +2197,8 @@ vm_map_inherit(vm_map_t map, vm_offset_t default: return (KERN_INVALID_ARGUMENT); } + if (start == end) + return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); if (vm_map_lookup_entry(map, start, &temp_entry)) { @@ -2222,6 +2231,8 @@ vm_map_unwire(vm_map_t map, vm_offset_t int rv; boolean_t need_wakeup, result, user_unwire; + if (start == end) + return (KERN_SUCCESS); user_unwire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2392,6 +2403,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st boolean_t fictitious, need_wakeup, result, user_wire; vm_prot_t prot; + if (start == end) + return (KERN_SUCCESS); prot = 0; if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; @@ -2833,6 +2846,8 @@ vm_map_delete(vm_map_t map, vm_offset_t vm_map_entry_t first_entry; VM_MAP_ASSERT_LOCKED(map); + if (start == end) + return (KERN_SUCCESS); /* * Find the start of the region, and clip it From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:29:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 232D21AA; Fri, 13 Dec 2013 06:29:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E93961712; Fri, 13 Dec 2013 06:29:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6T2SC087751; Fri, 13 Dec 2013 06:29:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6T2je087750; Fri, 13 Dec 2013 06:29:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201312130629.rBD6T2je087750@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 13 Dec 2013 06:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259300 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:29:03 -0000 Author: kib Date: Fri Dec 13 06:29:02 2013 New Revision: 259300 URL: http://svnweb.freebsd.org/changeset/base/259300 Log: MFC r258367: Verify for zero-length requests and act as if it is always successfull without performing any action on the address space. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Fri Dec 13 06:28:18 2013 (r259299) +++ stable/9/sys/vm/vm_map.c Fri Dec 13 06:29:02 2013 (r259300) @@ -1894,6 +1894,9 @@ vm_map_protect(vm_map_t map, vm_offset_t struct ucred *cred; vm_prot_t old_prot; + if (start == end) + return (KERN_SUCCESS); + vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2048,12 +2051,16 @@ vm_map_madvise( case MADV_AUTOSYNC: case MADV_NOCORE: case MADV_CORE: + if (start == end) + return (KERN_SUCCESS); modify_map = 1; vm_map_lock(map); break; case MADV_WILLNEED: case MADV_DONTNEED: case MADV_FREE: + if (start == end) + return (KERN_SUCCESS); vm_map_lock_read(map); break; default: @@ -2191,6 +2198,8 @@ vm_map_inherit(vm_map_t map, vm_offset_t default: return (KERN_INVALID_ARGUMENT); } + if (start == end) + return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); if (vm_map_lookup_entry(map, start, &temp_entry)) { @@ -2223,6 +2232,8 @@ vm_map_unwire(vm_map_t map, vm_offset_t int rv; boolean_t need_wakeup, result, user_unwire; + if (start == end) + return (KERN_SUCCESS); user_unwire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2393,6 +2404,8 @@ vm_map_wire(vm_map_t map, vm_offset_t st boolean_t fictitious, need_wakeup, result, user_wire; vm_prot_t prot; + if (start == end) + return (KERN_SUCCESS); prot = 0; if (flags & VM_MAP_WIRE_WRITE) prot |= VM_PROT_WRITE; @@ -2835,6 +2848,8 @@ vm_map_delete(vm_map_t map, vm_offset_t vm_map_entry_t first_entry; VM_MAP_ASSERT_LOCKED(map); + if (start == end) + return (KERN_SUCCESS); /* * Find the start of the region, and clip it From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 06:59:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 655B5B22; Fri, 13 Dec 2013 06:59:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F34119BD; Fri, 13 Dec 2013 06:59:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD6xLZ9098170; Fri, 13 Dec 2013 06:59:21 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD6xIEa098153; Fri, 13 Dec 2013 06:59:18 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201312130659.rBD6xIEa098153@svn.freebsd.org> From: Peter Grehan Date: Fri, 13 Dec 2013 06:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259301 - in stable/10/usr.sbin: bhyve bhyveload X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 06:59:21 -0000 Author: grehan Date: Fri Dec 13 06:59:18 2013 New Revision: 259301 URL: http://svnweb.freebsd.org/changeset/base/259301 Log: MFC r256657,r257018,r257347,r257423,r257729,r257767, r257933,r258609,r258614,r258668,r258673,r258855 Pull in some minor bugfixes and functionality enhancements from CURRENT. These are candidates to be moved to 10.0-release. r258855 mdoc: quote string properly. r258673 Don't create an initial value for the host filesystem of "/". r258668 Allow bhyve and bhyveload to attach to tty devices. r258614 The 22-bit Data Byte Count (DBC) field of a Physical Region Descriptor was being read as a 32-bit quantity by the bhyve AHCI driver. r258609 Fix discrepancy between the IOAPIC ID advertised by firmware tables and the actual value read by the guest. r257933 Route the legacy timer interrupt (IRQ0) to pin 2 of the IOAPIC. r257767 Fix an off-by-one error when iterating over the emulated PCI BARs. r257729 Add the VM name to the process name with setproctitle(). r257423 Make the virtual ioapic available unconditionally in a bhyve virtual machine. r257347 Update copyright to include the author of the LPC bridge emulation code. hand-merge r257018 Tidy usage messages for bhyve and bhyveload. r256657 Add an option to bhyveload(8) that allows setting a loader environment variable from the command line. Discussed with: neel Modified: stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/acpi.h stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/block_if.c stable/10/usr.sbin/bhyve/mevent.c stable/10/usr.sbin/bhyve/mptbl.c stable/10/usr.sbin/bhyve/mptbl.h stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_virtio_net.c stable/10/usr.sbin/bhyve/pit_8254.c stable/10/usr.sbin/bhyve/uart_emul.c stable/10/usr.sbin/bhyveload/bhyveload.8 stable/10/usr.sbin/bhyveload/bhyveload.c Modified: stable/10/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/10/usr.sbin/bhyve/acpi.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/acpi.c Fri Dec 13 06:59:18 2013 (r259301) @@ -253,13 +253,23 @@ basl_fwrite_madt(FILE *fp) EFPRINTF(fp, "[0001]\t\tSubtable Type : 01\n"); EFPRINTF(fp, "[0001]\t\tLength : 0C\n"); /* iasl expects a hex value for the i/o apic id */ - EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02x\n", basl_ncpu); + EFPRINTF(fp, "[0001]\t\tI/O Apic ID : %02x\n", 0); EFPRINTF(fp, "[0001]\t\tReserved : 00\n"); EFPRINTF(fp, "[0004]\t\tAddress : fec00000\n"); EFPRINTF(fp, "[0004]\t\tInterrupt : 00000000\n"); EFPRINTF(fp, "\n"); - /* Override the 8259 chained vector. XXX maybe not needed */ + /* Legacy IRQ0 is connected to pin 2 of the IOAPIC */ + EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n"); + EFPRINTF(fp, "[0001]\t\tLength : 0A\n"); + EFPRINTF(fp, "[0001]\t\tBus : 00\n"); + EFPRINTF(fp, "[0001]\t\tSource : 00\n"); + EFPRINTF(fp, "[0004]\t\tInterrupt : 00000002\n"); + EFPRINTF(fp, "[0002]\t\tFlags (decoded below) : 0005\n"); + EFPRINTF(fp, "\t\t\tPolarity : 1\n"); + EFPRINTF(fp, "\t\t\tTrigger Mode : 1\n"); + EFPRINTF(fp, "\n"); + EFPRINTF(fp, "[0001]\t\tSubtable Type : 02\n"); EFPRINTF(fp, "[0001]\t\tLength : 0A\n"); EFPRINTF(fp, "[0001]\t\tBus : 00\n"); @@ -806,7 +816,7 @@ static struct { }; int -acpi_build(struct vmctx *ctx, int ncpu, int ioapic) +acpi_build(struct vmctx *ctx, int ncpu) { int err; int i; @@ -814,11 +824,6 @@ acpi_build(struct vmctx *ctx, int ncpu, err = 0; basl_ncpu = ncpu; - if (!ioapic) { - fprintf(stderr, "ACPI tables require an ioapic\n"); - return (EINVAL); - } - /* * For debug, allow the user to have iasl compiler output sent * to stdout rather than /dev/null Modified: stable/10/usr.sbin/bhyve/acpi.h ============================================================================== --- stable/10/usr.sbin/bhyve/acpi.h Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/acpi.h Fri Dec 13 06:59:18 2013 (r259301) @@ -29,6 +29,6 @@ #ifndef _ACPI_H_ #define _ACPI_H_ -int acpi_build(struct vmctx *ctx, int ncpu, int ioapic); +int acpi_build(struct vmctx *ctx, int ncpu); #endif /* _ACPI_H_ */ Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/bhyverun.c Fri Dec 13 06:59:18 2013 (r259301) @@ -132,7 +132,6 @@ usage(int code) " -c: # cpus (default 1)\n" " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" " -H: vmexit from the guest on hlt\n" - " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" " -W: force virtio to use single-vector MSI\n" " -e: exit on unhandled I/O access\n" @@ -191,7 +190,7 @@ fbsdrun_start_thread(void *param) mtp = param; vcpu = mtp->mt_vcpu; - snprintf(tname, sizeof(tname), "%s vcpu %d", vmname, vcpu); + snprintf(tname, sizeof(tname), "vcpu %d", vcpu); pthread_set_name_np(mtp->mt_thr, tname); vm_loop(mtp->mt_ctx, vcpu, vmexit[vcpu].rip); @@ -543,7 +542,7 @@ fbsdrun_set_capabilities(struct vmctx *c int main(int argc, char *argv[]) { - int c, error, gdb_port, err, ioapic, bvmcons; + int c, error, gdb_port, err, bvmcons; int max_vcpus; struct vmctx *ctx; uint64_t rip; @@ -553,7 +552,6 @@ main(int argc, char *argv[]) progname = basename(argv[0]); gdb_port = 0; guest_ncpus = 1; - ioapic = 0; memsize = 256 * MB; while ((c = getopt(argc, argv, "abehAHIPWp:g:c:s:S:m:l:")) != -1) { @@ -601,7 +599,13 @@ main(int argc, char *argv[]) guest_vmexit_on_hlt = 1; break; case 'I': - ioapic = 1; + /* + * The "-I" option was used to add an ioapic to the + * virtual machine. + * + * An ioapic is now provided unconditionally for each + * virtual machine and this option is now deprecated. + */ break; case 'P': guest_vmexit_on_pause = 1; @@ -659,8 +663,7 @@ main(int argc, char *argv[]) if (init_pci(ctx) != 0) exit(1); - if (ioapic) - ioapic_init(0); + ioapic_init(0); if (gdb_port != 0) init_dbgport(gdb_port); @@ -674,14 +677,19 @@ main(int argc, char *argv[]) /* * build the guest tables, MP etc. */ - mptable_build(ctx, guest_ncpus, ioapic); + mptable_build(ctx, guest_ncpus); if (acpi) { - error = acpi_build(ctx, guest_ncpus, ioapic); + error = acpi_build(ctx, guest_ncpus); assert(error == 0); } /* + * Change the proc title to include the VM name. + */ + setproctitle("%s", vmname); + + /* * Add CPU 0 */ fbsdrun_addcpu(ctx, BSP, rip); Modified: stable/10/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/10/usr.sbin/bhyve/block_if.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/block_if.c Fri Dec 13 06:59:18 2013 (r259301) @@ -293,7 +293,7 @@ blockif_open(const char *optstr, const c pthread_create(&bc->bc_btid, NULL, blockif_thr, bc); - snprintf(tname, sizeof(tname), "%s blk-%s", vmname, ident); + snprintf(tname, sizeof(tname), "blk-%s", ident); pthread_set_name_np(bc->bc_btid, tname); return (bc); Modified: stable/10/usr.sbin/bhyve/mevent.c ============================================================================== --- stable/10/usr.sbin/bhyve/mevent.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/mevent.c Fri Dec 13 06:59:18 2013 (r259301) @@ -381,10 +381,8 @@ mevent_delete_close(struct mevent *evp) static void mevent_set_name(void) { - char tname[MAXCOMLEN + 1]; - snprintf(tname, sizeof(tname), "%s mevent", vmname); - pthread_set_name_np(mevent_tid, tname); + pthread_set_name_np(mevent_tid, "mevent"); } void Modified: stable/10/usr.sbin/bhyve/mptbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/mptbl.c Fri Dec 13 06:59:18 2013 (r259301) @@ -242,7 +242,7 @@ mptable_add_oemtbl(void *tbl, int tblsz) } int -mptable_build(struct vmctx *ctx, int ncpu, int ioapic) +mptable_build(struct vmctx *ctx, int ncpu) { mpcth_t mpch; bus_entry_ptr mpeb; @@ -278,15 +278,13 @@ mptable_build(struct vmctx *ctx, int ncp curraddr += sizeof(*mpeb) * MPE_NUM_BUSES; mpch->entry_count += MPE_NUM_BUSES; - if (ioapic) { - mpei = (io_apic_entry_ptr)curraddr; - mpt_build_ioapic_entries(mpei, ncpu + 1); - curraddr += sizeof(*mpei); - mpch->entry_count++; - } + mpei = (io_apic_entry_ptr)curraddr; + mpt_build_ioapic_entries(mpei, 0); + curraddr += sizeof(*mpei); + mpch->entry_count++; mpie = (int_entry_ptr) curraddr; - mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, ncpu + 1); + mpt_build_ioint_entries(mpie, MPEII_MAX_IRQ, 0); curraddr += sizeof(*mpie) * MPEII_MAX_IRQ; mpch->entry_count += MPEII_MAX_IRQ; Modified: stable/10/usr.sbin/bhyve/mptbl.h ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.h Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/mptbl.h Fri Dec 13 06:59:18 2013 (r259301) @@ -29,7 +29,7 @@ #ifndef _MPTBL_H_ #define _MPTBL_H_ -int mptable_build(struct vmctx *ctx, int ncpu, int ioapic); +int mptable_build(struct vmctx *ctx, int ncpu); void mptable_add_oemtbl(void *tbl, int tblsz); #endif /* _MPTBL_H_ */ Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Fri Dec 13 06:59:18 2013 (r259301) @@ -165,6 +165,7 @@ struct ahci_cmd_hdr { struct ahci_prdt_entry { uint64_t dba; uint32_t reserved; +#define DBCMASK 0x3fffff uint32_t dbc; }; @@ -461,10 +462,13 @@ ahci_handle_dma(struct ahci_port *p, int * Build up the iovec based on the prdt */ for (i = 0; i < iovcnt; i++) { + uint32_t dbcsz; + + dbcsz = (prdt->dbc & DBCMASK) + 1; breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, prdt->dbc + 1); - breq->br_iov[i].iov_len = prdt->dbc + 1; - aior->done += (prdt->dbc + 1); + prdt->dba, dbcsz); + breq->br_iov[i].iov_len = dbcsz; + aior->done += dbcsz; prdt++; } if (readop) @@ -513,11 +517,14 @@ write_prdt(struct ahci_port *p, int slot from = buf; prdt = (struct ahci_prdt_entry *)(cfis + 0x80); for (i = 0; i < hdr->prdtl && len; i++) { - uint8_t *ptr = paddr_guest2host(ahci_ctx(p->pr_sc), - prdt->dba, prdt->dbc + 1); - memcpy(ptr, from, prdt->dbc + 1); - len -= (prdt->dbc + 1); - from += (prdt->dbc + 1); + uint8_t *ptr; + uint32_t dbcsz; + + dbcsz = (prdt->dbc & DBCMASK) + 1; + ptr = paddr_guest2host(ahci_ctx(p->pr_sc), prdt->dba, dbcsz); + memcpy(ptr, from, dbcsz); + len -= dbcsz; + from += dbcsz; prdt++; } hdr->prdbc = size - len; @@ -908,10 +915,13 @@ atapi_read(struct ahci_port *p, int slot * Build up the iovec based on the prdt */ for (i = 0; i < iovcnt; i++) { + uint32_t dbcsz; + + dbcsz = (prdt->dbc & DBCMASK) + 1; breq->br_iov[i].iov_base = paddr_guest2host(ahci_ctx(sc), - prdt->dba, prdt->dbc + 1); - breq->br_iov[i].iov_len = prdt->dbc + 1; - aior->done += (prdt->dbc + 1); + prdt->dba, dbcsz); + breq->br_iov[i].iov_len = dbcsz; + aior->done += dbcsz; prdt++; } err = blockif_read(p->bctx, breq); @@ -1714,11 +1724,9 @@ pci_ahci_init(struct vmctx *ctx, struct /* * Attempt to open the backing image. Use the PCI - * slot/func/ahci_port for the identifier string - * since that uniquely identifies a storage device. + * slot/func for the identifier string. */ - snprintf(bident, sizeof(bident), "%d:%d:%d", pi->pi_slot, pi->pi_func, - 0); + snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); bctxt = blockif_open(opts, bident); if (bctxt == NULL) { ret = 1; Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/pci_emul.c Fri Dec 13 06:59:18 2013 (r259301) @@ -1252,7 +1252,7 @@ pci_emul_cmdwrite(struct pci_devinst *pi * If the MMIO or I/O address space decoding has changed then * register/unregister all BARs that decode that address space. */ - for (i = 0; i < PCI_BARMAX; i++) { + for (i = 0; i <= PCI_BARMAX; i++) { switch (pi->pi_bar[i].type) { case PCIBAR_NONE: case PCIBAR_MEMHI64: Modified: stable/10/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_virtio_net.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/pci_virtio_net.c Fri Dec 13 06:59:18 2013 (r259301) @@ -588,7 +588,7 @@ pci_vtnet_init(struct vmctx *ctx, struct */ if (!mac_provided) { snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); + pi->pi_func, vmname); MD5Init(&mdctx); MD5Update(&mdctx, nstr, strlen(nstr)); @@ -632,7 +632,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pthread_mutex_init(&sc->tx_mtx, NULL); pthread_cond_init(&sc->tx_cond, NULL); pthread_create(&sc->tx_tid, NULL, pci_vtnet_tx_thread, (void *)sc); - snprintf(tname, sizeof(tname), "%s vtnet%d tx", vmname, pi->pi_slot); + snprintf(tname, sizeof(tname), "vtnet-%d:%d tx", pi->pi_slot, + pi->pi_func); pthread_set_name_np(sc->tx_tid, tname); return (0); Modified: stable/10/usr.sbin/bhyve/pit_8254.c ============================================================================== --- stable/10/usr.sbin/bhyve/pit_8254.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/pit_8254.c Fri Dec 13 06:59:18 2013 (r259301) @@ -106,8 +106,8 @@ pit_mevent_cb(int fd, enum ev_type type, pit_mev_count++; - ioapic_assert_pin(c->ctx, 0); - ioapic_deassert_pin(c->ctx, 0); + ioapic_assert_pin(c->ctx, 2); + ioapic_deassert_pin(c->ctx, 2); /* * Delete the timer for one-shots Modified: stable/10/usr.sbin/bhyve/uart_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/uart_emul.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyve/uart_emul.c Fri Dec 13 06:59:18 2013 (r259301) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -67,6 +68,7 @@ __FBSDID("$FreeBSD$"); #define FIFOSZ 16 static bool uart_stdio; /* stdio in use for i/o */ +static struct termios tio_stdio_orig; static struct { int baseaddr; @@ -87,6 +89,12 @@ struct fifo { int size; /* size of the fifo */ }; +struct ttyfd { + bool opened; + int fd; /* tty device file descriptor */ + struct termios tio_orig, tio_new; /* I/O Terminals */ +}; + struct uart_softc { pthread_mutex_t mtx; /* protects all softc elements */ uint8_t data; /* Data register (R/W) */ @@ -103,8 +111,7 @@ struct uart_softc { struct fifo rxfifo; - bool opened; - bool stdio; + struct ttyfd tty; bool thre_int_pending; /* THRE interrupt pending */ void *arg; @@ -114,38 +121,41 @@ struct uart_softc { static void uart_drain(int fd, enum ev_type ev, void *arg); -static struct termios tio_orig, tio_new; /* I/O Terminals */ - static void ttyclose(void) { - tcsetattr(STDIN_FILENO, TCSANOW, &tio_orig); + tcsetattr(STDIN_FILENO, TCSANOW, &tio_stdio_orig); } static void -ttyopen(void) +ttyopen(struct ttyfd *tf) { - tcgetattr(STDIN_FILENO, &tio_orig); + tcgetattr(tf->fd, &tf->tio_orig); - cfmakeraw(&tio_new); - tcsetattr(STDIN_FILENO, TCSANOW, &tio_new); + tf->tio_new = tf->tio_orig; + cfmakeraw(&tf->tio_new); + tf->tio_new.c_cflag |= CLOCAL; + tcsetattr(tf->fd, TCSANOW, &tf->tio_new); - atexit(ttyclose); + if (tf->fd == STDIN_FILENO) { + tio_stdio_orig = tf->tio_orig; + atexit(ttyclose); + } } static bool -tty_char_available(void) +tty_char_available(struct ttyfd *tf) { fd_set rfds; struct timeval tv; FD_ZERO(&rfds); - FD_SET(STDIN_FILENO, &rfds); + FD_SET(tf->fd, &rfds); tv.tv_sec = 0; tv.tv_usec = 0; - if (select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv) > 0 ) { + if (select(tf->fd + 1, &rfds, NULL, NULL, &tv) > 0 ) { return (true); } else { return (false); @@ -153,12 +163,12 @@ tty_char_available(void) } static int -ttyread(void) +ttyread(struct ttyfd *tf) { char rb; - if (tty_char_available()) { - read(STDIN_FILENO, &rb, 1); + if (tty_char_available(tf)) { + read(tf->fd, &rb, 1); return (rb & 0xff); } else { return (-1); @@ -166,10 +176,10 @@ ttyread(void) } static void -ttywrite(unsigned char wb) +ttywrite(struct ttyfd *tf, unsigned char wb) { - (void)write(STDIN_FILENO, &wb, 1); + (void)write(tf->fd, &wb, 1); } static void @@ -226,10 +236,8 @@ uart_opentty(struct uart_softc *sc) { struct mevent *mev; - assert(!sc->opened && sc->stdio); - - ttyopen(); - mev = mevent_add(STDIN_FILENO, EVF_READ, uart_drain, sc); + ttyopen(&sc->tty); + mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); assert(mev); } @@ -294,7 +302,7 @@ uart_drain(int fd, enum ev_type ev, void sc = arg; - assert(fd == STDIN_FILENO); + assert(fd == sc->tty.fd); assert(ev == EVF_READ); /* @@ -305,10 +313,10 @@ uart_drain(int fd, enum ev_type ev, void pthread_mutex_lock(&sc->mtx); if ((sc->mcr & MCR_LOOPBACK) != 0) { - (void) ttyread(); + (void) ttyread(&sc->tty); } else { while (fifo_available(&sc->rxfifo) && - ((ch = ttyread()) != -1)) { + ((ch = ttyread(&sc->tty)) != -1)) { fifo_putchar(&sc->rxfifo, ch); } uart_toggle_intr(sc); @@ -323,12 +331,6 @@ uart_write(struct uart_softc *sc, int of int fifosz; uint8_t msr; - /* Open terminal */ - if (!sc->opened && sc->stdio) { - uart_opentty(sc); - sc->opened = true; - } - pthread_mutex_lock(&sc->mtx); /* @@ -351,8 +353,8 @@ uart_write(struct uart_softc *sc, int of if (sc->mcr & MCR_LOOPBACK) { if (fifo_putchar(&sc->rxfifo, value) != 0) sc->lsr |= LSR_OE; - } else if (sc->stdio) { - ttywrite(value); + } else if (sc->tty.opened) { + ttywrite(&sc->tty, value); } /* else drop on floor */ sc->thre_int_pending = true; break; @@ -459,12 +461,6 @@ uart_read(struct uart_softc *sc, int off { uint8_t iir, intr_reason, reg; - /* Open terminal */ - if (!sc->opened && sc->stdio) { - uart_opentty(sc); - sc->opened = true; - } - pthread_mutex_lock(&sc->mtx); /* @@ -581,19 +577,47 @@ uart_init(uart_intr_func_t intr_assert, return (sc); } +static int +uart_tty_backend(struct uart_softc *sc, const char *opts) +{ + int fd; + int retval; + + retval = -1; + + fd = open(opts, O_RDWR); + if (fd > 0 && isatty(fd)) { + sc->tty.fd = fd; + sc->tty.opened = true; + retval = 0; + } + + return (retval); +} + int uart_set_backend(struct uart_softc *sc, const char *opts) { - /* - * XXX one stdio backend supported at this time. - */ + int retval; + + retval = -1; + if (opts == NULL) return (0); - if (strcmp("stdio", opts) == 0 && !uart_stdio) { - sc->stdio = true; - uart_stdio = true; - return (0); - } else - return (-1); + if (strcmp("stdio", opts) == 0) { + if (!uart_stdio) { + sc->tty.fd = STDIN_FILENO; + sc->tty.opened = true; + uart_stdio = true; + retval = 0; + } + } else if (uart_tty_backend(sc, opts) == 0) { + retval = 0; + } + + if (retval == 0) + uart_opentty(sc); + + return (retval); } Modified: stable/10/usr.sbin/bhyveload/bhyveload.8 ============================================================================== --- stable/10/usr.sbin/bhyveload/bhyveload.8 Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyveload/bhyveload.8 Fri Dec 13 06:59:18 2013 (r259301) @@ -38,6 +38,8 @@ guest inside a bhyve virtual machine .Op Fl m Ar mem-size .Op Fl d Ar disk-path .Op Fl h Ar host-path +.Op Fl e Ar name=value +.Op Fl c Ar cons-dev .Ar vmname .Sh DESCRIPTION .Nm @@ -91,6 +93,24 @@ is the pathname of the guest's boot disk The .Ar host-path is the directory at the top of the guest's boot filesystem. +.It Fl e Ar name=value +Set the FreeBSD loader environment variable +.Ar name +to +.Ar value . +.Pp +The option may be used more than once to set more than one environment +variable. +.It Fl c Ar cons-dev +.Ar cons-dev +is a +.Xr tty 4 +device to use for +.Nm +terminal I/O. +.Pp +The text string "stdio" is also accepted and selects the use of +unbuffered standard I/O. This is the default value. .El .Sh EXAMPLES To create a virtual machine named @@ -100,10 +120,23 @@ that boots off the ISO image and has 1GB memory allocated to it: .Pp .Dl "bhyveload -m 1G -d /freebsd/release.iso freebsd-vm" +.Pp +To create a virtual machine named +.Ar test-vm +with 256MB of memory allocated, the guest root filesystem under the host +directory +.Pa /user/images/test +and terminal I/O sent to the +.Xr nmdm 4 +device +.Pa /dev/nmdm1B +.Pp +.Dl "bhyveload -m 256MB -h /usr/images/test -c /dev/nmdm1B test-vm" .Sh SEE ALSO .Xr bhyve 4 , .Xr bhyve 8 , .Xr loader 8 , +.Xr nmdm 4, .Xr vmm 4 .Sh HISTORY .Nm Modified: stable/10/usr.sbin/bhyveload/bhyveload.c ============================================================================== --- stable/10/usr.sbin/bhyveload/bhyveload.c Fri Dec 13 06:29:02 2013 (r259300) +++ stable/10/usr.sbin/bhyveload/bhyveload.c Fri Dec 13 06:59:18 2013 (r259301) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -86,9 +88,10 @@ __FBSDID("$FreeBSD$"); #define GB (1024 * 1024 * 1024UL) #define BSP 0 -static char *host_base = "/"; +static char *host_base; static struct termios term, oldterm; static int disk_fd = -1; +static int consin_fd, consout_fd; static char *vmname, *progname; static struct vmctx *ctx; @@ -106,7 +109,7 @@ cb_putc(void *arg, int ch) { char c = ch; - write(1, &c, 1); + (void) write(consout_fd, &c, 1); } static int @@ -114,7 +117,7 @@ cb_getc(void *arg) { char c; - if (read(0, &c, 1) == 1) + if (read(consin_fd, &c, 1) == 1) return (c); return (-1); } @@ -124,7 +127,7 @@ cb_poll(void *arg) { int n; - if (ioctl(0, FIONREAD, &n) >= 0) + if (ioctl(consin_fd, FIONREAD, &n) >= 0) return (n > 0); return (0); } @@ -486,7 +489,7 @@ static void cb_exit(void *arg, int v) { - tcsetattr(0, TCSAFLUSH, &oldterm); + tcsetattr(consout_fd, TCSAFLUSH, &oldterm); exit(v); } @@ -498,23 +501,37 @@ cb_getmem(void *arg, uint64_t *ret_lowme vm_get_memory_seg(ctx, 4 * GB, ret_highmem, NULL); } +struct env { + const char *str; /* name=value */ + SLIST_ENTRY(env) next; +}; + +static SLIST_HEAD(envhead, env) envhead; + +static void +addenv(const char *str) +{ + struct env *env; + + env = malloc(sizeof(struct env)); + env->str = str; + SLIST_INSERT_HEAD(&envhead, env, next); +} + static const char * cb_getenv(void *arg, int num) { - int max; - - static const char * var[] = { - "smbios.bios.vendor=BHYVE", - "boot_serial=1", - NULL - }; + int i; + struct env *env; - max = sizeof(var) / sizeof(var[0]); + i = 0; + SLIST_FOREACH(env, &envhead, next) { + if (i == num) + return (env->str); + i++; + } - if (num < max) - return (var[num]); - else - return (NULL); + return (NULL); } static struct loader_callbacks cb = { @@ -548,13 +565,46 @@ static struct loader_callbacks cb = { .getenv = cb_getenv, }; +static int +altcons_open(char *path) +{ + struct stat sb; + int err; + int fd; + + /* + * Allow stdio to be passed in so that the same string + * can be used for the bhyveload console and bhyve com-port + * parameters + */ + if (!strcmp(path, "stdio")) + return (0); + + err = stat(path, &sb); + if (err == 0) { + if (!S_ISCHR(sb.st_mode)) + err = ENOTSUP; + else { + fd = open(path, O_RDWR | O_NONBLOCK); + if (fd < 0) + err = errno; + else + consin_fd = consout_fd = fd; + } + } + + return (err); +} + static void usage(void) { fprintf(stderr, - "usage: %s [-m mem-size][-d ] [-h ] " - "\n", progname); + "usage: %s [-m mem-size] [-d ] [-h ]\n" + " %*s [-e ] [-c ] \n", + progname, + (int)strlen(progname), ""); exit(1); } @@ -567,17 +617,29 @@ main(int argc, char** argv) int opt, error; char *disk_image; - progname = argv[0]; + progname = basename(argv[0]); mem_size = 256 * MB; disk_image = NULL; - while ((opt = getopt(argc, argv, "d:h:m:")) != -1) { + consin_fd = STDIN_FILENO; + consout_fd = STDOUT_FILENO; + + while ((opt = getopt(argc, argv, "c:d:e:h:m:")) != -1) { switch (opt) { + case 'c': + error = altcons_open(optarg); + if (error != 0) + errx(EX_USAGE, "Could not open '%s'", optarg); + break; case 'd': disk_image = optarg; break; + case 'e': + addenv(optarg); + break; + case 'h': host_base = optarg; break; @@ -619,11 +681,13 @@ main(int argc, char** argv) exit(1); } - tcgetattr(0, &term); + tcgetattr(consout_fd, &term); oldterm = term; - term.c_lflag &= ~(ICANON|ECHO); - term.c_iflag &= ~ICRNL; - tcsetattr(0, TCSAFLUSH, &term); + cfmakeraw(&term); + term.c_cflag |= CLOCAL; + + tcsetattr(consout_fd, TCSAFLUSH, &term); + h = dlopen("/boot/userboot.so", RTLD_LOCAL); if (!h) { printf("%s\n", dlerror()); @@ -638,5 +702,9 @@ main(int argc, char** argv) if (disk_image) { disk_fd = open(disk_image, O_RDONLY); } + + addenv("smbios.bios.vendor=BHYVE"); + addenv("boot_serial=1"); + func(&cb, NULL, USERBOOT_VERSION_3, disk_fd >= 0); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 07:56:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32E98E35; Fri, 13 Dec 2013 07:56:02 +0000 (UTC) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [IPv6:2a00:1450:400c:c00::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 53AF21EF4; Fri, 13 Dec 2013 07:56:01 +0000 (UTC) Received: by mail-wg0-f41.google.com with SMTP id y10so1598434wgg.4 for ; Thu, 12 Dec 2013 23:55:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=YhLXsgppWYp/1pLjqocHuhfVuIXg/VrGvoGZKLfBZ5Y=; b=Vx+HGX+YtKiwUPrIUyDNqR9ghQCh9eDuZUWcUBXwMEhLoLHmGokz6fCbFh167nN1Ww crJBVae5aeMJGamtGPm0yS0s6a/M1AhFs2cnn/LnA1G4zy+SheK4gNkK6mrHQRyNo84g o8J/x9LRR2vEt5yjwdic2MFClDg6IpRC3KwENubTI3FEV4mKY18biVzEYG1AeIxY1p1h yZ3ICnmbK4LtH5Fa+2SP/eUVGNdJ9cudZS4CdFFlvPnmCeBuQ2ZltDkZthz12LI8b/Dv pPBTmcjIX9byqT2mDJsmYP3rV3aH+nihGUknHG2PMzxhmaB5lCR3CTv5Xy1d7XHzNHdI fsCA== MIME-Version: 1.0 X-Received: by 10.194.61.211 with SMTP id s19mr886995wjr.73.1386921359725; Thu, 12 Dec 2013 23:55:59 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.217.64.198 with HTTP; Thu, 12 Dec 2013 23:55:59 -0800 (PST) In-Reply-To: <201312122233.rBCMXW2Z015941@svn.freebsd.org> References: <201312122233.rBCMXW2Z015941@svn.freebsd.org> Date: Fri, 13 Dec 2013 11:55:59 +0400 X-Google-Sender-Auth: 6zhkMDtzAjb-QW3LTlyR8WqkCd0 Message-ID: Subject: Re: svn commit: r259280 - head/sbin/growfs From: Sergey Kandaurov To: Gleb Smirnoff Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 07:56:02 -0000 On 13 December 2013 02:33, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Dec 12 22:33:32 2013 > New Revision: 259280 > URL: http://svnweb.freebsd.org/changeset/base/259280 > > Log: > Somehow stable/10 branch contains correct version, but head doesn't. > > Modified: > head/sbin/growfs/growfs.8 > > Modified: head/sbin/growfs/growfs.8 > ============================================================================== > --- head/sbin/growfs/growfs.8 Thu Dec 12 22:04:47 2013 (r259279) > +++ head/sbin/growfs/growfs.8 Thu Dec 12 22:33:32 2013 (r259280) > @@ -116,7 +116,7 @@ The > utility first appeared in > .Fx 4.4 . > The ability to resize mounted filesystems was added in > -.Fx 9.2 . > +.Fx 10.0 . > .Sh AUTHORS > .An Christoph Herrmann Aq chm@FreeBSD.org > .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org It was merged in stable/9 before 9.2 in r246235. -- wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 08:14:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5527B6B7; Fri, 13 Dec 2013 08:14:54 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C58F5107F; Fri, 13 Dec 2013 08:14:52 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.7/8.14.7) with ESMTP id rBD8EoGn026386 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 13 Dec 2013 12:14:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.7/8.14.7/Submit) id rBD8EooP026385; Fri, 13 Dec 2013 12:14:50 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 13 Dec 2013 12:14:50 +0400 From: Gleb Smirnoff To: Sergey Kandaurov Subject: Re: svn commit: r259280 - head/sbin/growfs Message-ID: <20131213081450.GK21368@FreeBSD.org> References: <201312122233.rBCMXW2Z015941@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 08:14:54 -0000 On Fri, Dec 13, 2013 at 11:55:59AM +0400, Sergey Kandaurov wrote: S> On 13 December 2013 02:33, Gleb Smirnoff wrote: S> > Author: glebius S> > Date: Thu Dec 12 22:33:32 2013 S> > New Revision: 259280 S> > URL: http://svnweb.freebsd.org/changeset/base/259280 S> > S> > Log: S> > Somehow stable/10 branch contains correct version, but head doesn't. S> > S> > Modified: S> > head/sbin/growfs/growfs.8 S> > S> > Modified: head/sbin/growfs/growfs.8 S> > ============================================================================== S> > --- head/sbin/growfs/growfs.8 Thu Dec 12 22:04:47 2013 (r259279) S> > +++ head/sbin/growfs/growfs.8 Thu Dec 12 22:33:32 2013 (r259280) S> > @@ -116,7 +116,7 @@ The S> > utility first appeared in S> > .Fx 4.4 . S> > The ability to resize mounted filesystems was added in S> > -.Fx 9.2 . S> > +.Fx 10.0 . S> > .Sh AUTHORS S> > .An Christoph Herrmann Aq chm@FreeBSD.org S> > .An Thomas-Henning von Kamptz Aq tomsoft@FreeBSD.org S> S> It was merged in stable/9 before 9.2 in r246235. After 9.2: http://svnweb.freebsd.org/base/release/9.2.0/sbin/growfs/ Thus, it first appeared in 10.0. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 08:31:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21B9BE0F; Fri, 13 Dec 2013 08:31:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02F6411D3; Fri, 13 Dec 2013 08:31:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBD8VDfX033832; Fri, 13 Dec 2013 08:31:13 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBD8VDpF033830; Fri, 13 Dec 2013 08:31:13 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201312130831.rBD8VDpF033830@svn.freebsd.org> From: Peter Grehan Date: Fri, 13 Dec 2013 08:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259302 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 08:31:14 -0000 Author: grehan Date: Fri Dec 13 08:31:13 2013 New Revision: 259302 URL: http://svnweb.freebsd.org/changeset/base/259302 Log: bhyve(8) man page. mdoc formatting and much input and review from Warren Block (wblock@). Reviewed by: many MFC after: 3 days Added: head/usr.sbin/bhyve/bhyve.8 (contents, props changed) Modified: head/usr.sbin/bhyve/Makefile Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Fri Dec 13 06:59:18 2013 (r259301) +++ head/usr.sbin/bhyve/Makefile Fri Dec 13 08:31:13 2013 (r259302) @@ -6,6 +6,7 @@ PROG= bhyve DEBUG_FLAGS= -g -O0 +MAN= bhyve.8 SRCS= acpi.c atpic.c bhyverun.c block_if.c consport.c dbgport.c elcr.c SRCS+= inout.c legacy_irq.c mem.c mevent.c mptbl.c pci_ahci.c SRCS+= pci_emul.c pci_hostbridge.c pci_lpc.c pci_passthru.c pci_virtio_block.c @@ -15,8 +16,6 @@ SRCS+= uart_emul.c virtio.c xmsr.c spinu .PATH: ${.CURDIR}/../../sys/amd64/vmm SRCS+= vmm_instruction_emul.c -NO_MAN= - DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBUTIL} ${LIBPTHREAD} LDADD= -lvmmapi -lmd -lutil -lpthread Added: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/bhyve.8 Fri Dec 13 08:31:13 2013 (r259302) @@ -0,0 +1,299 @@ +.\" Copyright (c) 2013 Peter Grehan +.\" 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 AUTHORS 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 AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 12, 2013 +.Dt BHYVE 8 +.Os +.Sh NAME +.Nm bhyve +.Nd "run a guest operating system inside a virtual machine" +.Sh SYNOPSIS +.Nm +.Op Fl aehAHPW +.Op Fl c Ar numcpus +.Op Fl g Ar gdbport +.Op Fl p Ar pinnedcpu +.Op Fl s Ar slot,emulation Ns Op , Ns Ar conf +.Op Fl S Ar slot,emulation Ns Op , Ns Ar conf +.Op Fl l Ar lpcdev Ns Op , Ns Ar conf +.Ar vmname +.Sh DESCRIPTION +.Nm +is an experimental hypervisor that runs guest operating systems inside a +virtual machine. +.Pp +Parameters such as the number of virtual CPUs, amount of guest memory, and +I/O connectivity can be specified with command-line parameters. +.Pp +The guest operating system must be loaded with +.Xr bhyveload 4 +or a similar boot loader before running +.Nm . +.Pp +.Nm +runs until the guest operating system reboots or an unhandled hypervisor +exit is detected. +.Sh OPTIONS +.Bl -tag -width 10n +.It Fl a +Disallow use of the local APIC in X2APIC mode. +.It Fl A +Generate ACPI tables. +Required for +.Fx Ns /amd64 +guests. +.It Fl c Ar numcpus +Number of guest virtual CPUs. +The default is 1 and the maximum is 16. +.It Fl H +Yield the virtual CPU thread when a HLT instruction is detected. +If this option is not specified, virtual CPUs will use 100% of a host CPU. +.It Fl g Ar gdbport +For +.Fx Ns /amd64 kernels compiled with +.Cd "option bvmdebug" , +allow a remote kernel kgdb to be relayed to the guest kernel gdb stub +via a local IPv4 address and this port. +This option will be deprecated in a future version. +.It Fl p Ar pinnedcpu +Force guest virtual CPUs to be pinned to host CPUs. +Virtual CPU +.Em n +is pinned to host CPU +.Em pinnedcpu+n . +.It Fl P +Force the guest virtual CPU to exit when a PAUSE instruction is detected. +.It Fl W +Force virtio PCI device emulations to use MSI interrupts instead of MSI-X +interrupts. +.It Fl s Ar slot,emulation Ns Op , Ns Ar conf +Configure a virtual PCI slot and function. +.Pp +.Nm bhyve +provides PCI bus emulation and virtual devices that can be attached to +slots on the bus. +There are 32 available slots, with the option of providing up to 8 functions +per slot. +.Bl -tag -width 10n +.It Ar slot +.Ar pcislot Ns Op Ar :function +.Pp +The +.Ar pcislot +value is 0 to 31 and the optional function value is 0 to 7. +If not specified, the function value defaults to 0. +.It Ar emulation +.Bl -tag -width 10n +.It Li hostbridge | Li amd_hostbridge +.Pp +Provide a simple host bridge. +This is usually configured at slot 0, and is required by most guest +operating systems. +The +.Li amd_hostbridge +emulation is identical but uses a PCI vendor ID of +.Li AMD . +.It Li passthru +PCI pass-through device. +.It Li virtio-net +Virtio network interface. +.It Li virtio-block +Virtio block storage interface. +.It Li ahci-cd +AHCI controller attached to an ATAPI CD/DVD. +.It Li ahci-hd +AHCI controller attached to a SATA hard-drive. +.It Li uart +PCI 16550 serial device. +.It Li lpc +LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports. +.El +.It Op Ar conf +This optional parameter describes the backend for device emulations. +If +.Ar conf +is not specified, the device emulation has no backend and can be +considered unconnected. +.Pp +Network devices: +.Bl -tag -width 10n +.It Ar tapN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx +.It Ar vmnetN Ns Op , Ns Ar mac=xx:xx:xx:xx:xx:xx +.Pp +If +.Ar mac +is not specified, the MAC address is derived from a fixed OUI and the +remaining bytes from an MD5 hash of the slot and function numbers and +the device name. +.Pp +The MAC address is an ASCII string in +.Xr ethers 5 +format. +.El +.Pp +Block storage devices: +.Bl -tag -width 10n +.It Pa /filename Ns Oo , Ns Li nocache Oc Ns Oo , Ns Li direct Oc Ns Oo , Ns Li ro Oc +.It Pa /dev/xxx Ns Oo , Ns Ar nocache Oc Ns Oo , Ns Ar direct Oc Ns Oo , Ns Ar ro Oc +.Bl -tag -width 8n +.It Li nocache +Open the file with +.Dv O_DIRECT . +.It Li direct +Open the file using +.Dv O_SYNC . +.It Li ro +Force the file to be opened read-only. +.El +.Pp +The +.Li nocache , +.Li direct , +and +.Li ro +options are not available for virtio block devices. +.El +.Pp +TTY devices: +.Bl -tag -width 10n +.It Li stdio +Connect the serial port to the standard input and output of +the bhyve process. +.It Pa /dev/xxx +Use the host TTY device for serial port I/O. +.El +.Pp +Pass-through devices: +.Bl -tag -width 10n +.It Ns Ar slot Ns / Ns Ar bus Ns / Ns Ar function +Connect to a PCI device on the host at the selector described by +.Ar slot , +.Ar bus , +and +.Ar function +numbers. +.El +.Pp +The host device must have been reserved at boot-time using the +.Va pptdev +loader variable as described in +.Xr vmm 4 . +.El +.It Fl S Ar slot , Ns Ar emulation Ns Op , Ns Ar conf +Identical to the -s option except the device is instructed to use legacy +ISA addresses if possible. +Currently this only has an effect with the +.Li uart +device emulation. +This option will be deprecated in a future version. +.It Fl l Ar lpcdev Ns Op , Ns Ar conf +Allow devices behind the LPC PCI-ISA bridge to be configured. +The only supported devices are the TTY-class devices, +.Li com1 +and +.Li com2 . +.It Fl m Ar size Ns Op Ar K|k|M|m|G|g|T|t +Guest physical memory size in bytes. +This must be the same size that was given to +.Xr bhyveload 8 . +.Pp +The size argument may be suffixed with one of K, M, G or T (either upper +or lower case) to indicate a multiple of kilobytes, megabytes, gigabytes, +or terabytes. +If no suffix is given, the value is assumed to be in megabytes. +.It Fl e +Force +.Nm +to exit when a guest issues an access to an I/O port that is not emulated. +This is intended for debug purposes. +.It Fl h +Print help message and exit. +.It Ar vmname +Alphanumeric name of the guest. +This should be the same as that created by +.Xr bhyveload 8 . +.El +.Sh EXAMPLES +The guest operating system must have been loaded with +.Xr bhyveload 4 +or a similar boot loader before +.Xr bhyve 4 +can be run. +.Pp +To run a virtual machine with 1GB of memory, two virtual CPUs, a virtio +block device backed by the +.Pa /my/image +filesystem image, and a serial port for the console: +.Bd -literal -offset indent +bhyve -c 2 -s 0,hostbridge -s 1,lpc -s 2,virtio-blk,/my/image \\ + -l com1,stdio -A -H -P -m 1G vm1 +.Ed +.Pp +Run a 24GB single-CPU virtual machine with three network ports, one of which +has a MAC address specified: +.Bd -literal -offset indent +bhyve -s 0,hostbridge -s 1,lpc -s 2:0,virtio-net,tap0 \\ + -s 2:1,virtio-net,tap1 \\ + -s 2:2,virtio-net,tap2,mac=00:be:fa:76:45:00 \\ + -s 3,virtio-blk,/my/image -l com1,stdio \\ + -A -H -P -m 24G bigvm +.Ed +.Pp +Run an 8GB quad-CPU virtual machine with 8 AHCI SATA disks, an AHCI ATAPI +CD-ROM, a single virtio network port, an AMD hostbridge, and the console +port connected to an +.Xr nmdm 4 +null-model device. +.Bd -literal -offset indent +bhyve -c 4 \e\ + -s 0,amd_hostbridge -s 1,lpc \\ + -s 1:0,ahci-hd,/images/disk.1 \\ + -s 1:1,ahci-hd,/images/disk.2 \\ + -s 1:2,ahci-hd,/images/disk.3 \\ + -s 1:3,ahci-hd,/images/disk.4 \\ + -s 1:4,ahci-hd,/images/disk.5 \\ + -s 1:5,ahci-hd,/images/disk.6 \\ + -s 1:6,ahci-hd,/images/disk.7 \\ + -s 1:7,ahci-hd,/images/disk.8 \\ + -s 2,ahci-cd,/images.install.iso \\ + -s 3,virtio-net,tap0 \\ + -l com1,/dev/nmdm0A \\ + -A -H -P -m 8G +.Ed +.Sh SEE ALSO +.Xr bhyve 4 , +.Xr nmdm 4 , +.Xr vmm 4 , +.Xr ethers 5 , +.Xr bhyveload 8 , +.Xr bhyvectl 8 +.Sh HISTORY +.Nm +first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An Neel Natu Aq neel@freebsd.org +.An Peter Grehan Aq grehan@freebsd.org From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 08:48:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B2756A5; Fri, 13 Dec 2013 08:48:11 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0868912E2; Fri, 13 Dec 2013 08:48:10 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id D7F29730C; Fri, 13 Dec 2013 08:48:09 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 712051ACB; Fri, 13 Dec 2013 09:48:12 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John Baldwin Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312051650.26379.jhb@freebsd.org> Date: Fri, 13 Dec 2013 09:48:12 +0100 In-Reply-To: <201312051650.26379.jhb@freebsd.org> (John Baldwin's message of "Thu, 5 Dec 2013 16:50:26 -0500") Message-ID: <86a9g5uofn.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 08:48:11 -0000 > LINT64 is yet another kernel config covered by 'make tinderbox', but not = by > the periodic tinderbox. It is probably worth adding to the periodic tind= erbox=20 > (someday it'd be nice if the two tinderboxes built the same set of things= ). Some day it would be nice if people talked to me directly instead of sniping from the sidelines. The root issue here is that "make LINT" is poorly implemented, so under some circumstances (including the tinderbox and, if I read the code correctly, 'make universe'), the LINT64 config is never generated. Oh, and 'make tinderbox' should die. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 13:18:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6972F656; Fri, 13 Dec 2013 13:18:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5506216E7; Fri, 13 Dec 2013 13:18:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDDI0Y3035856; Fri, 13 Dec 2013 13:18:00 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDDI0Bk035855; Fri, 13 Dec 2013 13:18:00 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201312131318.rBDDI0Bk035855@svn.freebsd.org> From: Robert Millan Date: Fri, 13 Dec 2013 13:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259303 - stable/10/sys/dev/drm2/radeon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 13:18:00 -0000 Author: rmh Date: Fri Dec 13 13:17:59 2013 New Revision: 259303 URL: http://svnweb.freebsd.org/changeset/base/259303 Log: MFC r259003: Initialize modesetting sysctls in radeonkms. Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 13 08:31:13 2013 (r259302) +++ stable/10/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 13 13:17:59 2013 (r259303) @@ -338,6 +338,12 @@ static const struct file_operations rade }; #endif /* DUMBBELL_WIP */ +static int radeon_sysctl_init(struct drm_device *dev, struct sysctl_ctx_list *ctx, + struct sysctl_oid *top) +{ + return drm_add_busid_modesetting(dev, ctx, top); +} + static struct drm_driver_info kms_driver = { .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | @@ -367,6 +373,7 @@ static struct drm_driver_info kms_driver .irq_postinstall = radeon_driver_irq_postinstall_kms, .irq_uninstall = radeon_driver_irq_uninstall_kms, .irq_handler = radeon_driver_irq_handler_kms, + .sysctl_init = radeon_sysctl_init, .ioctls = radeon_ioctls_kms, .gem_init_object = radeon_gem_object_init, .gem_free_object = radeon_gem_object_free, From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 15:19:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 927B7CC0; Fri, 13 Dec 2013 15:19:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE79118A; Fri, 13 Dec 2013 15:19:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDFJboT089541; Fri, 13 Dec 2013 15:19:37 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDFJbxA089540; Fri, 13 Dec 2013 15:19:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312131519.rBDFJbxA089540@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 15:19:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259304 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 15:19:37 -0000 Author: trasz Date: Fri Dec 13 15:19:37 2013 New Revision: 259304 URL: http://svnweb.freebsd.org/changeset/base/259304 Log: MFC r258871: Properly report an error instead of panicing when user tries to create LUN backed by non-disk device, e.g. /dev/null. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Fri Dec 13 13:17:59 2013 (r259303) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Fri Dec 13 15:19:37 2013 (r259304) @@ -1485,6 +1485,7 @@ ctl_be_block_close(struct ctl_be_block_l case CTL_BE_BLOCK_FILE: break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1503,6 +1504,7 @@ ctl_be_block_close(struct ctl_be_block_l } break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1589,7 +1591,7 @@ ctl_be_block_open(struct ctl_be_block_so } else { error = EINVAL; snprintf(req->error_str, sizeof(req->error_str), - "%s is not a disk or file", be_lun->dev_path); + "%s is not a disk or plain file", be_lun->dev_path); } VOP_UNLOCK(be_lun->vn, 0); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 15:23:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7BDFF2F; Fri, 13 Dec 2013 15:23:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B367A11F1; Fri, 13 Dec 2013 15:23:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDFN7Iv092870; Fri, 13 Dec 2013 15:23:07 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDFN7mO092869; Fri, 13 Dec 2013 15:23:07 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312131523.rBDFN7mO092869@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 15:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259305 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 15:23:07 -0000 Author: trasz Date: Fri Dec 13 15:23:07 2013 New Revision: 259305 URL: http://svnweb.freebsd.org/changeset/base/259305 Log: MFC r259182: Fix handling for empty auth-groups. Without it, ctld child process would either exit on assertion, or, if assertions are not enabled, fail to authenticate the target. Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Fri Dec 13 15:19:37 2013 (r259304) +++ stable/10/usr.sbin/ctld/login.c Fri Dec 13 15:23:07 2013 (r259305) @@ -1007,6 +1007,14 @@ login(struct connection *conn) return; } + if (ag->ag_type == AG_TYPE_UNKNOWN) { + /* + * This can happen with empty auth-group. + */ + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-group type not set, denying access"); + } + log_debugx("CHAP authentication required"); auth_method = keys_find(request_keys, "AuthMethod"); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 15:25:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B86E8217; Fri, 13 Dec 2013 15:25:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3E4A1217; Fri, 13 Dec 2013 15:25:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDFPpwr093649; Fri, 13 Dec 2013 15:25:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDFPp5e093648; Fri, 13 Dec 2013 15:25:51 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312131525.rBDFPp5e093648@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 15:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259306 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 15:25:51 -0000 Author: trasz Date: Fri Dec 13 15:25:51 2013 New Revision: 259306 URL: http://svnweb.freebsd.org/changeset/base/259306 Log: MFC r259183: Properly refuse handoff requests on already connected sessions. Previously this would result in dropping the session. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Fri Dec 13 15:23:07 2013 (r259305) +++ stable/10/sys/dev/iscsi/iscsi.c Fri Dec 13 15:25:51 2013 (r259306) @@ -1247,6 +1247,18 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ sx_sunlock(&sc->sc_lock); return (EINVAL); } + if (is->is_connected) { + /* + * This might have happened because another iscsid(8) + * instance handed off the connection in the meantime. + * Just return. + */ + ISCSI_SESSION_WARN(is, "handoff on already connected " + "session"); + ISCSI_SESSION_UNLOCK(is); + sx_sunlock(&sc->sc_lock); + return (EBUSY); + } strlcpy(is->is_target_alias, handoff->idh_target_alias, sizeof(is->is_target_alias)); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 16:09:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18A61244; Fri, 13 Dec 2013 16:09:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03B5C1556; Fri, 13 Dec 2013 16:09:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDG97T0013375; Fri, 13 Dec 2013 16:09:07 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDG97lc013374; Fri, 13 Dec 2013 16:09:07 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131609.rBDG97lc013374@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 16:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259307 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 16:09:08 -0000 Author: ian Date: Fri Dec 13 16:09:07 2013 New Revision: 259307 URL: http://svnweb.freebsd.org/changeset/base/259307 Log: MFC r256492: Add the long-missing spibus_if.m to the MFILES list. Modified: stable/10/sys/conf/kmod.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/kmod.mk ============================================================================== --- stable/10/sys/conf/kmod.mk Fri Dec 13 15:25:51 2013 (r259306) +++ stable/10/sys/conf/kmod.mk Fri Dec 13 16:09:07 2013 (r259307) @@ -346,7 +346,7 @@ MFILES?= dev/acpica/acpi_if.m dev/acpi_s dev/mii/miibus_if.m dev/mvs/mvs_if.m dev/ofw/ofw_bus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m \ - dev/sdhci/sdhci_if.m dev/smbus/smbus_if.m \ + dev/sdhci/sdhci_if.m dev/smbus/smbus_if.m dev/spibus/spibus_if.m \ dev/sound/pci/hda/hdac_if.m \ dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ dev/sound/pcm/feeder_if.m dev/sound/pcm/mixer_if.m \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 16:14:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37BC5404; Fri, 13 Dec 2013 16:14:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2396915E3; Fri, 13 Dec 2013 16:14:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDGE8mu016605; Fri, 13 Dec 2013 16:14:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDGE8xs016604; Fri, 13 Dec 2013 16:14:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131614.rBDGE8xs016604@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 16:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259308 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 16:14:09 -0000 Author: ian Date: Fri Dec 13 16:14:08 2013 New Revision: 259308 URL: http://svnweb.freebsd.org/changeset/base/259308 Log: MFC r256628: Fix a register name typo. The effect was that CPU_CONTROL_AFLT_ENABLE wasn't being set, but it was almost assuredly already turned on anyway by the bootloader. Modified: stable/10/sys/arm/arm/locore.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/locore.S ============================================================================== --- stable/10/sys/arm/arm/locore.S Fri Dec 13 16:09:07 2013 (r259307) +++ stable/10/sys/arm/arm/locore.S Fri Dec 13 16:14:08 2013 (r259308) @@ -187,7 +187,7 @@ Lunmapped: mrc p15, 0, r0, c1, c0, 0 #ifdef _ARM_ARCH_6 orr r0, r0, #(CPU_CONTROL_V6_EXTPAGE | CPU_CONTROL_UNAL_ENABLE) - orr r2, r2, #(CPU_CONTROL_AFLT_ENABLE) + orr r0, r0, #(CPU_CONTROL_AFLT_ENABLE) orr r0, r0, #(CPU_CONTROL_AF_ENABLE) #endif orr r0, r0, #(CPU_CONTROL_MMU_ENABLE) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 16:38:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 902A1A90; Fri, 13 Dec 2013 16:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D77F175D; Fri, 13 Dec 2013 16:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDGcMJR024077; Fri, 13 Dec 2013 16:38:22 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDGcMC1024076; Fri, 13 Dec 2013 16:38:22 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131638.rBDGcMC1024076@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 16:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259309 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 16:38:22 -0000 Author: ian Date: Fri Dec 13 16:38:21 2013 New Revision: 259309 URL: http://svnweb.freebsd.org/changeset/base/259309 Log: MFC r256637: When calculating the number of bounce pages needed, round the maxsize up to a multiple of PAGE_SIZE, and add one page because there can always be one more boundary crossing than the number of pages in the transfer. Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep-v6.c Fri Dec 13 16:14:08 2013 (r259308) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Fri Dec 13 16:38:21 2013 (r259309) @@ -425,14 +425,21 @@ bus_dma_tag_create(bus_dma_tag_t parent, if (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr) || newtag->alignment > 1) newtag->flags |= BUS_DMA_COULD_BOUNCE; - else - maxsize = 2; /* Need at most 2 bounce pages for unaligned access on cache line boundaries */ + /* + * Any request can auto-bounce due to cacheline alignment, in addition + * to any alignment or boundary specifications in the tag, so if the + * ALLOCNOW flag is set, there's always work to do. + */ if ((flags & BUS_DMA_ALLOCNOW) != 0) { struct bounce_zone *bz; - - /* Must bounce */ - + /* + * Round size up to a full page, and add one more page because + * there can always be one more boundary crossing than the + * number of pages in a transfer. + */ + maxsize = roundup2(maxsize, PAGE_SIZE) + PAGE_SIZE; + if ((error = alloc_bounce_zone(newtag)) != 0) { free(newtag, M_DEVBUF); return (error); @@ -518,20 +525,22 @@ static int allocate_bz_and_pages(bus_dma STAILQ_INIT(&(mapp->bpages)); /* - * Attempt to add pages to our pool on a per-instance - * basis up to a sane limit. + * Attempt to add pages to our pool on a per-instance basis up to a sane + * limit. Even if the tag isn't flagged as COULD_BOUNCE due to + * alignment and boundary constraints, it could still auto-bounce due to + * cacheline alignment, which requires at most two bounce pages. */ if (dmat->flags & BUS_DMA_COULD_BOUNCE) maxpages = MAX_BPAGES; else - maxpages = 2 * bz->map_count; /* Only need at most 2 pages for buffers unaligned on cache line boundaries */ + maxpages = 2 * bz->map_count; if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0 || (bz->map_count > 0 && bz->total_bpages < maxpages)) { int pages; - pages = MAX(atop(dmat->maxsize), 1); + pages = atop(roundup2(dmat->maxsize, PAGE_SIZE)) + 1; pages = MIN(maxpages - bz->total_bpages, pages); - pages = MAX(pages, 1); + pages = MAX(pages, 2); if (alloc_bounce_pages(dmat, pages) < pages) return (ENOMEM); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 16:41:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C8E8C02; Fri, 13 Dec 2013 16:41:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 087DE17C5; Fri, 13 Dec 2013 16:41:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDGf4rN026769; Fri, 13 Dec 2013 16:41:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDGf49Y026768; Fri, 13 Dec 2013 16:41:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131641.rBDGf49Y026768@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 16:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259310 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 16:41:05 -0000 Author: ian Date: Fri Dec 13 16:41:04 2013 New Revision: 259310 URL: http://svnweb.freebsd.org/changeset/base/259310 Log: MFC r256638: Add cases for the combinations of busdma sync op flags that we handle correctly by doing nothing, then add a panic for the default case, because that implies that some driver asked for a sync (probably incorrectly) and nothing was done. Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep-v6.c Fri Dec 13 16:38:21 2013 (r259309) +++ stable/10/sys/arm/arm/busdma_machdep-v6.c Fri Dec 13 16:41:04 2013 (r259310) @@ -1282,7 +1282,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus } break; + case BUS_DMASYNC_POSTREAD: + case BUS_DMASYNC_POSTWRITE: + case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE: + break; default: + panic("unsupported combination of sync operations: 0x%08x\n", op); break; } } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 16:55:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BA1B36D; Fri, 13 Dec 2013 16:55:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A51D318C2; Fri, 13 Dec 2013 16:55:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDGtdJx030827; Fri, 13 Dec 2013 16:55:39 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDGtd9T030826; Fri, 13 Dec 2013 16:55:39 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201312131655.rBDGtd9T030826@svn.freebsd.org> From: Alan Somers Date: Fri, 13 Dec 2013 16:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259311 - stable/10/sbin/geom/class/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 16:55:39 -0000 Author: asomers Date: Fri Dec 13 16:55:39 2013 New Revision: 259311 URL: http://svnweb.freebsd.org/changeset/base/259311 Log: MFC 257006 sbin/geom/class/part/geom_part.c Always validate the return of find_geomcfg(). It could be NULL, for example when the geom is withering. Approved by: ken (mentor) Sponsored by: Spectra Logic Corporation Modified: stable/10/sbin/geom/class/part/geom_part.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/10/sbin/geom/class/part/geom_part.c Fri Dec 13 16:41:04 2013 (r259310) +++ stable/10/sbin/geom/class/part/geom_part.c Fri Dec 13 16:55:39 2013 (r259311) @@ -364,7 +364,11 @@ gpart_autofill_resize(struct gctl_req *r } offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment; - last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); + s = find_geomcfg(gp, "last"); + if (s == NULL) + errx(EXIT_FAILURE, "Final block not found for geom %s", + gp->lg_name); + last = (off_t)strtoimax(s, NULL, 0); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { s = find_provcfg(pp, "index"); if (s == NULL) @@ -502,8 +506,16 @@ gpart_autofill(struct gctl_req *req) if (size > alignment) size = ALIGNDOWN(size, alignment); - first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0); - last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0); + s = find_geomcfg(gp, "first"); + if (s == NULL) + errx(EXIT_FAILURE, "Starting block not found for geom %s", + gp->lg_name); + first = (off_t)strtoimax(s, NULL, 0); + s = find_geomcfg(gp, "last"); + if (s == NULL) + errx(EXIT_FAILURE, "Final block not found for geom %s", + gp->lg_name); + last = (off_t)strtoimax(s, NULL, 0); grade = ~0ULL; a_first = ALIGNUP(first + offset, alignment); last = ALIGNDOWN(last + offset, alignment); @@ -587,12 +599,22 @@ gpart_show_geom(struct ggeom *gp, const int idx, wblocks, wname, wmax; scheme = find_geomcfg(gp, "scheme"); + if (scheme == NULL) + errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name); s = find_geomcfg(gp, "first"); + if (s == NULL) + errx(EXIT_FAILURE, "Starting block not found for geom %s", + gp->lg_name); first = (off_t)strtoimax(s, NULL, 0); s = find_geomcfg(gp, "last"); + if (s == NULL) + errx(EXIT_FAILURE, "Final block not found for geom %s", + gp->lg_name); last = (off_t)strtoimax(s, NULL, 0); wblocks = strlen(s); s = find_geomcfg(gp, "state"); + if (s == NULL) + errx(EXIT_FAILURE, "State not found for geom %s", gp->lg_name); if (s != NULL && *s != 'C') s = NULL; wmax = strlen(gp->lg_name); @@ -748,6 +770,8 @@ gpart_backup(struct gctl_req *req, unsig abort(); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; s = find_geomcfg(gp, "last"); + if (s == NULL) + abort(); wblocks = strlen(s); wtype = 0; LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { @@ -757,6 +781,8 @@ gpart_backup(struct gctl_req *req, unsig wtype = i; } s = find_geomcfg(gp, "entries"); + if (s == NULL) + abort(); windex = strlen(s); printf("%s %s\n", scheme, s); LIST_FOREACH(pp, &gp->lg_provider, lg_provider) { @@ -1177,6 +1203,8 @@ gpart_bootcode(struct gctl_req *req, uns if (gp == NULL) errx(EXIT_FAILURE, "No such geom: %s.", s); s = find_geomcfg(gp, "scheme"); + if (s == NULL) + errx(EXIT_FAILURE, "Scheme not found for geom %s", gp->lg_name); vtoc8 = 0; if (strcmp(s, "VTOC8") == 0) vtoc8 = 1; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:00:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 794BA26C; Fri, 13 Dec 2013 17:00:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 651E018EF; Fri, 13 Dec 2013 17:00:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDH0Quo033678; Fri, 13 Dec 2013 17:00:26 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDH0QMd033677; Fri, 13 Dec 2013 17:00:26 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131700.rBDH0QMd033677@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:00:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259312 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:00:26 -0000 Author: ian Date: Fri Dec 13 17:00:25 2013 New Revision: 259312 URL: http://svnweb.freebsd.org/changeset/base/259312 Log: MFC 256640: Allow 'make xdev' to work when DESTDIR is set. Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Fri Dec 13 16:55:39 2013 (r259311) +++ stable/10/Makefile.inc1 Fri Dec 13 17:00:25 2013 (r259312) @@ -1857,7 +1857,7 @@ NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOU CPUTYPE=${XDEV_CPUTYPE} XDDIR=${XDEV_ARCH}-freebsd -XDTP=/usr/${XDDIR} +XDTP=usr/${XDDIR} CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \ INSTALL="sh ${.CURDIR}/tools/install.sh" CDENV= ${CDBENV} \ @@ -1870,8 +1870,8 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} -CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} ${NOFUN} -XDDESTDIR=${DESTDIR}${XDTP} +CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN} +XDDESTDIR=${DESTDIR}/${XDTP} .if !defined(OSREL) OSREL!= uname -r | sed -e 's/[-(].*//' .endif @@ -1951,6 +1951,7 @@ _xi-libraries: _xi-links: ${_+_}cd ${XDDESTDIR}/usr/bin; \ + mkdir -p ../../../../usr/bin; \ for i in *; do \ ln -sf ../../${XDTP}/usr/bin/$$i \ ../../../../usr/bin/${XDDIR}-$$i; \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:02:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6D26565; Fri, 13 Dec 2013 17:02:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B25BD1953; Fri, 13 Dec 2013 17:02:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDH294L034209; Fri, 13 Dec 2013 17:02:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDH29UB034208; Fri, 13 Dec 2013 17:02:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131702.rBDH29UB034208@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259313 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:02:09 -0000 Author: ian Date: Fri Dec 13 17:02:09 2013 New Revision: 259313 URL: http://svnweb.freebsd.org/changeset/base/259313 Log: MFC r256647: Invalidate the entire L2 cache before enabling it. Say whether it has been enabled or disabled. Modified: stable/10/sys/arm/arm/pl310.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/pl310.c ============================================================================== --- stable/10/sys/arm/arm/pl310.c Fri Dec 13 17:00:25 2013 (r259312) +++ stable/10/sys/arm/arm/pl310.c Fri Dec 13 17:02:09 2013 (r259313) @@ -341,8 +341,13 @@ pl310_attach(device_t dev) ctrl_value = pl310_read4(sc, PL310_CTRL); if (sc->sc_enabled && !(ctrl_value & CTRL_ENABLED)) { + /* invalidate current content */ + pl310_write4(pl310_softc, PL310_INV_WAY, 0xffff); + pl310_wait_background_op(PL310_INV_WAY, 0xffff); + /* Enable the L2 cache if disabled */ platform_pl310_write_ctrl(sc, CTRL_ENABLED); + device_printf(dev, "L2 Cache enabled\n"); } if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) { @@ -375,6 +380,7 @@ pl310_attach(device_t dev) EVENT_COUNTER_CTRL_C0_RESET | EVENT_COUNTER_CTRL_C1_RESET); + device_printf(dev, "L2 Cache disabled\n"); } if (sc->sc_enabled) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:03:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A465A740; Fri, 13 Dec 2013 17:03:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8ECFD1971; Fri, 13 Dec 2013 17:03:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDH3WNN034438; Fri, 13 Dec 2013 17:03:32 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDH3W13034437; Fri, 13 Dec 2013 17:03:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131703.rBDH3W13034437@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259314 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:03:32 -0000 Author: ian Date: Fri Dec 13 17:03:32 2013 New Revision: 259314 URL: http://svnweb.freebsd.org/changeset/base/259314 Log: MFC r256774: Clock divisors 0-3 correspond to dividing by 1-4, so add 1 before dividing. Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ccm.c Fri Dec 13 17:02:09 2013 (r259313) +++ stable/10/sys/arm/freescale/imx/imx51_ccm.c Fri Dec 13 17:03:32 2013 (r259314) @@ -278,8 +278,8 @@ imx51_get_clock(enum imx51_clock clk) case IMX51CLK_MAIN_BUS_CLK: freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK_SRC); cdcr = bus_read_4(ccm_softc->res[0], CCMC_CDCR); - return freq / (cdcr & CDCR_PERIPH_CLK_DVFS_PODF_MASK) >> - CDCR_PERIPH_CLK_DVFS_PODF_SHIFT; + return freq / (1 + ((cdcr & CDCR_PERIPH_CLK_DVFS_PODF_MASK) >> + CDCR_PERIPH_CLK_DVFS_PODF_SHIFT)); case IMX51CLK_AHB_CLK_ROOT: freq = imx51_get_clock(IMX51CLK_MAIN_BUS_CLK); cbcdr = bus_read_4(ccm_softc->res[0], CCMC_CBCDR); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:10:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A60C9A21; Fri, 13 Dec 2013 17:10:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7749A19E6; Fri, 13 Dec 2013 17:10:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDHAOhW037118; Fri, 13 Dec 2013 17:10:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDHAOQx037116; Fri, 13 Dec 2013 17:10:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131710.rBDHAOQx037116@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259315 - in stable/10/sys: arm/freescale/imx boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:10:24 -0000 Author: ian Date: Fri Dec 13 17:10:23 2013 New Revision: 259315 URL: http://svnweb.freebsd.org/changeset/base/259315 Log: MFC r256804: Switch to using the standard uart console driver instead of the special driver for early boot debugging. Modified: stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 17:03:32 2013 (r259314) +++ stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 17:10:23 2013 (r259315) @@ -12,8 +12,11 @@ arm/freescale/imx/imx53_machdep.c standa arm/freescale/imx/common.c standard arm/freescale/imx/bus_space.c standard -# Dummy serial console -arm/freescale/imx/console.c standard +# Special serial console for debuging early boot code +#arm/freescale/imx/console.c standard + +# UART driver (includes serial console support) +dev/uart/uart_dev_imx.c optional uart # TrustZone Interrupt Controller arm/freescale/imx/tzic.c standard @@ -33,9 +36,6 @@ arm/freescale/imx/imx51_ccm.c standard # i.MX5xx PATA controller dev/ata/chipsets/ata-fsl.c optional imxata -# UART driver -#dev/uart/uart_dev_imx.c optional uart - # USB join controller (1 OTG, 3 EHCI) dev/usb/controller/ehci_imx.c optional ehci Modified: stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Fri Dec 13 17:03:32 2013 (r259314) +++ stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Fri Dec 13 17:10:23 2013 (r259315) @@ -70,9 +70,9 @@ }; /* UART1, console */ - UART1: serial@53fbc000 { + console: serial@53fbc000 { status = "okay"; - clock-frequency = <3000000>; /* XXX */ + clock-frequency = <0>; /* won't load w/o this */ }; clock@53fd4000 { @@ -111,13 +111,12 @@ }; aliases { - UART1 = &UART1; SSI2 = &SSI2; }; chosen { bootargs = "-v"; - stdin = "UART1"; - stdout = "UART1"; + stdin = &console; + stdout = &console; }; }; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:23:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F42DCD2; Fri, 13 Dec 2013 17:23:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 612F91B05; Fri, 13 Dec 2013 17:23:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDHNm1v041881; Fri, 13 Dec 2013 17:23:48 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDHNm6B041879; Fri, 13 Dec 2013 17:23:48 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131723.rBDHNm6B041879@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259316 - stable/10/sys/dev/ofw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:23:48 -0000 Author: ian Date: Fri Dec 13 17:23:47 2013 New Revision: 259316 URL: http://svnweb.freebsd.org/changeset/base/259316 Log: MFC r257130: Add a helper routine to search for a compat string in a table that associates compat strings with arbitrary values that mean something to the driver. This is handy for drivers that support several variations of similar hardware and need to know which one matched. Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_bus_subr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.c Fri Dec 13 17:10:23 2013 (r259315) +++ stable/10/sys/dev/ofw/ofw_bus_subr.c Fri Dec 13 17:23:47 2013 (r259316) @@ -197,6 +197,21 @@ ofw_bus_is_compatible_strict(device_t de return (0); } +const struct ofw_compat_data * +ofw_bus_search_compatible(device_t dev, const struct ofw_compat_data *compat) +{ + + if (compat == NULL) + return NULL; + + for (; compat->ocd_str != NULL; ++compat) { + if (ofw_bus_is_compatible(dev, compat->ocd_str)) + break; + } + + return (compat); +} + int ofw_bus_has_prop(device_t dev, const char *propname) { Modified: stable/10/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- stable/10/sys/dev/ofw/ofw_bus_subr.h Fri Dec 13 17:10:23 2013 (r259315) +++ stable/10/sys/dev/ofw/ofw_bus_subr.h Fri Dec 13 17:23:47 2013 (r259316) @@ -47,6 +47,11 @@ struct ofw_bus_iinfo { pcell_t opi_addrc; }; +struct ofw_compat_data { + const char *ocd_str; + uintptr_t ocd_data; +}; + /* Generic implementation of ofw_bus_if.m methods and helper routines */ int ofw_bus_gen_setup_devinfo(struct ofw_bus_devinfo *, phandle_t); void ofw_bus_gen_destroy_devinfo(struct ofw_bus_devinfo *); @@ -74,6 +79,16 @@ void ofw_bus_find_iparent(phandle_t); int ofw_bus_is_compatible(device_t, const char *); int ofw_bus_is_compatible_strict(device_t, const char *); +/* + * Helper routine to search a list of compat properties. The table is + * terminated by an entry with a NULL compat-string pointer; a pointer to that + * table entry is returned if none of the compat strings match for the device, + * giving you control over the not-found value. Will not return NULL unless the + * provided table pointer is NULL. + */ +const struct ofw_compat_data * + ofw_bus_search_compatible(device_t, const struct ofw_compat_data *); + /* Helper routine for checking existence of a prop */ int ofw_bus_has_prop(device_t, const char *); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:28:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08B53E3D; Fri, 13 Dec 2013 17:28:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCA0A1B26; Fri, 13 Dec 2013 17:28:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDHS8pW042387; Fri, 13 Dec 2013 17:28:08 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDHS8rZ042385; Fri, 13 Dec 2013 17:28:08 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131728.rBDHS8rZ042385@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259317 - in stable/10/sys: arm/freescale/imx dev/ffec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:28:09 -0000 Author: ian Date: Fri Dec 13 17:28:08 2013 New Revision: 259317 URL: http://svnweb.freebsd.org/changeset/base/259317 Log: MFC r256806, r256919, r257167: Add a driver for the Freescale Fast Ethernet Controller found on various Freescale SoCs including the i.MX series. This also works for the newer SoCs with the ENET gigabit controller, but doesn't use any of the new hardware features other than enabling gigabit speed. Mask out non-address bits in the mac address register, for proper detection of an all-zeroes address. Also remove a misplaced return. Switch to using ofw_bus_search_compatible() table-driven compat lookup. Add compat strings for Freescale Vybrid family SoCs. Added: stable/10/sys/dev/ffec/ - copied from r256806, head/sys/dev/ffec/ Modified: stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/dev/ffec/if_ffec.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 17:23:47 2013 (r259316) +++ stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 17:28:08 2013 (r259317) @@ -49,3 +49,6 @@ dev/ofw/ofw_iicbus.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc +# Fast Ethernet Controller +dev/ffec/if_ffec.c optional ffec + Modified: stable/10/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Sun Oct 20 21:07:38 2013 (r256806) +++ stable/10/sys/dev/ffec/if_ffec.c Fri Dec 13 17:28:08 2013 (r259317) @@ -86,6 +86,38 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" /* + * There are small differences in the hardware on various SoCs. Not every SoC + * we support has its own FECTYPE; most work as GENERIC and only the ones that + * need different handling get their own entry. In addition to the types in + * this list, there are some flags below that can be ORed into the upper bits. + */ +enum { + FECTYPE_NONE, + FECTYPE_GENERIC, + FECTYPE_IMX53, + FECTYPE_IMX6, +}; + +/* + * Flags that describe general differences between the FEC hardware in various + * SoCs. These are ORed into the FECTYPE enum values. + */ +#define FECTYPE_MASK 0x0000ffff +#define FECFLAG_GBE (0x0001 << 16) + +/* + * Table of supported FDT compat strings and their associated FECTYPE values. + */ +static struct ofw_compat_data compat_data[] = { + {"fsl,imx51-fec", FECTYPE_GENERIC}, + {"fsl,imx53-fec", FECTYPE_IMX53}, + {"fsl,imx6q-fec", FECTYPE_IMX6 | FECFLAG_GBE}, + {"fsl,mvf600-fec", FECTYPE_GENERIC}, + {"fsl,vf-fec", FECTYPE_GENERIC}, + {NULL, FECTYPE_NONE}, +}; + +/* * Driver data and defines. */ #define RX_DESC_COUNT 64 @@ -108,13 +140,6 @@ enum { PHY_CONN_RGMII }; -enum { - FECTYPE_GENERIC, - FECTYPE_IMX51, - FECTYPE_IMX53, - FECTYPE_IMX6, -}; - struct ffec_softc { device_t dev; device_t miibus; @@ -226,7 +251,7 @@ ffec_miigasket_setup(struct ffec_softc * * We only need the gasket for MII and RMII connections on certain SoCs. */ - switch (sc->fectype) + switch (sc->fectype & FECTYPE_MASK) { case FECTYPE_IMX53: break; @@ -883,7 +908,7 @@ ffec_get_hwaddr(struct ffec_softc *sc, u * assigned bit set, and the broadcast/multicast bit clear. */ palr = RD4(sc, FEC_PALR_REG); - paur = RD4(sc, FEC_PAUR_REG); + paur = RD4(sc, FEC_PAUR_REG) & FEC_PAUR_PADDR2_MASK; if ((palr | paur) != 0) { hwaddr[0] = palr >> 24; hwaddr[1] = palr >> 16; @@ -891,7 +916,6 @@ ffec_get_hwaddr(struct ffec_softc *sc, u hwaddr[3] = palr >> 0; hwaddr[4] = paur >> 24; hwaddr[5] = paur >> 16; - return; } else { rnd = arc4random() & 0x00ffffff; hwaddr[0] = 'b'; @@ -1405,14 +1429,7 @@ ffec_attach(device_t dev) * There are differences in the implementation and features of the FEC * hardware on different SoCs, so figure out what type we are. */ - if (ofw_bus_is_compatible(dev, "fsl,imx51-fec")) - sc->fectype = FECTYPE_IMX51; - else if (ofw_bus_is_compatible(dev, "fsl,imx53-fec")) - sc->fectype = FECTYPE_IMX53; - else if (ofw_bus_is_compatible(dev, "fsl,imx6q-fec")) - sc->fectype = FECTYPE_IMX6; - else - sc->fectype = FECTYPE_GENERIC; + sc->fectype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; /* * We have to be told what kind of electrical connection exists between @@ -1692,15 +1709,16 @@ out: static int ffec_probe(device_t dev) { + uintptr_t fectype; - if (ofw_bus_is_compatible(dev, "fsl,imx51-fec") || - ofw_bus_is_compatible(dev, "fsl,imx53-fec")) { - device_set_desc(dev, "Freescale Fast Ethernet Controller"); - } else if (ofw_bus_is_compatible(dev, "fsl,imx6q-fec")) { - device_set_desc(dev, "Freescale Gigabit Ethernet Controller"); - } else { + fectype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (fectype == FECTYPE_NONE) return (ENXIO); - } + + device_set_desc(dev, (fectype & FECFLAG_GBE) ? + "Freescale Gigabit Ethernet Controller" : + "Freescale Fast Ethernet Controller"); + return (BUS_PROBE_DEFAULT); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 17:29:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28B0CFA2; Fri, 13 Dec 2013 17:29:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 077671B41; Fri, 13 Dec 2013 17:29:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDHTVRR042560; Fri, 13 Dec 2013 17:29:31 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDHTVPu042558; Fri, 13 Dec 2013 17:29:31 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131729.rBDHTVPu042558@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 17:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259318 - in stable/10/sys: arm/conf boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 17:29:32 -0000 Author: ian Date: Fri Dec 13 17:29:31 2013 New Revision: 259318 URL: http://svnweb.freebsd.org/changeset/base/259318 Log: MFC r256809: Add configuration for the Freescale i.MX53 Quick Start Board. Added: stable/10/sys/arm/conf/IMX53-QSB - copied unchanged from r256809, head/sys/arm/conf/IMX53-QSB stable/10/sys/boot/fdt/dts/imx53-qsb.dts - copied unchanged from r256809, head/sys/boot/fdt/dts/imx53-qsb.dts Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/conf/IMX53-QSB (from r256809, head/sys/arm/conf/IMX53-QSB) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/IMX53-QSB Fri Dec 13 17:29:31 2013 (r259318, copy of r256809, head/sys/arm/conf/IMX53-QSB) @@ -0,0 +1,179 @@ +# Kernel configuration for Freescale i.MX53 Quick Start Board +# +# For more information on this file, please read the config(5) manual page, +# and/or 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$ + +ident IMX53-QSB + +include "../freescale/imx/std.imx53" + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +#options DEBUG + +options HZ=250 # 4ms scheduling quantum +options SCHED_4BSD # 4BSD scheduler +#options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +#options SCTP # Stream Control Transmission Protocol +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 UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # TMP Memory Filesystem +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 +#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 +#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 +options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options INCLUDE_CONFIG_FILE # Include this file in kernel +options VFP # vfp/neon + +# required for netbooting +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ue0 + +#options ROOTDEVNAME=\"ufs:ada0s2a\" + + +# kernel/memory size reduction +#options MUTEX_NOINLINE +#options NO_FFS_SNAPSHOT +#options NO_SWAPPING +#options NO_SYSCTL_DESCR +#options RWLOCK_NOINLINE + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic. +# For full debugger support use this instead: +options DDB # Support DDB. +#options GDB # Support remote GDB. +#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 + +# The `bpf' device enables the Berkeley Packet Filter. +# Be aware of the administrative consequences of enabling this! +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device ether # Ethernet support +#device vlan # 802.1Q VLAN support +#device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module + +# Ethernet +device ffec # Freescale Fast Ethernet Controller +device miibus # Standard mii bus + +# Serial (COM) ports +device uart # Multi-uart driver +options ALT_BREAK_TO_DEBUGGER + +#device ata +#device atapci # Only for helper functions +#device imxata +#options ATA_STATIC_ID # Static device numbering + +device iomux # IO Multiplexor + +device gpio +device gpioled + +device fsliic +device iic +device iicbus + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +#options USB_DEBUG # enable debug msgs +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +#device uhid # "Human Interface Devices" +#device ukbd # Allow keyboard like HIDs to control console +#device ums + +# USB Ethernet, requires miibus +#device miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs + +# Watchdog timer. +# WARNING: can't be disabled!!! +device imxwdt # Watchdog + +# Wireless NIC cards +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support +device wlan_amrr # AMRR transmit rate control algorithm + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=imx53-qsb.dts + +# NOTE: serial console will be disabled if syscons enabled +# Uncomment following lines for framebuffer/syscons support +#device sc +#device kbdmux +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 + Copied: stable/10/sys/boot/fdt/dts/imx53-qsb.dts (from r256809, head/sys/boot/fdt/dts/imx53-qsb.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/imx53-qsb.dts Fri Dec 13 17:29:31 2013 (r259318, copy of r256809, head/sys/boot/fdt/dts/imx53-qsb.dts) @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2013 Rui Paulo + * All rights reserved. + * + * This software was developed by Semihalf under sponsorship from + * the FreeBSD Foundation. + * + * 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. + * + * Freescale i.MX53 Quick Start Board + * + * $FreeBSD$ + */ + +/dts-v1/; +/include/ "imx53x.dtsi" + +/ { + model = "Freescale i.MX53 Quick Start Board"; + compatible = "fsl,imx53-qsb", "fsl,imx53"; + + memory { + /* RAM 512M */ + reg = <0x70000000 0x20000000>; + }; + + localbus@18000000 { + ipu3@18000000 { + status = "okay"; + }; + }; + + soc@50000000 { + aips@50000000 { + spba@50000000 { + esdhc@50004000 { + clock-frequency = <216000000>; + status = "okay"; + }; + esdhc@50008000 { + clock-frequency = <216000000>; + status = "okay"; + }; + SSI2: ssi@50014000 { + status = "okay"; + }; + }; + timer@53fa0000 { + status = "okay"; + }; + + /* UART1, console */ + console: serial@53fbc000 { + status = "okay"; + clock-frequency = <0>; /* won't load w/o this */ + }; + + clock@53fd4000 { + status = "okay"; + }; + gpio@53f84000 { + status = "okay"; + }; + gpio@53f88000 { + status = "okay"; + }; + gpio@53f8c000 { + status = "okay"; + }; + gpio@53f90000 { + status = "okay"; + }; + wdog@53f98000 { + status = "okay"; + }; + }; + aips@60000000 { + ethernet@63fec000 { + status = "okay"; + phy-mode = "rmii"; + } + i2c@63fc4000 { + status = "okay"; + }; + i2c@63fc8000 { + status = "okay"; + }; + audmux@63fd4000 { + status = "okay"; + }; + ide@63fe0000 { + status = "okay"; + }; + }; + }; + + aliases { + SSI2 = &SSI2; + }; + + chosen { + bootargs = "-v"; + stdin = &console; + stdout = &console; + }; +}; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 18:21:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB453CC2; Fri, 13 Dec 2013 18:21:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A733D1023; Fri, 13 Dec 2013 18:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDILRgg063183; Fri, 13 Dec 2013 18:21:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDILRwp063182; Fri, 13 Dec 2013 18:21:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131821.rBDILRwp063182@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 18:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259319 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 18:21:27 -0000 Author: ian Date: Fri Dec 13 18:21:27 2013 New Revision: 259319 URL: http://svnweb.freebsd.org/changeset/base/259319 Log: MFC r256815: Calculate the baud rate divisor rather than using a hard-coded value. Modified: stable/10/sys/dev/uart/uart_dev_pl011.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- stable/10/sys/dev/uart/uart_dev_pl011.c Fri Dec 13 17:29:31 2013 (r259318) +++ stable/10/sys/dev/uart/uart_dev_pl011.c Fri Dec 13 18:21:27 2013 (r259319) @@ -147,9 +147,6 @@ uart_pl011_param(struct uart_bas *bas, i break; } - /* TODO: Calculate divisors */ - baud = (0x1 << 16) | 0x28; - if (stopbits == 2) line |= LCR_H_STP2; else @@ -164,8 +161,11 @@ uart_pl011_param(struct uart_bas *bas, i line &= ~LCR_H_FEN; ctrl |= (CR_RXE | CR_TXE | CR_UARTEN); - __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 16)) & IBRD_BDIVINT); - __uart_setreg(bas, UART_FBRD, (uint32_t)(baud) & FBRD_BDIVFRAC); + if (bas->rclk != 0 && baudrate != 0) { + baud = bas->rclk * 4 / baudrate; + __uart_setreg(bas, UART_IBRD, ((uint32_t)(baud >> 6)) & IBRD_BDIVINT); + __uart_setreg(bas, UART_FBRD, (uint32_t)(baud & 0x3F) & FBRD_BDIVFRAC); + } /* Add config. to line before reenabling UART */ __uart_setreg(bas, UART_LCR_H, (__uart_getreg(bas, UART_LCR_H) & From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 18:23:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9794EE01; Fri, 13 Dec 2013 18:23:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8336A1032; Fri, 13 Dec 2013 18:23:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDINE7Q063471; Fri, 13 Dec 2013 18:23:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDINETh063470; Fri, 13 Dec 2013 18:23:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312131823.rBDINETh063470@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 18:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259320 - stable/10/contrib/gperf/src X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 18:23:14 -0000 Author: pfg Date: Fri Dec 13 18:23:14 2013 New Revision: 259320 URL: http://svnweb.freebsd.org/changeset/base/259320 Log: MFC r258115 (partial); gperf: bring a small update from Apple Developers tools 4.4 From [1] offset.patch Makes use the C offsetof() macro. We are not merging the size_type.patch as it raises some (apparently) bogus warnings and is not really used. [1] http://opensource.apple.com/source/gperf/gperf-9/patches/ Modified: stable/10/contrib/gperf/src/output.cc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/gperf/src/output.cc ============================================================================== --- stable/10/contrib/gperf/src/output.cc Fri Dec 13 18:21:27 2013 (r259319) +++ stable/10/contrib/gperf/src/output.cc Fri Dec 13 18:23:14 2013 (r259320) @@ -1106,9 +1106,7 @@ output_keyword_entry (KeywordExt *temp, if (option[TYPE]) printf ("{"); if (option[SHAREDLIB]) - printf ("(int)(long)&((struct %s_t *)0)->%s_str%d", - option.get_stringpool_name (), option.get_stringpool_name (), - stringpool_index); + printf("offsetof(struct %s_t, %s_str%d)", option.get_stringpool_name (), option.get_stringpool_name (), stringpool_index); else output_string (temp->_allchars, temp->_allchars_length); if (option[TYPE]) @@ -2035,8 +2033,11 @@ Output::output () printf ("%s\n", _struct_decl); } - if (option[INCLUDE]) + if (option[INCLUDE]) { printf ("#include \n"); /* Declare strlen(), strcmp(), strncmp(). */ + if (option[SHAREDLIB]) + printf("#include \n"); /* Declare offsetof() */ + } if (!option[ENUM]) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 18:24:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBE6BE1; Fri, 13 Dec 2013 18:24:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D6A261047; Fri, 13 Dec 2013 18:24:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDIOax6063709; Fri, 13 Dec 2013 18:24:36 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDIOabU063708; Fri, 13 Dec 2013 18:24:36 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312131824.rBDIOabU063708@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 18:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259321 - stable/9/contrib/gperf/src X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 18:24:37 -0000 Author: pfg Date: Fri Dec 13 18:24:36 2013 New Revision: 259321 URL: http://svnweb.freebsd.org/changeset/base/259321 Log: MFC r258115 (partial); gperf: bring a small update from Apple Developers tools 4.4 From [1] offset.patch Makes use the C offsetof() macro. We are not merging the size_type.patch as it raises some (apparently) bogus warnings and is not really used. [1] http://opensource.apple.com/source/gperf/gperf-9/patches/ Modified: stable/9/contrib/gperf/src/output.cc Directory Properties: stable/9/ (props changed) stable/9/contrib/gperf/ (props changed) Modified: stable/9/contrib/gperf/src/output.cc ============================================================================== --- stable/9/contrib/gperf/src/output.cc Fri Dec 13 18:23:14 2013 (r259320) +++ stable/9/contrib/gperf/src/output.cc Fri Dec 13 18:24:36 2013 (r259321) @@ -1106,9 +1106,7 @@ output_keyword_entry (KeywordExt *temp, if (option[TYPE]) printf ("{"); if (option[SHAREDLIB]) - printf ("(int)(long)&((struct %s_t *)0)->%s_str%d", - option.get_stringpool_name (), option.get_stringpool_name (), - stringpool_index); + printf("offsetof(struct %s_t, %s_str%d)", option.get_stringpool_name (), option.get_stringpool_name (), stringpool_index); else output_string (temp->_allchars, temp->_allchars_length); if (option[TYPE]) @@ -2035,8 +2033,11 @@ Output::output () printf ("%s\n", _struct_decl); } - if (option[INCLUDE]) + if (option[INCLUDE]) { printf ("#include \n"); /* Declare strlen(), strcmp(), strncmp(). */ + if (option[SHAREDLIB]) + printf("#include \n"); /* Declare offsetof() */ + } if (!option[ENUM]) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 18:26:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BECB25E; Fri, 13 Dec 2013 18:26:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52EA9105F; Fri, 13 Dec 2013 18:26:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDIQOBf064026; Fri, 13 Dec 2013 18:26:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDIQNQU064015; Fri, 13 Dec 2013 18:26:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131826.rBDIQNQU064015@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 18:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259322 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 18:26:24 -0000 Author: ian Date: Fri Dec 13 18:26:22 2013 New Revision: 259322 URL: http://svnweb.freebsd.org/changeset/base/259322 Log: MFC r257197: Maximize available kva space by doing static device mapping from the top of the address space downwards, and then returning the lowest mapped device address from initarm_lastaddr(). Premap most of the device's on-chip peripherals. Added: stable/10/sys/arm/freescale/imx/imx_machdep.c - copied unchanged from r257197, head/sys/arm/freescale/imx/imx_machdep.c stable/10/sys/arm/freescale/imx/imx_machdep.h - copied unchanged from r257197, head/sys/arm/freescale/imx/imx_machdep.h Modified: stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/imx51_machdep.c stable/10/sys/arm/freescale/imx/imx53_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Fri Dec 13 18:24:36 2013 (r259321) +++ stable/10/sys/arm/freescale/imx/files.imx51 Fri Dec 13 18:26:22 2013 (r259322) @@ -8,6 +8,7 @@ arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init +arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx51_machdep.c standard arm/freescale/imx/common.c standard arm/freescale/imx/bus_space.c standard Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 18:24:36 2013 (r259321) +++ stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 18:26:22 2013 (r259322) @@ -8,6 +8,7 @@ arm/arm/irq_dispatch.S standard kern/kern_clocksource.c standard # Init +arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx53_machdep.c standard arm/freescale/imx/common.c standard arm/freescale/imx/bus_space.c standard Modified: stable/10/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_machdep.c Fri Dec 13 18:24:36 2013 (r259321) +++ stable/10/sys/arm/freescale/imx/imx51_machdep.c Fri Dec 13 18:26:22 2013 (r259322) @@ -1,14 +1,7 @@ /*- - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * Copyright (c) 2012, 2013 The FreeBSD Foundation + * Copyright (c) 2013 Ian Lepore * All rights reserved. * - * - * This code is derived from software written for Brini by Mark Brinicombe - * Portions of this software were developed by Oleksandr Rybalko - * under sponsorship from the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -17,26 +10,18 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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) + * 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. - * - * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 */ #include "opt_platform.h" @@ -44,99 +29,42 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include #include -#include -#include - -#include -#include /* For trapframe_t, used in */ #include -#include - -#include - -#define IMX51_DEV_VIRT_BASE 0xe0000000 -vm_offset_t -initarm_lastaddr(void) -{ - - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; - - if (fdt_immr_addr(IMX51_DEV_VIRT_BASE) != 0) - while (1); - - /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); -} +#include /* - * Set initial values of GPIO output ports + * Set up static device mappings. This is hand-optimized platform-specific + * config data which covers most of the common on-chip devices with a few 1MB + * section mappings. + * + * Notably missing are entries for GPU, IPU, in general anything video related. + * + * Note that for imx this is called from initarm_lastaddr() so that the lowest + * kva address used for static device mapping can be known at that point. */ void -initarm_gpio_init(void) +imx_devmap_init(void) { + imx_devmap_addentry(0x70000000, 0x00100000); + imx_devmap_addentry(0x73f00000, 0x00100000); + imx_devmap_addentry(0x83f00000, 0x00100000); } void -initarm_late_init(void) -{ - -} - -#define FDT_DEVMAP_MAX 2 -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, }, - { 0, 0, 0, 0, 0, } -}; - -/* - * Construct pmap_devmap[] with DT-derived config data. - */ -int -platform_devmap_init(void) -{ - - /* - * Map segment where UART1 and UART2 located. - */ - fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f00000; - fdt_devmap[0].pd_pa = 0x73f00000; - fdt_devmap[0].pd_size = 0x00100000; - fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[0].pd_cache = PTE_NOCACHE; - - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - return (0); -} - -struct arm32_dma_range * -bus_dma_get_range(void) +cpu_reset(void) { - return (NULL); + imx_wdog_cpu_reset(0x73F98000); } -int -bus_dma_get_range_nb(void) +u_int imx_soc_type() { - - return (0); + return (IMXSOC_51); } -void -cpu_reset(void) -{ - - printf("Reset ...\n"); - /* Clear n_reset flag */ - *((volatile u_int16_t *)(IMX51_DEV_VIRT_BASE + 0x03f98000)) = - (u_int16_t)0; - while (1); -} Modified: stable/10/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx53_machdep.c Fri Dec 13 18:24:36 2013 (r259321) +++ stable/10/sys/arm/freescale/imx/imx53_machdep.c Fri Dec 13 18:26:22 2013 (r259322) @@ -1,13 +1,7 @@ /*- - * Copyright (c) 1994-1998 Mark Brinicombe. - * Copyright (c) 1994 Brini. - * Copyright (c) 2012, 2013 The FreeBSD Foundation + * Copyright (c) 2013 Ian Lepore * All rights reserved. * - * This code is derived from software written for Brini by Mark Brinicombe - * Portions of this software were developed by Oleksandr Rybalko - * under sponsorship from the FreeBSD Foundation. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -16,20 +10,14 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Brini. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRINI ``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 BRINI 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) + * 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 @@ -41,101 +29,43 @@ #include __FBSDID("$FreeBSD$"); -#define _ARM32_BUS_DMA_PRIVATE #include #include #include #include -#include -#include - -#include -#include /* For trapframe_t, used in */ #include -#include - -#include - -#define IMX53_DEV_VIRT_BASE 0xe0000000 - -vm_offset_t -initarm_lastaddr(void) -{ - - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; - - if (fdt_immr_addr(IMX53_DEV_VIRT_BASE) != 0) - while (1); - - /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); -} +#include /* - * Set initial values of GPIO output ports + * Set up static device mappings. This is hand-optimized platform-specific + * config data which covers most of the common on-chip devices with a few 1MB + * section mappings. + * + * Notably missing are entries for GPU, IPU, in general anything video related. + * + * Note that for imx this is called from initarm_lastaddr() so that the lowest + * kva address used for static device mapping can be known at that point. */ void -initarm_gpio_init(void) +imx_devmap_init(void) { + imx_devmap_addentry(0x50000000, 0x00100000); + imx_devmap_addentry(0x53f00000, 0x00100000); + imx_devmap_addentry(0x63f00000, 0x00100000); } void -initarm_late_init(void) -{ - -} - -#define FDT_DEVMAP_MAX 2 -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { - { 0, 0, 0, 0, 0, }, - { 0, 0, 0, 0, 0, } -}; - -/* - * Construct pmap_devmap[] with DT-derived config data. - */ -int -platform_devmap_init(void) -{ - - /* - * Map segment where UART1 and UART2 located. - */ - fdt_devmap[0].pd_va = IMX53_DEV_VIRT_BASE + 0x03f00000; - fdt_devmap[0].pd_pa = 0x53f00000; - fdt_devmap[0].pd_size = 0x00100000; - fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[0].pd_cache = PTE_NOCACHE; - - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - - return (0); -} - -struct arm32_dma_range * -bus_dma_get_range(void) +cpu_reset(void) { - return (NULL); + imx_wdog_cpu_reset(0x53F98000); } -int -bus_dma_get_range_nb(void) +u_int imx_soc_type() { - - return (0); + return (IMXSOC_53); } -void -cpu_reset(void) -{ - printf("Reset ...\n"); - /* Clear n_reset flag */ - *((volatile u_int16_t *)(IMX53_DEV_VIRT_BASE + 0x03f98000)) = - (u_int16_t)0; - while (1); -} Copied: stable/10/sys/arm/freescale/imx/imx_machdep.c (from r257197, head/sys/arm/freescale/imx/imx_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 18:26:22 2013 (r259322, copy of r257197, head/sys/arm/freescale/imx/imx_machdep.c) @@ -0,0 +1,200 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include + +#include +#include + +#include +#include +#include /* For trapframe_t, used in */ +#include +#include + +#include +#include + +#define IMX_MAX_DEVMAP_ENTRIES 8 + +static struct pmap_devmap devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; +static u_int devmap_idx; +static vm_offset_t devmap_vaddr = ARM_VECTORS_HIGH; + +void +imx_devmap_addentry(vm_paddr_t pa, vm_size_t sz) +{ + struct pmap_devmap *m; + + /* + * The last table entry is the all-zeroes end-of-table marker. If we're + * about to overwrite it the world is coming to an end. This code runs + * too early for the panic to be printed unless a special early-debug + * console is in use, but there's nothing else we can do. + */ + if (devmap_idx == (IMX_MAX_DEVMAP_ENTRIES - 1)) + panic("IMX_MAX_DEVMAP_ENTRIES is too small!\n"); + + /* + * Allocate virtual address space from the top of kva downwards. If the + * range being mapped is aligned and sized to 1MB boundaries then also + * align the virtual address to the next-lower 1MB boundary so that we + * end up with a section mapping. + */ + if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { + devmap_vaddr = (devmap_vaddr - sz) & ~0x000fffff; + } else { + devmap_vaddr = (devmap_vaddr - sz) & ~0x00000fff; + } + m = &devmap_entries[devmap_idx++]; + m->pd_va = devmap_vaddr; + m->pd_pa = pa; + m->pd_size = sz; + m->pd_prot = VM_PROT_READ | VM_PROT_WRITE; + m->pd_cache = PTE_DEVICE; +} + +vm_offset_t +initarm_lastaddr(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; + + /* + * Normally initarm() calls platform_devmap_init() much later in the + * init process to set up static device mappings. To calculate the + * highest available kva address we have to do that setup first. It + * maps downwards from ARM_VECTORS_HIGH and the last usable kva address + * is the point right before the virtual address of the first static + * mapping. So go set up the static mapping table now, then we can + * return the lowest static devmap vaddr as the end of usable kva. + */ + imx_devmap_init(); + + pmap_devmap_bootstrap_table = devmap_entries; + + return (devmap_vaddr); +} + +int +platform_devmap_init(void) +{ + + /* On imx this work is done during initarm_lastaddr(). */ + return (0); +} + +/* + * Set initial values of GPIO output ports + */ +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + struct pmap_devmap *m; + + /* + * We did the static devmap setup earlier, during initarm_lastaddr(), + * but now the console should be working and we can be verbose about + * what we did. + */ + if (bootverbose) { + for (m = devmap_entries; m->pd_va != 0; ++m) { + printf("Devmap: phys 0x%08x virt 0x%08x size %uK\n", + m->pd_pa, m->pd_va, m->pd_size / 1024); + } + } + + +} + +struct arm32_dma_range * +bus_dma_get_range(void) +{ + + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + + return (0); +} + +void +imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr) +{ + + /* + * This code which manipulates the watchdog hardware is here to + * implement cpu_reset() because the watchdog is the only way for + * software to reset the chip. Why here and not in imx_wdog.c? Because + * there's no requirement that the watchdog driver be compiled in, but + * it's nice to be able to reboot even if it's not. + */ + volatile uint16_t * pcr; + const struct pmap_devmap *pd; + + if ((pd = pmap_devmap_find_pa(wdcr_physaddr, 2)) == NULL) { + printf("cpu_reset() can't find its control register... locking up now."); + } else { + pcr = (uint16_t *)(pd->pd_va + (wdcr_physaddr - pd->pd_pa)); + /* + * This deceptively simple write enables the watchdog, sets the timeout + * to its minimum value (half a second), and also clears the SRS bit + * which results in the SFTW (software-requested reset) bit being set in + * the watchdog status register after the reset. This is how software + * can distinguish a requested reset from a wdog timeout. + */ + *pcr = WDOG_CR_WDE; + } + while (1) + continue; +} + +u_int +imx_soc_family(void) +{ + return (imx_soc_type() >> IMXSOC_FAMSHIFT); +} + + Copied: stable/10/sys/arm/freescale/imx/imx_machdep.h (from r257197, head/sys/arm/freescale/imx/imx_machdep.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_machdep.h Fri Dec 13 18:26:22 2013 (r259322, copy of r257197, head/sys/arm/freescale/imx/imx_machdep.h) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * 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$ + */ + +#ifndef IMX_MACHDEP_H +#define IMX_MACHDEP_H + +#include + +/* Common functions, implemented in imx_machdep.c. */ + +void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz); +void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__)); + +/* + * SoC identity. + */ +#define IMXSOC_51 0x05000100 +#define IMXSOC_53 0x05000300 +#define IMXSOC_6S 0x06000010 +#define IMXSOC_6SL 0x06000011 +#define IMXSOC_6D 0x06000020 +#define IMXSOC_6DL 0x06000021 +#define IMXSOC_6Q 0x06000040 +#define IMXSOC_6QL 0x06000041 +#define IMXSOC_FAMSHIFT 24 + +u_int imx_soc_type(void); +u_int imx_soc_family(void); + +/* From here down, routines are implemented in imxNN_machdep.c. */ + +void imx_devmap_init(void); + +#endif + From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 18:46:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B771ACA for ; Fri, 13 Dec 2013 18:46:08 +0000 (UTC) Received: from nm32-vm0.bullet.mail.bf1.yahoo.com (nm32-vm0.bullet.mail.bf1.yahoo.com [72.30.239.136]) by mx1.freebsd.org (Postfix) with SMTP id F3A3C119B for ; Fri, 13 Dec 2013 18:46:07 +0000 (UTC) Received: from [98.139.212.150] by nm32.bullet.mail.bf1.yahoo.com with NNFMP; 13 Dec 2013 18:40:45 -0000 Received: from [98.139.211.203] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 13 Dec 2013 18:40:44 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 13 Dec 2013 18:40:44 -0000 X-Yahoo-Newman-Id: 975621.43504.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dlvXta0VM1mki.5HzK8wPr0yOGktjPOy1boRaBPcidBeEFF HFAZWVz4LcQKmrTLwst6iShr7goiReWOnu3WPUlXjeeFJ72zUPtRu0BfRH4w Yob4zaUASW5I.mmj5UyBSw4lDE87s9oS2IK_mZ3xoorFAfG9gwvmuZ5nf67U VnDo2fMRhx.Q5An1NDiMvT1iJp7dc4xqRDzrOU3C5oIe_0jQ_nnZBBAKUoUD CRABBIHfV3stGS8JmBJgCWcLWiRPziQYA7CAytplSaeE2c2OGxMQHFrSvUQb .7vvEXU1NR40FzIGc2M42ZqIg.e3sPj79teTRMyC8jwXdsFDkYWMvsLqm1_G w7HgeMK4LgLk9Rq8ScRnN9SCFiX3smxR285iXk1Z0YeiGx5iVesp_6CdrZF5 WckBw0RJXxcpPvvLJ16cJe28Vk3nLuwGcG5diNmy3HL06kQL0_gfSkJqv2xi 1P35W44FaNm2d6s7x7FwH9W9HL2cu2SI1mWkiF3WlCKwSing1P3NetNvPfC5 339k.h80uEmYB2GaYgiYGlLaZ6NejjpSX23I2NMkElSFi7VKDJCEg3MdAH4y LHwI_KRckURzrQr5_ozj.S6054yiKil0oULJSVWXBeQqKzlxtzqS9iN0aNEd AIhAl8RFtJ6AXcC7ZSVeLlJHQzPnEc.UCYISzkY0E6E1SMYM4Wk_P90_WrHI 00wQ4dk9LYvcNI2Mnpis_ X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.138.105.21]) by smtp212.mail.bf1.yahoo.com with SMTP; 13 Dec 2013 10:40:44 -0800 PST Message-ID: <52AB54A9.6040306@FreeBSD.org> Date: Fri, 13 Dec 2013 13:40:41 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Bruce Evans , Sean Bruno Subject: Re: svn commit: r258139 - head/contrib/gperf/src References: <201311141841.rAEIfwFU040620@svn.freebsd.org> <20131115145452.G954@besplex.bde.org> In-Reply-To: <20131115145452.G954@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 18:46:08 -0000 Hello; Sorry for the delay in looking into this issue. On 15.11.2013 00:06, Bruce Evans wrote: > On Thu, 14 Nov 2013, Sean Bruno wrote: > >> Log: >> Repair build after svn r258115 >> >> options.get_size_type() appears to return a const char *, so assume >> that >> its a string as oppose to *nothing*. I have no idea what apple's >> code is >> trying to do here: >> >> http://opensource.apple.com/source/gperf/gperf-9/patches/size_type.patch >> > > It is trying to add an arg to a printf, while retaining the old behaviour > of printing nothing (now including the new arg) in some cases. The > compiler doesn't like this, since the new arg is unconditional while > the format is conditional. I think it is a compiler bug to warn in > this case. > > This commit replaces the warning (which is really about the compiler bug) > by a bug in gperf. But I think the bug is harmless because it is in > unreachable code. But then why have the unreachable code? (It is for > a default case which I think is unreacheable because all possible cases > that occur are handled individually.) > I decided not to merge that patch from Apple, after all it has limited (no) use at this time. For the code in current, I agree the warning is bogus and I think it would be better to revert Sean's workaround and set the WARNS level to zero. This code is unlikely to evolve further before it is removed from the tree and we won't really need extra warnings for it. Does that sound acceptable? The alternative would be, of course, just reverting the Apple patch. Regards, Pedro. >> Modified: head/contrib/gperf/src/output.cc >> ============================================================================== >> >> --- head/contrib/gperf/src/output.cc Thu Nov 14 16:10:21 2013 >> (r258138) >> +++ head/contrib/gperf/src/output.cc Thu Nov 14 18:41:58 2013 >> (r258139) >> @@ -779,7 +779,7 @@ Output::output_hash_function () const >> " register %s len;\n" : >> option[ANSIC] | option[CPLUSPLUS] ? >> "(register const char *str, register %s len)\n" : >> - "", option.get_size_type()); >> + "%s", option.get_size_type()); >> >> /* Note that when the hash function is called, it has already been >> verified >> that min_key_len <= len <= max_key_len. */ >> ... > > The old code hard-coded the type of the integer arg as "unsigned > int". This > is now spelled "%s" with a new arg. When there is no declaration at all, > then there is no integer arg and the declaration was spelled "". This is > still the correct spelling. Changing it to "%s" gives a syntax error > like > a bare "unsigned int" in the output. However, this case seems to be > unreachable. > > The printf() is rather complicated and fancily formatted, with the fancy > format partly destroyed by the svn mail bug of not quoting patches and > mail > programs then sometimes removing leading whitespace. It uses a nice > conditional ladder of the following form: > > printf( > case1 ? "decl1 %s len" : > case2 ? "decl2 %s len" : > case3 ? "decl3 %s len" : > /* default (unreachable?) */ "", typestr); > > where the formatting is much fancier than this (but is perfectly > consistent > except for the default case and now for the option at the end (the option > should be on a line by itself and not grouped with the complicated > conditional ladder, especially not with its unreachable part). > > The cases are: > > case1: K&R C > case2: plain C > case3: ANSI (sic) C or C++ > default: unreachable? > > and the generated code is now: > > K&R C: "register len'\n" > plain C: "register len;\n" > ANSI (sic) C or C++: "register len;\n" > unreachable?: "" /* syntax error */ > > Before this commit, the generated code was: > > K&R C: "register len'\n" > plain C: "register len;\n" > ANSI (sic) C or C++: "register len;\n" > unreachable?: "" /* no syntax error */ > > and a few days ago it was: > > K&R C: "register unsigned len'\n" > plain C: "register unsigned len;\n" > ANSI (sic) C or C++: "register unsigned len;\n" > unreachable?: "" /* no syntax error */ > > This particular declaration doesn't even depend on the language. The > printf() just groups it with another one for a pointer because this used > to be convenient. > > The supported languages are sort of documented in the man page. ANSI C > doesn't exist, and there have been several versions of Standard C since > it existed, but there is no special version-dependent support. It is > even less clear what plain C is. It seems to be for a 1980's C that > is not quite as old as K&R C -- according to the generated code, plain C > has const but not signed char, while K&R C has neither. I get the lack > of signed char from smallest_integral_type(). smallest_integral_type() > is fundamentally wrong since it uses the host SCHAR_MIN for building > K&R and plain C targets that don't have SCHAR_MIN and might even have > a different character size when running on the same hardware as gperf. > > Bruce From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 19:01:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0145CD4A; Fri, 13 Dec 2013 19:01:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5CC4129B; Fri, 13 Dec 2013 19:01:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDJ1orv077706; Fri, 13 Dec 2013 19:01:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDJ1osG077705; Fri, 13 Dec 2013 19:01:50 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131901.rBDJ1osG077705@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 19:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259323 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:01:51 -0000 Author: ian Date: Fri Dec 13 19:01:50 2013 New Revision: 259323 URL: http://svnweb.freebsd.org/changeset/base/259323 Log: MFC r257480: Convert the if/else list of compatible devices to the table-driven ofw_bus_search_compatible() routine. In addition to converting existing strings to table entries, also add compat strings for the whole imx family. Modified: stable/10/sys/dev/uart/uart_bus_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_fdt.c Fri Dec 13 18:26:22 2013 (r259322) +++ stable/10/sys/dev/uart/uart_bus_fdt.c Fri Dec 13 19:01:50 2013 (r259323) @@ -61,6 +61,30 @@ static driver_t uart_fdt_driver = { sizeof(struct uart_softc), }; +/* + * Compatible devices. Keep this sorted in most- to least-specific order first, + * alphabetical second. That is, "zwie,ns16550" should appear before "ns16550" + * on the theory that the zwie driver knows how to make better use of the + * hardware than the generic driver. Likewise with chips within a family, the + * highest-numbers / most recent models should probably appear earlier. + */ +static struct ofw_compat_data compat_data[] = { + {"arm,pl011", (uintptr_t)&uart_pl011_class}, + {"cadence,uart", (uintptr_t)&uart_cdnc_class}, + {"exynos", (uintptr_t)&uart_s3c2410_class}, + {"fsl,imx6q-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx53-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx51-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx31-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx27-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx25-uart", (uintptr_t)&uart_imx_class}, + {"fsl,imx21-uart", (uintptr_t)&uart_imx_class}, + {"lpc,uart", (uintptr_t)&uart_lpc_class}, + {"ti,ns16550", (uintptr_t)&uart_ti8250_class}, + {"ns16550", (uintptr_t)&uart_ns8250_class}, + {NULL, (uintptr_t)NULL}, +}; + static int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { @@ -99,25 +123,16 @@ uart_fdt_probe(device_t dev) phandle_t node; pcell_t clock, shift; int err; + const struct ofw_compat_data * cd; sc = device_get_softc(dev); - if (ofw_bus_is_compatible(dev, "lpc,uart")) - sc->sc_class = &uart_lpc_class; - else if (ofw_bus_is_compatible(dev, "fsl,imx-uart")) - sc->sc_class = &uart_imx_class; - else if (ofw_bus_is_compatible(dev, "arm,pl011")) - sc->sc_class = &uart_pl011_class; - else if (ofw_bus_is_compatible(dev, "exynos")) - sc->sc_class = &uart_s3c2410_class; - else if (ofw_bus_is_compatible(dev, "cadence,uart")) - sc->sc_class = &uart_cdnc_class; - else if (ofw_bus_is_compatible(dev, "ti,ns16550")) - sc->sc_class = &uart_ti8250_class; - else if (ofw_bus_is_compatible(dev, "ns16550")) - sc->sc_class = &uart_ns8250_class; - else + + cd = ofw_bus_search_compatible(dev, compat_data); + if (cd->ocd_data == (uintptr_t)NULL) return (ENXIO); + sc->sc_class = (struct uart_class *)cd->ocd_data; + node = ofw_bus_get_node(dev); if ((err = uart_fdt_get_clock(node, &clock)) != 0) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 19:17:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 96C9313E; Fri, 13 Dec 2013 19:17:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68CD51377; Fri, 13 Dec 2013 19:17:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDJHAU4082320; Fri, 13 Dec 2013 19:17:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDJHAOd082319; Fri, 13 Dec 2013 19:17:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131917.rBDJHAOd082319@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 19:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259324 - stable/10/sys/arm/rockchip X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:17:10 -0000 Author: ian Date: Fri Dec 13 19:17:09 2013 New Revision: 259324 URL: http://svnweb.freebsd.org/changeset/base/259324 Log: MFC r256949: Import basic support for Rockchip RK3188 SoC. Added: stable/10/sys/arm/rockchip/ - copied from r256949, head/sys/arm/rockchip/ Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 19:27:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B474A4A0; Fri, 13 Dec 2013 19:27:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E77A147C; Fri, 13 Dec 2013 19:27:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDJROWH085863; Fri, 13 Dec 2013 19:27:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDJRN1m085857; Fri, 13 Dec 2013 19:27:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312131927.rBDJRN1m085857@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 19:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259325 - in stable/10/sys: arm/broadcom/bcm2835 arm/conf boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:27:24 -0000 Author: ian Date: Fri Dec 13 19:27:23 2013 New Revision: 259325 URL: http://svnweb.freebsd.org/changeset/base/259325 Log: MFC r257062: Add the Raspberry Pi SPI controller driver. Added: stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c - copied unchanged from r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spi.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_spireg.h - copied unchanged from r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spireg.h stable/10/sys/arm/broadcom/bcm2835/bcm2835_spivar.h - copied unchanged from r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h Modified: stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 stable/10/sys/arm/conf/RPI-B stable/10/sys/boot/fdt/dts/bcm2835.dtsi Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c (from r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spi.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c Fri Dec 13 19:27:23 2013 (r259325, copy of r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spi.c) @@ -0,0 +1,521 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "spibus_if.h" + +static void bcm_spi_intr(void *); + +#ifdef BCM_SPI_DEBUG +static void +bcm_spi_printr(device_t dev) +{ + struct bcm_spi_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + reg = BCM_SPI_READ(sc, SPI_CS); + device_printf(dev, "CS=%b\n", reg, + "\20\1CS0\2CS1\3CPHA\4CPOL\7CSPOL" + "\10TA\11DMAEN\12INTD\13INTR\14ADCS\15REN\16LEN" + "\21DONE\22RXD\23TXD\24RXR\25RXF\26CSPOL0\27CSPOL1" + "\30CSPOL2\31DMA_LEN\32LEN_LONG"); + reg = BCM_SPI_READ(sc, SPI_CLK) & SPI_CLK_MASK; + if (reg % 2) + reg--; + if (reg == 0) + reg = 65536; + device_printf(dev, "CLK=%uMhz/%d=%luhz\n", + SPI_CORE_CLK / 1000000, reg, SPI_CORE_CLK / reg); + reg = BCM_SPI_READ(sc, SPI_DLEN) & SPI_DLEN_MASK; + device_printf(dev, "DLEN=%d\n", reg); + reg = BCM_SPI_READ(sc, SPI_LTOH) & SPI_LTOH_MASK; + device_printf(dev, "LTOH=%d\n", reg); + reg = BCM_SPI_READ(sc, SPI_DC); + device_printf(dev, "DC=RPANIC=%#x RDREQ=%#x TPANIC=%#x TDREQ=%#x\n", + (reg & SPI_DC_RPANIC_MASK) >> SPI_DC_RPANIC_SHIFT, + (reg & SPI_DC_RDREQ_MASK) >> SPI_DC_RDREQ_SHIFT, + (reg & SPI_DC_TPANIC_MASK) >> SPI_DC_TPANIC_SHIFT, + (reg & SPI_DC_TDREQ_MASK) >> SPI_DC_TDREQ_SHIFT); +} +#endif + +static void +bcm_spi_modifyreg(struct bcm_spi_softc *sc, uint32_t off, uint32_t mask, + uint32_t value) +{ + uint32_t reg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + reg = BCM_SPI_READ(sc, off); + reg &= ~mask; + reg |= value; + BCM_SPI_WRITE(sc, off, reg); +} + +static int +bcm_spi_clock_proc(SYSCTL_HANDLER_ARGS) +{ + struct bcm_spi_softc *sc; + uint32_t clk; + int error; + + sc = (struct bcm_spi_softc *)arg1; + + BCM_SPI_LOCK(sc); + clk = BCM_SPI_READ(sc, SPI_CLK); + BCM_SPI_UNLOCK(sc); + clk &= 0xffff; + if (clk == 0) + clk = 65536; + clk = SPI_CORE_CLK / clk; + + error = sysctl_handle_int(oidp, &clk, sizeof(clk), req); + if (error != 0 || req->newptr == NULL) + return (error); + + clk = SPI_CORE_CLK / clk; + if (clk <= 1) + clk = 2; + else if (clk % 2) + clk--; + if (clk > 0xffff) + clk = 0; + BCM_SPI_LOCK(sc); + BCM_SPI_WRITE(sc, SPI_CLK, clk); + BCM_SPI_UNLOCK(sc); + + return (0); +} + +static int +bcm_spi_cs_bit_proc(SYSCTL_HANDLER_ARGS, uint32_t bit) +{ + struct bcm_spi_softc *sc; + uint32_t reg; + int error; + + sc = (struct bcm_spi_softc *)arg1; + BCM_SPI_LOCK(sc); + reg = BCM_SPI_READ(sc, SPI_CS); + BCM_SPI_UNLOCK(sc); + reg = (reg & bit) ? 1 : 0; + + error = sysctl_handle_int(oidp, ®, sizeof(reg), req); + if (error != 0 || req->newptr == NULL) + return (error); + + if (reg) + reg = bit; + BCM_SPI_LOCK(sc); + bcm_spi_modifyreg(sc, SPI_CS, bit, reg); + BCM_SPI_UNLOCK(sc); + + return (0); +} + +static int +bcm_spi_cpol_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CPOL)); +} + +static int +bcm_spi_cpha_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CPHA)); +} + +static int +bcm_spi_cspol0_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CSPOL0)); +} + +static int +bcm_spi_cspol1_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CSPOL1)); +} + +static void +bcm_spi_sysctl_init(struct bcm_spi_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree_node; + struct sysctl_oid_list *tree; + + /* + * Add system sysctl tree/handlers. + */ + ctx = device_get_sysctl_ctx(sc->sc_dev); + tree_node = device_get_sysctl_tree(sc->sc_dev); + tree = SYSCTL_CHILDREN(tree_node); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_clock_proc, "IU", "SPI BUS clock frequency"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpol", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cpol_proc, "IU", "SPI BUS clock polarity"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpha", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cpha_proc, "IU", "SPI BUS clock phase"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol0", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cspol0_proc, "IU", "SPI BUS chip select 0 polarity"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol1", + CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cspol1_proc, "IU", "SPI BUS chip select 1 polarity"); +} + +static int +bcm_spi_probe(device_t dev) +{ + + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-spi")) + return (ENXIO); + + device_set_desc(dev, "BCM2708/2835 SPI controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_spi_attach(device_t dev) +{ + struct bcm_spi_softc *sc; + device_t gpio; + int i, rid; + + if (device_get_unit(dev) != 0) { + device_printf(dev, "only one SPI controller supported\n"); + return (ENXIO); + } + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + /* Configure the GPIO pins to ALT0 function to enable SPI the pins. */ + gpio = devclass_get_device(devclass_find("gpio"), 0); + if (!gpio) { + device_printf(dev, "cannot find gpio0\n"); + return (ENXIO); + } + for (i = 0; i < nitems(bcm_spi_pins); i++) + bcm_gpio_set_alternate(gpio, bcm_spi_pins[i], BCM_GPIO_ALT0); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + return (ENXIO); + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot allocate interrupt\n"); + return (ENXIO); + } + + /* Hook up our interrupt handler. */ + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, bcm_spi_intr, sc, &sc->sc_intrhand)) { + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + device_printf(dev, "cannot setup the interrupt handler\n"); + return (ENXIO); + } + + mtx_init(&sc->sc_mtx, "bcm_spi", NULL, MTX_DEF); + + /* Add sysctl nodes. */ + bcm_spi_sysctl_init(sc); + +#ifdef BCM_SPI_DEBUG + bcm_spi_printr(dev); +#endif + + /* + * Enable the SPI controller. Clear the rx and tx FIFO. + * Defaults to SPI mode 0. + */ + BCM_SPI_WRITE(sc, SPI_CS, SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO); + + /* Set the SPI clock to 500Khz. */ + BCM_SPI_WRITE(sc, SPI_CLK, SPI_CORE_CLK / 500000); + +#ifdef BCM_SPI_DEBUG + bcm_spi_printr(dev); +#endif + + device_add_child(dev, "spibus", -1); + + return (bus_generic_attach(dev)); +} + +static int +bcm_spi_detach(device_t dev) +{ + struct bcm_spi_softc *sc; + + bus_generic_detach(dev); + + sc = device_get_softc(dev); + mtx_destroy(&sc->sc_mtx); + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (0); +} + +static void +bcm_spi_fill_fifo(struct bcm_spi_softc *sc) +{ + struct spi_command *cmd; + uint32_t cs, written; + uint8_t *data; + + cmd = sc->sc_cmd; + cs = BCM_SPI_READ(sc, SPI_CS) & (SPI_CS_TA | SPI_CS_TXD); + while (sc->sc_written < sc->sc_len && + cs == (SPI_CS_TA | SPI_CS_TXD)) { + data = (uint8_t *)cmd->tx_cmd; + written = sc->sc_written++; + if (written >= cmd->tx_cmd_sz) { + data = (uint8_t *)cmd->tx_data; + written -= cmd->tx_cmd_sz; + } + BCM_SPI_WRITE(sc, SPI_FIFO, data[written]); + cs = BCM_SPI_READ(sc, SPI_CS) & (SPI_CS_TA | SPI_CS_TXD); + } +} + +static void +bcm_spi_drain_fifo(struct bcm_spi_softc *sc) +{ + struct spi_command *cmd; + uint32_t cs, read; + uint8_t *data; + + cmd = sc->sc_cmd; + cs = BCM_SPI_READ(sc, SPI_CS) & SPI_CS_RXD; + while (sc->sc_read < sc->sc_len && cs == SPI_CS_RXD) { + data = (uint8_t *)cmd->rx_cmd; + read = sc->sc_read++; + if (read >= cmd->rx_cmd_sz) { + data = (uint8_t *)cmd->rx_data; + read -= cmd->rx_cmd_sz; + } + data[read] = BCM_SPI_READ(sc, SPI_FIFO) & 0xff; + cs = BCM_SPI_READ(sc, SPI_CS) & SPI_CS_RXD; + } +} + +static void +bcm_spi_intr(void *arg) +{ + struct bcm_spi_softc *sc; + + sc = (struct bcm_spi_softc *)arg; + BCM_SPI_LOCK(sc); + + /* Filter stray interrupts. */ + if ((sc->sc_flags & BCM_SPI_BUSY) == 0) { + BCM_SPI_UNLOCK(sc); + return; + } + + /* TX - Fill up the FIFO. */ + bcm_spi_fill_fifo(sc); + + /* RX - Drain the FIFO. */ + bcm_spi_drain_fifo(sc); + + /* Check for end of transfer. */ + if (sc->sc_written == sc->sc_len && sc->sc_read == sc->sc_len) { + /* Disable interrupts and the SPI engine. */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0); + wakeup(sc->sc_dev); + } + + BCM_SPI_UNLOCK(sc); +} + +static int +bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) +{ + struct bcm_spi_softc *sc; + int cs, err; + + sc = device_get_softc(dev); + + KASSERT(cmd->tx_cmd_sz == cmd->rx_cmd_sz, + ("TX/RX command sizes should be equal")); + KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, + ("TX/RX data sizes should be equal")); + + BCM_SPI_LOCK(sc); + + /* If the controller is in use wait until it is available. */ + while (sc->sc_flags & BCM_SPI_BUSY) + mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_spi", 0); + + /* Now we have control over SPI controller. */ + sc->sc_flags = BCM_SPI_BUSY; + + /* Clear the FIFO. */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO, + SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO); + + /* Get the proper chip select for this child. */ + spibus_get_cs(child, &cs); + if (cs < 0 || cs > 2) { + device_printf(dev, + "Invalid chip select %d requested by %s\n", cs, + device_get_nameunit(child)); + BCM_SPI_UNLOCK(sc); + return (EINVAL); + } + + /* Save a pointer to the SPI command. */ + sc->sc_cmd = cmd; + sc->sc_read = 0; + sc->sc_written = 0; + sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; + + /* + * Set the CS for this transaction, enable interrupts and announce + * we're ready to tx. This will kick off the first interrupt. + */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_MASK | SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, + cs | SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD); + + /* Wait for the transaction to complete. */ + err = mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_spi", hz * 2); + + /* Make sure the SPI engine and interrupts are disabled. */ + bcm_spi_modifyreg(sc, SPI_CS, SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, 0); + + /* Clear the controller flags. */ + sc->sc_flags = 0; + + /* + * Check for transfer timeout. The SPI controller doesn't + * return errors. + */ + if (err == EWOULDBLOCK) { + device_printf(sc->sc_dev, "SPI error\n"); + err = EIO; + } + + BCM_SPI_UNLOCK(sc); + + return (err); +} + +static phandle_t +bcm_spi_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the SPI bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t bcm_spi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_spi_probe), + DEVMETHOD(device_attach, bcm_spi_attach), + DEVMETHOD(device_detach, bcm_spi_detach), + + /* SPI interface */ + DEVMETHOD(spibus_transfer, bcm_spi_transfer), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, bcm_spi_get_node), + + DEVMETHOD_END +}; + +static devclass_t bcm_spi_devclass; + +static driver_t bcm_spi_driver = { + "spi", + bcm_spi_methods, + sizeof(struct bcm_spi_softc), +}; + +DRIVER_MODULE(bcm2835_spi, simplebus, bcm_spi_driver, bcm_spi_devclass, 0, 0); Copied: stable/10/sys/arm/broadcom/bcm2835/bcm2835_spireg.h (from r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spireg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_spireg.h Fri Dec 13 19:27:23 2013 (r259325, copy of r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spireg.h) @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * 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$ + */ + +#ifndef _BCM2835_SPIREG_H_ +#define _BCM2835_SPIREG_H_ + +#define SPI_CORE_CLK 250000000U +#define SPI_CS 0x00 +#define SPI_CS_LEN_LONG (1 << 25) +#define SPI_CS_DMA_LEN (1 << 24) +#define SPI_CS_CSPOL2 (1 << 23) +#define SPI_CS_CSPOL1 (1 << 22) +#define SPI_CS_CSPOL0 (1 << 21) +#define SPI_CS_RXF (1 << 20) +#define SPI_CS_RXR (1 << 19) +#define SPI_CS_TXD (1 << 18) +#define SPI_CS_RXD (1 << 17) +#define SPI_CS_DONE (1 << 16) +#define SPI_CS_LEN (1 << 13) +#define SPI_CS_REN (1 << 12) +#define SPI_CS_ADCS (1 << 11) +#define SPI_CS_INTR (1 << 10) +#define SPI_CS_INTD (1 << 9) +#define SPI_CS_DMAEN (1 << 8) +#define SPI_CS_TA (1 << 7) +#define SPI_CS_CSPOL (1 << 6) +#define SPI_CS_CLEAR_RXFIFO (1 << 5) +#define SPI_CS_CLEAR_TXFIFO (1 << 4) +#define SPI_CS_CPOL (1 << 3) +#define SPI_CS_CPHA (1 << 2) +#define SPI_CS_MASK 0x3 +#define SPI_FIFO 0x04 +#define SPI_CLK 0x08 +#define SPI_CLK_MASK 0xffff +#define SPI_DLEN 0x0c +#define SPI_DLEN_MASK 0xffff +#define SPI_LTOH 0x10 +#define SPI_LTOH_MASK 0xf +#define SPI_DC 0x14 +#define SPI_DC_RPANIC_SHIFT 24 +#define SPI_DC_RPANIC_MASK (0xff << SPI_DC_RPANIC_SHIFT) +#define SPI_DC_RDREQ_SHIFT 16 +#define SPI_DC_RDREQ_MASK (0xff << SPI_DC_RDREQ_SHIFT) +#define SPI_DC_TPANIC_SHIFT 8 +#define SPI_DC_TPANIC_MASK (0xff << SPI_DC_TPANIC_SHIFT) +#define SPI_DC_TDREQ_SHIFT 0 +#define SPI_DC_TDREQ_MASK 0xff + +#endif /* _BCM2835_SPIREG_H_ */ Copied: stable/10/sys/arm/broadcom/bcm2835/bcm2835_spivar.h (from r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_spivar.h Fri Dec 13 19:27:23 2013 (r259325, copy of r257062, head/sys/arm/broadcom/bcm2835/bcm2835_spivar.h) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2013 Luiz Otavio O Souza + * 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$ + */ + +#ifndef _BCM2835_SPIVAR_H_ +#define _BCM2835_SPIVAR_H_ + +/* + * Only the available pins are listed here. + * i.e. CS2 isn't available. + */ +uint32_t bcm_spi_pins[] = { + 7, /* CS1 */ + 8, /* CS0 */ + 9, /* MISO */ + 10, /* MOSI */ + 11 /* SCLK */ +}; + +struct bcm_spi_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + struct spi_command *sc_cmd; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + uint32_t sc_len; + uint32_t sc_read; + uint32_t sc_flags; + uint32_t sc_written; + void * sc_intrhand; +}; + +#define BCM_SPI_BUSY 0x1 + +#define BCM_SPI_WRITE(_sc, _off, _val) \ + bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) +#define BCM_SPI_READ(_sc, _off) \ + bus_space_read_4(_sc->sc_bst, _sc->sc_bsh, _off) + +#define BCM_SPI_LOCK(_sc) \ + mtx_lock(&(_sc)->sc_mtx) +#define BCM_SPI_UNLOCK(_sc) \ + mtx_unlock(&(_sc)->sc_mtx) + +#endif /* _BCM2835_SPIVAR_H_ */ Modified: stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Dec 13 19:17:09 2013 (r259324) +++ stable/10/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Dec 13 19:27:23 2013 (r259325) @@ -7,6 +7,7 @@ arm/broadcom/bcm2835/bcm2835_intr.c sta arm/broadcom/bcm2835/bcm2835_machdep.c standard arm/broadcom/bcm2835/bcm2835_mbox.c standard arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bus_space.c optional fdt Modified: stable/10/sys/arm/conf/RPI-B ============================================================================== --- stable/10/sys/arm/conf/RPI-B Fri Dec 13 19:17:09 2013 (r259324) +++ stable/10/sys/arm/conf/RPI-B Fri Dec 13 19:27:23 2013 (r259325) @@ -102,6 +102,10 @@ device smcphy device mii device smsc +# SPI +device spibus +device bcm2835_spi + # Flattened Device Tree options FDT # Note: DTB is normally loaded and modified by RPi boot loader, then Modified: stable/10/sys/boot/fdt/dts/bcm2835.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/bcm2835.dtsi Fri Dec 13 19:17:09 2013 (r259324) +++ stable/10/sys/boot/fdt/dts/bcm2835.dtsi Fri Dec 13 19:27:23 2013 (r259325) @@ -396,6 +396,14 @@ }; }; + spi0 { + compatible = "broadcom,bcm2835-spi", + "broadcom,bcm2708-spi"; + reg = <0x204000 0x20>; + interrupts = <62>; + interrupt-parent = <&intc>; + }; + dma: dma { compatible = "broadcom,bcm2835-dma", "broadcom,bcm2708-dma"; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 19:32:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 757DA65D; Fri, 13 Dec 2013 19:32:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47ACF150E; Fri, 13 Dec 2013 19:32:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDJW3UW088832; Fri, 13 Dec 2013 19:32:03 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDJW3iw088831; Fri, 13 Dec 2013 19:32:03 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312131932.rBDJW3iw088831@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 19:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259326 - stable/10/contrib/tcpdump X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:32:03 -0000 Author: pfg Date: Fri Dec 13 19:32:02 2013 New Revision: 259326 URL: http://svnweb.freebsd.org/changeset/base/259326 Log: MFV r258571: Removes strict-aliasing warnings from newer GCC in tcpdump. Corresponds to MFC r258573, but for some reason our new pre-commit hooks will not let us merge it from there. Modified: stable/10/contrib/tcpdump/extract.h Modified: stable/10/contrib/tcpdump/extract.h ============================================================================== --- stable/10/contrib/tcpdump/extract.h Fri Dec 13 19:27:23 2013 (r259325) +++ stable/10/contrib/tcpdump/extract.h Fri Dec 13 19:32:02 2013 (r259326) @@ -51,13 +51,25 @@ typedef struct { u_int32_t val; } __attribute__((packed)) unaligned_u_int32_t; -#define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)) -#define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)) -#define EXTRACT_64BITS(p) \ - ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ - ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)) +static inline u_int16_t +EXTRACT_16BITS(const void *p) +{ + return ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)); +} + +static inline u_int32_t +EXTRACT_32BITS(const void *p) +{ + return ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)); +} + +static inline u_int64_t +EXTRACT_64BITS(const void *p) +{ + return ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ + ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)); + +} #else /* HAVE___ATTRIBUTE__ */ /* @@ -88,13 +100,26 @@ typedef struct { * The processor natively handles unaligned loads, so we can just * cast the pointer and fetch through it. */ -#define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(*(const u_int16_t *)(p))) -#define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(*(const u_int32_t *)(p))) -#define EXTRACT_64BITS(p) \ - ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ - ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)) +static inline u_int16_t +EXTRACT_16BITS(const void *p) +{ + return ((u_int16_t)ntohs(*(const u_int16_t *)(p))); +} + +static inline u_int32_t +EXTRACT_32BITS(const void *p) +{ + return ((u_int32_t)ntohl(*(const u_int32_t *)(p))); +} + +static inline u_int64_t +EXTRACT_64BITS(const void *p) +{ + return ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ + ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)); + +} + #endif /* LBL_ALIGN */ #define EXTRACT_24BITS(p) \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 19:38:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AE25BAE; Fri, 13 Dec 2013 19:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0BF151574; Fri, 13 Dec 2013 19:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDJc50d089802; Fri, 13 Dec 2013 19:38:05 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDJc5o8089801; Fri, 13 Dec 2013 19:38:05 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201312131938.rBDJc5o8089801@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 13 Dec 2013 19:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259327 - stable/9/contrib/tcpdump X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:38:06 -0000 Author: pfg Date: Fri Dec 13 19:38:05 2013 New Revision: 259327 URL: http://svnweb.freebsd.org/changeset/base/259327 Log: MFV r258571: Removes strict-aliasing warnings from newer GCC in tcpdump. Corresponds to MFC r258573, but for some reason our new pre-commit hooks will not let us merge it from there. Modified: stable/9/contrib/tcpdump/extract.h Modified: stable/9/contrib/tcpdump/extract.h ============================================================================== --- stable/9/contrib/tcpdump/extract.h Fri Dec 13 19:32:02 2013 (r259326) +++ stable/9/contrib/tcpdump/extract.h Fri Dec 13 19:38:05 2013 (r259327) @@ -51,13 +51,25 @@ typedef struct { u_int32_t val; } __attribute__((packed)) unaligned_u_int32_t; -#define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)) -#define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)) -#define EXTRACT_64BITS(p) \ - ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ - ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)) +static inline u_int16_t +EXTRACT_16BITS(const void *p) +{ + return ((u_int16_t)ntohs(((const unaligned_u_int16_t *)(p))->val)); +} + +static inline u_int32_t +EXTRACT_32BITS(const void *p) +{ + return ((u_int32_t)ntohl(((const unaligned_u_int32_t *)(p))->val)); +} + +static inline u_int64_t +EXTRACT_64BITS(const void *p) +{ + return ((u_int64_t)(((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 0)->val)) << 32 | \ + ((u_int64_t)ntohl(((const unaligned_u_int32_t *)(p) + 1)->val)) << 0)); + +} #else /* HAVE___ATTRIBUTE__ */ /* @@ -88,13 +100,26 @@ typedef struct { * The processor natively handles unaligned loads, so we can just * cast the pointer and fetch through it. */ -#define EXTRACT_16BITS(p) \ - ((u_int16_t)ntohs(*(const u_int16_t *)(p))) -#define EXTRACT_32BITS(p) \ - ((u_int32_t)ntohl(*(const u_int32_t *)(p))) -#define EXTRACT_64BITS(p) \ - ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ - ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)) +static inline u_int16_t +EXTRACT_16BITS(const void *p) +{ + return ((u_int16_t)ntohs(*(const u_int16_t *)(p))); +} + +static inline u_int32_t +EXTRACT_32BITS(const void *p) +{ + return ((u_int32_t)ntohl(*(const u_int32_t *)(p))); +} + +static inline u_int64_t +EXTRACT_64BITS(const void *p) +{ + return ((u_int64_t)(((u_int64_t)ntohl(*((const u_int32_t *)(p) + 0))) << 32 | \ + ((u_int64_t)ntohl(*((const u_int32_t *)(p) + 1))) << 0)); + +} + #endif /* LBL_ALIGN */ #define EXTRACT_24BITS(p) \ From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 19:43:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB0EED6D for ; Fri, 13 Dec 2013 19:43:32 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6252815E7 for ; Fri, 13 Dec 2013 19:43:32 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id o15so1095877qap.3 for ; Fri, 13 Dec 2013 11:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=UzX9zY51GEdntUbSj4lNOAIYXXTPyUkh/lAYK6cuGQc=; b=mPsSCuk5gwz6kXnmhTTxShoT1R4Wq8CXT/0TLGXrEU1/3fUgrkg+v+wm5btkm0yxpL WDhkEW705DLOGwmefZiXqCR1vFiByOaNpWBr5QaukwyP8OmkxdbMyHAELWwjwN9Iqjw5 665D7DV3iF0pi7QLNDwkDU90cqJM/37x8mJ24= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=UzX9zY51GEdntUbSj4lNOAIYXXTPyUkh/lAYK6cuGQc=; b=kPLroU+ACKKoPzEPykqME5+iCRf5JiHoj2MbIQjNuC+f9D6Dlae8t8fSALNma3jHwG 0eUE6oB8zFRy0yRIrfW+snvbHjHNI47rBVmyJnAaJ4L+m0pRmnZL6SgG1Wy/saQds7wX vpgeZSHQ6TFQSR6jNE1AVyfxy9Yw8hQKEnKv2VU/wAylAA+rx2VTE40JNciSa9XcKYDi YUD8irXir842cUpAT4KyrjO+K3ULVw4aovT0NdGKFKJV96nzLAsm+Rk7Y5/sTrwNCqxj z92qaHRZcG1bHiW5dq69Y5kxDWhz9OMMc+CH+Dc8WGst9nA94VxyCrVSsURU2tnoMJfi UVug== X-Gm-Message-State: ALoCoQnHsEPsjNnO6t6nVrSDIlMDBJwokSlqWP958NaZrHfClK8wPzfCTY6Aj3VvvPVNPFQ+FXgi X-Received: by 10.224.28.72 with SMTP id l8mr7521317qac.35.1386963811481; Fri, 13 Dec 2013 11:43:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.86.42 with HTTP; Fri, 13 Dec 2013 11:43:01 -0800 (PST) In-Reply-To: <201312131932.rBDJW3iw088831@svn.freebsd.org> References: <201312131932.rBDJW3iw088831@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Dec 2013 14:43:01 -0500 X-Google-Sender-Auth: dm7L8m2gMe1JkQg1QjBqWSU2LHA Message-ID: Subject: Re: svn commit: r259326 - stable/10/contrib/tcpdump To: "Pedro F. Giffuni" Content-Type: text/plain; charset=UTF-8 Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 19:43:32 -0000 On Fri, Dec 13, 2013 at 2:32 PM, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Dec 13 19:32:02 2013 > New Revision: 259326 > URL: http://svnweb.freebsd.org/changeset/base/259326 > > Log: > MFV r258571: > > Removes strict-aliasing warnings from newer GCC in tcpdump. > > Corresponds to MFC r258573, but for some reason our new pre-commit hooks > will not let us merge it from there. How did you attempt to do this merge? What were the exact commands? From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 20:11:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3C777AE for ; Fri, 13 Dec 2013 20:11:05 +0000 (UTC) Received: from nm39-vm9.bullet.mail.bf1.yahoo.com (nm39-vm9.bullet.mail.bf1.yahoo.com [72.30.239.153]) by mx1.freebsd.org (Postfix) with SMTP id 27D37181D for ; Fri, 13 Dec 2013 20:11:05 +0000 (UTC) Received: from [98.139.212.149] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 13 Dec 2013 20:04:23 -0000 Received: from [68.142.230.77] by tm6.bullet.mail.bf1.yahoo.com with NNFMP; 13 Dec 2013 20:04:23 -0000 Received: from [127.0.0.1] by smtp234.mail.bf1.yahoo.com with NNFMP; 13 Dec 2013 20:04:23 -0000 X-Yahoo-Newman-Id: 771516.71567.bm@smtp234.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FReGZEcVM1nRzYZLDCj0ETN1IZ_pGQmSYgfqEZsOK7QWOHo YKUSWJzcrNWBoiBR_vfNMmil3ozJ6OTXVpNXtVhA8H30nHphQ4aVBLGAVc.v 2xGK7omuzkx6Gc3iFjax1CPHYty7OajTdBtrSLfc9I2i_ZQ5sc1bHwKwugXV 1Qv.c8l86CAin2DiJYk5O8zKp9Xepp2feVHj7bLzJyldezJc9tgeznnYzn1n S8_xZKlSb73YM_Dh4ItQKQyiMY66wuPAwfpusalTS1WGIr0xa7VWA02tPq6O 1crWz5GIyZ89fJlhIodZJ77fKVtayqh8SYoyW7E.xpuxj50OsjAsiPb3V_1Y NIyZtr_GykcuV2MgfABopnNqk5lymUWwX_hnbKvGw3jXsCUVcTXR2cQtG3R4 0aneDAZQqfWPsttc4RsGo.GDCjGi5ugprzH8q_jA9JcBKHKBOPGX3ga7Sc5p hMB_D_W3d3yYhW1LihKM5vUbcQArE.sZ91acxp069gVBNX3NMfhOOs35Awex zl7P7YXAzNF83c_fj0c598rQM6zi1eaqjL.wP03POuEY8C4xhq0BbTA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with plain [98.139.211.125]) by smtp234.mail.bf1.yahoo.com with SMTP; 13 Dec 2013 20:04:23 +0000 UTC Message-ID: <52AB6845.7020504@FreeBSD.org> Date: Fri, 13 Dec 2013 15:04:21 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r259326 - stable/10/contrib/tcpdump References: <201312131932.rBDJW3iw088831@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:11:05 -0000 On 13.12.2013 14:43, Eitan Adler wrote: > On Fri, Dec 13, 2013 at 2:32 PM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Dec 13 19:32:02 2013 >> New Revision: 259326 >> URL: http://svnweb.freebsd.org/changeset/base/259326 >> >> Log: >> MFV r258571: >> >> Removes strict-aliasing warnings from newer GCC in tcpdump. >> >> Corresponds to MFC r258573, but for some reason our new pre-commit hooks >> will not let us merge it from there. > How did you attempt to do this merge? What were the exact commands? (Standing on my local stable/10 dir) svn merge -c r258573 ^/head . Attempt to commit there fired the pre-commit hook. I then tried: svn merge --ignore-ancestry -c r258573 ^/head . (failed) Next attempt was: svn merge -c r258571 ^/vendor/tcpdump/dist contrib/tcpdump (also failed) finally this worked: svn merge --ignore-ancestry -c r258571 ^/vendor/tcpdump/dist contrib/tcpdump Hope that helps someone with the same issue ;). Pedro. From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 20:33:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EBC91D77; Fri, 13 Dec 2013 20:33:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BDBD3198A; Fri, 13 Dec 2013 20:33:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDKXxZS011031; Fri, 13 Dec 2013 20:33:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDKXx00011029; Fri, 13 Dec 2013 20:33:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312132033.rBDKXx00011029@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 20:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259328 - in stable/10/sys/geom: . label X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:34:00 -0000 Author: trasz Date: Fri Dec 13 20:33:59 2013 New Revision: 259328 URL: http://svnweb.freebsd.org/changeset/base/259328 Log: MFC r256724: Make geom_label(4) resize-aware. This fixes a situation when "gpart resize" would resize a partition, but label providers - e.g. /dev/gptid/XXX - would stay the same size. MFC r256766: Fix build with gcc by spelling unused format string as "unused" instead of NULL. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/geom/geom_slice.c stable/10/sys/geom/label/g_label.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/geom_slice.c ============================================================================== --- stable/10/sys/geom/geom_slice.c Fri Dec 13 19:38:05 2013 (r259327) +++ stable/10/sys/geom/geom_slice.c Fri Dec 13 20:33:59 2013 (r259328) @@ -382,7 +382,7 @@ g_slice_config(struct g_geom *gp, u_int printf("GEOM: Reconfigure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, (intmax_t)(offset + length - 1)); - pp->mediasize = gsl->length; + g_resize_provider(pp, gsl->length); return (0); } sb = sbuf_new_auto(); Modified: stable/10/sys/geom/label/g_label.c ============================================================================== --- stable/10/sys/geom/label/g_label.c Fri Dec 13 19:38:05 2013 (r259327) +++ stable/10/sys/geom/label/g_label.c Fri Dec 13 20:33:59 2013 (r259328) @@ -124,6 +124,17 @@ g_label_spoiled(struct g_consumer *cp) g_slice_spoiled(cp); } +static void +g_label_resize(struct g_consumer *cp) +{ + + G_LABEL_DEBUG(1, "Label %s resized.", + LIST_FIRST(&cp->geom->provider)->name); + + g_slice_config(cp->geom, 0, G_SLICE_CONFIG_FORCE, (off_t)0, + cp->provider->mediasize, cp->provider->sectorsize, "notused"); +} + static int g_label_is_name_ok(const char *label) { @@ -208,6 +219,7 @@ g_label_create(struct gctl_req *req, str } gp->orphan = g_label_orphan; gp->spoiled = g_label_spoiled; + gp->resize = g_label_resize; g_access(cp, -1, 0, 0); g_slice_config(gp, 0, G_SLICE_CONFIG_SET, (off_t)0, mediasize, pp->sectorsize, "%s", name); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 20:43:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BB92408; Fri, 13 Dec 2013 20:43:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 439441AD5; Fri, 13 Dec 2013 20:43:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDKhTnH014468; Fri, 13 Dec 2013 20:43:29 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDKhCpN014366; Fri, 13 Dec 2013 20:43:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132043.rBDKhCpN014366@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 20:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259329 - in stable/10/sys/arm: allwinner allwinner/a20 arm at91 broadcom/bcm2835 econa freescale/imx include lpc mv mv/orion rockchip sa11x0 samsung/exynos tegra ti ti/am335x ti/omap4 ... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:43:29 -0000 Author: ian Date: Fri Dec 13 20:43:11 2013 New Revision: 259329 URL: http://svnweb.freebsd.org/changeset/base/259329 Log: MFC r257199, r257200, r257217: Remove all #include from arm code. It's already included by vm/pmap.h, which is a prerequisite for arm/machine/pmap.h so there's no reason to ever include it directly. Remove #include from all the arm code that doesn't really need it. That would be almost everywhere it was included. Add it in a couple files that really do need it and were previously getting it by accident via another header. Remove the last dregs of trapframe_t. It turns out only arm was using this type, so remove it to make arm code more consistant with other platforms. Modified: stable/10/sys/arm/allwinner/a10_clk.c stable/10/sys/arm/allwinner/a10_gpio.c stable/10/sys/arm/allwinner/a10_machdep.c stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c stable/10/sys/arm/allwinner/timer.c stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/genassym.c stable/10/sys/arm/arm/generic_timer.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/minidump_machdep.c stable/10/sys/arm/arm/mpcore_timer.c stable/10/sys/arm/arm/nexus.c stable/10/sys/arm/arm/trap.c stable/10/sys/arm/arm/undefined.c stable/10/sys/arm/arm/vfp.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/at91/at91_mci.c stable/10/sys/arm/at91/at91_pmc.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c stable/10/sys/arm/econa/timer.c stable/10/sys/arm/freescale/imx/imx51_ipuv3.c stable/10/sys/arm/freescale/imx/imx_gpt.c stable/10/sys/arm/freescale/imx/imx_machdep.c stable/10/sys/arm/include/cpu.h stable/10/sys/arm/include/fdt.h stable/10/sys/arm/include/frame.h stable/10/sys/arm/include/pcb.h stable/10/sys/arm/include/pcpu.h stable/10/sys/arm/include/undefined.h stable/10/sys/arm/lpc/lpc_fb.c stable/10/sys/arm/lpc/lpc_gpio.c stable/10/sys/arm/lpc/lpc_machdep.c stable/10/sys/arm/lpc/lpc_mmc.c stable/10/sys/arm/lpc/lpc_spi.c stable/10/sys/arm/lpc/lpc_timer.c stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/mv/mvvar.h stable/10/sys/arm/mv/orion/db88f5xxx.c stable/10/sys/arm/mv/timer.c stable/10/sys/arm/rockchip/rk30xx_gpio.c stable/10/sys/arm/rockchip/rk30xx_grf.c stable/10/sys/arm/rockchip/rk30xx_machdep.c stable/10/sys/arm/rockchip/rk30xx_pmu.c stable/10/sys/arm/sa11x0/sa11x0_io.c stable/10/sys/arm/samsung/exynos/arch_timer.c stable/10/sys/arm/samsung/exynos/exynos5_machdep.c stable/10/sys/arm/tegra/tegra2_machdep.c stable/10/sys/arm/ti/am335x/am335x_dmtimer.c stable/10/sys/arm/ti/am335x/am335x_lcd_syscons.c stable/10/sys/arm/ti/am335x/am335x_prcm.c stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c stable/10/sys/arm/ti/omap4/pandaboard/pandaboard.c stable/10/sys/arm/ti/ti_cpuid.c stable/10/sys/arm/ti/ti_machdep.c stable/10/sys/arm/ti/ti_mmchs.c stable/10/sys/arm/ti/ti_prcm.c stable/10/sys/arm/ti/ti_scm.c stable/10/sys/arm/ti/twl/twl.c stable/10/sys/arm/ti/twl/twl_clks.c stable/10/sys/arm/ti/twl/twl_vreg.c stable/10/sys/arm/versatile/pl050.c stable/10/sys/arm/versatile/sp804.c stable/10/sys/arm/versatile/versatile_clcd.c stable/10/sys/arm/versatile/versatile_machdep.c stable/10/sys/arm/versatile/versatile_pci.c stable/10/sys/arm/versatile/versatile_timer.c stable/10/sys/arm/xilinx/zy7_machdep.c stable/10/sys/arm/xscale/i80321/i80321_pci.c stable/10/sys/arm/xscale/i8134x/i81342_pci.c stable/10/sys/arm/xscale/ixp425/ixp425_pci.c stable/10/sys/arm/xscale/ixp425/ixp425_wdog.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_clk.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_clk.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/allwinner/a10_clk.c Fri Dec 13 20:43:11 2013 (r259329) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/allwinner/a10_gpio.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_gpio.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/allwinner/a10_gpio.c Fri Dec 13 20:43:11 2013 (r259329) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/allwinner/a10_machdep.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c ============================================================================== --- stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/allwinner/a20/a20_cpu_cfg.c Fri Dec 13 20:43:11 2013 (r259329) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/allwinner/timer.c ============================================================================== --- stable/10/sys/arm/allwinner/timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/allwinner/timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/arm/cpufunc.c ============================================================================== --- stable/10/sys/arm/arm/cpufunc.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/cpufunc.c Fri Dec 13 20:43:11 2013 (r259329) @@ -1720,7 +1720,7 @@ int early_abort_fixup(arg) void *arg; { - trapframe_t *frame = arg; + struct trapframe *frame = arg; u_int fault_pc; u_int fault_instruction; int saved_lr = 0; @@ -1861,7 +1861,7 @@ int late_abort_fixup(arg) void *arg; { - trapframe_t *frame = arg; + struct trapframe *frame = arg; u_int fault_pc; u_int fault_instruction; int saved_lr = 0; Modified: stable/10/sys/arm/arm/genassym.c ============================================================================== --- stable/10/sys/arm/arm/genassym.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/genassym.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/10/sys/arm/arm/generic_timer.c ============================================================================== --- stable/10/sys/arm/arm/generic_timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/generic_timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -90,11 +90,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include #include #include Modified: stable/10/sys/arm/arm/minidump_machdep.c ============================================================================== --- stable/10/sys/arm/arm/minidump_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/minidump_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#include #include #include #include Modified: stable/10/sys/arm/arm/mpcore_timer.c ============================================================================== --- stable/10/sys/arm/arm/mpcore_timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/mpcore_timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/arm/nexus.c ============================================================================== --- stable/10/sys/arm/arm/nexus.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/nexus.c Fri Dec 13 20:43:11 2013 (r259329) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/trap.c Fri Dec 13 20:43:11 2013 (r259329) @@ -123,8 +123,8 @@ __FBSDID("$FreeBSD$"); #endif -void swi_handler(trapframe_t *); -void undefinedinstruction(trapframe_t *); +void swi_handler(struct trapframe *); +void undefinedinstruction(struct trapframe *); #include #include @@ -145,13 +145,17 @@ struct ksig { u_long code; }; struct data_abort { - int (*func)(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); + int (*func)(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); const char *desc; }; -static int dab_fatal(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); -static int dab_align(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); -static int dab_buserr(trapframe_t *, u_int, u_int, struct thread *, struct ksig *); +static int dab_fatal(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); +static int dab_align(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); +static int dab_buserr(struct trapframe *, u_int, u_int, struct thread *, + struct ksig *); static const struct data_abort data_aborts[] = { {dab_fatal, "Vector Exception"}, @@ -196,7 +200,8 @@ call_trapsignal(struct thread *td, int s } static __inline int -data_abort_fixup(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +data_abort_fixup(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { #ifdef CPU_ABORT_FIXUP_REQUIRED int error; @@ -226,7 +231,7 @@ data_abort_fixup(trapframe_t *tf, u_int } void -data_abort_handler(trapframe_t *tf) +data_abort_handler(struct trapframe *tf) { struct vm_map *map; struct pcb *pcb; @@ -482,7 +487,8 @@ out: * Note: If 'l' is NULL, we assume we're dealing with a prefetch abort. */ static int -dab_fatal(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { const char *mode; @@ -538,7 +544,8 @@ dab_fatal(trapframe_t *tf, u_int fsr, u_ * deliver a bus error to the process. */ static int -dab_align(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_align(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { /* Alignment faults are always fatal if they occur in kernel mode */ @@ -586,7 +593,8 @@ dab_align(trapframe_t *tf, u_int fsr, u_ * In all other cases, these data aborts are considered fatal. */ static int -dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct thread *td, struct ksig *ksig) +dab_buserr(struct trapframe *tf, u_int fsr, u_int far, struct thread *td, + struct ksig *ksig) { struct pcb *pcb = td->td_pcb; @@ -607,7 +615,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u * If the current trapframe is at the top of the kernel stack, * the fault _must_ have come from user mode. */ - if (tf != ((trapframe_t *)pcb->un_32.pcb32_sp) - 1) { + if (tf != ((struct trapframe *)pcb->un_32.pcb32_sp) - 1) { /* * Kernel mode. We're either about to die a * spectacular death, or pcb_onfault will come @@ -660,7 +668,7 @@ dab_buserr(trapframe_t *tf, u_int fsr, u } static __inline int -prefetch_abort_fixup(trapframe_t *tf, struct ksig *ksig) +prefetch_abort_fixup(struct trapframe *tf, struct ksig *ksig) { #ifdef CPU_ABORT_FIXUP_REQUIRED int error; @@ -691,7 +699,7 @@ prefetch_abort_fixup(trapframe_t *tf, st } /* - * void prefetch_abort_handler(trapframe_t *tf) + * void prefetch_abort_handler(struct trapframe *tf) * * Abort handler called when instruction execution occurs at * a non existent or restricted (access permissions) memory page. @@ -702,7 +710,7 @@ prefetch_abort_fixup(trapframe_t *tf, st * Otherwise fault the page in and try again. */ void -prefetch_abort_handler(trapframe_t *tf) +prefetch_abort_handler(struct trapframe *tf) { struct thread *td; struct proc * p; @@ -907,7 +915,7 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" static void -syscall(struct thread *td, trapframe_t *frame) +syscall(struct thread *td, struct trapframe *frame) { struct syscall_args sa; int error; @@ -932,7 +940,7 @@ syscall(struct thread *td, trapframe_t * } void -swi_handler(trapframe_t *frame) +swi_handler(struct trapframe *frame) { struct thread *td = curthread; Modified: stable/10/sys/arm/arm/undefined.c ============================================================================== --- stable/10/sys/arm/arm/undefined.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/undefined.c Fri Dec 13 20:43:11 2013 (r259329) @@ -166,7 +166,7 @@ undefined_init() void -undefinedinstruction(trapframe_t *frame) +undefinedinstruction(struct trapframe *frame) { struct thread *td; u_int fault_pc; Modified: stable/10/sys/arm/arm/vfp.c ============================================================================== --- stable/10/sys/arm/arm/vfp.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/vfp.c Fri Dec 13 20:43:11 2013 (r259329) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/arm/vm_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -294,7 +295,7 @@ done: void cpu_set_syscall_retval(struct thread *td, int error) { - trapframe_t *frame; + struct trapframe *frame; int fixup; #ifdef __ARMEB__ uint32_t insn; Modified: stable/10/sys/arm/at91/at91_mci.c ============================================================================== --- stable/10/sys/arm/at91/at91_mci.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/at91/at91_mci.c Fri Dec 13 20:43:11 2013 (r259329) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/at91/at91_pmc.c ============================================================================== --- stable/10/sys/arm/at91/at91_pmc.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/at91/at91_pmc.c Fri Dec 13 20:43:11 2013 (r259329) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_dma.c Fri Dec 13 20:43:11 2013 (r259329) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "bcm2835_dma.h" #include "bcm2835_vcbus.h" Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_fb.c Fri Dec 13 20:43:11 2013 (r259329) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_gpio.c Fri Dec 13 20:43:11 2013 (r259329) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Dec 13 20:43:11 2013 (r259329) @@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_spi.c Fri Dec 13 20:43:11 2013 (r259329) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_systimer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/econa/timer.c ============================================================================== --- stable/10/sys/arm/econa/timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/econa/timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include "econa_reg.h" Modified: stable/10/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/freescale/imx/imx51_ipuv3.c Fri Dec 13 20:43:11 2013 (r259329) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 20:43:11 2013 (r259329) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include #include Modified: stable/10/sys/arm/include/cpu.h ============================================================================== --- stable/10/sys/arm/include/cpu.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/include/cpu.h Fri Dec 13 20:43:11 2013 (r259329) @@ -5,6 +5,7 @@ #define MACHINE_CPU_H #include +#include void cpu_halt(void); void swi_vm(void *); Modified: stable/10/sys/arm/include/fdt.h ============================================================================== --- stable/10/sys/arm/include/fdt.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/include/fdt.h Fri Dec 13 20:43:11 2013 (r259329) @@ -38,7 +38,6 @@ #include #include -#include #include /* Max interrupt number */ Modified: stable/10/sys/arm/include/frame.h ============================================================================== --- stable/10/sys/arm/include/frame.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/include/frame.h Fri Dec 13 20:43:11 2013 (r259329) @@ -59,7 +59,7 @@ * Trap frame. Pushed onto the kernel stack on a trap (synchronous exception). */ -typedef struct trapframe { +struct trapframe { register_t tf_spsr; /* Zero on arm26 */ register_t tf_r0; register_t tf_r1; @@ -80,7 +80,7 @@ typedef struct trapframe { register_t tf_svc_lr; /* Not used on arm26 */ register_t tf_pc; register_t tf_pad; -} trapframe_t; +}; /* Register numbers */ #define tf_r13 tf_usr_sp Modified: stable/10/sys/arm/include/pcb.h ============================================================================== --- stable/10/sys/arm/include/pcb.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/include/pcb.h Fri Dec 13 20:43:11 2013 (r259329) @@ -38,7 +38,6 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ -#include #include Modified: stable/10/sys/arm/include/pcpu.h ============================================================================== --- stable/10/sys/arm/include/pcpu.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/include/pcpu.h Fri Dec 13 20:43:11 2013 (r259329) @@ -33,7 +33,6 @@ #ifdef _KERNEL #include -#include #define ALT_STACK_SIZE 128 Modified: stable/10/sys/arm/include/undefined.h ============================================================================== --- stable/10/sys/arm/include/undefined.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/include/undefined.h Fri Dec 13 20:43:11 2013 (r259329) @@ -52,7 +52,9 @@ #include -typedef int (*undef_handler_t) (unsigned int, unsigned int, trapframe_t *, int); +struct trapframe; + +typedef int (*undef_handler_t) (unsigned int, unsigned int, struct trapframe *, int); #define FP_COPROC 1 #define FP_COPROC2 2 Modified: stable/10/sys/arm/lpc/lpc_fb.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_fb.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/lpc/lpc_fb.c Fri Dec 13 20:43:11 2013 (r259329) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/lpc/lpc_gpio.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_gpio.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/lpc/lpc_gpio.c Fri Dec 13 20:43:11 2013 (r259329) @@ -76,7 +76,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/lpc/lpc_machdep.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -50,9 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include #include Modified: stable/10/sys/arm/lpc/lpc_mmc.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_mmc.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/lpc/lpc_mmc.c Fri Dec 13 20:43:11 2013 (r259329) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/lpc/lpc_spi.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_spi.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/lpc/lpc_spi.c Fri Dec 13 20:43:11 2013 (r259329) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/lpc/lpc_timer.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/lpc/lpc_timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -50,9 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include /* XXX */ #include /* XXX eventually this should be eliminated */ Modified: stable/10/sys/arm/mv/mvvar.h ============================================================================== --- stable/10/sys/arm/mv/mvvar.h Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/mv/mvvar.h Fri Dec 13 20:43:11 2013 (r259329) @@ -44,7 +44,6 @@ #include #include #include -#include #include #define MV_TYPE_PCI 0 Modified: stable/10/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- stable/10/sys/arm/mv/orion/db88f5xxx.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/mv/orion/db88f5xxx.c Fri Dec 13 20:43:11 2013 (r259329) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/mv/timer.c ============================================================================== --- stable/10/sys/arm/mv/timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/mv/timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/rockchip/rk30xx_gpio.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_gpio.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/rockchip/rk30xx_gpio.c Fri Dec 13 20:43:11 2013 (r259329) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/rockchip/rk30xx_grf.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_grf.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/rockchip/rk30xx_grf.c Fri Dec 13 20:43:11 2013 (r259329) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/rockchip/rk30xx_pmu.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_pmu.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/rockchip/rk30xx_pmu.c Fri Dec 13 20:43:11 2013 (r259329) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/sa11x0/sa11x0_io.c ============================================================================== --- stable/10/sys/arm/sa11x0/sa11x0_io.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/sa11x0/sa11x0_io.c Fri Dec 13 20:43:11 2013 (r259329) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* Proto types for all the bus_space structure functions */ Modified: stable/10/sys/arm/samsung/exynos/arch_timer.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/arch_timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/samsung/exynos/arch_timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- stable/10/sys/arm/tegra/tegra2_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/tegra/tegra2_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -45,9 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/am335x/am335x_lcd_syscons.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_lcd_syscons.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/am335x/am335x_lcd_syscons.c Fri Dec 13 20:43:11 2013 (r259329) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/am335x/am335x_prcm.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_prcm.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/am335x/am335x_prcm.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c ============================================================================== --- stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/am335x/am335x_scm_padconf.c Fri Dec 13 20:43:11 2013 (r259329) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Fri Dec 13 20:43:11 2013 (r259329) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c ============================================================================== --- stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/omap4/omap4_scm_padconf.c Fri Dec 13 20:43:11 2013 (r259329) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/10/sys/arm/ti/omap4/pandaboard/pandaboard.c ============================================================================== --- stable/10/sys/arm/ti/omap4/pandaboard/pandaboard.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/omap4/pandaboard/pandaboard.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: stable/10/sys/arm/ti/ti_cpuid.c ============================================================================== --- stable/10/sys/arm/ti/ti_cpuid.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/ti_cpuid.c Fri Dec 13 20:43:11 2013 (r259329) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/ti_machdep.c ============================================================================== --- stable/10/sys/arm/ti/ti_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/ti_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/ti/ti_mmchs.c ============================================================================== --- stable/10/sys/arm/ti/ti_mmchs.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/ti_mmchs.c Fri Dec 13 20:43:11 2013 (r259329) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/ti_prcm.c ============================================================================== --- stable/10/sys/arm/ti/ti_prcm.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/ti_prcm.c Fri Dec 13 20:43:11 2013 (r259329) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/ti_scm.c ============================================================================== --- stable/10/sys/arm/ti/ti_scm.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/ti_scm.c Fri Dec 13 20:43:11 2013 (r259329) @@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/twl/twl.c ============================================================================== --- stable/10/sys/arm/ti/twl/twl.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/twl/twl.c Fri Dec 13 20:43:11 2013 (r259329) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/twl/twl_clks.c ============================================================================== --- stable/10/sys/arm/ti/twl/twl_clks.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/twl/twl_clks.c Fri Dec 13 20:43:11 2013 (r259329) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/ti/twl/twl_vreg.c ============================================================================== --- stable/10/sys/arm/ti/twl/twl_vreg.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/ti/twl/twl_vreg.c Fri Dec 13 20:43:11 2013 (r259329) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/versatile/pl050.c ============================================================================== --- stable/10/sys/arm/versatile/pl050.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/versatile/pl050.c Fri Dec 13 20:43:11 2013 (r259329) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: stable/10/sys/arm/versatile/sp804.c ============================================================================== --- stable/10/sys/arm/versatile/sp804.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/versatile/sp804.c Fri Dec 13 20:43:11 2013 (r259329) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/versatile/versatile_clcd.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_clcd.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/versatile/versatile_clcd.c Fri Dec 13 20:43:11 2013 (r259329) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: stable/10/sys/arm/versatile/versatile_machdep.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/versatile/versatile_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* For trapframe_t, used in */ #include -#include #include Modified: stable/10/sys/arm/versatile/versatile_pci.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_pci.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/versatile/versatile_pci.c Fri Dec 13 20:43:11 2013 (r259329) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/versatile/versatile_timer.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_timer.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/versatile/versatile_timer.c Fri Dec 13 20:43:11 2013 (r259329) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- stable/10/sys/arm/xilinx/zy7_machdep.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/xilinx/zy7_machdep.c Fri Dec 13 20:43:11 2013 (r259329) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include #include #include Modified: stable/10/sys/arm/xscale/i80321/i80321_pci.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/i80321_pci.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/xscale/i80321/i80321_pci.c Fri Dec 13 20:43:11 2013 (r259329) @@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/xscale/i8134x/i81342_pci.c ============================================================================== --- stable/10/sys/arm/xscale/i8134x/i81342_pci.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/xscale/i8134x/i81342_pci.c Fri Dec 13 20:43:11 2013 (r259329) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/xscale/ixp425/ixp425_pci.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/ixp425_pci.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/xscale/ixp425/ixp425_pci.c Fri Dec 13 20:43:11 2013 (r259329) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/arm/xscale/ixp425/ixp425_wdog.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/ixp425_wdog.c Fri Dec 13 20:33:59 2013 (r259328) +++ stable/10/sys/arm/xscale/ixp425/ixp425_wdog.c Fri Dec 13 20:43:11 2013 (r259329) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 20:53:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BA65800; Fri, 13 Dec 2013 20:53:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48C131C9C; Fri, 13 Dec 2013 20:53:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDKrWRj017932; Fri, 13 Dec 2013 20:53:32 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDKrW1w017931; Fri, 13 Dec 2013 20:53:32 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201312132053.rBDKrW1w017931@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 13 Dec 2013 20:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259330 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:53:32 -0000 Author: mjg Date: Fri Dec 13 20:53:31 2013 New Revision: 259330 URL: http://svnweb.freebsd.org/changeset/base/259330 Log: rlimit: add and utilize lim_shared MFC after: 2 weeks Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Fri Dec 13 20:43:11 2013 (r259329) +++ head/sys/kern/kern_resource.c Fri Dec 13 20:53:31 2013 (r259330) @@ -80,6 +80,8 @@ static int donice(struct thread *td, str static struct uidinfo *uilookup(uid_t uid); static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); +static __inline int lim_shared(struct plimit *limp); + /* * Resource controls and accounting. */ @@ -1129,6 +1131,14 @@ lim_hold(limp) return (limp); } +static __inline int +lim_shared(limp) + struct plimit *limp; +{ + + return (limp->pl_refcnt > 1); +} + void lim_fork(struct proc *p1, struct proc *p2) { @@ -1162,7 +1172,7 @@ lim_copy(dst, src) struct plimit *dst, *src; { - KASSERT(dst->pl_refcnt == 1, ("lim_copy to shared limit")); + KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit)); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 20:54:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B95B2979; Fri, 13 Dec 2013 20:54:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A66A91CA5; Fri, 13 Dec 2013 20:54:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDKsjtR018151; Fri, 13 Dec 2013 20:54:45 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDKsjBN018150; Fri, 13 Dec 2013 20:54:45 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201312132054.rBDKsjBN018150@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 13 Dec 2013 20:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259331 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:54:45 -0000 Author: mjg Date: Fri Dec 13 20:54:45 2013 New Revision: 259331 URL: http://svnweb.freebsd.org/changeset/base/259331 Log: rlimit: avoid unnecessary copying of rlimits If refcount is 1 just modify rlimits in place. MFC after: 2 weeks Modified: head/sys/kern/kern_resource.c Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Fri Dec 13 20:53:31 2013 (r259330) +++ head/sys/kern/kern_resource.c Fri Dec 13 20:54:45 2013 (r259331) @@ -679,21 +679,29 @@ kern_proc_setrlimit(struct thread *td, s limp->rlim_max = RLIM_INFINITY; oldssiz.rlim_cur = 0; - newlim = lim_alloc(); + newlim = NULL; PROC_LOCK(p); + if (lim_shared(p->p_limit)) { + PROC_UNLOCK(p); + newlim = lim_alloc(); + PROC_LOCK(p); + } oldlim = p->p_limit; alimp = &oldlim->pl_rlimit[which]; if (limp->rlim_cur > alimp->rlim_max || limp->rlim_max > alimp->rlim_max) if ((error = priv_check(td, PRIV_PROC_SETRLIMIT))) { PROC_UNLOCK(p); - lim_free(newlim); + if (newlim != NULL) + lim_free(newlim); return (error); } if (limp->rlim_cur > limp->rlim_max) limp->rlim_cur = limp->rlim_max; - lim_copy(newlim, oldlim); - alimp = &newlim->pl_rlimit[which]; + if (newlim != NULL) { + lim_copy(newlim, oldlim); + alimp = &newlim->pl_rlimit[which]; + } switch (which) { @@ -743,9 +751,11 @@ kern_proc_setrlimit(struct thread *td, s if (p->p_sysent->sv_fixlimit != NULL) p->p_sysent->sv_fixlimit(limp, which); *alimp = *limp; - p->p_limit = newlim; + if (newlim != NULL) + p->p_limit = newlim; PROC_UNLOCK(p); - lim_free(oldlim); + if (newlim != NULL) + lim_free(oldlim); if (which == RLIMIT_STACK) { /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 20:57:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7239DB60; Fri, 13 Dec 2013 20:57:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4744B1CC7; Fri, 13 Dec 2013 20:57:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D36C9B9A3; Fri, 13 Dec 2013 15:57:37 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Subject: Re: svn commit: r259010 - in head/sys: conf powerpc/fpu Date: Fri, 13 Dec 2013 12:31:04 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201312052149.rB5LnEcT011811@svn.freebsd.org> <201312051650.26379.jhb@freebsd.org> <86a9g5uofn.fsf@nine.des.no> In-Reply-To: <86a9g5uofn.fsf@nine.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201312131231.04749.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 Dec 2013 15:57:37 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 20:57:39 -0000 On Friday, December 13, 2013 3:48:12 am Dag-Erling Sm=C3=B8rgrav wrote: > > LINT64 is yet another kernel config covered by 'make tinderbox', but no= t by > > the periodic tinderbox. It is probably worth adding to the periodic ti= nderbox=20 > > (someday it'd be nice if the two tinderboxes built the same set of thin= gs). >=20 > Some day it would be nice if people talked to me directly instead of > sniping from the sidelines. Ah, but when people have raised this exact issue before (that tcbuild and 'make tinderbox' build different things), you have blown them off repeatedl= y. > The root issue here is that "make LINT" is poorly implemented, so under > some circumstances (including the tinderbox and, if I read the code > correctly, 'make universe'), the LINT64 config is never generated. Agreed on that front. > Oh, and 'make tinderbox' should die. No, it is very developer friendly as it Just Works(tm) as a single command from an existing source tree checkout. It also happens to build more of the tree than the periodic tinderbox (by building more kernel configs, albeit doing quite a bit of duplicate work for platforms like arm in the process). =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:22:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ADAAA0D; Fri, 13 Dec 2013 21:22:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8788B1EEE; Fri, 13 Dec 2013 21:22:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLMCVx028927; Fri, 13 Dec 2013 21:22:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLMCBg028926; Fri, 13 Dec 2013 21:22:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312132122.rBDLMCBg028926@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 21:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259332 - releng/10.0/sys/cam/ctl X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:22:12 -0000 Author: trasz Date: Fri Dec 13 21:22:12 2013 New Revision: 259332 URL: http://svnweb.freebsd.org/changeset/base/259332 Log: MFC r258871: Properly report an error instead of panicing when user tries to create LUN backed by non-disk device, e.g. /dev/null. Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/sys/cam/ctl/ctl_backend_block.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- releng/10.0/sys/cam/ctl/ctl_backend_block.c Fri Dec 13 20:54:45 2013 (r259331) +++ releng/10.0/sys/cam/ctl/ctl_backend_block.c Fri Dec 13 21:22:12 2013 (r259332) @@ -1485,6 +1485,7 @@ ctl_be_block_close(struct ctl_be_block_l case CTL_BE_BLOCK_FILE: break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1503,6 +1504,7 @@ ctl_be_block_close(struct ctl_be_block_l } break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1589,7 +1591,7 @@ ctl_be_block_open(struct ctl_be_block_so } else { error = EINVAL; snprintf(req->error_str, sizeof(req->error_str), - "%s is not a disk or file", be_lun->dev_path); + "%s is not a disk or plain file", be_lun->dev_path); } VOP_UNLOCK(be_lun->vn, 0); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:27:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD8B9C59; Fri, 13 Dec 2013 21:27:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B9CA91F35; Fri, 13 Dec 2013 21:27:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLRGHx029476; Fri, 13 Dec 2013 21:27:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLRGHg029475; Fri, 13 Dec 2013 21:27:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312132127.rBDLRGHg029475@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 21:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259333 - releng/10.0/usr.sbin/ctld X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:27:16 -0000 Author: trasz Date: Fri Dec 13 21:27:16 2013 New Revision: 259333 URL: http://svnweb.freebsd.org/changeset/base/259333 Log: MFC r259182: Fix handling for empty auth-groups. Without it, ctld child process would either exit on assertion, or, if assertions are not enabled, fail to authenticate the target. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/usr.sbin/ctld/login.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/usr.sbin/ctld/login.c ============================================================================== --- releng/10.0/usr.sbin/ctld/login.c Fri Dec 13 21:22:12 2013 (r259332) +++ releng/10.0/usr.sbin/ctld/login.c Fri Dec 13 21:27:16 2013 (r259333) @@ -1007,6 +1007,14 @@ login(struct connection *conn) return; } + if (ag->ag_type == AG_TYPE_UNKNOWN) { + /* + * This can happen with empty auth-group. + */ + login_send_error(request, 0x02, 0x01); + log_errx(1, "auth-group type not set, denying access"); + } + log_debugx("CHAP authentication required"); auth_method = keys_find(request_keys, "AuthMethod"); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:28:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17257DF7; Fri, 13 Dec 2013 21:28:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DD98C1F4C; Fri, 13 Dec 2013 21:28:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLSj4h029658; Fri, 13 Dec 2013 21:28:45 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLSjat029657; Fri, 13 Dec 2013 21:28:45 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201312132128.rBDLSjat029657@svn.freebsd.org> From: Tijl Coosemans Date: Fri, 13 Dec 2013 21:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259334 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:28:46 -0000 Author: tijl Date: Fri Dec 13 21:28:45 2013 New Revision: 259334 URL: http://svnweb.freebsd.org/changeset/base/259334 Log: Add mergeinfo for the MFC of r258573 done in r259326. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:32:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF5B715C; Fri, 13 Dec 2013 21:32:54 +0000 (UTC) Received: from mailrelay005.isp.belgacom.be (mailrelay005.isp.belgacom.be [195.238.6.171]) by mx1.freebsd.org (Postfix) with ESMTP id 8EF971FD0; Fri, 13 Dec 2013 21:32:53 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmoGAKJ7q1JbsVZ9/2dsb2JhbABZgwo4SbhsgSQXdIIlAQEFOhwjEAsOBgQJJQ8qHgYTiAgBCMp8F48VB4Q2BJgVgTGQZIMrOw Received: from 125.86-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.86.125]) by relay.skynet.be with ESMTP; 13 Dec 2013 22:32:46 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id rBDLWj0x013693; Fri, 13 Dec 2013 22:32:45 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Fri, 13 Dec 2013 22:32:44 +0100 From: Tijl Coosemans To: Pedro Giffuni Subject: Re: svn commit: r259326 - stable/10/contrib/tcpdump Message-ID: <20131213223244.6ef4384f@kalimero.tijl.coosemans.org> In-Reply-To: <52AB6845.7020504@FreeBSD.org> References: <201312131932.rBDJW3iw088831@svn.freebsd.org> <52AB6845.7020504@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Eitan Adler , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:32:54 -0000 On Fri, 13 Dec 2013 15:04:21 -0500 Pedro Giffuni wrote: > On 13.12.2013 14:43, Eitan Adler wrote: >> On Fri, Dec 13, 2013 at 2:32 PM, Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Fri Dec 13 19:32:02 2013 >>> New Revision: 259326 >>> URL: http://svnweb.freebsd.org/changeset/base/259326 >>> >>> Log: >>> MFV r258571: >>> >>> Removes strict-aliasing warnings from newer GCC in tcpdump. >>> >>> Corresponds to MFC r258573, but for some reason our new pre-commit hooks >>> will not let us merge it from there. >> How did you attempt to do this merge? What were the exact commands? > > (Standing on my local stable/10 dir) > > svn merge -c r258573 ^/head . > > Attempt to commit there fired the pre-commit hook. This also copies the svn:mergeinfo property on head/contrib/tcpdump to stable/10/contrib/tcpdump, but this property is only allowed on stable/10 at the moment. I think you can just delete the property before committing: svn propdel svn:mergeinfo contrib/tcpdump From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:40:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 09EC04C6; Fri, 13 Dec 2013 21:40:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E84A11042; Fri, 13 Dec 2013 21:40:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLeFmj033909; Fri, 13 Dec 2013 21:40:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLeCJs033888; Fri, 13 Dec 2013 21:40:12 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132140.rBDLeCJs033888@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 21:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259335 - in stable/10/sys/arm: allwinner arm broadcom/bcm2835 include lpc mv rockchip samsung/exynos tegra ti versatile xilinx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:40:16 -0000 Author: ian Date: Fri Dec 13 21:40:12 2013 New Revision: 259335 URL: http://svnweb.freebsd.org/changeset/base/259335 Log: MFC r257201, r257202 Retire arm_remap_nocache() and the data and constants associated with it. Modified: stable/10/sys/arm/allwinner/a10_machdep.c stable/10/sys/arm/arm/busdma_machdep.c stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/arm/pmap.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/10/sys/arm/include/pmap.h stable/10/sys/arm/lpc/lpc_machdep.c stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/rockchip/rk30xx_machdep.c stable/10/sys/arm/samsung/exynos/exynos5_machdep.c stable/10/sys/arm/tegra/tegra2_machdep.c stable/10/sys/arm/ti/ti_machdep.c stable/10/sys/arm/versatile/versatile_machdep.c stable/10/sys/arm/xilinx/zy7_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_machdep.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -57,7 +57,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: stable/10/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/arm/busdma_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -122,7 +122,6 @@ struct bus_dma_tag { struct bounce_page { vm_offset_t vaddr; /* kva of bounce buffer */ - vm_offset_t vaddr_nocache; /* kva of bounce buffer uncached */ bus_addr_t busaddr; /* Physical address */ vm_offset_t datavaddr; /* kva of client data */ bus_addr_t dataaddr; /* client physical address */ @@ -1196,39 +1195,23 @@ _bus_dmamap_sync_bp(bus_dma_tag_t dmat, STAILQ_FOREACH(bpage, &map->bpages, links) { if (op & BUS_DMASYNC_PREWRITE) { if (bpage->datavaddr != 0) - bcopy((void *)bpage->datavaddr, - (void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : - bpage->vaddr), - bpage->datacount); + bcopy((void *)bpage->datavaddr, + (void *)bpage->vaddr, bpage->datacount); else physcopyout(bpage->dataaddr, - (void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : - bpage->vaddr), - bpage->datacount); - if (bpage->vaddr_nocache == 0) { - cpu_dcache_wb_range(bpage->vaddr, - bpage->datacount); - cpu_l2cache_wb_range(bpage->vaddr, - bpage->datacount); - } + (void *)bpage->vaddr,bpage->datacount); + cpu_dcache_wb_range(bpage->vaddr, bpage->datacount); + cpu_l2cache_wb_range(bpage->vaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; } if (op & BUS_DMASYNC_POSTREAD) { - if (bpage->vaddr_nocache == 0) { - cpu_dcache_inv_range(bpage->vaddr, - bpage->datacount); - cpu_l2cache_inv_range(bpage->vaddr, - bpage->datacount); - } + cpu_dcache_inv_range(bpage->vaddr, bpage->datacount); + cpu_l2cache_inv_range(bpage->vaddr, bpage->datacount); if (bpage->datavaddr != 0) - bcopy((void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : bpage->vaddr), + bcopy((void *)bpage->vaddr, (void *)bpage->datavaddr, bpage->datacount); else - physcopyin((void *)(bpage->vaddr_nocache != 0 ? - bpage->vaddr_nocache : bpage->vaddr), + physcopyin((void *)bpage->vaddr, bpage->dataaddr, bpage->datacount); dmat->bounce_zone->total_bounced++; } @@ -1385,8 +1368,6 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u break; } bpage->busaddr = pmap_kextract(bpage->vaddr); - bpage->vaddr_nocache = (vm_offset_t)arm_remap_nocache( - (void *)bpage->vaddr, PAGE_SIZE); mtx_lock(&bounce_lock); STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links); total_bpages++; Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/arm/pmap-v6.c Fri Dec 13 21:40:12 2013 (r259335) @@ -1951,7 +1951,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - arm_nocache_startaddr = vm_max_kernel_address; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); pmap_set_pcb_pagedir(kernel_pmap, thread0.td_pcb); Modified: stable/10/sys/arm/arm/pmap.c ============================================================================== --- stable/10/sys/arm/arm/pmap.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/arm/pmap.c Fri Dec 13 21:40:12 2013 (r259335) @@ -2423,7 +2423,6 @@ pmap_bootstrap(vm_offset_t firstaddr, st virtual_avail = round_page(virtual_avail); virtual_end = vm_max_kernel_address; kernel_vm_end = pmap_curmaxkvaddr; - arm_nocache_startaddr = vm_max_kernel_address; mtx_init(&cmtx, "TMP mappings mtx", NULL, MTX_DEF); #ifdef ARM_USE_SMALL_ALLOC Modified: stable/10/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/10/sys/arm/arm/vm_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/arm/vm_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -482,80 +482,6 @@ cpu_exit(struct thread *td) { } -#define BITS_PER_INT (8 * sizeof(int)) -vm_offset_t arm_nocache_startaddr; -static int arm_nocache_allocated[ARM_NOCACHE_KVA_SIZE / (PAGE_SIZE * - BITS_PER_INT)]; - -/* - * Functions to map and unmap memory non-cached into KVA the kernel won't try - * to allocate. The goal is to provide uncached memory to busdma, to honor - * BUS_DMA_COHERENT. - * We can allocate at most ARM_NOCACHE_KVA_SIZE bytes. - * The allocator is rather dummy, each page is represented by a bit in - * a bitfield, 0 meaning the page is not allocated, 1 meaning it is. - * As soon as it finds enough contiguous pages to satisfy the request, - * it returns the address. - */ -void * -arm_remap_nocache(void *addr, vm_size_t size) -{ - int i, j; - - size = round_page(size); - for (i = 0; i < ARM_NOCACHE_KVA_SIZE / PAGE_SIZE; i++) { - if (!(arm_nocache_allocated[i / BITS_PER_INT] & (1 << (i % - BITS_PER_INT)))) { - for (j = i; j < i + (size / (PAGE_SIZE)); j++) - if (arm_nocache_allocated[j / BITS_PER_INT] & - (1 << (j % BITS_PER_INT))) - break; - if (j == i + (size / (PAGE_SIZE))) - break; - } - } - if (i < ARM_NOCACHE_KVA_SIZE / PAGE_SIZE) { - vm_offset_t tomap = arm_nocache_startaddr + i * PAGE_SIZE; - void *ret = (void *)tomap; - vm_paddr_t physaddr = vtophys((vm_offset_t)addr); - vm_offset_t vaddr = (vm_offset_t) addr; - - vaddr = vaddr & ~PAGE_MASK; - for (; tomap < (vm_offset_t)ret + size; tomap += PAGE_SIZE, - vaddr += PAGE_SIZE, physaddr += PAGE_SIZE, i++) { - cpu_idcache_wbinv_range(vaddr, PAGE_SIZE); -#ifdef ARM_L2_PIPT - cpu_l2cache_wbinv_range(physaddr, PAGE_SIZE); -#else - cpu_l2cache_wbinv_range(vaddr, PAGE_SIZE); -#endif - pmap_kenter_nocache(tomap, physaddr); - cpu_tlb_flushID_SE(vaddr); - arm_nocache_allocated[i / BITS_PER_INT] |= 1 << (i % - BITS_PER_INT); - } - return (ret); - } - - return (NULL); -} - -void -arm_unmap_nocache(void *addr, vm_size_t size) -{ - vm_offset_t raddr = (vm_offset_t)addr; - int i; - - size = round_page(size); - i = (raddr - arm_nocache_startaddr) / (PAGE_SIZE); - for (; size > 0; size -= PAGE_SIZE, i++) { - arm_nocache_allocated[i / BITS_PER_INT] &= ~(1 << (i % - BITS_PER_INT)); - pmap_kremove(raddr); - raddr += PAGE_SIZE; - } -} - #ifdef ARM_USE_SMALL_ALLOC static TAILQ_HEAD(,arm_small_page) pages_normal = Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -65,7 +65,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/include/pmap.h Fri Dec 13 21:40:12 2013 (r259335) @@ -727,11 +727,6 @@ struct arm_small_page { #endif -#define ARM_NOCACHE_KVA_SIZE 0x1000000 -extern vm_offset_t arm_nocache_startaddr; -void *arm_remap_nocache(void *, vm_size_t); -void arm_unmap_nocache(void *, vm_size_t); - extern vm_paddr_t dump_avail[]; #endif /* _KERNEL */ Modified: stable/10/sys/arm/lpc/lpc_machdep.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -66,7 +66,7 @@ initarm_lastaddr(void) while (1); /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); + return (fdt_immr_va); } void Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -206,7 +206,7 @@ initarm_lastaddr(void) while (1); /* Platform-specific initialisation */ - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); + return (fdt_immr_va); } void Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -55,7 +55,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: stable/10/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -49,7 +49,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: stable/10/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- stable/10/sys/arm/tegra/tegra2_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/tegra/tegra2_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -109,7 +109,7 @@ initarm_lastaddr(void) if (fdt_immr_addr(TEGRA2_BASE) != 0) /* FIXME ???? */ while (1); - return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE); + return (fdt_immr_va); } void Modified: stable/10/sys/arm/ti/ti_machdep.c ============================================================================== --- stable/10/sys/arm/ti/ti_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/ti/ti_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -63,7 +63,7 @@ initarm_lastaddr(void) { ti_cpu_reset = NULL; - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: stable/10/sys/arm/versatile/versatile_machdep.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/versatile/versatile_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -60,7 +60,7 @@ vm_offset_t initarm_lastaddr(void) { - return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); + return (DEVMAP_BOOTSTRAP_MAP_START); } void Modified: stable/10/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- stable/10/sys/arm/xilinx/zy7_machdep.c Fri Dec 13 21:28:45 2013 (r259334) +++ stable/10/sys/arm/xilinx/zy7_machdep.c Fri Dec 13 21:40:12 2013 (r259335) @@ -59,7 +59,7 @@ vm_offset_t initarm_lastaddr(void) { - return (ZYNQ7_PSIO_VBASE - ARM_NOCACHE_KVA_SIZE); + return (ZYNQ7_PSIO_VBASE); } void From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:41:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0CE7662C; Fri, 13 Dec 2013 21:41:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EBB5C1095; Fri, 13 Dec 2013 21:41:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLfN1V035867; Fri, 13 Dec 2013 21:41:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLfNua035866; Fri, 13 Dec 2013 21:41:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312132141.rBDLfNua035866@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 21:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259336 - releng/10.0/sys/dev/iscsi X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:41:24 -0000 Author: trasz Date: Fri Dec 13 21:41:23 2013 New Revision: 259336 URL: http://svnweb.freebsd.org/changeset/base/259336 Log: MFC r259183: Properly refuse handoff requests on already connected sessions. Previously this would result in dropping the session. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/sys/dev/iscsi/iscsi.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/dev/iscsi/iscsi.c ============================================================================== --- releng/10.0/sys/dev/iscsi/iscsi.c Fri Dec 13 21:40:12 2013 (r259335) +++ releng/10.0/sys/dev/iscsi/iscsi.c Fri Dec 13 21:41:23 2013 (r259336) @@ -1247,6 +1247,18 @@ iscsi_ioctl_daemon_handoff(struct iscsi_ sx_sunlock(&sc->sc_lock); return (EINVAL); } + if (is->is_connected) { + /* + * This might have happened because another iscsid(8) + * instance handed off the connection in the meantime. + * Just return. + */ + ISCSI_SESSION_WARN(is, "handoff on already connected " + "session"); + ISCSI_SESSION_UNLOCK(is); + sx_sunlock(&sc->sc_lock); + return (EBUSY); + } strlcpy(is->is_target_alias, handoff->idh_target_alias, sizeof(is->is_target_alias)); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:41:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9049F757; Fri, 13 Dec 2013 21:41:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE50109B; Fri, 13 Dec 2013 21:41:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLfe6e035932; Fri, 13 Dec 2013 21:41:40 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLfeIa035931; Fri, 13 Dec 2013 21:41:40 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132141.rBDLfeIa035931@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 21:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259337 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:41:40 -0000 Author: ian Date: Fri Dec 13 21:41:40 2013 New Revision: 259337 URL: http://svnweb.freebsd.org/changeset/base/259337 Log: MFC r257203: Eliminate a compiler warning about extraneous parens. Modified: stable/10/sys/arm/arm/busdma_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/busdma_machdep.c ============================================================================== --- stable/10/sys/arm/arm/busdma_machdep.c Fri Dec 13 21:41:23 2013 (r259336) +++ stable/10/sys/arm/arm/busdma_machdep.c Fri Dec 13 21:41:40 2013 (r259337) @@ -807,7 +807,7 @@ _bus_dmamap_count_phys(bus_dma_tag_t dma bus_addr_t curaddr; bus_size_t sgsize; - if ((map->pagesneeded == 0)) { + if (map->pagesneeded == 0) { CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", @@ -838,7 +838,7 @@ _bus_dmamap_count_pages(bus_dma_tag_t dm vm_offset_t vendaddr; bus_addr_t paddr; - if ((map->pagesneeded == 0)) { + if (map->pagesneeded == 0) { CTR3(KTR_BUSDMA, "lowaddr= %d, boundary= %d, alignment= %d", dmat->lowaddr, dmat->boundary, dmat->alignment); CTR2(KTR_BUSDMA, "map= %p, pagesneeded= %d", From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:42:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68C2E8B6 for ; Fri, 13 Dec 2013 21:42:15 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0D85C10A7 for ; Fri, 13 Dec 2013 21:42:14 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id n7so1951035qcx.19 for ; Fri, 13 Dec 2013 13:42:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=OUiPIuGSom34TU8x3gKp0CXQNnRBruRTx/HuiW4Pv1E=; b=cW3kfgaXmujXgnIpOjOQGPQ3mi148Q6Zi7YahFlZHcZM9vi8jhR623Akmhg3HytUPG 5GYlb1Yr5C/PJBS25cPVisl5EUSpHTdR29qYlGWXFaxw+clQVG+zfOI8rdAVfvyjEpc0 KwtzdtSvFAUA5e1C8dkhukDZG3Ti98ltJtKIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=OUiPIuGSom34TU8x3gKp0CXQNnRBruRTx/HuiW4Pv1E=; b=ZHYJrDMQX2EjTZM07QLXhAP/CsR5hqjOgK1oIAjFL4Uw0fc+1HH/G4isM8/eZeAAU0 t7zN2x+sw5VjeYCQ2rIixeUSY7xlSpJTURAT5k159MUI5vpv1+gu1WdT913RA6YC+jPt CdCLqvb2qwIwLVBDrLDHowuaupjBXttX3DlzJAZoQ2OwTnBfCxwiotbl1j5n5Bsm7yBL njWqUkHEhYz4rsrpXFYzc5hSsgbpVgTduOL1NSyiT6lvRw0AZK4Y77KwvHL2MMTO/CUc 4ou3U103Ts2gUo73cuJSrFS+9tCNzjyyfzyVFfCoZ+y/oFcprnj8lsuSG43CmrCIP4tG 8WKA== X-Gm-Message-State: ALoCoQnmZ90gP4Cjf1o0qaGZJtj7/5yYtnwUgnSINW7tUh/+a10rZfn4EU3Q/nD47KjFFB7UI8KW X-Received: by 10.229.194.1 with SMTP id dw1mr8613536qcb.20.1386970934170; Fri, 13 Dec 2013 13:42:14 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.86.42 with HTTP; Fri, 13 Dec 2013 13:41:44 -0800 (PST) In-Reply-To: <20131213223244.6ef4384f@kalimero.tijl.coosemans.org> References: <201312131932.rBDJW3iw088831@svn.freebsd.org> <52AB6845.7020504@FreeBSD.org> <20131213223244.6ef4384f@kalimero.tijl.coosemans.org> From: Eitan Adler Date: Fri, 13 Dec 2013 16:41:44 -0500 X-Google-Sender-Auth: FOnsdPZPfUdQSqxjHKrr8khbA0s Message-ID: Subject: Re: svn commit: r259326 - stable/10/contrib/tcpdump To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , Pedro Giffuni , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:42:15 -0000 On Fri, Dec 13, 2013 at 4:32 PM, Tijl Coosemans wrote: > On Fri, 13 Dec 2013 15:04:21 -0500 Pedro Giffuni wrote: >> On 13.12.2013 14:43, Eitan Adler wrote: >>> On Fri, Dec 13, 2013 at 2:32 PM, Pedro F. Giffuni wrote: >>>> Author: pfg >>>> Date: Fri Dec 13 19:32:02 2013 >>>> New Revision: 259326 >>>> URL: http://svnweb.freebsd.org/changeset/base/259326 >>>> >>>> Log: >>>> MFV r258571: >>>> >>>> Removes strict-aliasing warnings from newer GCC in tcpdump. >>>> >>>> Corresponds to MFC r258573, but for some reason our new pre-commit hooks >>>> will not let us merge it from there. >>> How did you attempt to do this merge? What were the exact commands? >> >> (Standing on my local stable/10 dir) >> >> svn merge -c r258573 ^/head . >> >> Attempt to commit there fired the pre-commit hook. > > This also copies the svn:mergeinfo property on head/contrib/tcpdump > to stable/10/contrib/tcpdump, but this property is only allowed on > stable/10 at the moment. I think you can just delete the property > before committing: > > svn propdel svn:mergeinfo contrib/tcpdump I think this should still be done, along with a --record-only merge. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:46:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 457B8AF8; Fri, 13 Dec 2013 21:46:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3278510DA; Fri, 13 Dec 2013 21:46:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLksQA036600; Fri, 13 Dec 2013 21:46:54 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLksYk036598; Fri, 13 Dec 2013 21:46:54 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201312132146.rBDLksYk036598@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 13 Dec 2013 21:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259338 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:46:54 -0000 Author: ken Date: Fri Dec 13 21:46:53 2013 New Revision: 259338 URL: http://svnweb.freebsd.org/changeset/base/259338 Log: Release Alan Somers (asomers) from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Dec 13 21:41:40 2013 (r259337) +++ svnadmin/conf/mentors Fri Dec 13 21:46:53 2013 (r259338) @@ -12,7 +12,6 @@ # Mentee Mentor Optional comment achim scottl Co-mentor: emaste agc scottl Co-mentor: emax -asomers ken Co-mentor: gibbs, will benl philip Co-mentor: simon carl jimharris cy andre Co-mentor: glebius From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:49:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32640CD1; Fri, 13 Dec 2013 21:49:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 04E4010FF; Fri, 13 Dec 2013 21:49:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLnfEo036923; Fri, 13 Dec 2013 21:49:41 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLnfYB036922; Fri, 13 Dec 2013 21:49:41 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201312132149.rBDLnfYB036922@svn.freebsd.org> From: Alan Somers Date: Fri, 13 Dec 2013 21:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259339 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:49:42 -0000 Author: asomers Date: Fri Dec 13 21:49:41 2013 New Revision: 259339 URL: http://svnweb.freebsd.org/changeset/base/259339 Log: sbin/devd/devd.cc Increase the size of devd's client socket's send buffer from the default (8k) to 128k. This prevents clients from getting POLLHUPped during event storms. For example, during zpool creation, the kernel emits a resource.fs.zfs.statechange event for every vdev in the pool. A 128k buffer is large enough to hold the statechange events for a pool with nearly 800 drives. Reviewed by: ian, imp Approved by: ken (mentor) Sponsored by: Spectra Logic Corp MFC after: 4 weeks Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Fri Dec 13 21:46:53 2013 (r259338) +++ head/sbin/devd/devd.cc Fri Dec 13 21:49:41 2013 (r259339) @@ -104,6 +104,19 @@ __FBSDID("$FreeBSD$"); #define CF "/etc/devd.conf" #define SYSCTL "hw.bus.devctl_disable" +/* + * Since the client socket is nonblocking, we must increase its send buffer to + * handle brief event storms. On FreeBSD, AF_UNIX sockets don't have a receive + * buffer, so the client can't increate the buffersize by itself. + * + * For example, when creating a ZFS pool, devd emits one 165 character + * resource.fs.zfs.statechange message for each vdev in the pool. A 64k + * buffer has enough space for almost 400 drives, which would be very large but + * not impossibly large pool. A 128k buffer has enough space for 794 drives, + * which is more than can fit in a rack with modern technology. + */ +#define CLIENT_BUFSIZE 131072 + using namespace std; extern FILE *yyin; @@ -892,6 +905,7 @@ void new_client(int fd) { int s; + int sndbuf_size; /* * First go reap any zombie clients, then accept the connection, and @@ -901,10 +915,15 @@ new_client(int fd) check_clients(); s = accept(fd, NULL, NULL); if (s != -1) { + sndbuf_size = CLIENT_BUFSIZE; + if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, &sndbuf_size, + sizeof(sndbuf_size))) + err(1, "setsockopt"); shutdown(s, SHUT_RD); clients.push_back(s); ++num_clients; - } + } else + err(1, "accept"); } static void From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:50:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31DEEE0C; Fri, 13 Dec 2013 21:50:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EAC01106; Fri, 13 Dec 2013 21:50:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLo3Oj037079; Fri, 13 Dec 2013 21:50:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLo3b8037078; Fri, 13 Dec 2013 21:50:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312132150.rBDLo3b8037078@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Dec 2013 21:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259340 - head/lib/libc/stdlib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:50:04 -0000 Author: eadler Date: Fri Dec 13 21:50:03 2013 New Revision: 259340 URL: http://svnweb.freebsd.org/changeset/base/259340 Log: getopt_long.3: wording quibbles - Make wording more clear: "is expect" vs "is expected" [1] - Remove extraneous trailing period.. Reported by: dim [1] Modified: head/lib/libc/stdlib/getopt_long.3 Modified: head/lib/libc/stdlib/getopt_long.3 ============================================================================== --- head/lib/libc/stdlib/getopt_long.3 Fri Dec 13 21:49:41 2013 (r259339) +++ head/lib/libc/stdlib/getopt_long.3 Fri Dec 13 21:50:03 2013 (r259340) @@ -130,11 +130,11 @@ field should be one of: .Pp .Bl -tag -width ".Dv optional_argument" -offset indent -compact .It Dv no_argument -no argument to the option is expect +no argument to the option is expected .It Dv required_argument an argument to the option is required .It Dv optional_argument -an argument to the option may be presented. +an argument to the option may be presented .El .Pp If From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:57:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F1EC429; Fri, 13 Dec 2013 21:57:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 19A6E11AE; Fri, 13 Dec 2013 21:57:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLvj8q040227; Fri, 13 Dec 2013 21:57:45 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLvi61040225; Fri, 13 Dec 2013 21:57:44 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201312132157.rBDLvi61040225@svn.freebsd.org> From: Rui Paulo Date: Fri, 13 Dec 2013 21:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259341 - stable/10/sys/dev/ath X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 21:57:45 -0000 Author: rpaulo Date: Fri Dec 13 21:57:44 2013 New Revision: 259341 URL: http://svnweb.freebsd.org/changeset/base/259341 Log: MFC r256658, r256666: Move a lot of debugging printf's to DPRINTF. Modified: stable/10/sys/dev/ath/if_ath.c stable/10/sys/dev/ath/if_ath_tx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ath/if_ath.c ============================================================================== --- stable/10/sys/dev/ath/if_ath.c Fri Dec 13 21:50:03 2013 (r259340) +++ stable/10/sys/dev/ath/if_ath.c Fri Dec 13 21:57:44 2013 (r259341) @@ -2725,7 +2725,7 @@ ath_transmit(struct ifnet *ifp, struct m */ ATH_PCU_LOCK(sc); if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: sc_inreset_cnt > 0; bailing\n", __func__); ATH_PCU_UNLOCK(sc); IF_LOCK(&ifp->if_snd); @@ -6430,7 +6430,7 @@ ath_node_recv_pspoll(struct ieee80211_no * Immediately punt. */ if (! an->an_is_powersave) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: not in powersave?\n", __func__, ni->ni_macaddr, @@ -6498,7 +6498,8 @@ ath_node_recv_pspoll(struct ieee80211_no /* * XXX nothing in the TIDs at this point? Eek. */ - device_printf(sc->sc_dev, "%s: %6D: TIDs empty, but ath_node showed traffic?!\n", + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: %6D: TIDs empty, but ath_node showed traffic?!\n", __func__, ni->ni_macaddr, ":"); Modified: stable/10/sys/dev/ath/if_ath_tx.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_tx.c Fri Dec 13 21:50:03 2013 (r259340) +++ stable/10/sys/dev/ath/if_ath_tx.c Fri Dec 13 21:57:44 2013 (r259341) @@ -268,7 +268,7 @@ ath_txfrag_setup(struct ath_softc *sc, a /* XXX non-management? */ bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL); if (bf == NULL) { /* out of buffers, cleanup */ - device_printf(sc->sc_dev, "%s: no buffer?\n", + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: no buffer?\n", __func__); ath_txfrag_cleanup(sc, frags, ni); break; @@ -560,10 +560,10 @@ ath_tx_setds_11n(struct ath_softc *sc, s bf = bf_first; if (bf->bf_state.bfs_txrate0 == 0) - device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: bf=%p, txrate0=%d\n", __func__, bf, 0); if (bf->bf_state.bfs_rc[0].ratecode == 0) - device_printf(sc->sc_dev, "%s: bf=%p, rix0=%d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: bf=%p, rix0=%d\n", __func__, bf, 0); /* @@ -708,11 +708,9 @@ ath_tx_handoff_mcast(struct ath_softc *s * mapped correctly. */ if (bf->bf_state.bfs_tx_queue != sc->sc_cabq->axq_qnum) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: bf=%p, bfs_tx_queue=%d, axq_qnum=%d\n", - __func__, - bf, - bf->bf_state.bfs_tx_queue, + __func__, bf, bf->bf_state.bfs_tx_queue, txq->axq_qnum); } @@ -881,11 +879,9 @@ ath_tx_handoff_hw(struct ath_softc *sc, * checking and holding buffer manipulation is sane. */ if (bf->bf_state.bfs_tx_queue != txq->axq_qnum) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: bf=%p, bfs_tx_queue=%d, axq_qnum=%d\n", - __func__, - bf, - bf->bf_state.bfs_tx_queue, + __func__, bf, bf->bf_state.bfs_tx_queue, txq->axq_qnum); } @@ -1343,8 +1339,8 @@ ath_tx_setds(struct ath_softc *sc, struc struct ath_hal *ah = sc->sc_ah; if (bf->bf_state.bfs_txrate0 == 0) - device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n", - __func__, bf, 0); + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: bf=%p, txrate0=%d\n", __func__, bf, 0); ath_hal_setuptxdesc(ah, ds , bf->bf_state.bfs_pktlen /* packet length */ @@ -1481,14 +1477,10 @@ ath_tx_should_swq_frame(struct ath_softc * Other control/mgmt frame; bypass software queuing * for now! */ - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %6D: Node is asleep; sending mgmt " "(type=%d, subtype=%d)\n", - __func__, - ni->ni_macaddr, - ":", - type, - subtype); + __func__, ni->ni_macaddr, ":", type, subtype); return (0); } else { return (1); @@ -1743,7 +1735,7 @@ ath_tx_normal_setup(struct ath_softc *sc */ #if 0 if (txq != sc->sc_ac2q[pri]) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: txq=%p (%d), pri=%d, pri txq=%p (%d)\n", __func__, txq, @@ -2145,7 +2137,7 @@ ath_tx_raw_start(struct ath_softc *sc, s /* Map ADDBA to the correct priority */ if (do_override) { #if 0 - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: overriding tid %d pri %d -> %d\n", __func__, o_tid, pri, TID_TO_WME_AC(o_tid)); #endif @@ -2356,8 +2348,8 @@ ath_raw_xmit(struct ieee80211_node *ni, ATH_PCU_LOCK(sc); if (sc->sc_inreset_cnt > 0) { - device_printf(sc->sc_dev, "%s: sc_inreset_cnt > 0; bailing\n", - __func__); + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: sc_inreset_cnt > 0; bailing\n", __func__); error = EIO; ATH_PCU_UNLOCK(sc); goto bad0; @@ -2585,16 +2577,14 @@ ath_tx_addto_baw(struct ath_softc *sc, s tap = ath_tx_get_tx_tid(an, tid->tid); if (! bf->bf_state.bfs_dobaw) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: dobaw=0, seqno=%d, window %d:%d\n", - __func__, - SEQNO(bf->bf_state.bfs_seqno), - tap->txa_start, - tap->txa_wnd); + __func__, SEQNO(bf->bf_state.bfs_seqno), + tap->txa_start, tap->txa_wnd); } if (bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: re-added? tid=%d, seqno %d; window %d:%d; " "baw head=%d tail=%d\n", __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), @@ -2607,7 +2597,7 @@ ath_tx_addto_baw(struct ath_softc *sc, s */ if (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, SEQNO(bf->bf_state.bfs_seqno))) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: bf=%p: outside of BAW?? tid=%d, seqno %d; window %d:%d; " "baw head=%d tail=%d\n", __func__, bf, tid->tid, SEQNO(bf->bf_state.bfs_seqno), @@ -2633,11 +2623,11 @@ ath_tx_addto_baw(struct ath_softc *sc, s assert(tid->tx_buf[cindex] == NULL); #endif if (tid->tx_buf[cindex] != NULL) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: ba packet dup (index=%d, cindex=%d, " "head=%d, tail=%d)\n", __func__, index, cindex, tid->baw_head, tid->baw_tail); - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: BA bf: %p; seqno=%d ; new bf: %p; seqno=%d\n", __func__, tid->tx_buf[cindex], @@ -2684,22 +2674,21 @@ ath_tx_switch_baw_buf(struct ath_softc * * soon hang. */ if (old_bf->bf_state.bfs_seqno != new_bf->bf_state.bfs_seqno) { - device_printf(sc->sc_dev, "%s: retransmitted buffer" + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: retransmitted buffer" " has mismatching seqno's, BA session may hang.\n", __func__); - device_printf(sc->sc_dev, "%s: old seqno=%d, new_seqno=%d\n", - __func__, - old_bf->bf_state.bfs_seqno, - new_bf->bf_state.bfs_seqno); + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: old seqno=%d, new_seqno=%d\n", __func__, + old_bf->bf_state.bfs_seqno, new_bf->bf_state.bfs_seqno); } if (tid->tx_buf[cindex] != old_bf) { - device_printf(sc->sc_dev, "%s: ath_buf pointer incorrect; " - " has m BA session may hang.\n", - __func__); - device_printf(sc->sc_dev, "%s: old bf=%p, new bf=%p\n", - __func__, - old_bf, new_bf); + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: ath_buf pointer incorrect; " + " has m BA session may hang.\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: old bf=%p, new bf=%p\n", __func__, old_bf, new_bf); } tid->tx_buf[cindex] = new_bf; @@ -2743,10 +2732,9 @@ ath_tx_update_baw(struct ath_softc *sc, * here and causing it to fire off. Disable TDMA for now. */ if (tid->tx_buf[cindex] != bf) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: comp bf=%p, seq=%d; slot bf=%p, seqno=%d\n", - __func__, - bf, SEQNO(bf->bf_state.bfs_seqno), + __func__, bf, SEQNO(bf->bf_state.bfs_seqno), tid->tx_buf[cindex], (tid->tx_buf[cindex] != NULL) ? SEQNO(tid->tx_buf[cindex]->bf_state.bfs_seqno) : -1); @@ -2992,10 +2980,9 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s * be reset or the completion code will get upset with you. */ if (bf->bf_state.bfs_aggr != 0 || bf->bf_state.bfs_nframes > 1) { - device_printf(sc->sc_dev, "%s: bfs_aggr=%d, bfs_nframes=%d\n", - __func__, - bf->bf_state.bfs_aggr, - bf->bf_state.bfs_nframes); + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + "%s: bfs_aggr=%d, bfs_nframes=%d\n", __func__, + bf->bf_state.bfs_aggr, bf->bf_state.bfs_nframes); bf->bf_state.bfs_aggr = 0; bf->bf_state.bfs_nframes = 1; } @@ -3273,10 +3260,9 @@ ath_tx_tid_resume(struct ath_softc *sc, * until it's actually resolved. */ if (tid->paused == 0) { - device_printf(sc->sc_dev, "%s: %6D: paused=0?\n", - __func__, - tid->an->an_node.ni_macaddr, - ":"); + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, + "%s: %6D: paused=0?\n", __func__, + tid->an->an_node.ni_macaddr, ":"); } else { tid->paused--; } @@ -3298,7 +3284,8 @@ ath_tx_tid_resume(struct ath_softc *sc, /* XXX isfiltered shouldn't ever be 0 at this point */ if (tid->isfiltered == 1) { - device_printf(sc->sc_dev, "%s: filtered?!\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: filtered?!\n", + __func__); return; } @@ -3321,8 +3308,9 @@ ath_tx_tid_filt_addbuf(struct ath_softc ATH_TX_LOCK_ASSERT(sc); - if (! tid->isfiltered) - device_printf(sc->sc_dev, "%s: not filtered?!\n", __func__); + if (!tid->isfiltered) + DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: not filtered?!\n", + __func__); DPRINTF(sc, ATH_DEBUG_SW_TX_FILT, "%s: bf=%p\n", __func__, bf); @@ -3518,8 +3506,8 @@ ath_tx_tid_bar_suspend(struct ath_softc /* We shouldn't be called when bar_tx is 1 */ if (tid->bar_tx) { - device_printf(sc->sc_dev, "%s: bar_tx is 1?!\n", - __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, + "%s: bar_tx is 1?!\n", __func__); } /* If we've already been called, just be patient. */ @@ -3551,14 +3539,10 @@ ath_tx_tid_bar_unsuspend(struct ath_soft tid->tid); if (tid->bar_tx == 0 || tid->bar_wait == 0) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: %6D: TID=%d, bar_tx=%d, bar_wait=%d: ?\n", - __func__, - tid->an->an_node.ni_macaddr, - ":", - tid->tid, - tid->bar_tx, - tid->bar_wait); + __func__, tid->an->an_node.ni_macaddr, ":", + tid->tid, tid->bar_tx, tid->bar_wait); } tid->bar_tx = tid->bar_wait = 0; @@ -3621,14 +3605,10 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, * This is an error condition! */ if (tid->bar_wait == 0 || tid->bar_tx == 1) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: %6D: TID=%d, bar_tx=%d, bar_wait=%d: ?\n", - __func__, - tid->an->an_node.ni_macaddr, - ":", - tid->tid, - tid->bar_tx, - tid->bar_wait); + __func__, tid->an->an_node.ni_macaddr, ":", + tid->tid, tid->bar_tx, tid->bar_wait); return; } @@ -3679,11 +3659,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, /* Failure? For now, warn loudly and continue */ ATH_TX_LOCK(sc); - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: %6D: TID=%d, failed to TX BAR, continue!\n", - __func__, - tid->an->an_node.ni_macaddr, - ":", + __func__, tid->an->an_node.ni_macaddr, ":", tid->tid); ath_tx_tid_bar_unsuspend(sc, tid); } @@ -3715,7 +3693,7 @@ ath_tx_tid_drain_pkt(struct ath_softc *s * This has become a non-fatal error now */ if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); #endif @@ -3733,12 +3711,13 @@ ath_tx_tid_drain_print(struct ath_softc const char *pfx, struct ath_tid *tid, struct ath_buf *bf) { struct ieee80211_node *ni = &an->an_node; - struct ath_txq *txq = sc->sc_ac2q[tid->ac]; + struct ath_txq *txq; struct ieee80211_tx_ampdu *tap; + txq = sc->sc_ac2q[tid->ac]; tap = ath_tx_get_tx_tid(an, tid->tid); - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: %s: %6D: bf=%p: addbaw=%d, dobaw=%d, " "seqno=%d, retry=%d\n", __func__, @@ -3750,7 +3729,7 @@ ath_tx_tid_drain_print(struct ath_softc bf->bf_state.bfs_dobaw, SEQNO(bf->bf_state.bfs_seqno), bf->bf_state.bfs_retries); - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: %s: %6D: bf=%p: txq[%d] axq_depth=%d, axq_aggr_depth=%d\n", __func__, pfx, @@ -3760,8 +3739,7 @@ ath_tx_tid_drain_print(struct ath_softc txq->axq_qnum, txq->axq_depth, txq->axq_aggr_depth); - - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: %s: %6D: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, " "isfiltered=%d\n", __func__, @@ -3773,7 +3751,7 @@ ath_tx_tid_drain_print(struct ath_softc tid->hwq_depth, tid->bar_wait, tid->isfiltered); - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: %s: %6D: tid %d: " "sched=%d, paused=%d, " "incomp=%d, baw_head=%d, " @@ -4091,7 +4069,7 @@ ath_tx_normal_comp(struct ath_softc *sc, */ if ((ts->ts_status & HAL_TXERR_FILT) || (ts->ts_status != 0 && atid->isfiltered)) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: isfiltered=%d, ts_status=%d: huh?\n", __func__, atid->isfiltered, @@ -4100,9 +4078,9 @@ ath_tx_normal_comp(struct ath_softc *sc, } #endif if (atid->isfiltered) - device_printf(sc->sc_dev, "%s: filtered?!\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: filtered?!\n", __func__); if (atid->hwq_depth < 0) - device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: hwq_depth < 0: %d\n", __func__, atid->hwq_depth); /* @@ -4213,8 +4191,8 @@ ath_tx_tid_cleanup(struct ath_softc *sc, ATH_TID_REMOVE(atid, bf, bf_list); if (bf->bf_state.bfs_dobaw) { ath_tx_update_baw(sc, an, atid, bf); - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); @@ -4275,13 +4253,13 @@ ath_tx_retry_clone(struct ath_softc *sc, nbf = ath_buf_clone(sc, bf); #if 0 - device_printf(sc->sc_dev, "%s: ATH_BUF_BUSY; cloning\n", + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: ATH_BUF_BUSY; cloning\n", __func__); #endif if (nbf == NULL) { /* Failed to clone */ - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: failed to clone a busy buffer\n", __func__); return NULL; @@ -4290,7 +4268,7 @@ ath_tx_retry_clone(struct ath_softc *sc, /* Setup the dma for the new buffer */ error = ath_tx_dmasetup(sc, nbf, nbf->bf_m); if (error != 0) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: failed to setup dma for clone\n", __func__); /* @@ -4367,7 +4345,7 @@ ath_tx_aggr_retry_unaggr(struct ath_soft if (bf->bf_state.bfs_dobaw) { ath_tx_update_baw(sc, an, atid, bf); if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); } @@ -4457,8 +4435,8 @@ ath_tx_retry_subframe(struct ath_softc * "%s: max retries: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); ath_tx_update_baw(sc, an, atid, bf); - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); bf->bf_state.bfs_dobaw = 0; @@ -4663,7 +4641,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * atid->hwq_depth--; if (atid->hwq_depth < 0) - device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: hwq_depth < 0: %d\n", __func__, atid->hwq_depth); /* @@ -4681,7 +4659,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * */ if (atid->cleanup_inprogress) { if (atid->isfiltered) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: isfiltered=1, normal_comp?\n", __func__); ATH_TX_UNLOCK(sc); @@ -4699,7 +4677,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * if ((ts.ts_status & HAL_TXERR_FILT) || (ts.ts_status != 0 && atid->isfiltered)) { if (fail != 0) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: isfiltered=1, fail=%d\n", __func__, fail); ath_tx_tid_filt_comp_aggr(sc, atid, bf_first, &bf_cq); @@ -4709,8 +4687,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * drops++; if (bf->bf_state.bfs_dobaw) { ath_tx_update_baw(sc, an, atid, bf); - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); @@ -4792,7 +4770,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * #if 0 /* Occasionally, the MAC sends a tx status for the wrong TID. */ if (tid != ts.ts_tid) { - device_printf(sc->sc_dev, "%s: tid %d != hw tid %d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: tid %d != hw tid %d\n", __func__, tid, ts.ts_tid); tx_ok = 0; } @@ -4800,7 +4778,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); @@ -4851,8 +4829,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * sc->sc_stats.ast_tx_aggr_ok++; ath_tx_update_baw(sc, an, atid, bf); bf->bf_state.bfs_dobaw = 0; - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); bf->bf_next = NULL; @@ -4881,7 +4859,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * ATH_TX_UNLOCK(sc); if (nframes != nf) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: num frames seen=%d; bf nframes=%d\n", __func__, nframes, nf); @@ -4992,7 +4970,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc ATH_TX_LOCK(sc); if (tid == IEEE80211_NONQOS_TID) - device_printf(sc->sc_dev, "%s: TID=16!\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: TID=16!\n", __func__); DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: tid=%d, hwq_depth=%d, seqno=%d\n", @@ -5001,7 +4979,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc atid->hwq_depth--; if (atid->hwq_depth < 0) - device_printf(sc->sc_dev, "%s: hwq_depth < 0: %d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: hwq_depth < 0: %d\n", __func__, atid->hwq_depth); /* @@ -5020,7 +4998,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc */ if (atid->cleanup_inprogress) { if (atid->isfiltered) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: isfiltered=1, normal_comp?\n", __func__); ATH_TX_UNLOCK(sc); @@ -5047,10 +5025,9 @@ ath_tx_aggr_comp_unaggr(struct ath_softc int freeframe; if (fail != 0) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: isfiltered=1, fail=%d\n", - __func__, - fail); + __func__, fail); freeframe = ath_tx_tid_filt_comp_single(sc, atid, bf); if (freeframe) { /* Remove from BAW */ @@ -5058,8 +5035,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc drops++; if (bf->bf_state.bfs_dobaw) { ath_tx_update_baw(sc, an, atid, bf); - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); } @@ -5111,8 +5088,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc if (bf->bf_state.bfs_dobaw) { ath_tx_update_baw(sc, an, atid, bf); bf->bf_state.bfs_dobaw = 0; - if (! bf->bf_state.bfs_addedbaw) - device_printf(sc->sc_dev, + if (!bf->bf_state.bfs_addedbaw) + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: wasn't added: seqno %d\n", __func__, SEQNO(bf->bf_state.bfs_seqno)); } @@ -5177,8 +5154,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft tap = ath_tx_get_tx_tid(an, tid->tid); if (tid->tid == IEEE80211_NONQOS_TID) - device_printf(sc->sc_dev, "%s: called for TID=NONQOS_TID?\n", - __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: called for TID=NONQOS_TID?\n", __func__); for (;;) { status = ATH_AGGR_DONE; @@ -5210,7 +5187,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft ATH_TID_REMOVE(tid, bf, bf_list); if (bf->bf_state.bfs_nframes > 1) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: aggr=%d, nframes=%d\n", __func__, bf->bf_state.bfs_aggr, @@ -5341,7 +5318,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft bf->bf_comp = ath_tx_aggr_comp; if (bf->bf_state.bfs_tid == IEEE80211_NONQOS_TID) - device_printf(sc->sc_dev, "%s: TID=16?\n", __func__); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: TID=16?\n", __func__); /* * Update leak count and frame config if were leaking frames. @@ -5399,10 +5376,10 @@ ath_tx_tid_hw_queue_norm(struct ath_soft /* Check - is AMPDU pending or running? then print out something */ if (ath_tx_ampdu_pending(sc, an, tid->tid)) - device_printf(sc->sc_dev, "%s: tid=%d, ampdu pending?\n", + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ampdu pending?\n", __func__, tid->tid); if (ath_tx_ampdu_running(sc, an, tid->tid)) - device_printf(sc->sc_dev, "%s: tid=%d, ampdu running?\n", + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: tid=%d, ampdu running?\n", __func__, tid->tid); for (;;) { @@ -5426,9 +5403,9 @@ ath_tx_tid_hw_queue_norm(struct ath_soft /* Sanity check! */ if (tid->tid != bf->bf_state.bfs_tid) { - device_printf(sc->sc_dev, "%s: bfs_tid %d !=" - " tid %d\n", - __func__, bf->bf_state.bfs_tid, tid->tid); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bfs_tid %d !=" + " tid %d\n", __func__, bf->bf_state.bfs_tid, + tid->tid); } /* Normal completion handler */ bf->bf_comp = ath_tx_normal_comp; @@ -5900,7 +5877,7 @@ ath_bar_response(struct ieee80211_node * if (status == 0 || attempts == 50) { ATH_TX_LOCK(sc); if (atid->bar_tx == 0 || atid->bar_wait == 0) - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: huh? bar_tx=%d, bar_wait=%d\n", __func__, atid->bar_tx, atid->bar_wait); @@ -5986,11 +5963,9 @@ ath_tx_node_sleep(struct ath_softc *sc, ATH_TX_LOCK(sc); if (an->an_is_powersave) { - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: %6D: node was already asleep!\n", - __func__, - an->an_node.ni_macaddr, - ":"); + __func__, an->an_node.ni_macaddr, ":"); ATH_TX_UNLOCK(sc); return; } @@ -6026,7 +6001,7 @@ ath_tx_node_wakeup(struct ath_softc *sc, /* !? */ if (an->an_is_powersave == 0) { ATH_TX_UNLOCK(sc); - device_printf(sc->sc_dev, + DPRINTF(sc, ATH_DEBUG_XMIT, "%s: an=%p: node was already awake\n", __func__, an); return; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:00:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 602B15CC; Fri, 13 Dec 2013 22:00:26 +0000 (UTC) Received: from mailrelay012.isp.belgacom.be (mailrelay012.isp.belgacom.be [195.238.6.179]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC0511CD; Fri, 13 Dec 2013 22:00:24 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmoGAKiCq1JbsVZ9/2dsb2JhbABZgwo4SbhsgSQXdIIlAQEFOhwjEAsOBgQJJQ8qHgYTiAgBCMp8F48VB4Q2BJgVgTGQZIMrOw Received: from 125.86-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.86.125]) by relay.skynet.be with ESMTP; 13 Dec 2013 22:59:15 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id rBDLxEOk013851; Fri, 13 Dec 2013 22:59:14 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Fri, 13 Dec 2013 22:59:13 +0100 From: Tijl Coosemans To: Eitan Adler Subject: Re: svn commit: r259326 - stable/10/contrib/tcpdump Message-ID: <20131213225913.6a235dbe@kalimero.tijl.coosemans.org> In-Reply-To: References: <201312131932.rBDJW3iw088831@svn.freebsd.org> <52AB6845.7020504@FreeBSD.org> <20131213223244.6ef4384f@kalimero.tijl.coosemans.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , Pedro Giffuni , "src-committers@freebsd.org" , svn-src-stable-10@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:00:26 -0000 On Fri, 13 Dec 2013 16:41:44 -0500 Eitan Adler wrote: > On Fri, Dec 13, 2013 at 4:32 PM, Tijl Coosemans wrote: >> On Fri, 13 Dec 2013 15:04:21 -0500 Pedro Giffuni wrote: >>> On 13.12.2013 14:43, Eitan Adler wrote: >>>> On Fri, Dec 13, 2013 at 2:32 PM, Pedro F. Giffuni wrote: >>>>> Author: pfg >>>>> Date: Fri Dec 13 19:32:02 2013 >>>>> New Revision: 259326 >>>>> URL: http://svnweb.freebsd.org/changeset/base/259326 >>>>> >>>>> Log: >>>>> MFV r258571: >>>>> >>>>> Removes strict-aliasing warnings from newer GCC in tcpdump. >>>>> >>>>> Corresponds to MFC r258573, but for some reason our new pre-commit hooks >>>>> will not let us merge it from there. >>>> How did you attempt to do this merge? What were the exact commands? >>> >>> (Standing on my local stable/10 dir) >>> >>> svn merge -c r258573 ^/head . >>> >>> Attempt to commit there fired the pre-commit hook. >> >> This also copies the svn:mergeinfo property on head/contrib/tcpdump >> to stable/10/contrib/tcpdump, but this property is only allowed on >> stable/10 at the moment. I think you can just delete the property >> before committing: >> >> svn propdel svn:mergeinfo contrib/tcpdump > > I think this should still be done, along with a --record-only merge. Yes, done in r259334. From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:08:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A05F7916; Fri, 13 Dec 2013 22:08:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AF3D1262; Fri, 13 Dec 2013 22:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDM8XMG044301; Fri, 13 Dec 2013 22:08:33 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDM8WKQ044292; Fri, 13 Dec 2013 22:08:32 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132208.rBDM8WKQ044292@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259342 - in stable/10/sys/arm: at91 econa lpc ti/cpsw versatile xscale/ixp425 xscale/pxa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:08:33 -0000 Author: ian Date: Fri Dec 13 22:08:31 2013 New Revision: 259342 URL: http://svnweb.freebsd.org/changeset/base/259342 Log: MFC r257258, r257265: Include headers (if_var.h and others) where needed. The change that triggered the need for this on head was r257244. That hasn't been MFC'd yet, but there's no harm in paving the way for it with this MFC. Modified: stable/10/sys/arm/at91/if_ate.c stable/10/sys/arm/econa/if_ece.c stable/10/sys/arm/lpc/if_lpe.c stable/10/sys/arm/ti/cpsw/if_cpsw.c stable/10/sys/arm/versatile/if_smc_fdt.c stable/10/sys/arm/xscale/ixp425/if_npe.c stable/10/sys/arm/xscale/pxa/if_smc_smi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/if_ate.c ============================================================================== --- stable/10/sys/arm/at91/if_ate.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/at91/if_ate.c Fri Dec 13 22:08:31 2013 (r259342) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET #include Modified: stable/10/sys/arm/econa/if_ece.c ============================================================================== --- stable/10/sys/arm/econa/if_ece.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/econa/if_ece.c Fri Dec 13 22:08:31 2013 (r259342) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef INET Modified: stable/10/sys/arm/lpc/if_lpe.c ============================================================================== --- stable/10/sys/arm/lpc/if_lpe.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/lpc/if_lpe.c Fri Dec 13 22:08:31 2013 (r259342) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: stable/10/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- stable/10/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/ti/cpsw/if_cpsw.c Fri Dec 13 22:08:31 2013 (r259342) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: stable/10/sys/arm/versatile/if_smc_fdt.c ============================================================================== --- stable/10/sys/arm/versatile/if_smc_fdt.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/versatile/if_smc_fdt.c Fri Dec 13 22:08:31 2013 (r259342) @@ -28,11 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include - #include -#include +#include +#include +#include #include #include Modified: stable/10/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/if_npe.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/xscale/ixp425/if_npe.c Fri Dec 13 22:08:31 2013 (r259342) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET #include Modified: stable/10/sys/arm/xscale/pxa/if_smc_smi.c ============================================================================== --- stable/10/sys/arm/xscale/pxa/if_smc_smi.c Fri Dec 13 21:57:44 2013 (r259341) +++ stable/10/sys/arm/xscale/pxa/if_smc_smi.c Fri Dec 13 22:08:31 2013 (r259342) @@ -28,11 +28,12 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include - #include -#include +#include +#include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:11:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FFD5AA0 for ; Fri, 13 Dec 2013 22:11:27 +0000 (UTC) Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B85BE12BC for ; Fri, 13 Dec 2013 22:11:26 +0000 (UTC) Received: by mail-ee0-f51.google.com with SMTP id b15so1128519eek.24 for ; Fri, 13 Dec 2013 14:11:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:user-agent:in-reply-to:references:mime-version :content-type:content-transfer-encoding:subject:from:date:to:cc :message-id; bh=7fs/zRRESkn1VuT3YP+pcixHx2+VcTXfMjkINF1dBkI=; b=Ef4iIzZE/7jZmD16ViEoXCCNNSAtKTctylRePgunokDh7vl/BDB1U0DQBoThs5wPXo pAYDFInQa21WzdaiqW7TTitohqTv2jduLXdEfIxJ1o/QYgpbNbnel3RjdRItSdXcsqfX 0TkknLWA6EzFuypqz794dE/iGzV+47OGWmRE9qws85v6MZp8EKB9QVpFx8wYOZUZ7377 hgJm8SNjBnU0vl5OKoQ/6itVRXKOxwzV84Y5OQnCXYt79T2IlH6CUj3o1lUdIkUY/vNs by4MJ6ZLAqCbp96dS/3AmnKmKWkN1tZEWbx+nv2tSbdavXx+BiOXLke98xn04O7uV61e mH0A== X-Gm-Message-State: ALoCoQlcgBkxof7yZJdy3QBh/J4ChTKCJlXzpqaWn6RhlQOlNvzqxDviqhkKmp9kH+RfLA9PIAN3 X-Received: by 10.14.204.135 with SMTP id h7mr5092385eeo.104.1386972679221; Fri, 13 Dec 2013 14:11:19 -0800 (PST) Received: from [46.96.136.173] ([46.96.136.173]) by mx.google.com with ESMTPSA id v1sm11452290eef.9.2013.12.13.14.11.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 13 Dec 2013 14:11:18 -0800 (PST) User-Agent: K-9 Mail for Android In-Reply-To: <20131212190230.GU59496@kib.kiev.ua> References: <201312121449.rBCEnRRQ045690@svn.freebsd.org> <20131212190230.GU59496@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: svn commit: r259261 - head/sys/dev/drm2 From: Aleksandr Rybalko Date: Sat, 14 Dec 2013 00:11:01 +0200 To: Konstantin Belousov , Aleksandr Rybalko Message-ID: Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:11:27 -0000 Konstantin Belousov написав(ла): >On Thu, Dec 12, 2013 at 02:49:27PM +0000, Aleksandr Rybalko wrote: >> Author: ray >> Date: Thu Dec 12 14:49:26 2013 >> New Revision: 259261 >> URL: http://svnweb.freebsd.org/changeset/base/259261 >> >> Log: >> Do not try to probe/attach if attempt to add fbd child are failed. >> >> Sponsored by: The FreeBSD Foundation >> >> Modified: >> head/sys/dev/drm2/drm_fb_helper.c >> >> Modified: head/sys/dev/drm2/drm_fb_helper.c >> >============================================================================== >> --- head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:37:25 >2013 (r259260) >> +++ head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:49:26 >2013 (r259261) >> @@ -1043,7 +1043,10 @@ int drm_fb_helper_single_fb_probe(struct >> >> kdev = fb_helper->dev->device; >> fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); >> - ret = device_probe_and_attach(fbd); >> + if (fbd != NULL) >> + ret = device_probe_and_attach(fbd); >> + else >> + ret = ENODEV; >This must be -ENODEV, since linux layer operates on negative values for >error. The error is negated in the drm layer, which would result in >non-existent errno returned to FreeBSD code. It is not actually return code, but only value to show in error message few lines later. ENODEV just value for case no device attached. That error message appear only if kernel configuration include device vt. (planning for syscons too, maybe). > >Also, the #ifdef __FreeBSD braces in the file are not useful, please >remove them. >> #ifdef DEV_VT >> if (ret != 0) >> DRM_ERROR("Failed to attach fbd device: %d\n", ret); Should we with Jean have to remove all #ifdef __FreeBSD and __Linux over whole DRM2 code, to reduce differences with linux code? Thanks! WBW ------ Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:12:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B31C3B3A; Fri, 13 Dec 2013 22:12:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 929E212CD; Fri, 13 Dec 2013 22:12:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMCc9h047326; Fri, 13 Dec 2013 22:12:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMCbpC047319; Fri, 13 Dec 2013 22:12:37 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132212.rBDMCbpC047319@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259343 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:12:38 -0000 Author: ian Date: Fri Dec 13 22:12:37 2013 New Revision: 259343 URL: http://svnweb.freebsd.org/changeset/base/259343 Log: MFC r257383, r257384: Add some bare-bones support for enabling usb and usbphy clocks. Add a "no-op" USB PHY driver for imx-family SoCs. Added: stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c - copied unchanged from r257384, head/sys/arm/freescale/imx/imx_nop_usbphy.c Modified: stable/10/sys/arm/freescale/imx/files.imx51 stable/10/sys/arm/freescale/imx/files.imx53 stable/10/sys/arm/freescale/imx/imx51_ccm.c stable/10/sys/arm/freescale/imx/imx51_ccmreg.h stable/10/sys/arm/freescale/imx/imx_machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/files.imx51 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx51 Fri Dec 13 22:08:31 2013 (r259342) +++ stable/10/sys/arm/freescale/imx/files.imx51 Fri Dec 13 22:12:37 2013 (r259343) @@ -37,7 +37,8 @@ dev/ata/chipsets/ata-fsl.c optional imx # UART driver dev/uart/uart_dev_imx.c optional uart -# USB join controller (1 OTG, 3 EHCI) +# USB OH3 controller (1 OTG, 3 EHCI) +arm/freescale/imx/imx_nop_usbphy.c optional echi dev/usb/controller/ehci_imx.c optional ehci # Watchdog Modified: stable/10/sys/arm/freescale/imx/files.imx53 ============================================================================== --- stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 22:08:31 2013 (r259342) +++ stable/10/sys/arm/freescale/imx/files.imx53 Fri Dec 13 22:12:37 2013 (r259343) @@ -37,7 +37,8 @@ arm/freescale/imx/imx51_ccm.c standard # i.MX5xx PATA controller dev/ata/chipsets/ata-fsl.c optional imxata -# USB join controller (1 OTG, 3 EHCI) +# USB OH3 controller (1 OTG, 3 EHCI) +arm/freescale/imx/imx_nop_usbphy.c optional ehci dev/usb/controller/ehci_imx.c optional ehci # Watchdog Modified: stable/10/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ccm.c Fri Dec 13 22:08:31 2013 (r259342) +++ stable/10/sys/arm/freescale/imx/imx51_ccm.c Fri Dec 13 22:12:37 2013 (r259343) @@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define IMXCCMDEBUG #undef IMXCCMDEBUG @@ -473,3 +474,78 @@ imx51_get_clk_gating(int clk_src) return ((reg >> (clk_src % CCMR_CCGR_NSOURCE) * 2) & 0x03); } +/* + * Code from here down is temporary, in lieu of a SoC-independent clock API. + */ + +void +imx_ccm_usb_enable(device_t dev) +{ + uint32_t regval; + + /* + * Select PLL2 as the source for the USB clock. + * The default is PLL3, but U-boot changes it to PLL2. + */ + regval = bus_read_4(ccm_softc->res[0], CCMC_CSCMR1); + regval &= ~CSCMR1_USBOH3_CLK_SEL_MASK; + regval |= 1 << CSCMR1_USBOH3_CLK_SEL_SHIFT; + bus_write_4(ccm_softc->res[0], CCMC_CSCMR1, regval); + + /* + * Set the USB clock pre-divider to div-by-5, post-divider to div-by-2. + */ + regval = bus_read_4(ccm_softc->res[0], CCMC_CSCDR1); + regval &= ~CSCDR1_USBOH3_CLK_PODF_MASK; + regval &= ~CSCDR1_USBOH3_CLK_PRED_MASK; + regval |= 4 << CSCDR1_USBOH3_CLK_PRED_SHIFT; + regval |= 1 << CSCDR1_USBOH3_CLK_PODF_SHIFT; + bus_write_4(ccm_softc->res[0], CCMC_CSCDR1, regval); + + /* + * The same two clocks gates are used on imx51 and imx53. + */ + imx51_clk_gating(CCGR_USBOH3_IPG_AHB_CLK, CCGR_CLK_MODE_ALWAYS); + imx51_clk_gating(CCGR_USBOH3_60M_CLK, CCGR_CLK_MODE_ALWAYS); +} + +void +imx_ccm_usbphy_enable(device_t dev) +{ + uint32_t regval; + + /* + * Select PLL3 as the source for the USBPHY clock. U-boot does this + * only for imx53, but the bit exists on imx51. That seems a bit + * strange, but we'll go with it until more is known. + */ + if (imx_soc_type() == IMXSOC_53) { + regval = bus_read_4(ccm_softc->res[0], CCMC_CSCMR1); + regval |= 1 << CSCMR1_USBPHY_CLK_SEL_SHIFT; + bus_write_4(ccm_softc->res[0], CCMC_CSCMR1, regval); + } + + /* + * For the imx51 there's just one phy gate control, enable it. + */ + if (imx_soc_type() == IMXSOC_51) { + imx51_clk_gating(CCGR_USB_PHY_CLK, CCGR_CLK_MODE_ALWAYS); + return; + } + + /* + * For imx53 we don't have a full set of clock defines yet, but the + * datasheet says: + * gate reg 4, bits 13-12 usb ph2 clock (usb_phy2_clk_enable) + * gate reg 4, bits 11-10 usb ph1 clock (usb_phy1_clk_enable) + * + * We should use the fdt data for the device to figure out which of + * the two we're working on, but for now just turn them both on. + */ + if (imx_soc_type() == IMXSOC_53) { + imx51_clk_gating(__CCGR_NUM(4, 5), CCGR_CLK_MODE_ALWAYS); + imx51_clk_gating(__CCGR_NUM(4, 6), CCGR_CLK_MODE_ALWAYS); + return; + } +} + Modified: stable/10/sys/arm/freescale/imx/imx51_ccmreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_ccmreg.h Fri Dec 13 22:08:31 2013 (r259342) +++ stable/10/sys/arm/freescale/imx/imx51_ccmreg.h Fri Dec 13 22:12:37 2013 (r259343) @@ -114,12 +114,20 @@ #define CCMC_CSCMR1 0x001c #define CSCMR1_UART_CLK_SEL_SHIFT 24 #define CSCMR1_UART_CLK_SEL_MASK 0x03000000 +#define CSCMR1_USBPHY_CLK_SEL_SHIFT 26 +#define CSCMR1_USBPHY_CLK_SEL_MASK 0x04000000 +#define CSCMR1_USBOH3_CLK_SEL_SHIFT 22 +#define CSCMR1_USBOH3_CLK_SEL_MASK 0x00c00000 #define CCMC_CSCMR2 0x0020 #define CCMC_CSCDR1 0x0024 #define CSCDR1_UART_CLK_PRED_SHIFT 3 #define CSCDR1_UART_CLK_PRED_MASK 0x00000038 #define CSCDR1_UART_CLK_PODF_SHIFT 0 #define CSCDR1_UART_CLK_PODF_MASK 0x00000007 +#define CSCDR1_USBOH3_CLK_PRED_SHIFT 8 +#define CSCDR1_USBOH3_CLK_PRED_MASK 0x00000700 +#define CSCDR1_USBOH3_CLK_PODF_SHIFT 6 +#define CSCDR1_USBOH3_CLK_PODF_MASK 0x000000c0 #define CCMC_CS1CDR 0x0028 #define CCMC_CS2CDR 0x002c #define CCMC_CDCDR 0x0030 Modified: stable/10/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.h Fri Dec 13 22:08:31 2013 (r259342) +++ stable/10/sys/arm/freescale/imx/imx_machdep.h Fri Dec 13 22:12:37 2013 (r259343) @@ -56,5 +56,21 @@ u_int imx_soc_family(void); void imx_devmap_init(void); +/* + * We need a clock management system that works across unrelated SoCs and + * devices. For now, to keep imx development moving, define some barebones + * functionality that can be shared within the imx family by having each SoC + * implement functions with a common name. + * + * The usb enable functions are best-effort. They turn on the usb otg, host, + * and phy clocks in a SoC-specific manner, but it may take a lot more than that + * to make usb work on a given board. In particular, it can require specific + * pinmux setup of gpio pins connected to external phy parts, voltage regulators + * and overcurrent detectors, and so on. On such boards, u-boot or other early + * board setup code has to handle those things. + */ +void imx_ccm_usb_enable(device_t _usbdev); +void imx_ccm_usbphy_enable(device_t _phydev); + #endif Copied: stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c (from r257384, head/sys/arm/freescale/imx/imx_nop_usbphy.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_nop_usbphy.c Fri Dec 13 22:12:37 2013 (r259343, copy of r257384, head/sys/arm/freescale/imx/imx_nop_usbphy.c) @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * USBPHY "no-op" driver for Freescale family of SoCs. This driver is used on + * SoCs which have usbphy hardware whose clocks need to be enabled, but no other + * action has to be taken to make the hardware work. + */ + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include + +/* + * Table of supported FDT compat strings. + */ +static struct ofw_compat_data compat_data[] = { + {"nop-usbphy", true}, + {"usb-nop-xceiv", true}, + {NULL, false}, +}; + +struct usbphy_softc { + device_t dev; + u_int phy_num; +}; + +static int +usbphy_detach(device_t dev) +{ + + return (0); +} + +static int +usbphy_attach(device_t dev) +{ + struct usbphy_softc *sc; + + sc = device_get_softc(dev); + + /* + * Turn on the phy clocks. + */ + imx_ccm_usbphy_enable(dev); + + return (0); +} + +static int +usbphy_probe(device_t dev) +{ + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale USB PHY"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static device_method_t usbphy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, usbphy_probe), + DEVMETHOD(device_attach, usbphy_attach), + DEVMETHOD(device_detach, usbphy_detach), + + DEVMETHOD_END +}; + +static driver_t usbphy_driver = { + "usbphy", + usbphy_methods, + sizeof(struct usbphy_softc) +}; + +static devclass_t usbphy_devclass; + +DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0); + From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:15:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7B3FD29; Fri, 13 Dec 2013 22:15:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A3BD412F2; Fri, 13 Dec 2013 22:15:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMFO6P047697; Fri, 13 Dec 2013 22:15:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMFOAL047696; Fri, 13 Dec 2013 22:15:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132215.rBDMFOAL047696@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259344 - stable/10/sys/dev/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:15:24 -0000 Author: ian Date: Fri Dec 13 22:15:24 2013 New Revision: 259344 URL: http://svnweb.freebsd.org/changeset/base/259344 Log: MFC r257390: Add a vendor entry for Freescale Semiconductor. Modified: stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Fri Dec 13 22:12:37 2013 (r259343) +++ stable/10/sys/dev/usb/usbdevs Fri Dec 13 22:15:24 2013 (r259344) @@ -654,6 +654,7 @@ vendor OWEN 0x1555 Owen vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline +vendor FREESCALE 0x15a2 Freescale Semiconductor, Inc. vendor AFATECH 0x15a4 Afatech Technologies, Inc. vendor SPARKLAN 0x15a9 SparkLAN vendor OLIMEX 0x15ba Olimex From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:19:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32EFE43A; Fri, 13 Dec 2013 22:19:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1CDF6134C; Fri, 13 Dec 2013 22:19:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMJN3P048186; Fri, 13 Dec 2013 22:19:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMJLcS048180; Fri, 13 Dec 2013 22:19:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132219.rBDMJLcS048180@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259345 - in stable/10/sys: boot/fdt/dts dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:19:23 -0000 Author: ian Date: Fri Dec 13 22:19:21 2013 New Revision: 259345 URL: http://svnweb.freebsd.org/changeset/base/259345 Log: MFC r257393: Rework the imx ehci driver so that it's four separate ehci units rather than one unit with four busses attached to it. This allows us to use existing fdt data which describes separate devices with separate resources. It also allows any combination of the units to be en/disabled in the board dts files. Adjust our dts code to match what's used by linux and u-boot now that we're structured to do so. Modified: stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts stable/10/sys/boot/fdt/dts/efikamx.dts stable/10/sys/boot/fdt/dts/imx51x.dtsi stable/10/sys/boot/fdt/dts/imx53-qsb.dts stable/10/sys/boot/fdt/dts/imx53x.dtsi stable/10/sys/dev/usb/controller/ehci_imx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Fri Dec 13 22:15:24 2013 (r259344) +++ stable/10/sys/boot/fdt/dts/digi-ccwmx53.dts Fri Dec 13 22:19:21 2013 (r259345) @@ -90,6 +90,12 @@ gpio@53f90000 { status = "okay"; }; + usb@53f80000 /* OTG */ { + status = "okay"; + }; + usb@53f80200 /* Host 1 */ { + status = "okay"; + }; wdog@53f98000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/efikamx.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/efikamx.dts Fri Dec 13 22:15:24 2013 (r259344) +++ stable/10/sys/boot/fdt/dts/efikamx.dts Fri Dec 13 22:19:21 2013 (r259345) @@ -89,6 +89,12 @@ gpio@73f90000 { status = "okay"; }; + usb@73f80000 /* OTG */ { + status = "okay"; + }; + usb@73f80200 /* Host 1 */ { + status = "okay"; + }; wdog@73f98000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/imx51x.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/imx51x.dtsi Fri Dec 13 22:15:24 2013 (r259344) +++ stable/10/sys/boot/fdt/dts/imx51x.dtsi Fri Dec 13 22:19:21 2013 (r259345) @@ -246,16 +246,48 @@ /* 7003C000 0x4000 SPBA */ }; - /* 73F80000 0x4000 USBOH3 */ - /* irq14 USBOH3 USB Host 1 */ - /* irq16 USBOH3 USB Host 2 */ - /* irq17 USBOH3 USB Host 3 */ - /* irq18 USBOH3 USB OTG */ - usb1: usb@73F80000 { - compatible = "fsl,usb-4core"; - reg = <0x73f80000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <18 14 16 17>; + usbphy0: usbphy@0 { + compatible = "usb-nop-xceiv"; + status = "okay"; + }; + + usbotg: usb@73f80000 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80000 0x0200>; + interrupts = <18>; + fsl,usbmisc = <&usbmisc 0>; + fsl,usbphy = <&usbphy0>; + status = "disabled"; + }; + + usbh1: usb@73f80200 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80200 0x0200>; + interrupts = <14>; + fsl,usbmisc = <&usbmisc 1>; + status = "disabled"; + }; + + usbh2: usb@73f80400 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80400 0x0200>; + interrupts = <16>; + fsl,usbmisc = <&usbmisc 2>; + status = "disabled"; + }; + + usbh3: usb@73f80600 { + compatible = "fsl,imx51-usb", "fsl,imx27-usb"; + reg = <0x73f80600 0x0200>; + interrupts = <17>; + fsl,usbmisc = <&usbmisc 3>; + status = "disabled"; + }; + + usbmisc: usbmisc@73f80800 { + #index-cells = <1>; + compatible = "fsl,imx51-usbmisc"; + reg = <0x73f80800 0x200>; }; /* 73F98000 0x4000 WDOG1 */ Modified: stable/10/sys/boot/fdt/dts/imx53-qsb.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/imx53-qsb.dts Fri Dec 13 22:15:24 2013 (r259344) +++ stable/10/sys/boot/fdt/dts/imx53-qsb.dts Fri Dec 13 22:19:21 2013 (r259345) @@ -28,6 +28,7 @@ * SUCH DAMAGE. * * Freescale i.MX53 Quick Start Board + * In u-boot, this board is known as "MX53LOCO" for some reason. * * $FreeBSD$ */ @@ -90,6 +91,12 @@ gpio@53f90000 { status = "okay"; }; + usb@53f80000 /* OTG */ { + status = "okay"; + }; + usb@53f80200 /* Host 1 */ { + status = "okay"; + }; wdog@53f98000 { status = "okay"; }; Modified: stable/10/sys/boot/fdt/dts/imx53x.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/imx53x.dtsi Fri Dec 13 22:15:24 2013 (r259344) +++ stable/10/sys/boot/fdt/dts/imx53x.dtsi Fri Dec 13 22:19:21 2013 (r259345) @@ -290,16 +290,50 @@ /* 5003C000 0x4000 SPBA */ }; - /* 73F80000 0x4000 USBOH3 */ - /* irq14 USBOH3 USB Host 1 */ - /* irq16 USBOH3 USB Host 2 */ - /* irq17 USBOH3 USB Host 3 */ - /* irq18 USBOH3 USB OTG */ - usb1: usb@53F80000 { - compatible = "fsl,usb-4core"; - reg = <0x53f80000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <18 14 16 17>; + usbphy0: usbphy@0 { + compatible = "usb-nop-xceiv"; + status = "okay"; + }; + + usbphy1: usbphy@1 { + compatible = "usb-nop-xceiv"; + status = "okay"; + }; + + usbotg: usb@53f80000 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80000 0x0200>; + interrupts = <18>; + fsl,usbphy = <&usbphy0>; + status = "disabled"; + }; + + usbh1: usb@53f80200 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80200 0x0200>; + interrupts = <14>; + fsl,usbphy = <&usbphy1>; + status = "disabled"; + }; + + usbh2: usb@53f80400 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80400 0x0200>; + interrupts = <16>; + status = "disabled"; + }; + + usbh3: usb@53f80600 { + compatible = "fsl,imx53-usb", "fsl,imx27-usb"; + reg = <0x53f80600 0x0200>; + interrupts = <17>; + status = "disabled"; + }; + + usbmisc: usbmisc@53f80800 { + #index-cells = <1>; + compatible = "fsl,imx53-usbmisc"; + reg = <0x53f80800 0x200>; }; /* 53F98000 0x4000 WDOG1 */ @@ -419,18 +453,6 @@ status = "disabled"; }; - - - /* 53FC4000 0x4000 USBOH3 */ - /* NOTYET - usb@53fc4000 { - compatible = "fsl,imx53-otg"; - reg = <0x53fc4000 0x4000>; - interrupt-parent = <&tzic>; - interrupts = <>; - status = "disabled"; - }; - */ /* 53FD0000 0x4000 SRC */ reset@53fd0000 { compatible = "fsl,imx53-src"; Modified: stable/10/sys/dev/usb/controller/ehci_imx.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_imx.c Fri Dec 13 22:15:24 2013 (r259344) +++ stable/10/sys/dev/usb/controller/ehci_imx.c Fri Dec 13 22:19:21 2013 (r259345) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2010-2012 Semihalf * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2013 Ian Lepore * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko @@ -31,7 +32,9 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_bus.h" +/* + * EHCI driver for Freescale i.MX SoCs which incorporate the USBOH3 controller. + */ #include #include @@ -52,231 +55,278 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include "usbdevs.h" #include #include -#include "opt_platform.h" +#include -#define FSL_EHCI_COUNT 4 -#define FSL_EHCI_REG_OFF 0x100 -#define FSL_EHCI_REG_SIZE 0x100 -#define FSL_EHCI_REG_STEP 0x200 +#include "opt_platform.h" -struct imx_ehci_softc { - ehci_softc_t ehci[FSL_EHCI_COUNT]; - /* MEM + 4 interrupts */ - struct resource *sc_res[1 + FSL_EHCI_COUNT]; -}; +/* + * Notes on the hardware and related FDT data seen in the wild. + * + * There are two sets of registers in the USBOH3 implementation; documentation + * refers to them as "core" and "non-core" registers. A set of core register + * exists for each OTG or EHCI device. There is a single set of non-core + * registers per USBOH3, and they control aspects of operation not directly + * related to the USB specs, such as whether interrupts from each of the core + * devices are able to generate a SoC wakeup event. + * + * In the FreeBSD universe we might be inclined to describe the core and + * non-core registers by using a pair of resource address/size values (two + * entries in the reg property for each core). However, we have to work with + * existing FDT data (which mostly comes from the linux universe), and the way + * they've chosen to represent this is with an entry for a "usbmisc" device + * whose reg property describes the non-core registers. The way we handle FDT + * data, this means that the resources (memory-mapped register range) for the + * non-core registers belongs to a device other than the echi devices. + * + * At the moment we have no need to access the non-core registers, so all of + * this amounts to documenting what's known. The following compat strings have + * been seen in existing FDT data: + * - "fsl,imx25-usbmisc" + * - "fsl,imx51-usbmisc"; + * - "fsl,imx6q-usbmisc"; + * + * In addition to the single usbmisc device, the existing FDT data defines a + * separate device for each of the OTG or EHCI cores within the USBOH3. Each of + * those devices has a set of core registers described by the reg property. + * + * The core registers for each of the four cores in the USBOH3 are divided into + * two parts: a set of imx-specific registers at an offset of 0 from the + * beginning of the register range, and the standard USB (EHCI or OTG) registers + * at an offset of 0x100 from the beginning of the register range. The FreeBSD + * way of dealing with this might be to map out two ranges in the reg property, + * but that's not what the alternate universe has done. To work with existing + * FDT data, we acquire the resource that maps all the core registers, then use + * bus_space_subregion() to create another resource that maps just the standard + * USB registers, which we provide to the standard USB code in the ehci_softc. + * + * The following compat strings have been seen for the OTG and EHCI cores. The + * FDT compat table in this driver contains all these strings, but as of this + * writing, not all of these SoCs have been tested with the driver. The fact + * that imx27 is common to all of them gives some hope that the driver will work + * on all these SoCs. + * - "fsl,imx23-usb", "fsl,imx27-usb"; + * - "fsl,imx25-usb", "fsl,imx27-usb"; + * - "fsl,imx28-usb", "fsl,imx27-usb"; + * - "fsl,imx51-usb", "fsl,imx27-usb"; + * - "fsl,imx53-usb", "fsl,imx27-usb"; + * - "fsl,imx6q-usb", "fsl,imx27-usb"; + * + * The FDT data for some SoCs contains the following properties, which we don't + * currently do anything with: + * - fsl,usbmisc = <&usbmisc 0>; + * - fsl,usbphy = <&usbphy0>; + * + * Some imx SoCs have FDT data related to USB PHY, some don't. We have separate + * usbphy drivers where needed; this data is mentioned here just to keep all the + * imx-FDT-usb-related info in one place. Here are the usbphy compat strings + * known to exist: + * - "nop-usbphy" + * - "usb-nop-xceiv"; + * - "fsl,imx23-usbphy" + * - "fsl,imx28-usbphy", "fsl,imx23-usbphy"; + * - "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + * + */ -/* i.MX515 have 4 EHCI inside USB core */ -/* TODO: we can get number of EHCIs by IRQ allocation */ -static struct resource_spec imx_ehci_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 0, RF_ACTIVE }, - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { SYS_RES_IRQ, 2, RF_ACTIVE }, - /* RF_OPTIONAL will allow to use driver for systems with 3 EHCIs */ - { SYS_RES_IRQ, 3, RF_ACTIVE | RF_OPTIONAL }, - { -1, 0 } +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-usb", 1}, + {"fsl,imx53-usb", 1}, + {"fsl,imx51-usb", 1}, + {"fsl,imx28-usb", 1}, + {"fsl,imx27-usb", 1}, + {"fsl,imx25-usb", 1}, + {"fsl,imx23-usb", 1}, + {NULL, 0}, }; -/* Forward declarations */ -static int fsl_ehci_attach(device_t self); -static int fsl_ehci_detach(device_t self); -static int fsl_ehci_probe(device_t self); - -static device_method_t ehci_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, fsl_ehci_probe), - DEVMETHOD(device_attach, fsl_ehci_attach), - DEVMETHOD(device_detach, fsl_ehci_detach), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - - /* Bus interface */ - DEVMETHOD(bus_print_child, bus_generic_print_child), - - { 0, 0 } -}; +/* + * Each EHCI device in the SoC has some SoC-specific per-device registers at an + * offset of 0, then the standard EHCI registers begin at an offset of 0x100. + */ +#define IMX_EHCI_REG_OFF 0x100 +#define IMX_EHCI_REG_SIZE 0x100 -/* kobj_class definition */ -static driver_t ehci_driver = { - "ehci", - ehci_methods, - sizeof(struct imx_ehci_softc) +struct imx_ehci_softc { + ehci_softc_t ehci_softc; + struct resource *ehci_mem_res; /* EHCI core regs. */ + struct resource *ehci_irq_res; /* EHCI core IRQ. */ }; -static devclass_t ehci_devclass; +static int +imx_ehci_probe(device_t dev) +{ -DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); -MODULE_DEPEND(ehci, usb, 1, 1, 1); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX integrated USB controller"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} -/* - * Public methods - */ static int -fsl_ehci_probe(device_t dev) +imx_ehci_detach(device_t dev) { + struct imx_ehci_softc *sc; + ehci_softc_t *esc; - if (ofw_bus_is_compatible(dev, "fsl,usb-4core") == 0) - return (ENXIO); + sc = device_get_softc(dev); - device_set_desc(dev, "Freescale integrated USB controller"); + esc = &sc->ehci_softc; - return (BUS_PROBE_DEFAULT); + if (esc->sc_bus.bdev != NULL) + device_delete_child(dev, esc->sc_bus.bdev); + if (esc->sc_flags & EHCI_SCFLG_DONEINIT) + ehci_detach(esc); + if (esc->sc_intr_hdl != NULL) + bus_teardown_intr(dev, esc->sc_irq_res, + esc->sc_intr_hdl); + if (sc->ehci_irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->ehci_irq_res); + if (sc->ehci_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, + sc->ehci_mem_res); + + usb_bus_mem_free_all(&esc->sc_bus, &ehci_iterate_hw_softc); + + /* During module unload there are lots of children leftover */ + device_delete_children(dev); + + return (0); } static int -fsl_ehci_attach(device_t self) +imx_ehci_attach(device_t dev) { struct imx_ehci_softc *sc; - bus_space_tag_t iot; ehci_softc_t *esc; - int err, i, rid; + int err, rid; + + sc = device_get_softc(dev); + esc = &sc->ehci_softc; + err = 0; - sc = device_get_softc(self); + /* Allocate bus_space resources. */ rid = 0; + sc->ehci_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->ehci_mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } - /* Allocate io resource for EHCI */ - if (bus_alloc_resources(self, imx_ehci_spec, sc->sc_res)) { - device_printf(self, "could not allocate resources\n"); - return (ENXIO); + rid = 0; + sc->ehci_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->ehci_irq_res == NULL) { + device_printf(dev, "Cannot allocate IRQ resources\n"); + err = ENXIO; + goto out; } - iot = rman_get_bustag(sc->sc_res[0]); - /* TODO: Power/clock enable */ - /* TODO: basic init */ + esc->sc_io_tag = rman_get_bustag(sc->ehci_mem_res); + esc->sc_bus.parent = dev; + esc->sc_bus.devices = esc->sc_devices; + esc->sc_bus.devices_max = EHCI_MAX_DEVICES; + + if (usb_bus_mem_alloc_all(&esc->sc_bus, USB_GET_DMA_TAG(dev), + &ehci_iterate_hw_softc) != 0) { + device_printf(dev, "usb_bus_mem_alloc_all() failed\n"); + err = ENOMEM; + goto out; + } - for (i = 0; i < FSL_EHCI_COUNT; i ++) { - /* No interrupt - no driver */ - if (sc->sc_res[1 + i] == NULL) - continue; - - esc = &sc->ehci[i]; - esc->sc_io_tag = iot; - esc->sc_bus.parent = self; - esc->sc_bus.devices = esc->sc_devices; - esc->sc_bus.devices_max = EHCI_MAX_DEVICES; - - if (usb_bus_mem_alloc_all(&esc->sc_bus, USB_GET_DMA_TAG(self), - &ehci_iterate_hw_softc)) - continue; - - /* - * Set handle to USB related registers subregion used by - * generic EHCI driver. - */ - err = bus_space_subregion(iot, - rman_get_bushandle(sc->sc_res[0]), - FSL_EHCI_REG_OFF + (i * FSL_EHCI_REG_STEP), - FSL_EHCI_REG_SIZE, &esc->sc_io_hdl); - if (err != 0) - continue; - - /* Setup interrupt handler */ - err = bus_setup_intr(self, sc->sc_res[1 + i], INTR_TYPE_BIO, - NULL, (driver_intr_t *)ehci_interrupt, esc, - &esc->sc_intr_hdl); - if (err) { - device_printf(self, "Could not setup irq, " - "for EHCI%d %d\n", i, err); - continue; - } - - /* Add USB device */ - esc->sc_bus.bdev = device_add_child(self, "usbus", -1); - if (!esc->sc_bus.bdev) { - device_printf(self, "Could not add USB device\n"); - err = bus_teardown_intr(self, esc->sc_irq_res, - esc->sc_intr_hdl); - if (err) - device_printf(self, "Could not tear down irq," - " %d\n", err); - continue; - } - device_set_ivars(esc->sc_bus.bdev, &esc->sc_bus); - - esc->sc_id_vendor = 0x1234; - strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor)); - - /* Set flags */ - esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; - - err = ehci_init(esc); - if (!err) { - esc->sc_flags |= EHCI_SCFLG_DONEINIT; - err = device_probe_and_attach(esc->sc_bus.bdev); - } else { - device_printf(self, "USB init failed err=%d\n", err); - - device_delete_child(self, esc->sc_bus.bdev); - esc->sc_bus.bdev = NULL; - - err = bus_teardown_intr(self, esc->sc_irq_res, - esc->sc_intr_hdl); - if (err) - device_printf(self, "Could not tear down irq," - " %d\n", err); + /* + * Set handle to USB related registers subregion used by + * generic EHCI driver. + */ + err = bus_space_subregion(esc->sc_io_tag, + rman_get_bushandle(sc->ehci_mem_res), + IMX_EHCI_REG_OFF, IMX_EHCI_REG_SIZE, &esc->sc_io_hdl); + if (err != 0) { + device_printf(dev, "bus_space_subregion() failed\n"); + err = ENXIO; + goto out; + } - continue; - } + /* Setup interrupt handler. */ + err = bus_setup_intr(dev, sc->ehci_irq_res, INTR_TYPE_BIO, NULL, + (driver_intr_t *)ehci_interrupt, esc, &esc->sc_intr_hdl); + if (err != 0) { + device_printf(dev, "Could not setup IRQ\n"); + goto out; } - return (0); -} -static int -fsl_ehci_detach(device_t self) -{ - struct imx_ehci_softc *sc; - ehci_softc_t *esc; - int err, i; + /* Turn on clocks. */ + imx_ccm_usb_enable(dev); + + /* Add USB bus device. */ + esc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (esc->sc_bus.bdev == NULL) { + device_printf(dev, "Could not add USB device\n"); + goto out; + } + device_set_ivars(esc->sc_bus.bdev, &esc->sc_bus); - sc = device_get_softc(self); + esc->sc_id_vendor = USB_VENDOR_FREESCALE; + strlcpy(esc->sc_vendor, "Freescale", sizeof(esc->sc_vendor)); - for (i = 0; i < FSL_EHCI_COUNT; i ++) { - esc = &sc->ehci[i]; - if (esc->sc_flags & EHCI_SCFLG_DONEINIT) - continue; - /* - * only call ehci_detach() after ehci_init() - */ - if (esc->sc_flags & EHCI_SCFLG_DONEINIT) { - ehci_detach(esc); - esc->sc_flags &= ~EHCI_SCFLG_DONEINIT; - } - - /* - * Disable interrupts that might have been switched on in - * ehci_init. - */ - if (esc->sc_io_tag && esc->sc_io_hdl) - bus_space_write_4(esc->sc_io_tag, esc->sc_io_hdl, - EHCI_USBINTR, 0); - - if (esc->sc_irq_res && esc->sc_intr_hdl) { - err = bus_teardown_intr(self, esc->sc_irq_res, - esc->sc_intr_hdl); - if (err) { - device_printf(self, "Could not tear down irq," - " %d\n", err); - return (err); - } - esc->sc_intr_hdl = NULL; - } - - if (esc->sc_bus.bdev) { - device_delete_child(self, esc->sc_bus.bdev); - esc->sc_bus.bdev = NULL; - } + /* Set flags that affect ehci_init() behavior. */ + esc->sc_flags |= EHCI_SCFLG_DONTRESET | EHCI_SCFLG_NORESTERM; + err = ehci_init(esc); + if (err != 0) { + device_printf(dev, "USB init failed, usb_err_t=%d\n", + err); + goto out; } + esc->sc_flags |= EHCI_SCFLG_DONEINIT; - /* During module unload there are lots of children leftover */ - device_delete_children(self); + /* Probe the bus. */ + err = device_probe_and_attach(esc->sc_bus.bdev); + if (err != 0) { + device_printf(dev, + "device_probe_and_attach() failed\n"); + goto out; + } - if (sc->sc_res[0]) - bus_release_resources(self, imx_ehci_spec, sc->sc_res); + err = 0; - return (0); +out: + + if (err != 0) + imx_ehci_detach(dev); + + return (err); } + +static device_method_t ehci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx_ehci_probe), + DEVMETHOD(device_attach, imx_ehci_attach), + DEVMETHOD(device_detach, imx_ehci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + /* Bus interface */ + DEVMETHOD(bus_print_child, bus_generic_print_child), + + DEVMETHOD_END +}; + +static driver_t ehci_driver = { + "ehci", + ehci_methods, + sizeof(struct imx_ehci_softc) +}; + +static devclass_t ehci_devclass; + +DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); +MODULE_DEPEND(ehci, usb, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:21:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D109A68A; Fri, 13 Dec 2013 22:21:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A2DBC13A6; Fri, 13 Dec 2013 22:21:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDML40M050860; Fri, 13 Dec 2013 22:21:04 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDML4ji050859; Fri, 13 Dec 2013 22:21:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132221.rBDML4ji050859@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:21:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259346 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:21:04 -0000 Author: ian Date: Fri Dec 13 22:21:04 2013 New Revision: 259346 URL: http://svnweb.freebsd.org/changeset/base/259346 Log: MFC r257407: Expand the list of compatible devices this driver works with. Increase the target frequency from 1 to 10 MHz because these SoCs are plenty fast enough to benefit from the extra event timer resolution. Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 22:19:21 2013 (r259345) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 22:21:04 2013 (r259346) @@ -95,7 +95,7 @@ struct imx_gpt_softc *imx_gpt_sc = NULL; static const int imx_gpt_delay_count = 78; /* Try to divide down an available fast clock to this frequency. */ -#define TARGET_FREQUENCY 1000000 +#define TARGET_FREQUENCY 10000000 /* Don't try to set an event timer period smaller than this. */ #define MIN_ET_PERIOD 10LLU @@ -107,16 +107,26 @@ static struct resource_spec imx_gpt_spec { -1, 0 } }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-gpt", 1}, + {"fsl,imx53-gpt", 1}, + {"fsl,imx51-gpt", 1}, + {"fsl,imx31-gpt", 1}, + {"fsl,imx27-gpt", 1}, + {"fsl,imx25-gpt", 1}, + {NULL, 0} +}; + static int imx_gpt_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "fsl,imx51-gpt") && - !ofw_bus_is_compatible(dev, "fsl,imx53-gpt")) - return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX GPT timer"); + return (BUS_PROBE_DEFAULT); + } - device_set_desc(dev, "Freescale i.MX GPT timer"); - return (BUS_PROBE_DEFAULT); + return (ENXIO); } static int @@ -142,10 +152,7 @@ imx_gpt_attach(device_t dev) * we're running on. Eventually we could allow selection from the fdt; * the code in this driver will cope with any clock frequency. */ - if (ofw_bus_is_compatible(dev, "fsl,imx6-gpt")) - sc->sc_clksrc = GPT_CR_CLKSRC_24M; - else - sc->sc_clksrc = GPT_CR_CLKSRC_IPG; + sc->sc_clksrc = GPT_CR_CLKSRC_IPG; ctlreg = 0; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:21:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42A3B7DF; Fri, 13 Dec 2013 22:21:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 235EB13AD; Fri, 13 Dec 2013 22:21:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMLoZ4051041; Fri, 13 Dec 2013 22:21:50 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMLna5051040; Fri, 13 Dec 2013 22:21:49 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132221.rBDMLna5051040@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259347 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:21:50 -0000 Author: ian Date: Fri Dec 13 22:21:49 2013 New Revision: 259347 URL: http://svnweb.freebsd.org/changeset/base/259347 Log: MFC r257413: Reset the timer interrupt status register at the top rather than bottom of the interrupt handler. If the event callback starts a new short timeout, the timer can fire before returning from the event callback, and clearing the interrupt status after that loses the interrupt and hangs until the counter wraps. Fixing all of this removes the need for the do-nothing loop at the top of the handler which really just waited for the counter to roll over and reach the one-shot count again. Also add a missing return(0) in the periodic timer start case. Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 22:21:04 2013 (r259346) +++ stable/10/sys/arm/freescale/imx/imx_gpt.c Fri Dec 13 22:21:49 2013 (r259347) @@ -277,14 +277,9 @@ imx_gpt_timer_start(struct eventtimer *e WRITE4(sc, IMX_GPT_OCR2, READ4(sc, IMX_GPT_CNT) + sc->sc_period); /* Enable compare register 2 Interrupt */ SET4(sc, IMX_GPT_IR, GPT_IR_OF2); + return (0); } else if (first != 0) { ticks = ((uint32_t)et->et_frequency * first) >> 32; - - /* - * TODO: setupt second compare reg with time which will save - * us in case correct one lost, f.e. if period to short and - * setup done later than counter reach target value. - */ /* Do not disturb, otherwise event will be lost */ spinlock_enter(); /* Set expected value */ @@ -293,7 +288,6 @@ imx_gpt_timer_start(struct eventtimer *e SET4(sc, IMX_GPT_IR, GPT_IR_OF1); /* Now everybody can relax */ spinlock_exit(); - return (0); } @@ -341,27 +335,32 @@ imx_gpt_intr(void *arg) sc = (struct imx_gpt_softc *)arg; - /* Sometime we not get staus bit when interrupt arrive. Cache? */ - while (!(status = READ4(sc, IMX_GPT_SR))) - ; + status = READ4(sc, IMX_GPT_SR); + + /* + * Clear interrupt status before invoking event callbacks. The callback + * often sets up a new one-shot timer event and if the interval is short + * enough it can fire before we get out of this function. If we cleared + * at the bottom we'd miss the interrupt and hang until the clock wraps. + */ + WRITE4(sc, IMX_GPT_SR, status); + /* Handle one-shot timer events. */ if (status & GPT_IR_OF1) { if (sc->et.et_active) { sc->et.et_event_cb(&sc->et, sc->et.et_arg); } } + + /* Handle periodic timer events. */ if (status & GPT_IR_OF2) { - if (sc->et.et_active) { + if (sc->et.et_active) sc->et.et_event_cb(&sc->et, sc->et.et_arg); - /* Set expected value */ + if (sc->sc_period != 0) WRITE4(sc, IMX_GPT_OCR2, READ4(sc, IMX_GPT_CNT) + sc->sc_period); - } } - /* ACK */ - WRITE4(sc, IMX_GPT_SR, status); - return (FILTER_HANDLED); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:22:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55ED1A04; Fri, 13 Dec 2013 22:22:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 418DD13B9; Fri, 13 Dec 2013 22:22:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMMtIV051365; Fri, 13 Dec 2013 22:22:55 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMMt7I051364; Fri, 13 Dec 2013 22:22:55 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132222.rBDMMt7I051364@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259348 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:22:55 -0000 Author: ian Date: Fri Dec 13 22:22:54 2013 New Revision: 259348 URL: http://svnweb.freebsd.org/changeset/base/259348 Log: MFC r257418: Don't iterate through the bits of the pending interrupt register if the whole register is zero. Most of the registers will be zero most of the time. Modified: stable/10/sys/arm/freescale/imx/tzic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/tzic.c ============================================================================== --- stable/10/sys/arm/freescale/imx/tzic.c Fri Dec 13 22:21:49 2013 (r259347) +++ stable/10/sys/arm/freescale/imx/tzic.c Fri Dec 13 22:22:54 2013 (r259348) @@ -163,7 +163,7 @@ arm_get_next_irq(int last_irq) for (i = 0; i < 4; i++) { pending = tzic_read_4(TZIC_PND(i)); - for (b = 0; b < 32; b++) + for (b = 0; pending != 0 && b < 32; b++) if (pending & (1 << b)) { return (i * 32 + b); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:24:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCA26B64; Fri, 13 Dec 2013 22:24:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C8B9E13C5; Fri, 13 Dec 2013 22:24:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMO05a051527; Fri, 13 Dec 2013 22:24:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMO0Tp051526; Fri, 13 Dec 2013 22:24:00 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132224.rBDMO0Tp051526@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259349 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:24:00 -0000 Author: ian Date: Fri Dec 13 22:24:00 2013 New Revision: 259349 URL: http://svnweb.freebsd.org/changeset/base/259349 Log: MFC r257419: Do not EOI an interrupt until the point after the filter handlers / before threaded handlers. Modified: stable/10/sys/arm/arm/gic.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/gic.c ============================================================================== --- stable/10/sys/arm/arm/gic.c Fri Dec 13 22:22:54 2013 (r259348) +++ stable/10/sys/arm/arm/gic.c Fri Dec 13 22:24:00 2013 (r259349) @@ -271,7 +271,6 @@ arm_get_next_irq(int last_irq) printf("Spurious interrupt detected [0x%08x]\n", active_irq); return -1; } - gic_c_write_4(GICC_EOIR, active_irq); return active_irq; } @@ -279,14 +278,15 @@ arm_get_next_irq(int last_irq) void arm_mask_irq(uintptr_t nb) { + gic_d_write_4(GICD_ICENABLER(nb >> 5), (1UL << (nb & 0x1F))); + gic_c_write_4(GICC_EOIR, nb); } void arm_unmask_irq(uintptr_t nb) { - gic_c_write_4(GICC_EOIR, nb); gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F))); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:25:21 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C9F9CB8; Fri, 13 Dec 2013 22:25:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EC58713D2; Fri, 13 Dec 2013 22:25:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMPK5L051745; Fri, 13 Dec 2013 22:25:20 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMPKVu051744; Fri, 13 Dec 2013 22:25:20 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201312132225.rBDMPKVu051744@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 13 Dec 2013 22:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259350 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:25:21 -0000 Author: gibbs Date: Fri Dec 13 22:25:20 2013 New Revision: 259350 URL: http://svnweb.freebsd.org/changeset/base/259350 Log: Officially record my mentees. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri Dec 13 22:24:00 2013 (r259349) +++ svnadmin/conf/mentors Fri Dec 13 22:25:20 2013 (r259350) @@ -14,6 +14,7 @@ achim scottl Co-mentor: emaste agc scottl Co-mentor: emax benl philip Co-mentor: simon carl jimharris +cherry gibbs cy andre Co-mentor: glebius edavis davidch eri mlaier Co-mentor: thompsa @@ -28,5 +29,6 @@ miwi rwatson monthadar adrian odeds jhb Co-mentor: alfred peterj jhb Co-mentor: grog +royger gibbs snb dwmalone versus gavin Co-mentor: fjoe From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:26:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D52DDF4; Fri, 13 Dec 2013 22:26:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F29D613E0; Fri, 13 Dec 2013 22:26:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMQAHL051872; Fri, 13 Dec 2013 22:26:10 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMQA0m051871; Fri, 13 Dec 2013 22:26:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132226.rBDMQA0m051871@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259351 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:26:11 -0000 Author: ian Date: Fri Dec 13 22:26:10 2013 New Revision: 259351 URL: http://svnweb.freebsd.org/changeset/base/259351 Log: MFC r257452: Add support for the USB PHY on imx6 SoCs. Added: stable/10/sys/arm/freescale/imx/imx6_usbphy.c - copied unchanged from r257452, head/sys/arm/freescale/imx/imx6_usbphy.c Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/freescale/imx/imx6_usbphy.c (from r257452, head/sys/arm/freescale/imx/imx6_usbphy.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_usbphy.c Fri Dec 13 22:26:10 2013 (r259351, copy of r257452, head/sys/arm/freescale/imx/imx6_usbphy.c) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * USBPHY driver for Freescale i.MX6 family of SoCs. + */ + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include + +/* + * Hardware register defines. + */ +#define PWD_REG 0x0000 +#define CTRL_STATUS_REG 0x0030 +#define CTRL_SET_REG 0x0034 +#define CTRL_CLR_REG 0x0038 +#define CTRL_TOGGLE_REG 0x003c +#define CTRL_SFTRST (1 << 31) +#define CTRL_CLKGATE (1 << 30) +#define CTRL_ENUTMILEVEL3 (1 << 15) +#define CTRL_ENUTMILEVEL2 (1 << 14) + +struct usbphy_softc { + device_t dev; + struct resource *mem_res; + u_int phy_num; +}; + +static int +usbphy_detach(device_t dev) +{ + struct usbphy_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +usbphy_attach(device_t dev) +{ + struct usbphy_softc *sc; + int err, regoff, rid; + + sc = device_get_softc(dev); + err = 0; + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + /* + * XXX Totally lame way to get the unit number (but not quite as lame as + * adding an ad-hoc property to the fdt data). This works as long as + * this driver is used for imx6 only. + */ + const uint32_t PWD_PHY1_REG_PHYSADDR = 0x020c9000; + if (BUS_SPACE_PHYSADDR(sc->mem_res, 0) == PWD_PHY1_REG_PHYSADDR) { + sc->phy_num = 0; + regoff = 0; + } else { + sc->phy_num = 1; + regoff = 0x60; + } + + /* + * Based on a note in the u-boot source code, disable charger detection + * to avoid degrading the differential signaling on the DP line. Note + * that this disables (by design) both charger detection and contact + * detection, because of the screwball mix of active-high and active-low + * bits in this register. + */ + imx6_anatop_write_4(IMX6_ANALOG_USB1_CHRG_DETECT + regoff, + IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE | + IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG); + + imx6_anatop_write_4(IMX6_ANALOG_USB1_CHRG_DETECT + regoff, + IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE | + IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG); + + /* XXX Configure the overcurrent detection here. */ + + /* + * Turn on the phy clocks. + */ + imx_ccm_usbphy_enable(dev); + + /* + * Set the software reset bit, then clear both it and the clock gate bit + * to bring the device out of reset with the clock running. + */ + bus_write_4(sc->mem_res, CTRL_SET_REG, CTRL_SFTRST); + bus_write_4(sc->mem_res, CTRL_CLR_REG, CTRL_SFTRST | CTRL_CLKGATE); + + /* Power up: clear all bits in the powerdown register. */ + bus_write_4(sc->mem_res, PWD_REG, 0); + + err = 0; + +out: + + if (err != 0) + usbphy_detach(dev); + + return (err); +} + +static int +usbphy_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "fsl,imx6q-usbphy") == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 USB PHY"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t usbphy_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, usbphy_probe), + DEVMETHOD(device_attach, usbphy_attach), + DEVMETHOD(device_detach, usbphy_detach), + + DEVMETHOD_END +}; + +static driver_t usbphy_driver = { + "usbphy", + usbphy_methods, + sizeof(struct usbphy_softc) +}; + +static devclass_t usbphy_devclass; + +DRIVER_MODULE(usbphy, simplebus, usbphy_driver, usbphy_devclass, 0, 0); + From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:27:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36D95B3; Fri, 13 Dec 2013 22:27:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 20B4F1431; Fri, 13 Dec 2013 22:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMRSAi052136; Fri, 13 Dec 2013 22:27:28 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMRR6t052131; Fri, 13 Dec 2013 22:27:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132227.rBDMRR6t052131@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259352 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:27:28 -0000 Author: ian Date: Fri Dec 13 22:27:26 2013 New Revision: 259352 URL: http://svnweb.freebsd.org/changeset/base/259352 Log: MFC r257453: Add stubbed-out imx6 support for clocks and power management. Added: stable/10/sys/arm/freescale/imx/imx6_anatop.c - copied unchanged from r257453, head/sys/arm/freescale/imx/imx6_anatop.c stable/10/sys/arm/freescale/imx/imx6_anatopreg.h - copied unchanged from r257453, head/sys/arm/freescale/imx/imx6_anatopreg.h stable/10/sys/arm/freescale/imx/imx6_anatopvar.h - copied unchanged from r257453, head/sys/arm/freescale/imx/imx6_anatopvar.h stable/10/sys/arm/freescale/imx/imx6_ccm.c - copied unchanged from r257453, head/sys/arm/freescale/imx/imx6_ccm.c stable/10/sys/arm/freescale/imx/imx6_ccmreg.h - copied unchanged from r257453, head/sys/arm/freescale/imx/imx6_ccmreg.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/freescale/imx/imx6_anatop.c (from r257453, head/sys/arm/freescale/imx/imx6_anatop.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Fri Dec 13 22:27:26 2013 (r259352, copy of r257453, head/sys/arm/freescale/imx/imx6_anatop.c) @@ -0,0 +1,155 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Analog PLL and power regulator driver for Freescale i.MX6 family of SoCs. + * + * We don't really do anything with analog PLLs, but the registers for + * controlling them belong to the same block as the power regulator registers. + * Since the newbus hierarchy makes it hard for anyone other than us to get at + * them, we just export a couple public functions to allow the imx6 CCM clock + * driver to read and write those registers. + * + * We also don't do anything about power regulation yet, but when the need + * arises, this would be the place for that code to live. + * + * I have no idea where the "anatop" name comes from. It's in the standard DTS + * source describing i.MX6 SoCs, and in the linux and u-boot code which comes + * from Freescale, but it's not in the SoC manual. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + +struct imx6_anatop_softc { + device_t dev; + struct resource *mem_res; +}; + +static struct imx6_anatop_softc *imx6_anatop_sc; + +uint32_t +imx6_anatop_read_4(bus_size_t offset) +{ + + return (bus_read_4(imx6_anatop_sc->mem_res, offset)); +} + +void +imx6_anatop_write_4(bus_size_t offset, uint32_t value) +{ + + bus_write_4(imx6_anatop_sc->mem_res, offset, value); +} + +static int +imx6_anatop_detach(device_t dev) +{ + struct imx6_anatop_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +imx6_anatop_attach(device_t dev) +{ + struct imx6_anatop_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + imx6_anatop_sc = sc; + err = 0; + +out: + + if (err != 0) + imx6_anatop_detach(dev); + + return (err); +} + +static int +imx6_anatop_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "fsl,imx6q-anatop") == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 Analog PLLs and Power"); + + return (BUS_PROBE_DEFAULT); +} + +static device_method_t imx6_anatop_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx6_anatop_probe), + DEVMETHOD(device_attach, imx6_anatop_attach), + DEVMETHOD(device_detach, imx6_anatop_detach), + + DEVMETHOD_END +}; + +static driver_t imx6_anatop_driver = { + "imx6_anatop", + imx6_anatop_methods, + sizeof(struct imx6_anatop_softc) +}; + +static devclass_t imx6_anatop_devclass; + +DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, imx6_anatop_devclass, 0, 0); + Copied: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h (from r257453, head/sys/arm/freescale/imx/imx6_anatopreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Fri Dec 13 22:27:26 2013 (r259352, copy of r257453, head/sys/arm/freescale/imx/imx6_anatopreg.h) @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * 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$ + */ + +#ifndef IMX6_ANATOPREG_H +#define IMX6_ANATOPREG_H + +#define IMX6_ANALOG_CCM_PLL_ARM 0x000 +#define IMX6_ANALOG_CCM_PLL_ARM_SET 0x004 +#define IMX6_ANALOG_CCM_PLL_ARM_CLR 0x008 +#define IMX6_ANALOG_CCM_PLL_ARM_TOG 0x00C +#define IMX6_ANALOG_CCM_PLL_USB1 0x010 +#define IMX6_ANALOG_CCM_PLL_USB1_SET 0x014 +#define IMX6_ANALOG_CCM_PLL_USB1_CLR 0x018 +#define IMX6_ANALOG_CCM_PLL_USB1_TOG 0x01C +#define IMX6_ANALOG_CCM_PLL_USB_LOCK (1 << 31) +#define IMX6_ANALOG_CCM_PLL_USB_BYPASS (1 << 16) +#define IMX6_ANALOG_CCM_PLL_USB_ENABLE (1 << 13) +#define IMX6_ANALOG_CCM_PLL_USB_POWER (1 << 12) +#define IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS (1 << 6) +#define IMX6_ANALOG_CCM_PLL_USB2 0x020 +#define IMX6_ANALOG_CCM_PLL_USB2_SET 0x024 +#define IMX6_ANALOG_CCM_PLL_USB2_CLR 0x028 +#define IMX6_ANALOG_CCM_PLL_USB2_TOG 0x02C +#define IMX6_ANALOG_CCM_PLL_SYS 0x030 +#define IMX6_ANALOG_CCM_PLL_SYS_SET 0x034 +#define IMX6_ANALOG_CCM_PLL_SYS_CLR 0x038 +#define IMX6_ANALOG_CCM_PLL_SYS_TOG 0x03C +#define IMX6_ANALOG_CCM_PLL_SYS_SS 0x040 +#define IMX6_ANALOG_CCM_PLL_SYS_NUM 0x050 +#define IMX6_ANALOG_CCM_PLL_SYS_DENOM 0x060 +#define IMX6_ANALOG_CCM_PLL_AUDIO 0x070 +#define IMX6_ANALOG_CCM_PLL_AUDIO_SET 0x074 +#define IMX6_ANALOG_CCM_PLL_AUDIO_CLR 0x078 +#define IMX6_ANALOG_CCM_PLL_AUDIO_TOG 0x07C +#define IMX6_ANALOG_CCM_PLL_AUDIO_NUM 0x080 +#define IMX6_ANALOG_CCM_PLL_AUDIO_DENOM 0x090 +#define IMX6_ANALOG_CCM_PLL_VIDEO 0x0A0 +#define IMX6_ANALOG_CCM_PLL_VIDEO_SET 0x0A4 +#define IMX6_ANALOG_CCM_PLL_VIDEO_CLR 0x0A8 +#define IMX6_ANALOG_CCM_PLL_VIDEO_TOG 0x0AC +#define IMX6_ANALOG_CCM_PLL_VIDEO_NUM 0x0B0 +#define IMX6_ANALOG_CCM_PLL_VIDEO_DENOM 0x0C0 +#define IMX6_ANALOG_CCM_PLL_MLB 0x0D0 +#define IMX6_ANALOG_CCM_PLL_MLB_SET 0x0D4 +#define IMX6_ANALOG_CCM_PLL_MLB_CLR 0x0D8 +#define IMX6_ANALOG_CCM_PLL_MLB_TOG 0x0DC +#define IMX6_ANALOG_CCM_PLL_ENET 0x0E0 +#define IMX6_ANALOG_CCM_PLL_ENET_SET 0x0E4 +#define IMX6_ANALOG_CCM_PLL_ENET_CLR 0x0E8 +#define IMX6_ANALOG_CCM_PLL_ENET_TOG 0x0EC +#define IMX6_ANALOG_CCM_PFD_480 0x0F0 +#define IMX6_ANALOG_CCM_PFD_480_SET 0x0F4 +#define IMX6_ANALOG_CCM_PFD_480_CLR 0x0F8 +#define IMX6_ANALOG_CCM_PFD_480_TOG 0x0FC +#define IMX6_ANALOG_CCM_PFD_528 0x100 +#define IMX6_ANALOG_CCM_PFD_528_SET 0x104 +#define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 +#define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C +#define IMX6_ANALOG_CCM_MISC0 0x150 +#define IMX6_ANALOG_CCM_MISC0_SET 0x154 +#define IMX6_ANALOG_CCM_MISC0_CLR 0x158 +#define IMX6_ANALOG_CCM_MISC0_TOG 0x15C +#define IMX6_ANALOG_CCM_MISC2 0x170 +#define IMX6_ANALOG_CCM_MISC2_SET 0x174 +#define IMX6_ANALOG_CCM_MISC2_CLR 0x178 +#define IMX6_ANALOG_CCM_MISC2_TOG 0x17C + +#define IMX6_ANALOG_USB1_VBUS_DETECT 0x1A0 +#define IMX6_ANALOG_USB1_VBUS_DETECT_SET 0x1A4 +#define IMX6_ANALOG_USB1_VBUS_DETECT_CLR 0x1A8 +#define IMX6_ANALOG_USB1_VBUS_DETECT_TOG 0x1AC +#define IMX6_ANALOG_USB1_CHRG_DETECT 0x1B0 +#define IMX6_ANALOG_USB1_CHRG_DETECT_SET 0x1B4 +#define IMX6_ANALOG_USB1_CHRG_DETECT_CLR 0x1B8 +#define IMX6_ANALOG_USB1_CHRG_DETECT_TOG 0x1BC +#define IMX6_ANALOG_USB_CHRG_DETECT_N_ENABLE (1 << 20) /* EN_B */ +#define IMX6_ANALOG_USB_CHRG_DETECT_N_CHK_CHRG (1 << 19) /* CHK_CHRG_B */ +#define IMX6_ANALOG_USB_CHRG_DETECT_CHK_CONTACT (1 << 18) +#define IMX6_ANALOG_USB1_VBUS_DETECT_STAT 0x1C0 +#define IMX6_ANALOG_USB1_CHRG_DETECT_STAT 0x1D0 +#define IMX6_ANALOG_USB1_MISC 0x1F0 +#define IMX6_ANALOG_USB1_MISC_SET 0x1F4 +#define IMX6_ANALOG_USB1_MISC_CLR 0x1F8 +#define IMX6_ANALOG_USB1_MISC_TOG 0x1FC +#define IMX6_ANALOG_USB2_VBUS_DETECT 0x200 +#define IMX6_ANALOG_USB2_VBUS_DETECT_SET 0x204 +#define IMX6_ANALOG_USB2_VBUS_DETECT_CLR 0x208 +#define IMX6_ANALOG_USB2_VBUS_DETECT_TOG 0x20C +#define IMX6_ANALOG_USB2_CHRG_DETECT 0x210 +#define IMX6_ANALOG_USB2_CHRG_DETECT_SET 0x214 +#define IMX6_ANALOG_USB2_CHRG_DETECT_CLR 0x218 +#define IMX6_ANALOG_USB2_CHRG_DETECT_TOG 0x21C +#define IMX6_ANALOG_USB2_VBUS_DETECT_STAT 0x220 +#define IMX6_ANALOG_USB2_CHRG_DETECT_STAT 0x230 +#define IMX6_ANALOG_USB2_MISC 0x250 +#define IMX6_ANALOG_USB2_MISC_SET 0x254 +#define IMX6_ANALOG_USB2_MISC_CLR 0x258 +#define IMX6_ANALOG_USB2_MISC_TOG 0x25C +#define IMX6_ANALOG_DIGPROG 0x260 + + + +#endif Copied: stable/10/sys/arm/freescale/imx/imx6_anatopvar.h (from r257453, head/sys/arm/freescale/imx/imx6_anatopvar.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_anatopvar.h Fri Dec 13 22:27:26 2013 (r259352, copy of r257453, head/sys/arm/freescale/imx/imx6_anatopvar.h) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * 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$ + */ + +#ifndef IMX6_ANATOPVAR_H +#define IMX6_ANATOPVAR_H + +/* + * All registers controlling various analog aspects of the SoC (such as PLLs or + * voltage regulators or USB VBUS detection) are gathered together under the + * anatop device (because of newbus hierarchical resource management), but other + * drivers such as CMM or USBPHY need access to these registers. These + * functions let them have at the hardware directly. No effort is made by these + * functions to mediate concurrent access. + */ +uint32_t imx6_anatop_read_4(bus_size_t _offset); +void imx6_anatop_write_4(bus_size_t _offset, uint32_t _value); + +#endif Copied: stable/10/sys/arm/freescale/imx/imx6_ccm.c (from r257453, head/sys/arm/freescale/imx/imx6_ccm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_ccm.c Fri Dec 13 22:27:26 2013 (r259352, copy of r257453, head/sys/arm/freescale/imx/imx6_ccm.c) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Clocks and power control driver for Freescale i.MX6 family of SoCs. + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include + + +/* XXX temp kludge for imx51_get_clock. */ +#include +#include + +struct ccm_softc { + device_t dev; + struct resource *mem_res; +}; + +static struct ccm_softc *ccm_sc; + +static inline uint32_t +RD4(struct ccm_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct ccm_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +static int +ccm_detach(device_t dev) +{ + struct ccm_softc *sc; + + sc = device_get_softc(dev); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (0); +} + +static int +ccm_attach(device_t dev) +{ + struct ccm_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + err = 0; + + /* Allocate bus_space resources. */ + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resources\n"); + err = ENXIO; + goto out; + } + + ccm_sc = sc; + err = 0; + +out: + + if (err != 0) + ccm_detach(dev); + + return (err); +} + +static int +ccm_probe(device_t dev) +{ + + if (ofw_bus_is_compatible(dev, "fsl,imx6q-ccm") == 0) + return (ENXIO); + + device_set_desc(dev, "Freescale i.MX6 Clock Control Module"); + + return (BUS_PROBE_DEFAULT); +} + +void +imx_ccm_usb_enable(device_t _usbdev) +{ + + /* + * For imx6, the USBOH3 clock gate is bits 0-1 of CCGR6, so no need for + * shifting and masking here, just set the low-order two bits to ALWAYS. + */ + WR4(ccm_sc, CCM_CCGR6, RD4(ccm_sc, CCM_CCGR6) | CCGR_CLK_MODE_ALWAYS); +} + +void +imx_ccm_usbphy_enable(device_t _phydev) +{ + /* + * XXX Which unit? + * Right now it's not clear how to figure from fdt data which phy unit + * we're supposed to operate on. Until this is worked out, just enable + * both PHYs. + */ +#if 0 + int phy_num, regoff; + + phy_num = 0; /* XXX */ + + switch (phy_num) { + case 0: + regoff = 0; + break; + case 1: + regoff = 0x10; + break; + default: + device_printf(ccm_sc->dev, "Bad PHY number %u,\n", + phy_num); + return; + } + + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_USB1 + regoff, + IMX6_ANALOG_CCM_PLL_USB_ENABLE | + IMX6_ANALOG_CCM_PLL_USB_POWER | + IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS); +#else + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_USB1 + 0, + IMX6_ANALOG_CCM_PLL_USB_ENABLE | + IMX6_ANALOG_CCM_PLL_USB_POWER | + IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS); + + imx6_anatop_write_4(IMX6_ANALOG_CCM_PLL_USB1 + 0x10, + IMX6_ANALOG_CCM_PLL_USB_ENABLE | + IMX6_ANALOG_CCM_PLL_USB_POWER | + IMX6_ANALOG_CCM_PLL_USB_EN_USB_CLKS); +#endif +} + + + + + +// XXX Fix this. This has to be here for other code to link, +// but it doesn't have to return anything useful for imx6 right now. +u_int +imx51_get_clock(enum imx51_clock clk) +{ + switch (clk) + { + case IMX51CLK_IPG_CLK_ROOT: + return 66000000; + default: + printf("imx51_get_clock() on imx6 doesn't know about clock %d\n", clk); + break; + } + return 0; +} + +static device_method_t ccm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ccm_probe), + DEVMETHOD(device_attach, ccm_attach), + DEVMETHOD(device_detach, ccm_detach), + + DEVMETHOD_END +}; + +static driver_t ccm_driver = { + "ccm", + ccm_methods, + sizeof(struct ccm_softc) +}; + +static devclass_t ccm_devclass; + +DRIVER_MODULE(ccm, simplebus, ccm_driver, ccm_devclass, 0, 0); + Copied: stable/10/sys/arm/freescale/imx/imx6_ccmreg.h (from r257453, head/sys/arm/freescale/imx/imx6_ccmreg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_ccmreg.h Fri Dec 13 22:27:26 2013 (r259352, copy of r257453, head/sys/arm/freescale/imx/imx6_ccmreg.h) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * 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$ + */ + +#ifndef IMX6_CCMREG_H +#define IMX6_CCMREG_H + +#define CCM_CCGR1 0x06C +#define CCM_CCGR2 0x070 +#define CCM_CCGR3 0x074 +#define CCM_CCGR4 0x078 +#define CCM_CCGR5 0x07C +#define CCM_CCGR6 0x080 +#define CCM_CMEOR 0x088 + + +#endif From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:28:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D508264; Fri, 13 Dec 2013 22:28:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 67A9D1457; Fri, 13 Dec 2013 22:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMSJI0052275; Fri, 13 Dec 2013 22:28:19 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMSJqf052274; Fri, 13 Dec 2013 22:28:19 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132228.rBDMSJqf052274@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259353 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:28:19 -0000 Author: ian Date: Fri Dec 13 22:28:19 2013 New Revision: 259353 URL: http://svnweb.freebsd.org/changeset/base/259353 Log: MFC r257454: Add sdhci driver glue for imx family SoCs. Added: stable/10/sys/arm/freescale/imx/imx_sdhci.c - copied unchanged from r257454, head/sys/arm/freescale/imx/imx_sdhci.c Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/freescale/imx/imx_sdhci.c (from r257454, head/sys/arm/freescale/imx/imx_sdhci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Fri Dec 13 22:28:19 2013 (r259353, copy of r257454, head/sys/arm/freescale/imx/imx_sdhci.c) @@ -0,0 +1,704 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +/* + * SDHCI driver glue for Freescale i.MX SoC family. + * + * This supports both eSDHC (earlier SoCs) and uSDHC (more recent SoCs). + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + +#include +#include "sdhci_if.h" + +struct imx_sdhci_softc { + device_t dev; + struct resource * mem_res; + struct resource * irq_res; + void * intr_cookie; + struct sdhci_slot slot; + uint32_t baseclk_hz; + uint32_t sdclockreg_freq_bits; + uint32_t cmd_and_mode; + uint32_t r1bfix_intmask; + uint8_t r1bfix_type; + uint8_t hwtype; +}; + +#define R1BFIX_NONE 0 /* No fix needed at next interrupt. */ +#define R1BFIX_NODATA 1 /* Synthesize DATA_END for R1B w/o data. */ +#define R1BFIX_AC12 2 /* Wait for busy after auto command 12. */ + +#define HWTYPE_NONE 0 /* Hardware not recognized/supported. */ +#define HWTYPE_ESDHC 1 /* imx5x and earlier. */ +#define HWTYPE_USDHC 2 /* imx6. */ + +#define SDHC_WTMK_LVL 0x44 /* Watermark Level register. */ +#define USDHC_MIX_CONTROL 0x48 /* Mix(ed) Control register. */ +#define SDHC_VEND_SPEC 0xC0 /* Vendor-specific register. */ +#define SDHC_VEND_FRC_SDCLK_ON (1 << 8) +#define SDHC_VEND_IPGEN (1 << 11) +#define SDHC_VEND_HCKEN (1 << 12) +#define SDHC_VEND_PEREN (1 << 13) + +#define SDHC_PROT_CTRL 0x28 +#define SDHC_PROT_LED (1 << 0) +#define SDHC_PROT_WIDTH_1BIT (0 << 1) +#define SDHC_PROT_WIDTH_4BIT (1 << 1) +#define SDHC_PROT_WIDTH_8BIT (2 << 1) +#define SDHC_PROT_WIDTH_MASK (3 << 1) +#define SDHC_PROT_D3CD (1 << 3) +#define SDHC_PROT_EMODE_BIG (0 << 4) +#define SDHC_PROT_EMODE_HALF (1 << 4) +#define SDHC_PROT_EMODE_LITTLE (2 << 4) +#define SDHC_PROT_EMODE_MASK (3 << 4) +#define SDHC_PROT_SDMA (0 << 8) +#define SDHC_PROT_ADMA1 (1 << 8) +#define SDHC_PROT_ADMA2 (2 << 8) +#define SDHC_PROT_ADMA264 (3 << 8) +#define SDHC_PROT_DMA_MASK (3 << 8) +#define SDHC_PROT_CDTL (1 << 6) +#define SDHC_PROT_CDSS (1 << 7) + +#define SDHC_CLK_IPGEN (1 << 0) +#define SDHC_CLK_HCKEN (1 << 1) +#define SDHC_CLK_PEREN (1 << 2) +#define SDHC_CLK_DIVISOR_MASK 0x000000f0 +#define SDHC_CLK_DIVISOR_SHIFT 4 +#define SDHC_CLK_PRESCALE_MASK 0x0000ff00 +#define SDHC_CLK_PRESCALE_SHIFT 8 + +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-usdhc", HWTYPE_USDHC}, + {"fsl,imx6sl-usdhc", HWTYPE_USDHC}, + {"fsl,imx53-esdhc", HWTYPE_ESDHC}, + {"fsl,imx51-esdhc", HWTYPE_ESDHC}, + {NULL, HWTYPE_NONE}, +};; + +static void imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable); + +static inline uint32_t +RD4(struct imx_sdhci_softc *sc, bus_size_t off) +{ + + return (bus_read_4(sc->mem_res, off)); +} + +static inline void +WR4(struct imx_sdhci_softc *sc, bus_size_t off, uint32_t val) +{ + + bus_write_4(sc->mem_res, off, val); +} + +static uint8_t +imx_sdhci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32, wrk32; + + /* + * Most of the things in the standard host control register are in the + * hardware's wider protocol control register, but some of the bits are + * moved around. + */ + if (off == SDHCI_HOST_CONTROL) { + wrk32 = RD4(sc, SDHC_PROT_CTRL); + val32 = wrk32 & (SDHCI_CTRL_LED | SDHCI_CTRL_CARD_DET | + SDHCI_CTRL_FORCE_CARD); + switch (wrk32 & SDHC_PROT_WIDTH_MASK) { + case SDHC_PROT_WIDTH_1BIT: + /* Value is already 0. */ + break; + case SDHC_PROT_WIDTH_4BIT: + val32 |= SDHCI_CTRL_4BITBUS; + break; + case SDHC_PROT_WIDTH_8BIT: + val32 |= SDHCI_CTRL_8BITBUS; + break; + } + switch (wrk32 & SDHC_PROT_DMA_MASK) { + case SDHC_PROT_SDMA: + /* Value is already 0. */ + break; + case SDHC_PROT_ADMA1: + /* This value is deprecated, should never appear. */ + break; + case SDHC_PROT_ADMA2: + val32 |= SDHCI_CTRL_ADMA2; + break; + case SDHC_PROT_ADMA264: + val32 |= SDHCI_CTRL_ADMA264; + break; + } + return val32; + } + + /* + * XXX can't find the bus power on/off knob. For now we have to say the + * power is always on and always set to the same voltage. + */ + if (off == SDHCI_POWER_CONTROL) { + return (SDHCI_POWER_ON | SDHCI_POWER_300); + } + + + return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xff); +} + +static uint16_t +imx_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32, wrk32; + + if (sc->hwtype == HWTYPE_USDHC) { + /* + * The USDHC hardware has nothing in the version register, but + * it's v3 compatible with all our translation code. + */ + if (off == SDHCI_HOST_VERSION) { + return (SDHCI_SPEC_300 << SDHCI_SPEC_VER_SHIFT); + } + /* + * The USDHC hardware moved the transfer mode bits to the mixed + * control register, fetch them from there. + */ + if (off == SDHCI_TRANSFER_MODE) + return (RD4(sc, USDHC_MIX_CONTROL) & 0x37); + + } else if (sc->hwtype == HWTYPE_ESDHC) { + + /* + * The ESDHC hardware has the typical 32-bit combined "command + * and mode" register that we have to cache so that command + * isn't written until after mode. On a read, just retrieve the + * cached values last written. + */ + if (off == SDHCI_TRANSFER_MODE) { + return (sc->cmd_and_mode >> 16); + } else if (off == SDHCI_COMMAND_FLAGS) { + return (sc->cmd_and_mode & 0x0000ffff); + } + } + + /* + * This hardware only manages one slot. Synthesize a slot interrupt + * status register... if there are any enabled interrupts active they + * must be coming from our one and only slot. + */ + if (off == SDHCI_SLOT_INT_STATUS) { + val32 = RD4(sc, SDHCI_INT_STATUS); + val32 &= RD4(sc, SDHCI_SIGNAL_ENABLE); + return (val32 ? 1 : 0); + } + + /* + * The clock enable bit is in the vendor register and the clock-stable + * bit is in the present state register. Transcribe them as if they + * were in the clock control register where they should be. + * XXX Is it important that we distinguish between "internal" and "card" + * clocks? Probably not; transcribe the card clock status to both bits. + */ + if (off == SDHCI_CLOCK_CONTROL) { + val32 = 0; + wrk32 = RD4(sc, SDHC_VEND_SPEC); + if (wrk32 & SDHC_VEND_FRC_SDCLK_ON) + val32 |= SDHCI_CLOCK_INT_EN | SDHCI_CLOCK_CARD_EN; + wrk32 = RD4(sc, SDHCI_PRESENT_STATE); + if (wrk32 & 0x08) + val32 |= SDHCI_CLOCK_INT_STABLE; + val32 |= sc->sdclockreg_freq_bits; + return (val32); + } + + return ((RD4(sc, off & ~3) >> (off & 3) * 8) & 0xffff); +} + +static uint32_t +imx_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + /* + * The hardware leaves the base clock frequency out of the capabilities + * register; fill it in. The timeout clock is the same as the active + * output sdclock; we indicate that with a quirk setting so don't + * populate the timeout frequency bits. + * + * XXX Turn off (for now) features the hardware can do but this driver + * doesn't yet handle (1.8v, suspend/resume, etc). + */ + if (off == SDHCI_CAPABILITIES) { + val32 = RD4(sc, off); + val32 &= ~SDHCI_CAN_VDD_180; + val32 &= ~SDHCI_CAN_DO_SUSPEND; + val32 |= SDHCI_CAN_DO_8BITBUS; + val32 |= (sc->baseclk_hz / 1000000) << SDHCI_CLOCK_BASE_SHIFT; + return (val32); + } + + val32 = RD4(sc, off); + + /* + * imx_sdhci_intr() can synthesize a DATA_END interrupt following a + * command with an R1B response, mix it into the hardware status. + */ + if (off == SDHCI_INT_STATUS) { + val32 |= sc->r1bfix_intmask; + } + + return val32; +} + +static void +imx_sdhci_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + + bus_read_multi_4(sc->mem_res, off, data, count); +} + +static void +imx_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + /* + * Most of the things in the standard host control register are in the + * hardware's wider protocol control register, but some of the bits are + * moved around. + */ + if (off == SDHCI_HOST_CONTROL) { + val32 = RD4(sc, SDHC_PROT_CTRL); + val32 &= ~(SDHC_PROT_LED | SDHC_PROT_DMA_MASK | + SDHC_PROT_WIDTH_MASK | SDHC_PROT_CDTL | SDHC_PROT_CDSS); + val32 |= (val & SDHCI_CTRL_LED); + if (val & SDHCI_CTRL_8BITBUS) + val32 |= SDHC_PROT_WIDTH_8BIT; + else + val32 |= (val & SDHCI_CTRL_4BITBUS); + val32 |= (val & (SDHCI_CTRL_SDMA | SDHCI_CTRL_ADMA2)) << 4; + val32 |= (val & (SDHCI_CTRL_CARD_DET | SDHCI_CTRL_FORCE_CARD)); + WR4(sc, SDHC_PROT_CTRL, val32); + return; + } + + /* XXX I can't find the bus power on/off knob; do nothing. */ + if (off == SDHCI_POWER_CONTROL) { + return; + } + + val32 = RD4(sc, off & ~3); + val32 &= ~(0xff << (off & 3) * 8); + val32 |= (val << (off & 3) * 8); + + WR4(sc, off & ~3, val32); +} + +static void +imx_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32; + + /* The USDHC hardware moved the transfer mode bits to mixed control. */ + if (sc->hwtype == HWTYPE_USDHC) { + if (off == SDHCI_TRANSFER_MODE) { + val32 = RD4(sc, USDHC_MIX_CONTROL); + val32 &= ~0x3f; + val32 |= val & 0x37; + // XXX acmd23 not supported here (or by sdhci driver) + WR4(sc, USDHC_MIX_CONTROL, val32); + return; + } + } + + /* + * The clock control stuff is complex enough to have its own routine + * that can both change speeds and en/disable the clock output. Also, + * save the register bits in SDHCI format so that we can play them back + * in the read2 routine without complex decoding. + */ + if (off == SDHCI_CLOCK_CONTROL) { + sc->sdclockreg_freq_bits = val & 0xffc0; + if (val & SDHCI_CLOCK_CARD_EN) { + imx_sdhc_set_clock(sc, true); + } else { + imx_sdhc_set_clock(sc, false); + } + } + + /* + * Figure out whether we need to check the DAT0 line for busy status at + * interrupt time. The controller should be doing this, but for some + * reason it doesn't. There are two cases: + * - R1B response with no data transfer should generate a DATA_END (aka + * TRANSFER_COMPLETE) interrupt after waiting for busy, but if + * there's no data transfer there's no DATA_END interrupt. This is + * documented; they seem to think it's a feature. + * - R1B response after Auto-CMD12 appears to not work, even though + * there's a control bit for it (bit 3) in the vendor register. + * When we're starting a command that needs a manual DAT0 line check at + * interrupt time, we leave ourselves a note in r1bfix_type so that we + * can do the extra work in imx_sdhci_intr(). + */ + if (off == SDHCI_COMMAND_FLAGS) { + if (val & SDHCI_CMD_DATA) { + const uint32_t MBAUTOCMD = SDHCI_TRNS_ACMD12 | SDHCI_TRNS_MULTI; + val32 = RD4(sc, USDHC_MIX_CONTROL); + if ((val32 & MBAUTOCMD) == MBAUTOCMD) + sc->r1bfix_type = R1BFIX_AC12; + } else { + if ((val & SDHCI_CMD_RESP_MASK) == SDHCI_CMD_RESP_SHORT_BUSY) { + WR4(sc, SDHCI_INT_ENABLE, slot->intmask | SDHCI_INT_RESPONSE); + WR4(sc, SDHCI_SIGNAL_ENABLE, slot->intmask | SDHCI_INT_RESPONSE); + sc->r1bfix_type = R1BFIX_NODATA; + } + } + } + + val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3) * 8); + val32 |= ((val & 0xffff) << (off & 3) * 8); + WR4(sc, off & ~3, val32); +} + +static void +imx_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + + /* Clear synthesized interrupts, then pass the value to the hardware. */ + if (off == SDHCI_INT_STATUS) { + sc->r1bfix_intmask &= ~val; + } + + WR4(sc, off, val); +} + +static void +imx_sdhci_write_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + + bus_write_multi_4(sc->mem_res, off, data, count); +} + +static void +imx_sdhc_set_clock(struct imx_sdhci_softc *sc, int enable) +{ + uint32_t divisor, enable_bits, enable_reg, freq, prescale, val32; + + if (sc->hwtype == HWTYPE_ESDHC) { + divisor = (sc->sdclockreg_freq_bits >> SDHCI_DIVIDER_SHIFT) & + SDHCI_DIVIDER_MASK; + enable_reg = SDHCI_CLOCK_CONTROL; + enable_bits = SDHC_CLK_IPGEN | SDHC_CLK_HCKEN | + SDHC_CLK_PEREN; + } else { + divisor = (sc->sdclockreg_freq_bits >> SDHCI_DIVIDER_SHIFT) & + SDHCI_DIVIDER_MASK; + divisor |= ((sc->sdclockreg_freq_bits >> + SDHCI_DIVIDER_HI_SHIFT) & + SDHCI_DIVIDER_HI_MASK) << SDHCI_DIVIDER_MASK_LEN; + enable_reg = SDHCI_CLOCK_CONTROL; + enable_bits = SDHC_VEND_IPGEN | SDHC_VEND_HCKEN | + SDHC_VEND_PEREN; + } + + WR4(sc, SDHC_VEND_SPEC, + RD4(sc, SDHC_VEND_SPEC) & ~SDHC_VEND_FRC_SDCLK_ON); + WR4(sc, enable_reg, RD4(sc, enable_reg) & ~enable_bits); + + if (!enable) + return; + + if (divisor == 0) + freq = sc->baseclk_hz; + else + freq = sc->baseclk_hz / (2 * divisor); + + for (prescale = 2; prescale < freq / prescale / 16;) + prescale <<= 1; + + for (divisor = 1; freq < freq / prescale / divisor;) + ++divisor; + + prescale >>= 1; + divisor -= 1; + + val32 = RD4(sc, SDHCI_CLOCK_CONTROL); + val32 &= ~SDHC_CLK_DIVISOR_MASK; + val32 |= divisor << SDHC_CLK_DIVISOR_SHIFT; + val32 &= ~SDHC_CLK_PRESCALE_MASK; + val32 |= prescale << SDHC_CLK_PRESCALE_SHIFT; + WR4(sc, SDHCI_CLOCK_CONTROL, val32); + + WR4(sc, enable_reg, RD4(sc, enable_reg) | enable_bits); + WR4(sc, SDHC_VEND_SPEC, + RD4(sc, SDHC_VEND_SPEC) | SDHC_VEND_FRC_SDCLK_ON); +} + +static void +imx_sdhci_intr(void *arg) +{ + struct imx_sdhci_softc *sc = arg; + uint32_t intmask; + + intmask = RD4(sc, SDHCI_INT_STATUS); + + /* + * Manually check the DAT0 line for R1B response types that the + * controller fails to handle properly. + * + * To do the NODATA fix, when the RESPONSE (COMMAND_COMPLETE) interrupt + * occurs, we have to wait for the DAT0 line to be released, then + * synthesize a DATA_END (TRANSFER_COMPLETE) interrupt, which we do by + * storing SDHCI_INT_DATA_END into a variable that gets ORed into the + * return value when the SDHCI_INT_STATUS register is read. + * + * For the AC12 fix, when the DATA_END interrupt occurs we wait for the + * DAT0 line to be released, and the waiting is all the fix we need. + */ + if ((sc->r1bfix_type == R1BFIX_NODATA && + (intmask & SDHCI_INT_RESPONSE)) || + (sc->r1bfix_type == R1BFIX_AC12 && + (intmask & SDHCI_INT_DATA_END))) { + uint32_t count; + count = 0; + /* XXX use a callout or something instead of busy-waiting. */ + while (count < 250000 && + (RD4(sc, SDHCI_PRESENT_STATE) & SDHCI_DAT_ACTIVE)) { + ++count; + DELAY(1); + } + if (count >= 250000) + sc->r1bfix_intmask = SDHCI_INT_DATA_TIMEOUT; + else if (sc->r1bfix_type == R1BFIX_NODATA) + sc->r1bfix_intmask = SDHCI_INT_DATA_END; + sc->r1bfix_type = R1BFIX_NONE; + } + + sdhci_generic_intr(&sc->slot); +} + +static int +imx_sdhci_get_ro(device_t bus, device_t child) +{ + + return (false); +} + +static int +imx_sdhci_detach(device_t dev) +{ + + return (EBUSY); +} + +static int +imx_sdhci_attach(device_t dev) +{ + struct imx_sdhci_softc *sc = device_get_softc(dev); + int rid, err; + + sc->dev = dev; + + if (ofw_bus_is_compatible(dev, "fsl,imx51-esdhc")) { + sc->hwtype = HWTYPE_ESDHC; + } else if (ofw_bus_is_compatible(dev, "fsl,imx-usdhc")) { + sc->hwtype = HWTYPE_USDHC; + } else { + panic("Impossible: not compatible in imx_sdhci_attach()"); + } + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + err = ENXIO; + goto fail; + } + + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->irq_res) { + device_printf(dev, "cannot allocate interrupt\n"); + err = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, imx_sdhci_intr, sc, &sc->intr_cookie)) { + device_printf(dev, "cannot setup interrupt handler\n"); + err = ENXIO; + goto fail; + } + + sc->slot.quirks |= SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK; + + /* + * DMA is not really broken, I just haven't implemented it yet. + */ + sc->slot.quirks |= SDHCI_QUIRK_BROKEN_DMA; + + /* + * Set the buffer watermark level to 128 words (512 bytes) for both read + * and write. The hardware has a restriction that when the read or + * write ready status is asserted, that means you can read exactly the + * number of words set in the watermark register before you have to + * re-check the status and potentially wait for more data. The main + * sdhci driver provides no hook for doing status checking on less than + * a full block boundary, so we set the watermark level to be a full + * block. Reads and writes where the block size is less than the + * watermark size will work correctly too, no need to change the + * watermark for different size blocks. However, 128 is the maximum + * allowed for the watermark, so PIO is limitted to 512 byte blocks + * (which works fine for SD cards, may be a problem for SDIO some day). + * + * XXX need named constants for this stuff. + */ + WR4(sc, SDHC_WTMK_LVL, 0x08800880); + + /* XXX get imx6 clock frequency from CCM */ + if (sc->hwtype == HWTYPE_USDHC) { + sc->baseclk_hz = 200000000; + } else if (sc->hwtype == HWTYPE_ESDHC) { + sc->baseclk_hz = imx51_get_clock(IMX51CLK_PERCLK_ROOT); + } + + sdhci_init_slot(dev, &sc->slot, 0); + + bus_generic_probe(dev); + bus_generic_attach(dev); + + sdhci_start_slot(&sc->slot); + + return (0); + +fail: + if (sc->intr_cookie) + bus_teardown_intr(dev, sc->irq_res, sc->intr_cookie); + if (sc->irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + if (sc->mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + + return (err); +} + +static int +imx_sdhci_probe(device_t dev) +{ + + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case HWTYPE_ESDHC: + device_set_desc(dev, "Freescale eSDHC controller"); + return (BUS_PROBE_DEFAULT); + case HWTYPE_USDHC: + device_set_desc(dev, "Freescale uSDHC controller"); + return (BUS_PROBE_DEFAULT); + default: + break; + } + return (ENXIO); +} + +static device_method_t imx_sdhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, imx_sdhci_probe), + DEVMETHOD(device_attach, imx_sdhci_attach), + DEVMETHOD(device_detach, imx_sdhci_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + DEVMETHOD(bus_print_child, bus_generic_print_child), + + /* MMC bridge interface */ + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, imx_sdhci_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, imx_sdhci_read_1), + DEVMETHOD(sdhci_read_2, imx_sdhci_read_2), + DEVMETHOD(sdhci_read_4, imx_sdhci_read_4), + DEVMETHOD(sdhci_read_multi_4, imx_sdhci_read_multi_4), + DEVMETHOD(sdhci_write_1, imx_sdhci_write_1), + DEVMETHOD(sdhci_write_2, imx_sdhci_write_2), + DEVMETHOD(sdhci_write_4, imx_sdhci_write_4), + DEVMETHOD(sdhci_write_multi_4, imx_sdhci_write_multi_4), + + { 0, 0 } +}; + +static devclass_t imx_sdhci_devclass; + +static driver_t imx_sdhci_driver = { + "sdhci_imx", + imx_sdhci_methods, + sizeof(struct imx_sdhci_softc), +}; + +DRIVER_MODULE(sdhci_imx, simplebus, imx_sdhci_driver, imx_sdhci_devclass, 0, 0); +MODULE_DEPEND(sdhci_imx, sdhci, 1, 1, 1); + From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:30:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2A71412; Fri, 13 Dec 2013 22:30:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C474C1483; Fri, 13 Dec 2013 22:30:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMULAm052877; Fri, 13 Dec 2013 22:30:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMULB3052874; Fri, 13 Dec 2013 22:30:21 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132230.rBDMULB3052874@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259354 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:30:22 -0000 Author: ian Date: Fri Dec 13 22:30:21 2013 New Revision: 259354 URL: http://svnweb.freebsd.org/changeset/base/259354 Log: MFC r257476, r257478: Revamp the SoC identity numbering scheme to be more in line with the way Freescale numbers the chips in the ID registers. Add definitions for the register and data that describes the SoC type. Modified: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h stable/10/sys/arm/freescale/imx/imx_machdep.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Fri Dec 13 22:28:19 2013 (r259353) +++ stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Fri Dec 13 22:30:21 2013 (r259354) @@ -122,7 +122,9 @@ #define IMX6_ANALOG_USB2_MISC_CLR 0x258 #define IMX6_ANALOG_USB2_MISC_TOG 0x25C #define IMX6_ANALOG_DIGPROG 0x260 - - +#define IMX6_ANALOG_DIGPROG_SL 0x280 +#define IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT 16 +#define IMX6_ANALOG_DIGPROG_SOCTYPE_MASK \ + (0xff << IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) #endif Modified: stable/10/sys/arm/freescale/imx/imx_machdep.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.h Fri Dec 13 22:28:19 2013 (r259353) +++ stable/10/sys/arm/freescale/imx/imx_machdep.h Fri Dec 13 22:30:21 2013 (r259354) @@ -36,24 +36,27 @@ void imx_devmap_addentry(vm_paddr_t _pa, vm_size_t _sz); void imx_wdog_cpu_reset(vm_offset_t _wdcr_phys) __attribute__((__noreturn__)); +/* From here down, routines are implemented in imxNN_machdep.c. */ + /* * SoC identity. + * According to the documentation, there is such a thing as an i.MX6 Dual + * (non-lite flavor). However, Freescale doesn't seem to have assigned it a + * number in their code for determining the SoC type in u-boot. + * + * To-do: put silicon revision numbers into the low-order bits somewhere. */ -#define IMXSOC_51 0x05000100 -#define IMXSOC_53 0x05000300 -#define IMXSOC_6S 0x06000010 -#define IMXSOC_6SL 0x06000011 -#define IMXSOC_6D 0x06000020 -#define IMXSOC_6DL 0x06000021 -#define IMXSOC_6Q 0x06000040 -#define IMXSOC_6QL 0x06000041 -#define IMXSOC_FAMSHIFT 24 +#define IMXSOC_51 0x51000000 +#define IMXSOC_53 0x53000000 +#define IMXSOC_6SL 0x60000000 +#define IMXSOC_6DL 0x61000000 +#define IMXSOC_6S 0x62000000 +#define IMXSOC_6Q 0x63000000 +#define IMXSOC_FAMSHIFT 28 u_int imx_soc_type(void); u_int imx_soc_family(void); -/* From here down, routines are implemented in imxNN_machdep.c. */ - void imx_devmap_init(void); /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:41:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE6B2B64; Fri, 13 Dec 2013 22:41:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C818615D4; Fri, 13 Dec 2013 22:41:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMfxj6058618; Fri, 13 Dec 2013 22:41:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMfvpZ058604; Fri, 13 Dec 2013 22:41:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132241.rBDMfvpZ058604@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259355 - in stable/10/sys: arm/conf arm/freescale/imx boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:42:00 -0000 Author: ian Date: Fri Dec 13 22:41:57 2013 New Revision: 259355 URL: http://svnweb.freebsd.org/changeset/base/259355 Log: MFC r257483, r257486, r257489: Add the Soc- / machine-dependent parts of imx6 support. Add dts source for imx6 SoCs and for Wandboard boards. Add kernel config for Wandboard. Added: stable/10/sys/arm/conf/WANDBOARD-COMMON - copied unchanged from r257489, head/sys/arm/conf/WANDBOARD-COMMON stable/10/sys/arm/conf/WANDBOARD-DUAL - copied unchanged from r257489, head/sys/arm/conf/WANDBOARD-DUAL stable/10/sys/arm/conf/WANDBOARD-QUAD - copied unchanged from r257489, head/sys/arm/conf/WANDBOARD-QUAD stable/10/sys/arm/conf/WANDBOARD-SOLO - copied unchanged from r257489, head/sys/arm/conf/WANDBOARD-SOLO stable/10/sys/arm/freescale/imx/files.imx6 - copied unchanged from r257483, head/sys/arm/freescale/imx/files.imx6 stable/10/sys/arm/freescale/imx/imx6_machdep.c - copied unchanged from r257483, head/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/arm/freescale/imx/imx6_pl310.c - copied unchanged from r257483, head/sys/arm/freescale/imx/imx6_pl310.c stable/10/sys/arm/freescale/imx/std.imx6 - copied unchanged from r257483, head/sys/arm/freescale/imx/std.imx6 stable/10/sys/boot/fdt/dts/imx6.dtsi - copied unchanged from r257486, head/sys/boot/fdt/dts/imx6.dtsi stable/10/sys/boot/fdt/dts/wandboard-dual.dts - copied unchanged from r257486, head/sys/boot/fdt/dts/wandboard-dual.dts stable/10/sys/boot/fdt/dts/wandboard-quad.dts - copied unchanged from r257486, head/sys/boot/fdt/dts/wandboard-quad.dts stable/10/sys/boot/fdt/dts/wandboard-solo.dts - copied unchanged from r257486, head/sys/boot/fdt/dts/wandboard-solo.dts Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/conf/WANDBOARD-COMMON (from r257489, head/sys/arm/conf/WANDBOARD-COMMON) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/WANDBOARD-COMMON Fri Dec 13 22:41:57 2013 (r259355, copy of r257489, head/sys/arm/conf/WANDBOARD-COMMON) @@ -0,0 +1,155 @@ +# Kernel configuration for Wandboard +# +# For more information on this file, please read the config(5) manual page, +# and/or 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$ + +include "../freescale/imx/std.imx6" + +options HZ=250 # Scheduling quantum is 4 milliseconds. +options SCHED_4BSD # 4BSD scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +#options SCTP # Stream Control Transmission Protocol +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 UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # TMP Memory Filesystem +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support use KDB_TRACE, for interactive use DDB. +#options KDB_TRACE # Print a stack trace for a panic. +options DDB # Support DDB. +# For full debugger support use this instead: +#options GDB # Support remote GDB. +# Other debugging options... +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options ALT_BREAK_TO_DEBUGGER # Use to enter debugger. +#options DEBUG +#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 + +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module +device ether # Ethernet support +device miibus # Required for ethernet + +# Serial (COM) ports +device uart # Multi-uart driver + +#device iomux # IO Multiplexor + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +#options USB_DEBUG # enable debug msgs +options USB_HOST_ALIGN=32 # Required for ARM, set to cache line size. +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +device u3g # USB modems + +# USB Ethernet, requires miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs + +# Watchdog timer. +# WARNING: can't be disabled!!! +#device imxwdt # Watchdog + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + +# NOTE: serial console will be disabled if syscons enabled +# Uncomment following lines for framebuffer/syscons support +# Wandboard has no video console support yet. +#device sc +#device kbdmux +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 +#device ukbd # Allow keyboard like HIDs to control console +#device ums + +# required for netbooting +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 + +# U-Boot stuff lives on slice 1, FreeBSD on slice 2. +options ROOTDEVNAME=\"ufs:mmcsd0s2a\" + +#device fsliic # Freescale i2c/iic (not ready yet) +#device iic # iic protocol +#device iicbus # iic bus + +device sdhci # SD controller +device mmc # SD/MMC protocol +device mmcsd # SDCard disk device + +device ffec # Freescale Fast Ethernet Controller + Copied: stable/10/sys/arm/conf/WANDBOARD-DUAL (from r257489, head/sys/arm/conf/WANDBOARD-DUAL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/WANDBOARD-DUAL Fri Dec 13 22:41:57 2013 (r259355, copy of r257489, head/sys/arm/conf/WANDBOARD-DUAL) @@ -0,0 +1,27 @@ +# Kernel configuration for Wandboard-Dual +# +# For more information on this file, please read the config(5) manual page, +# and/or 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$ + +include WANDBOARD-COMMON +ident WANDBOARD-DUAL + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=wandboard-dual.dts + Copied: stable/10/sys/arm/conf/WANDBOARD-QUAD (from r257489, head/sys/arm/conf/WANDBOARD-QUAD) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/WANDBOARD-QUAD Fri Dec 13 22:41:57 2013 (r259355, copy of r257489, head/sys/arm/conf/WANDBOARD-QUAD) @@ -0,0 +1,27 @@ +# Kernel configuration for Wandboard-Quad +# +# For more information on this file, please read the config(5) manual page, +# and/or 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$ + +include WANDBOARD-COMMON +ident WANDBOARD-QUAD + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=wandboard-quad.dts + Copied: stable/10/sys/arm/conf/WANDBOARD-SOLO (from r257489, head/sys/arm/conf/WANDBOARD-SOLO) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/WANDBOARD-SOLO Fri Dec 13 22:41:57 2013 (r259355, copy of r257489, head/sys/arm/conf/WANDBOARD-SOLO) @@ -0,0 +1,27 @@ +# Kernel configuration for Wandboard-Solo +# +# For more information on this file, please read the config(5) manual page, +# and/or 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$ + +include WANDBOARD-COMMON +ident WANDBOARD-SOLO + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=wandboard-solo.dts + Copied: stable/10/sys/arm/freescale/imx/files.imx6 (from r257483, head/sys/arm/freescale/imx/files.imx6) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/files.imx6 Fri Dec 13 22:41:57 2013 (r259355, copy of r257483, head/sys/arm/freescale/imx/files.imx6) @@ -0,0 +1,56 @@ +# $FreeBSD$ + +# +# Standard ARM support. +# +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard +arm/arm/cpufunc_asm_arm11.S standard +arm/arm/cpufunc_asm_armv5.S standard +arm/arm/cpufunc_asm_armv7.S standard +arm/arm/irq_dispatch.S standard +kern/kern_clocksource.c standard + +# +# Standard imx6 devices and support. +# +arm/arm/gic.c standard +arm/arm/pl310.c standard +arm/freescale/imx/bus_space.c standard +arm/freescale/imx/common.c standard +arm/freescale/imx/imx6_anatop.c standard +arm/freescale/imx/imx6_ccm.c standard +arm/freescale/imx/imx6_machdep.c standard +arm/freescale/imx/imx6_pl310.c standard +arm/freescale/imx/imx_machdep.c standard +arm/freescale/imx/imx_gpt.c standard + +# +# Optional devices. +# +arm/freescale/imx/imx_sdhci.c optional sdhci + +arm/freescale/imx/imx_wdog.c optional imxwdt + +dev/ffec/if_ffec.c optional ffec + +dev/uart/uart_dev_imx.c optional uart + +dev/usb/controller/ehci_imx.c optional ehci +arm/freescale/imx/imx6_usbphy.c optional ehci + +# +# Low-level serial console for debugging early kernel startup. +# +#arm/freescale/imx/console.c standard + +# +# Not ready yet... +# +#arm/freescale/imx/imx51_iomux.c optional iomux +#arm/freescale/imx/imx51_gpio.c optional gpio +#dev/ata/chipsets/ata-fsl.c optional imxata +#arm/freescale/imx/i2c.c optional fsliic +#dev/ofw/ofw_iicbus.c optional fsliic +#arm/freescale/imx/imx51_ipuv3.c optional sc + Copied: stable/10/sys/arm/freescale/imx/imx6_machdep.c (from r257483, head/sys/arm/freescale/imx/imx6_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Fri Dec 13 22:41:57 2013 (r259355, copy of r257483, head/sys/arm/freescale/imx/imx6_machdep.c) @@ -0,0 +1,164 @@ +/*- + * Copyright (c) 2013 Ian Lepore + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +/* + * Set up static device mappings. Note that for imx this is called from + * initarm_lastaddr() so that it can return the lowest address used for static + * device mapping, maximizing kva space. + * + * This attempts to cover the most-used devices with 1MB section mappings, which + * is good for performance (uses fewer TLB entries for device access). + * + * ARMMP covers the interrupt controller, MPCore timers, global timer, and the + * L2 cache controller. Most of the 1MB range is unused reserved space. + * + * AIPS1/AIPS2 cover most of the on-chip devices such as uart, spi, i2c, etc. + * + * Notably not mapped right now are HDMI, GPU, and other devices below ARMMP in + * the memory map. When we get support for graphics it might make sense to + * static map some of that area. Be careful with other things in that area such + * as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory. + */ +void +imx_devmap_init(void) +{ + const uint32_t IMX6_ARMMP_PHYS = 0x00a00000; + const uint32_t IMX6_ARMMP_SIZE = 0x00100000; + const uint32_t IMX6_AIPS1_PHYS = 0x02000000; + const uint32_t IMX6_AIPS1_SIZE = 0x00100000; + const uint32_t IMX6_AIPS2_PHYS = 0x02100000; + const uint32_t IMX6_AIPS2_SIZE = 0x00100000; + + imx_devmap_addentry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); + imx_devmap_addentry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); + imx_devmap_addentry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); +} + +void +cpu_reset(void) +{ + const uint32_t IMX6_WDOG_CR_PHYS = 0x020bc000; + + imx_wdog_cpu_reset(IMX6_WDOG_CR_PHYS); +} + +/* + * Determine what flavor of imx6 we're running on. + * + * This code is based on the way u-boot does it. Information found on the web + * indicates that Freescale themselves were the original source of this logic, + * including the strange check for number of CPUs in the SCU configuration + * register, which is apparently needed on some revisions of the SOLO. + * + * According to the documentation, there is such a thing as an i.MX6 Dual + * (non-lite flavor). However, Freescale doesn't seem to have assigned it a + * number or provided any logic to handle it in their detection code. + * + * Note that the ANALOG_DIGPROG and SCU configuration registers are not + * documented in the chip reference manual. (SCU configuration is mentioned, + * but not mapped out in detail.) I think the bottom two bits of the scu config + * register may be ncpu-1. + * + * This hasn't been tested yet on a dual[-lite]. + * + * On a solo: + * digprog = 0x00610001 + * hwsoc = 0x00000062 + * scu config = 0x00000500 + * On a quad: + * digprog = 0x00630002 + * hwsoc = 0x00000063 + * scu config = 0x00005503 + */ +u_int imx_soc_type() +{ + const struct pmap_devmap *pd; + uint32_t digprog, hwsoc; + uint32_t *pcr; + const uint32_t HWSOC_MX6SL = 0x60; + const uint32_t HWSOC_MX6DL = 0x61; + const uint32_t HWSOC_MX6SOLO = 0x62; + const uint32_t HWSOC_MX6Q = 0x63; + const vm_offset_t SCU_CONFIG_PHYSADDR = 0x00a00004; + + digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG_SL); + hwsoc = (digprog >> IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) & + IMX6_ANALOG_DIGPROG_SOCTYPE_MASK; + + if (hwsoc != HWSOC_MX6SL) { + digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG); + hwsoc = (digprog & IMX6_ANALOG_DIGPROG_SOCTYPE_MASK) >> + IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT; + /*printf("digprog = 0x%08x\n", digprog);*/ + if (hwsoc == HWSOC_MX6DL) { + pd = pmap_devmap_find_pa(SCU_CONFIG_PHYSADDR, 4); + if (pd != NULL) { + pcr = (uint32_t *)(pd->pd_va + + (SCU_CONFIG_PHYSADDR - pd->pd_pa)); + /*printf("scu config = 0x%08x\n", *pcr);*/ + if ((*pcr & 0x03) == 0) { + hwsoc = HWSOC_MX6SOLO; + } + } + } + } + /* printf("hwsoc 0x%08x\n", hwsoc); */ + + switch (hwsoc) { + case HWSOC_MX6SL: + return (IMXSOC_6SL); + case HWSOC_MX6SOLO: + return (IMXSOC_6S); + case HWSOC_MX6DL: + return (IMXSOC_6DL); + case HWSOC_MX6Q : + return (IMXSOC_6Q); + default: + printf("imx_soc_type: Don't understand hwsoc 0x%02x, " + "digprog 0x%08x; assuming IMXSOC_6Q\n", hwsoc, digprog); + break; + } + + return (IMXSOC_6Q); +} + Copied: stable/10/sys/arm/freescale/imx/imx6_pl310.c (from r257483, head/sys/arm/freescale/imx/imx6_pl310.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/imx6_pl310.c Fri Dec 13 22:41:57 2013 (r259355, copy of r257483, head/sys/arm/freescale/imx/imx6_pl310.c) @@ -0,0 +1,98 @@ +/*- + * Copyright (c) 2012 Olivier Houchard. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The machine-dependent part of the arm/pl310 driver for imx6 SoCs. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +void +platform_pl310_init(struct pl310_softc *sc) +{ + uint32_t aux, prefetch; + + aux = pl310_read4(sc, PL310_AUX_CTRL); + prefetch = pl310_read4(sc, PL310_PREFETCH_CTRL); + + if (bootverbose) { + device_printf(sc->sc_dev, "Early BRESP response: %s\n", + (aux & AUX_CTRL_EARLY_BRESP) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (aux & AUX_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (aux & AUX_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Non-secure interrupt control: %s\n", + (aux & AUX_CTRL_NS_INT_CTRL) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Non-secure lockdown: %s\n", + (aux & AUX_CTRL_NS_LOCKDOWN) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Share override: %s\n", + (aux & AUX_CTRL_SHARE_OVERRIDE) ? "enabled" : "disabled"); + + device_printf(sc->sc_dev, "Double linefil: %s\n", + (prefetch & PREFETCH_CTRL_DL) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Instruction prefetch: %s\n", + (prefetch & PREFETCH_CTRL_INSTR_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Data prefetch: %s\n", + (prefetch & PREFETCH_CTRL_DATA_PREFETCH) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Double linefill on WRAP request: %s\n", + (prefetch & PREFETCH_CTRL_DL_ON_WRAP) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Prefetch drop: %s\n", + (prefetch & PREFETCH_CTRL_PREFETCH_DROP) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Incr double Linefill: %s\n", + (prefetch & PREFETCH_CTRL_INCR_DL) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Not same ID on exclusive sequence: %s\n", + (prefetch & PREFETCH_CTRL_NOTSAMEID) ? "enabled" : "disabled"); + device_printf(sc->sc_dev, "Prefetch offset: %d\n", + (prefetch & PREFETCH_CTRL_OFFSET_MASK)); + } +} + +void +platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) +{ + + pl310_write4(sc, PL310_CTRL, val); +} + +void +platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) +{ + + pl310_write4(sc, PL310_DEBUG_CTRL, val); +} + Copied: stable/10/sys/arm/freescale/imx/std.imx6 (from r257483, head/sys/arm/freescale/imx/std.imx6) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/freescale/imx/std.imx6 Fri Dec 13 22:41:57 2013 (r259355, copy of r257483, head/sys/arm/freescale/imx/std.imx6) @@ -0,0 +1,15 @@ +# $FreeBSD$ +machine arm armv6 +cpu CPU_CORTEXA +makeoptions ARM_LITTLE_ENDIAN +options ARM_L2_PIPT + +options KERNVIRTADDR = 0xc2000000 +makeoptions KERNVIRTADDR = 0xc2000000 +options KERNPHYSADDR = 0x12000000 +makeoptions KERNPHYSADDR = 0x12000000 +options PHYSADDR = 0x10000000 +options STARTUP_PAGETABLE_ADDR = 0x11f00000 + +files "../freescale/imx/files.imx6" + Copied: stable/10/sys/boot/fdt/dts/imx6.dtsi (from r257486, head/sys/boot/fdt/dts/imx6.dtsi) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/imx6.dtsi Fri Dec 13 22:41:57 2013 (r259355, copy of r257486, head/sys/boot/fdt/dts/imx6.dtsi) @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2013 Ian Lepore + * Copyright (c) 2012 The FreeBSD Foundation + * 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. + * + * Freescale i.MX6 Common Device Tree Source. + * There are enough differences between the Solo, Dual, Quad, and *-lite + * flavors of this SoC that eventually we will need a finer-grained breakdown + * of some of this stuff. For now this file works for all of them. I think. + * + * $FreeBSD$ + */ + +/ { + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "ARM,MCIMX6"; + reg = <0x0>; + d-cache-line-size = <32>; + i-cache-line-size = <32>; + d-cache-size = <0x8000>; + i-cache-size = <0x8000>; + /* TODO: describe L2 cache also */ + timebase-frequency = <0>; + bus-frequency = <0>; + clock-frequency = <0>; + }; + }; + + aliases { + soc = &SOC; + }; + + SOC: soc@00000000 { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + ranges = <0x00000000 0x00000000 0x10000000>; + + gic: generic-interrupt-controller@00a00100 { + compatible = "arm,gic"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0x00a01000 0x00001000 + 0x00a00100 0x00000100>; + }; + + l2-cache@00a02000 { + compatible = "arm,pl310-cache", "arm,pl310"; + reg = <0xa02000 0x1000>; + interrupts = <124>; + cache-level = <0x2>; + interrupt-parent = < &gic >; + }; + + aips@02000000 { /* AIPS1 */ + compatible = "fsl,aips-bus", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + reg = <0x02000000 0x00100000>; + ranges; + + /* Required by many devices, so better to stay first */ + clks: ccm@020c4000 { + compatible = "fsl,imx6q-ccm"; + reg = <0x020c4000 0x4000>; + interrupts = <119 120>; + }; + + anatop: anatop@020c8000 { + compatible = "fsl,imx6q-anatop"; + reg = <0x020c8000 0x1000>; + } + + gpt: timer@02098000 { + compatible = "fsl,imx6q-gpt", "fsl,imx51-gpt"; + reg = <0x02098000 0x4000>; + interrupt-parent = <&gic>; interrupts = <87>; + }; + +// iomux@73fa8000 { +// compatible = "fsl,imx51-iomux"; +// reg = <0x73fa8000 0x4000>; +// interrupt-parent = <&gic>; interrupts = <7>; +// status = "disabled"; +// }; + +// /* +// * GPIO modules moved up - to have it attached for +// * drivers which rely on GPIO +// */ +// gpio1: gpio@0209C000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x0209C000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <50 51 42 43 44 45 46 47 48 49>; +// /* TODO: use <> also */ +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; +// +// gpio2: gpio@020A0000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x020A0000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <52 53>; +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; +// +// gpio3: gpio@020A4000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x020A4000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <54 55>; +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; +// +// gpio4: gpio@020A8000 { +// compatible = "fsl,imx51-gpio", "fsl,imx31-gpio"; +// reg = <0x020A8000 0x4000>; +// interrupt-parent = <&gic>; +// interrupts = <56 57>; +// gpio-controller; +// #gpio-cells = <2>; +// interrupt-controller; +// #interrupt-cells = <1>; +// status = "disabled"; +// }; + + uart1: serial@02020000 { + compatible = "fsl,imx6q-uart"; + reg = <0x02020000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <58>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart2: serial@021e8000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021e8000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <59>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart3: serial@021ec000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021ec000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <60>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart4: serial@021f0000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021f0000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <61>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + uart5: serial@021f4000 { + compatible = "fsl,imx6q-uart"; + reg = <0x021f4000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <62>; + clock-frequency = <80000000>; + status = "disabled"; + }; + + usbphy1: usbphy@020c9000 { + compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + reg = <0x020c9000 0x1000>; + interrupts = <44>; + status = "disabled"; + }; + + usbphy2: usbphy@020ca000 { + compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; + reg = <0x020ca000 0x1000>; + interrupts = <45>; + status = "disabled"; + }; + + }; + + aips@02100000 { /* AIPS2 */ + compatible = "fsl,aips-bus", "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&gic>; + reg = <0x02100000 0x00100000>; + ranges; + + fec1: ethernet@02188000 { + compatible = "fsl,imx6q-fec"; + reg = <0x02188000 0x4000>; + interrupts = <150 151>; + status = "disabled"; + }; + + usbotg1: usb@02184000 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184000 0x200>; + interrupts = <75>; + fsl,usbphy = <&usbphy1>; + fsl,usbmisc = <&usbmisc 0>; + status = "disabled"; + }; + + usbh1: usb@02184200 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184200 0x200>; + interrupts = <72>; + fsl,usbphy = <&usbphy2>; + fsl,usbmisc = <&usbmisc 1>; + status = "disabled"; + }; + + usbh2: usb@02184400 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184400 0x200>; + interrupts = <73>; + fsl,usbmisc = <&usbmisc 2>; + status = "disabled"; + }; + + usbh3: usb@02184600 { + compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; + reg = <0x02184600 0x200>; + interrupts = <74>; + fsl,usbmisc = <&usbmisc 3>; + status = "disabled"; + }; + + usbmisc: usbmisc@02184800 { + #index-cells = <1>; + compatible = "fsl,imx6q-usbmisc"; + reg = <0x02184800 0x200>; + // Not disabled on purpose. + }; + + usdhc1: usdhc@02190000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x02190000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <54>; + bus-width = <0x4>; + status ="disabled"; + }; + + usdhc2: usdhc@02194000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x02194000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <55>; + bus-width = <0x4>; + status ="disabled"; + }; + + usdhc3: usdhc@02198000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x02198000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <56>; + bus-width = <0x4>; + status ="disabled"; + }; + + usdhc4: usdhc@0219c000 { + compatible = "fsl,imx6q-usdhc"; + reg = <0x0219c000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <57>; + bus-width = <0x4>; + status ="disabled"; + }; + }; + }; +}; Copied: stable/10/sys/boot/fdt/dts/wandboard-dual.dts (from r257486, head/sys/boot/fdt/dts/wandboard-dual.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/boot/fdt/dts/wandboard-dual.dts Fri Dec 13 22:41:57 2013 (r259355, copy of r257486, head/sys/boot/fdt/dts/wandboard-dual.dts) @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2013 Ian Lepore + * 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. + * + * Wandboard Dual. + * + * $FreeBSD$ + */ + +/dts-v1/; +/include/ "imx6.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + + model = "Wandboard Dual"; + compatible = "wand,imx6d-wandboard", "fsl,imx6d"; + + memory { + reg = <0x10000000 0x40000000>; /* RAM 1GB */ + }; + + SOC: soc@00000000 { + aips@02000000 { /* AIPS1 */ +// iomux@73fa8000 { status = "disabled"; }; +// gpio@0209C000 { status = "disabled"; }; +// gpio@020A0000 { status = "disabled"; }; +// gpio@020A4000 { status = "disabled"; }; +// gpio@020A8000 { status = "disabled"; }; + console:serial@02020000 { status = "okay"; }; + serial@021e8000 { status = "disabled"; }; + serial@021ec000 { status = "disabled"; }; + serial@021f0000 { status = "disabled"; }; + serial@021f4000 { status = "disabled"; }; + usbphy@020c9000 { status = "okay"; }; + usbphy@020ca000 { status = "okay"; }; + }; + aips@02100000 { /* AIPS2 */ + ethernet@02188000 { + status = "okay"; + phy-mode = "rgmii"; + phy-disable-preamble; + }; + usb@02184000 { status = "okay"; }; + usb@02184200 { status = "okay"; }; + usb@02184400 { status = "disabled"; }; + usb@02184600 { status = "disabled"; }; + usdhc@02190000 { status = "disabled"; }; + usdhc@02194000 { status = "okay"; }; + usdhc@02198000 { status = "okay"; }; + usdhc@0219c000 { status = "disabled"; }; + }; + }; + + chosen { + stdin = &console; + stdout = &console; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:46:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6A2ADEA4; Fri, 13 Dec 2013 22:46:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4B85C1614; Fri, 13 Dec 2013 22:46:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMkBdK059201; Fri, 13 Dec 2013 22:46:11 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMkAU6059198; Fri, 13 Dec 2013 22:46:10 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132246.rBDMkAU6059198@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259356 - in stable/10/sys: arm/ti boot/fdt/dts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:46:11 -0000 Author: ian Date: Fri Dec 13 22:46:10 2013 New Revision: 259356 URL: http://svnweb.freebsd.org/changeset/base/259356 Log: MFC r257518, r257519: TI sdhci driver improvements, mostly related to fdt data... Use the published compatible strings (our own invention, "ti,mmchs" is still accepted as well, for now). Don't blindly turn on 8-bit bus mode, because even though the controller supports it, the board has to be wired appropriately as well. Use the published property (bus-width=) and honor all the valid values (1,4,8). The eMMC device on a Beaglebone Black is wired for 8-bit, update the dts. The mmchs controller can inherently do both 1.8v and 3.0v on the first device and 1.8v only on other devices, unless an external transceiver is used. Set the voltage automatically for the first device and honor the published fdt property (ti,dualvolt) for other devices. Modified: stable/10/sys/arm/ti/ti_sdhci.c stable/10/sys/boot/fdt/dts/am335x.dtsi stable/10/sys/boot/fdt/dts/beaglebone-black.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/10/sys/arm/ti/ti_sdhci.c Fri Dec 13 22:41:57 2013 (r259355) +++ stable/10/sys/arm/ti/ti_sdhci.c Fri Dec 13 22:46:10 2013 (r259356) @@ -75,6 +75,21 @@ struct ti_sdhci_softc { }; /* + * Table of supported FDT compat strings. + * + * Note that "ti,mmchs" is our own invention, and should be phased out in favor + * of the documented names. + * + * Note that vendor Beaglebone dtsi files use "ti,omap3-hsmmc" for the am335x. + */ +static struct ofw_compat_data compat_data[] = { + {"ti,omap3-hsmmc", 1}, + {"ti,omap4-hsmmc", 1}, + {"ti,mmchs", 1}, + {NULL, 0}, +}; + +/* * The MMCHS hardware has a few control and status registers at the beginning of * the device's memory map, followed by the standard sdhci register block. * Different SoCs have the register blocks at different offsets from the @@ -93,6 +108,10 @@ struct ti_sdhci_softc { #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) +#define MMCHS_SD_CAPA 0x240 +#define MMCHS_SD_CAPA_VS18 (1 << 26) +#define MMCHS_SD_CAPA_VS30 (1 << 25) +#define MMCHS_SD_CAPA_VS33 (1 << 24) static inline uint32_t ti_mmchs_read_4(struct ti_sdhci_softc *sc, bus_size_t off) @@ -320,6 +339,7 @@ ti_sdhci_hw_init(device_t dev) { struct ti_sdhci_softc *sc = device_get_softc(dev); clk_ident_t clk; + uint32_t regval; unsigned long timeout; /* Enable the controller and interface/functional clocks */ @@ -357,6 +377,21 @@ ti_sdhci_hw_init(device_t dev) DELAY(100); } + /* + * The attach() routine has examined fdt data and set flags in + * slot.host.caps to reflect what voltages we can handle. Set those + * values in the CAPA register. The manual says that these values can + * only be set once, "before initialization" whatever that means, and + * that they survive a reset. So maybe doing this will be a no-op if + * u-boot has already initialized the hardware. + */ + regval = ti_mmchs_read_4(sc, MMCHS_SD_CAPA); + if (sc->slot.host.caps & MMC_OCR_LOW_VOLTAGE) + regval |= MMCHS_SD_CAPA_VS18; + if (sc->slot.host.caps & (MMC_OCR_290_300 | MMC_OCR_300_310)) + regval |= MMCHS_SD_CAPA_VS30; + ti_mmchs_write_4(sc, MMCHS_SD_CAPA, regval); + /* Set initial host configuration (1-bit, std speed, pwr off). */ ti_sdhci_write_1(dev, NULL, SDHCI_HOST_CONTROL, 0); ti_sdhci_write_1(dev, NULL, SDHCI_POWER_CONTROL, 0); @@ -378,7 +413,8 @@ ti_sdhci_attach(device_t dev) /* * Get the MMCHS device id from FDT. If it's not there use the newbus * unit number (which will work as long as the devices are in order and - * none are skipped in the fdt). + * none are skipped in the fdt). Note that this is a property we made + * up and added in freebsd, it doesn't exist in the published bindings. */ node = ofw_bus_get_node(dev); if ((OF_getprop(node, "mmchs-device-id", &prop, sizeof(prop))) <= 0) { @@ -388,7 +424,23 @@ ti_sdhci_attach(device_t dev) } else sc->mmchs_device_id = fdt32_to_cpu(prop); - /* See if we've got a GPIO-based write detect pin. */ + /* + * The hardware can inherently do dual-voltage (1p8v, 3p0v) on the first + * device, and only 1p8v on other devices unless an external transceiver + * is used. The only way we could know about a transceiver is fdt data. + * Note that we have to do this before calling ti_sdhci_hw_init() so + * that it can set the right values in the CAPA register, which can only + * be done once and never reset. + */ + sc->slot.host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + if (sc->mmchs_device_id == 0 || OF_hasprop(node, "ti,dual-volt")) { + sc->slot.host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + } + + /* + * See if we've got a GPIO-based write detect pin. This is not the + * standard documented property for this, we added it in freebsd. + */ if ((OF_getprop(node, "mmchs-wp-gpio-pin", &prop, sizeof(prop))) <= 0) sc->wp_gpio_pin = 0xffffffff; else @@ -406,10 +458,6 @@ ti_sdhci_attach(device_t dev) /* * Set the offset from the device's memory start to the MMCHS registers. - * - * XXX A better way to handle this would be to have separate memory - * resources for the sdhci registers and the mmchs registers. That - * requires changing everyone's DTS files. */ if (ti_chip() == CHIP_OMAP_3) sc->mmchs_reg_off = OMAP3_MMCHS_REG_OFFSET; @@ -482,14 +530,35 @@ ti_sdhci_attach(device_t dev) */ sc->slot.quirks |= SDHCI_QUIRK_BROKEN_DMA; - /* Set up the hardware and go. */ + /* + * Set up the hardware and go. Note that this sets many of the + * slot.host.* fields, so we have to do this before overriding any of + * those values based on fdt data, below. + */ sdhci_init_slot(dev, &sc->slot, 0); /* - * The SDHCI controller doesn't realize it, but we support 8-bit even - * though we're not a v3.0 controller. Advertise the ability. - */ - sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + * The SDHCI controller doesn't realize it, but we can support 8-bit + * even though we're not a v3.0 controller. If there's an fdt bus-width + * property, honor it. + */ + if (OF_getencprop(node, "bus-width", &prop, sizeof(prop)) > 0) { + sc->slot.host.caps &= ~(MMC_CAP_4_BIT_DATA | + MMC_CAP_8_BIT_DATA); + switch (prop) { + case 8: + sc->slot.host.caps |= MMC_CAP_8_BIT_DATA; + /* FALLTHROUGH */ + case 4: + sc->slot.host.caps |= MMC_CAP_4_BIT_DATA; + break; + case 1: + break; + default: + device_printf(dev, "Bad bus-width value %u\n", prop); + break; + } + } bus_generic_probe(dev); bus_generic_attach(dev); @@ -513,13 +582,12 @@ static int ti_sdhci_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "ti,mmchs")) { - return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "TI MMCHS (SDHCI 2.0)"); + return (BUS_PROBE_DEFAULT); } - device_set_desc(dev, "TI MMCHS (SDHCI 2.0)"); - - return (BUS_PROBE_DEFAULT); + return (ENXIO); } static device_method_t ti_sdhci_methods[] = { Modified: stable/10/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- stable/10/sys/boot/fdt/dts/am335x.dtsi Fri Dec 13 22:41:57 2013 (r259355) +++ stable/10/sys/boot/fdt/dts/am335x.dtsi Fri Dec 13 22:46:10 2013 (r259356) @@ -163,16 +163,17 @@ }; mmchs0@48060000 { - compatible = "ti,mmchs"; + compatible = "ti,omap3-hsmmc", "ti,mmchs"; reg =<0x48060000 0x1000 >; interrupts = <64>; interrupt-parent = <&AINTC>; mmchs-device-id = <0>; mmchs-wp-gpio-pin = <0xffffffff>; + ti,dual-volt; }; mmchs1@481D8000 { - compatible = "ti,mmchs"; + compatible = "ti,omap3-hsmmc", "ti,mmchs"; reg =<0x481D8000 0x1000 >; interrupts = <28>; interrupt-parent = <&AINTC>; Modified: stable/10/sys/boot/fdt/dts/beaglebone-black.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/beaglebone-black.dts Fri Dec 13 22:41:57 2013 (r259355) +++ stable/10/sys/boot/fdt/dts/beaglebone-black.dts Fri Dec 13 22:46:10 2013 (r259356) @@ -134,6 +134,7 @@ }; mmchs1@481D8000 { + bus-width = <8>; status = "okay"; }; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:48:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E7301FA; Fri, 13 Dec 2013 22:48:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0021631; Fri, 13 Dec 2013 22:48:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMm2jv059442; Fri, 13 Dec 2013 22:48:02 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMm1Mw059438; Fri, 13 Dec 2013 22:48:01 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132248.rBDMm1Mw059438@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259357 - stable/10/sys/dev/uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:48:02 -0000 Author: ian Date: Fri Dec 13 22:48:01 2013 New Revision: 259357 URL: http://svnweb.freebsd.org/changeset/base/259357 Log: MFC r257556: Arrange for uart_cpu_fdt's probe() routine to use the same table of compat strings as uart_bus_fdt's probe(). Modified: stable/10/sys/dev/uart/uart.h stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/uart/uart_cpu_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart.h ============================================================================== --- stable/10/sys/dev/uart/uart.h Fri Dec 13 22:46:10 2013 (r259356) +++ stable/10/sys/dev/uart/uart.h Fri Dec 13 22:48:01 2013 (r259357) @@ -76,6 +76,11 @@ extern struct uart_class uart_pl011_clas extern struct uart_class uart_cdnc_class __attribute__((weak)); extern struct uart_class uart_ti8250_class __attribute__((weak)); +#ifdef FDT +struct ofw_compat_data; +extern const struct ofw_compat_data *uart_fdt_compat_data; +#endif + #ifdef PC98 struct uart_class *uart_pc98_getdev(u_long port); #endif Modified: stable/10/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_fdt.c Fri Dec 13 22:46:10 2013 (r259356) +++ stable/10/sys/dev/uart/uart_bus_fdt.c Fri Dec 13 22:48:01 2013 (r259357) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -85,6 +87,9 @@ static struct ofw_compat_data compat_dat {NULL, (uintptr_t)NULL}, }; +/* Export the compat_data table for use by the uart_cpu_fdt.c probe routine. */ +const struct ofw_compat_data *uart_fdt_compat_data = compat_data; + static int uart_fdt_get_clock(phandle_t node, pcell_t *cell) { Modified: stable/10/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- stable/10/sys/dev/uart/uart_cpu_fdt.c Fri Dec 13 22:46:10 2013 (r259356) +++ stable/10/sys/dev/uart/uart_cpu_fdt.c Fri Dec 13 22:48:01 2013 (r259357) @@ -30,6 +30,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include @@ -93,6 +95,7 @@ int uart_cpu_getdev(int devtype, struct uart_devinfo *di) { char buf[64]; + const struct ofw_compat_data *cd; struct uart_class *class; phandle_t node, chosen; pcell_t shift, br, rclk; @@ -139,22 +142,13 @@ uart_cpu_getdev(int devtype, struct uart /* * Finalize configuration. */ - if (fdt_is_compatible(node, "fsl,imx-uart")) - class = &uart_imx_class; - else if (fdt_is_compatible(node, "quicc")) - class = &uart_quicc_class; - else if (fdt_is_compatible(node, "lpc")) - class = &uart_lpc_class; - else if (fdt_is_compatible(node, "arm,pl011")) - class = &uart_pl011_class; - else if (fdt_is_compatible(node, "exynos")) - class = &uart_s3c2410_class; - else if (fdt_is_compatible(node, "cadence,uart")) - class = &uart_cdnc_class; - else if (fdt_is_compatible(node, "ti,ns16550")) - class = &uart_ti8250_class; - else if (fdt_is_compatible(node, "ns16550")) - class = &uart_ns8250_class; + for (cd = uart_fdt_compat_data; cd->ocd_str != NULL; ++cd) { + if (fdt_is_compatible(node, cd->ocd_str)) + break; + } + if (cd->ocd_str == NULL) + return (ENXIO); + class = (struct uart_class *)cd->ocd_data; di->bas.chan = 0; di->bas.regshft = (u_int)shift; From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:49:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B12F379; Fri, 13 Dec 2013 22:49:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 166481640; Fri, 13 Dec 2013 22:49:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMnIwi059618; Fri, 13 Dec 2013 22:49:18 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMnITd059616; Fri, 13 Dec 2013 22:49:18 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132249.rBDMnITd059616@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259358 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:49:19 -0000 Author: ian Date: Fri Dec 13 22:49:18 2013 New Revision: 259358 URL: http://svnweb.freebsd.org/changeset/base/259358 Log: MFC r257557: Add a missing register definition. Modified: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_anatopreg.h ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Fri Dec 13 22:48:01 2013 (r259357) +++ stable/10/sys/arm/freescale/imx/imx6_anatopreg.h Fri Dec 13 22:49:18 2013 (r259358) @@ -81,6 +81,17 @@ #define IMX6_ANALOG_CCM_PFD_528_SET 0x104 #define IMX6_ANALOG_CCM_PFD_528_CLR 0x108 #define IMX6_ANALOG_CCM_PFD_528_TOG 0x10C +#define IMX6_ANALOG_PMU_REG_CORE 0x140 +#define IMX6_ANALOG_PMU_REG2_TARG_SHIFT 18 +#define IMX6_ANALOG_PMU_REG2_TARG_MASK \ + (0x1f << IMX6_ANALOG_PMU_REG2_TARG_SHIFT) +#define IMX6_ANALOG_PMU_REG1_TARG_SHIFT 9 +#define IMX6_ANALOG_PMU_REG1_TARG_MASK \ + (0x1f << IMX6_ANALOG_PMU_REG1_TARG_SHIFT) +#define IMX6_ANALOG_PMU_REG0_TARG_SHIFT 0 +#define IMX6_ANALOG_PMU_REG0_TARG_MASK \ + (0x1f << IMX6_ANALOG_PMU_REG0_TARG_SHIFT) + #define IMX6_ANALOG_CCM_MISC0 0x150 #define IMX6_ANALOG_CCM_MISC0_SET 0x154 #define IMX6_ANALOG_CCM_MISC0_CLR 0x158 From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:50:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A791506; Fri, 13 Dec 2013 22:50:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 763351650; Fri, 13 Dec 2013 22:50:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMoDKe059829; Fri, 13 Dec 2013 22:50:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMoDvt059828; Fri, 13 Dec 2013 22:50:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132250.rBDMoDvt059828@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:50:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259359 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:50:13 -0000 Author: ian Date: Fri Dec 13 22:50:12 2013 New Revision: 259359 URL: http://svnweb.freebsd.org/changeset/base/259359 Log: MFC r257561: Bugfix: the attach routine needs to use the same table of fdt compat strings that the probe routine used. Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_sdhci.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_sdhci.c Fri Dec 13 22:49:18 2013 (r259358) +++ stable/10/sys/arm/freescale/imx/imx_sdhci.c Fri Dec 13 22:50:12 2013 (r259359) @@ -558,13 +558,9 @@ imx_sdhci_attach(device_t dev) sc->dev = dev; - if (ofw_bus_is_compatible(dev, "fsl,imx51-esdhc")) { - sc->hwtype = HWTYPE_ESDHC; - } else if (ofw_bus_is_compatible(dev, "fsl,imx-usdhc")) { - sc->hwtype = HWTYPE_USDHC; - } else { + sc->hwtype = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + if (sc->hwtype == HWTYPE_NONE) panic("Impossible: not compatible in imx_sdhci_attach()"); - } rid = 0; sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:51:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D454E67C; Fri, 13 Dec 2013 22:51:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A64D616A2; Fri, 13 Dec 2013 22:51:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMp93m062294; Fri, 13 Dec 2013 22:51:09 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMp9DF062293; Fri, 13 Dec 2013 22:51:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132251.rBDMp9DF062293@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259360 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:51:09 -0000 Author: ian Date: Fri Dec 13 22:51:09 2013 New Revision: 259360 URL: http://svnweb.freebsd.org/changeset/base/259360 Log: MFC r257595: Comments and style(9) only, no functional changes. Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 22:50:12 2013 (r259359) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 22:51:09 2013 (r259360) @@ -158,34 +158,33 @@ bus_dma_get_range_nb(void) return (0); } +/* + * This code which manipulates the watchdog hardware is here to implement + * cpu_reset() because the watchdog is the only way for software to reset the + * chip. Why here and not in imx_wdog.c? Because there's no requirement that + * the watchdog driver be compiled in, but it's nice to be able to reboot even + * if it's not. + */ void imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr) { + const struct pmap_devmap *pd; + volatile uint16_t * pcr; /* - * This code which manipulates the watchdog hardware is here to - * implement cpu_reset() because the watchdog is the only way for - * software to reset the chip. Why here and not in imx_wdog.c? Because - * there's no requirement that the watchdog driver be compiled in, but - * it's nice to be able to reboot even if it's not. + * The deceptively simple write of WDOG_CR_WDE enables the watchdog, + * sets the timeout to its minimum value (half a second), and also + * clears the SRS bit which results in the SFTW (software-requested + * reset) bit being set in the watchdog status register after the reset. + * This is how software can distinguish a reset from a wdog timeout. */ - volatile uint16_t * pcr; - const struct pmap_devmap *pd; - if ((pd = pmap_devmap_find_pa(wdcr_physaddr, 2)) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { pcr = (uint16_t *)(pd->pd_va + (wdcr_physaddr - pd->pd_pa)); - /* - * This deceptively simple write enables the watchdog, sets the timeout - * to its minimum value (half a second), and also clears the SRS bit - * which results in the SFTW (software-requested reset) bit being set in - * the watchdog status register after the reset. This is how software - * can distinguish a requested reset from a wdog timeout. - */ *pcr = WDOG_CR_WDE; } - while (1) + for (;;) continue; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:53:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C089386E; Fri, 13 Dec 2013 22:53:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9E6CA16B9; Fri, 13 Dec 2013 22:53:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMr0Gh062541; Fri, 13 Dec 2013 22:53:00 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMqxo6062526; Fri, 13 Dec 2013 22:52:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132252.rBDMqxo6062526@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 22:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259361 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:53:00 -0000 Author: ian Date: Fri Dec 13 22:52:59 2013 New Revision: 259361 URL: http://svnweb.freebsd.org/changeset/base/259361 Log: MFC r257603, r257604: Rename WANDBOARD-COMMON to WANDBOARD.common and adjust the configs that include it accordingly. The build machinery for universe and tinderbox tries to build every kernel config whose name begins and ends with [A-Z0-9] and the common include file that has most of the options isn't buildable by itself, so the new lowercase .common will avoid building it. Added: stable/10/sys/arm/conf/WANDBOARD.common - copied unchanged from r257603, head/sys/arm/conf/WANDBOARD.common Deleted: stable/10/sys/arm/conf/WANDBOARD-COMMON Modified: stable/10/sys/arm/conf/WANDBOARD-DUAL stable/10/sys/arm/conf/WANDBOARD-QUAD stable/10/sys/arm/conf/WANDBOARD-SOLO Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/WANDBOARD-DUAL ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-DUAL Fri Dec 13 22:51:09 2013 (r259360) +++ stable/10/sys/arm/conf/WANDBOARD-DUAL Fri Dec 13 22:52:59 2013 (r259361) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include WANDBOARD-COMMON +include "WANDBOARD.common" ident WANDBOARD-DUAL # Flattened Device Tree Modified: stable/10/sys/arm/conf/WANDBOARD-QUAD ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-QUAD Fri Dec 13 22:51:09 2013 (r259360) +++ stable/10/sys/arm/conf/WANDBOARD-QUAD Fri Dec 13 22:52:59 2013 (r259361) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include WANDBOARD-COMMON +include "WANDBOARD.common" ident WANDBOARD-QUAD # Flattened Device Tree Modified: stable/10/sys/arm/conf/WANDBOARD-SOLO ============================================================================== --- stable/10/sys/arm/conf/WANDBOARD-SOLO Fri Dec 13 22:51:09 2013 (r259360) +++ stable/10/sys/arm/conf/WANDBOARD-SOLO Fri Dec 13 22:52:59 2013 (r259361) @@ -17,7 +17,7 @@ # # $FreeBSD$ -include WANDBOARD-COMMON +include "WANDBOARD.common" ident WANDBOARD-SOLO # Flattened Device Tree Copied: stable/10/sys/arm/conf/WANDBOARD.common (from r257603, head/sys/arm/conf/WANDBOARD.common) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/conf/WANDBOARD.common Fri Dec 13 22:52:59 2013 (r259361, copy of r257603, head/sys/arm/conf/WANDBOARD.common) @@ -0,0 +1,155 @@ +# Kernel configuration for Wandboard +# +# For more information on this file, please read the config(5) manual page, +# and/or 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$ + +include "../freescale/imx/std.imx6" + +options HZ=250 # Scheduling quantum is 4 milliseconds. +options SCHED_4BSD # 4BSD scheduler +options PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +#options SCTP # Stream Control Transmission Protocol +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 UFS_GJOURNAL # Enable gjournal-based UFS journaling +#options MD_ROOT # MD is a potential root device +options NFSCL # New Network Filesystem Client +#options NFSD # New Network Filesystem Server +options NFSLOCKD # Network Lock Manager +options NFS_ROOT # NFS usable as /, requires NFSCL +options MSDOSFS # MSDOS Filesystem +options CD9660 # ISO 9660 Filesystem +#options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework +options TMPFS # TMP Memory Filesystem +options GEOM_PART_GPT # GUID Partition Tables. +options GEOM_LABEL # Provides labelization +options KTRACE # ktrace(1) support +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options INCLUDE_CONFIG_FILE # Include this file in kernel + +# Debugging support. Always need this: +options KDB # Enable kernel debugger support. +# For minimum debugger support use KDB_TRACE, for interactive use DDB. +#options KDB_TRACE # Print a stack trace for a panic. +options DDB # Support DDB. +# For full debugger support use this instead: +#options GDB # Support remote GDB. +# Other debugging options... +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options ALT_BREAK_TO_DEBUGGER # Use to enter debugger. +#options DEBUG +#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 + +# Note that 'bpf' is required for DHCP. +device bpf # Berkeley packet filter + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device vlan # 802.1Q VLAN support +device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device faith # IPv6-to-IPv4 relaying (translation) +#device firmware # firmware assist module +device ether # Ethernet support +device miibus # Required for ethernet + +# Serial (COM) ports +device uart # Multi-uart driver + +#device iomux # IO Multiplexor + +# SCSI peripherals +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct SCSI access) + +# USB support +#options USB_DEBUG # enable debug msgs +options USB_HOST_ALIGN=32 # Required for ARM, set to cache line size. +device ehci # OHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +device u3g # USB modems + +# USB Ethernet, requires miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs + +# Watchdog timer. +# WARNING: can't be disabled!!! +#device imxwdt # Watchdog + +# Wireless NIC cards +#device wlan # 802.11 support +#device wlan_wep # 802.11 WEP support +#device wlan_ccmp # 802.11 CCMP support +#device wlan_tkip # 802.11 TKIP support +#device wlan_amrr # AMRR transmit rate control algorithm + +# NOTE: serial console will be disabled if syscons enabled +# Uncomment following lines for framebuffer/syscons support +# Wandboard has no video console support yet. +#device sc +#device kbdmux +#options SC_DFLT_FONT # compile font in +#makeoptions SC_DFLT_FONT=cp437 +#device ukbd # Allow keyboard like HIDs to control console +#device ums + +# required for netbooting +#options BOOTP +#options BOOTP_COMPAT +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=ffec0 + +# U-Boot stuff lives on slice 1, FreeBSD on slice 2. +options ROOTDEVNAME=\"ufs:mmcsd0s2a\" + +#device fsliic # Freescale i2c/iic (not ready yet) +#device iic # iic protocol +#device iicbus # iic bus + +device sdhci # SD controller +device mmc # SD/MMC protocol +device mmcsd # SDCard disk device + +device ffec # Freescale Fast Ethernet Controller + From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 22:58:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3F34B18; Fri, 13 Dec 2013 22:58:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A683216F0; Fri, 13 Dec 2013 22:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDMwwPN063200; Fri, 13 Dec 2013 22:58:58 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDMwwI3063198; Fri, 13 Dec 2013 22:58:58 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201312132258.rBDMwwI3063198@svn.freebsd.org> From: Alan Somers Date: Fri, 13 Dec 2013 22:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259362 - in head: etc sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 22:58:58 -0000 Author: asomers Date: Fri Dec 13 22:58:57 2013 New Revision: 259362 URL: http://svnweb.freebsd.org/changeset/base/259362 Log: sbin/devd/devd.cc Promoting the SIGINFO handler's log message from LOG_INFO to LOG_NOTICE, and promoting the "Processing event ..." message from LOG_DEBUG to LOG_INFO. Setting the logfile to LOG_NOTICE with this change will have the same result as setting it to LOG_INFO without this change. Setting it to LOG_INFO with this change will include the useful "Processing event ..." messages that were previously at LOG_DEBUG, without including useless messages like "Pushing table". The intent of this change is that one can log "Processing event ..." without logging "Pushing table" and related messages that are sent for every event. The number of lines actually logged is reduced by about 75% by making this change and setting syslog to LOG_INFO vs setting syslog to LOG_DEBUG. etc/syslog.conf Changing the recommended loglevel to notice instead of info. Sponsored by: Spectra Logic Corp MFC after: 4 weeks Modified: head/etc/syslog.conf head/sbin/devd/devd.cc Modified: head/etc/syslog.conf ============================================================================== --- head/etc/syslog.conf Fri Dec 13 22:52:59 2013 (r259361) +++ head/etc/syslog.conf Fri Dec 13 22:58:57 2013 (r259362) @@ -30,7 +30,7 @@ cron.* /var/log/cron # news.notice /var/log/news/news.notice # Uncomment this if you wish to see messages produced by devd # !devd -# *.>=info /var/log/devd.log +# *.>=notice /var/log/devd.log !ppp *.* /var/log/ppp.log !* Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Fri Dec 13 22:52:59 2013 (r259361) +++ head/sbin/devd/devd.cc Fri Dec 13 22:58:57 2013 (r259362) @@ -772,7 +772,7 @@ process_event(char *buffer) char *sp; sp = buffer + 1; - devdlog(LOG_DEBUG, "Processing event '%s'\n", buffer); + devdlog(LOG_INFO, "Processing event '%s'\n", buffer); type = *buffer++; cfg.push_var_table(); // No match doesn't have a device, and the format is a little @@ -989,7 +989,7 @@ event_loop(void) } rv = select(max_fd, &fds, NULL, NULL, &tv); if (got_siginfo) { - devdlog(LOG_INFO, "Events received so far=%u\n", + devdlog(LOG_NOTICE, "Events received so far=%u\n", total_events); got_siginfo = 0; } From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 23:07:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8790DEA2; Fri, 13 Dec 2013 23:07:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 732A017A6; Fri, 13 Dec 2013 23:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDN7NqY066957; Fri, 13 Dec 2013 23:07:23 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDN7NIA066954; Fri, 13 Dec 2013 23:07:23 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132307.rBDN7NIA066954@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 23:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259363 - stable/10/sys/arm/s3c2xx0 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 23:07:23 -0000 Author: ian Date: Fri Dec 13 23:07:22 2013 New Revision: 259363 URL: http://svnweb.freebsd.org/changeset/base/259363 Log: MFC r257639: Remove the duplicated implementations of some bus_space functions and use the essentially identical generic implementations instead. The generic implementations differ only in the spelling of a couple variable names and some formatting differences. Modified: stable/10/sys/arm/s3c2xx0/files.s3c2xx0 stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/s3c2xx0/files.s3c2xx0 ============================================================================== --- stable/10/sys/arm/s3c2xx0/files.s3c2xx0 Fri Dec 13 22:58:57 2013 (r259362) +++ stable/10/sys/arm/s3c2xx0/files.s3c2xx0 Fri Dec 13 23:07:22 2013 (r259363) @@ -1,4 +1,6 @@ # $FreeBSD$ +arm/arm/bus_space_asm_generic.S standard +arm/arm/bus_space_generic.c standard arm/arm/cpufunc_asm_arm9.S standard arm/arm/irq_dispatch.S standard arm/s3c2xx0/board_ln2410sbc.c optional board_ln2410sbc Modified: stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c Fri Dec 13 22:58:57 2013 (r259362) +++ stable/10/sys/arm/s3c2xx0/s3c2xx0_space.c Fri Dec 13 23:07:22 2013 (r259363) @@ -89,7 +89,6 @@ __FBSDID("$FreeBSD$"); #include /* Prototypes for all the bus_space structure functions */ -bs_protos(s3c2xx0); bs_protos(generic); bs_protos(generic_armv4); @@ -98,16 +97,16 @@ struct bus_space s3c2xx0_bs_tag = { (void *) 0, /* mapping/unmapping */ - s3c2xx0_bs_map, - s3c2xx0_bs_unmap, - s3c2xx0_bs_subregion, + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, /* allocation/deallocation */ - s3c2xx0_bs_alloc, /* not implemented */ - s3c2xx0_bs_free, /* not implemented */ + generic_bs_alloc, /* not implemented */ + generic_bs_free, /* not implemented */ /* barrier */ - s3c2xx0_bs_barrier, + generic_bs_barrier, /* read (single) */ generic_bs_r_1, @@ -164,87 +163,3 @@ struct bus_space s3c2xx0_bs_tag = { NULL, }; -int -s3c2xx0_bs_map(void *t, bus_addr_t bpa, bus_size_t size, - int flag, bus_space_handle_t * bshp) -{ - u_long startpa, endpa, pa; - vm_offset_t va; - pt_entry_t *pte; - const struct pmap_devmap *pd; - - if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { - /* Device was statically mapped. */ - *bshp = pd->pd_va + (bpa - pd->pd_pa); - return 0; - } - - startpa = trunc_page(bpa); - endpa = round_page(bpa + size); - - va = kva_alloc(endpa - startpa); - if (!va) - return (ENOMEM); - - *bshp = (bus_space_handle_t) (va + (bpa - startpa)); - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - if ((flag & BUS_SPACE_MAP_CACHEABLE) == 0) - *pte &= ~L2_S_CACHE_MASK; - } - return (0); -} - -void -s3c2xx0_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) -{ - vm_offset_t va, endva, origva; - - if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page((vm_offset_t)h + size); - origva = va = trunc_page((vm_offset_t)h); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kva_free(origva, endva - origva); -} - -int -s3c2xx0_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t size, bus_space_handle_t * nbshp) -{ - - *nbshp = bsh + offset; - return (0); -} - -void -s3c2xx0_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, - bus_size_t len, int flags) -{ - - /* Nothing to do. */ -} - -int -s3c2xx0_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, - bus_size_t size, bus_size_t alignment, bus_size_t boundary, - int flags, bus_addr_t * bpap, bus_space_handle_t * bshp) -{ - - panic("s3c2xx0_io_bs_alloc(): not implemented\n"); -} - -void -s3c2xx0_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - panic("s3c2xx0_io_bs_free(): not implemented\n"); -} From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 23:56:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EB9345A0; Fri, 13 Dec 2013 23:56:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D31A91CC8; Fri, 13 Dec 2013 23:56:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDNuwVi086452; Fri, 13 Dec 2013 23:56:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDNusQE086420; Fri, 13 Dec 2013 23:56:54 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312132356.rBDNusQE086420@svn.freebsd.org> From: Ian Lepore Date: Fri, 13 Dec 2013 23:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259364 - in stable/10/sys: arm/allwinner arm/arm arm/at91 arm/broadcom/bcm2835 arm/econa arm/freescale/imx arm/include arm/lpc arm/mv arm/rockchip arm/s3c2xx0 arm/sa11x0 arm/samsung/ex... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 23:56:59 -0000 Author: ian Date: Fri Dec 13 23:56:53 2013 New Revision: 259364 URL: http://svnweb.freebsd.org/changeset/base/259364 Log: MFC r257648, r257649, r257660: Begin reducing code duplication in arm pmap.c and pmap-v6.c by factoring out common code related to mapping device memory into a new devmap.c file. Remove the growing duplication of code that used pmap_devmap_find_pa() and then did some math with the returned results to generate a virtual address, and likewise in reverse to get a physical address. Now there are a pair of functions, arm_devmap_vtop() and arm_devmap_ptov(), to do that. The bus_space_map() implementations are rewritten in terms of these. Move remaining code and data related to static device mapping into the new devmap.[ch] files. Emphasize the MD nature of these things by using the prefix arm_devmap_ on the function and type names (already a few of these things found their way into MI code, hopefully it will be harder to do by accident in the future). Added: stable/10/sys/arm/arm/devmap.c - copied, changed from r257648, head/sys/arm/arm/devmap.c stable/10/sys/arm/include/devmap.h - copied, changed from r257648, head/sys/arm/include/devmap.h Modified: stable/10/sys/arm/allwinner/a10_machdep.c stable/10/sys/arm/arm/bus_space_generic.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/arm/pmap-v6.c stable/10/sys/arm/arm/pmap.c stable/10/sys/arm/at91/at91.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/10/sys/arm/econa/econa_machdep.c stable/10/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/arm/freescale/imx/imx_machdep.c stable/10/sys/arm/include/fdt.h stable/10/sys/arm/include/machdep.h stable/10/sys/arm/include/pmap.h stable/10/sys/arm/lpc/lpc_machdep.c stable/10/sys/arm/mv/mv_localbus.c stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/mv/mvvar.h stable/10/sys/arm/rockchip/rk30xx_machdep.c stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/sa11x0/assabet_machdep.c stable/10/sys/arm/samsung/exynos/exynos5_machdep.c stable/10/sys/arm/tegra/tegra2_machdep.c stable/10/sys/arm/ti/ti_machdep.c stable/10/sys/arm/versatile/versatile_machdep.c stable/10/sys/arm/xilinx/zy7_machdep.c stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/pxa/pxa_machdep.c stable/10/sys/conf/files.arm stable/10/sys/dev/fdt/fdt_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_machdep.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -71,7 +72,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -91,7 +92,7 @@ platform_devmap_init(void) i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } Modified: stable/10/sys/arm/arm/bus_space_generic.c ============================================================================== --- stable/10/sys/arm/arm/bus_space_generic.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/arm/bus_space_generic.c Fri Dec 13 23:56:53 2013 (r259364) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* Prototypes for all the bus_space structure functions */ bs_protos(generic); @@ -58,36 +59,20 @@ int generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, bus_space_handle_t *bshp) { - const struct pmap_devmap *pd; - vm_paddr_t startpa, endpa, pa, offset; - vm_offset_t va; - pt_entry_t *pte; - - if ((pd = pmap_devmap_find_pa(bpa, size)) != NULL) { - /* Device was statically mapped. */ - *bshp = pd->pd_va + (bpa - pd->pd_pa); - return (0); - } - - endpa = round_page(bpa + size); - offset = bpa & PAGE_MASK; - startpa = trunc_page(bpa); - - va = kva_alloc(endpa - startpa); - if (va == 0) - return (ENOMEM); - - *bshp = va + offset; - - for (pa = startpa; pa < endpa; pa += PAGE_SIZE, va += PAGE_SIZE) { - pmap_kenter(va, pa); - pte = vtopte(va); - if (!(flags & BUS_SPACE_MAP_CACHEABLE)) { - *pte &= ~L2_S_CACHE_MASK; - PTE_SYNC(pte); - } - } + void *va; + /* + * Look up the address in the static device mappings. If it's not + * there, establish a new dynamic mapping. + * + * We don't even examine the passed-in flags. For ARM, the CACHEABLE + * flag doesn't make sense (we create PTE_DEVICE mappings), and the + * LINEAR flag is just implied because we use kva_alloc(size). + */ + if ((va = arm_devmap_ptov(bpa, size)) == NULL) + if ((va = pmap_mapdev(bpa, size)) == NULL) + return (ENOMEM); + *bshp = (bus_space_handle_t)va; return (0); } @@ -104,21 +89,13 @@ generic_bs_alloc(void *t, bus_addr_t rst void generic_bs_unmap(void *t, bus_space_handle_t h, bus_size_t size) { - vm_offset_t va, endva, origva; - if (pmap_devmap_find_va((vm_offset_t)h, size) != NULL) { - /* Device was statically mapped; nothing to do. */ - return; - } - - endva = round_page((vm_offset_t)h + size); - origva = va = trunc_page((vm_offset_t)h); - - while (va < endva) { - pmap_kremove(va); - va += PAGE_SIZE; - } - kva_free(origva, endva - origva); + /* + * If the region is static-mapped do nothing, otherwise remove the + * dynamic mapping. + */ + if (arm_devmap_vtop((void*)h, size) == DEVMAP_PADDR_NOTFOUND) + pmap_unmapdev((vm_offset_t)h, size); } void Copied and modified: stable/10/sys/arm/arm/devmap.c (from r257648, head/sys/arm/arm/devmap.c) ============================================================================== --- head/sys/arm/arm/devmap.c Mon Nov 4 19:44:37 2013 (r257648, copy source) +++ stable/10/sys/arm/arm/devmap.c Fri Dec 13 23:56:53 2013 (r259364) @@ -38,18 +38,42 @@ __FBSDID("$FreeBSD$"); #include #include -static const struct pmap_devmap *devmap_table; +static const struct arm_devmap_entry *devmap_table; /* - * Map all of the static regions in the devmap table, and remember - * the devmap table so other parts of the kernel can do lookups later. + * Register the given table as the one to use in arm_devmap_bootstrap(). */ void -pmap_devmap_bootstrap(vm_offset_t l1pt, const struct pmap_devmap *table) +arm_devmap_register_table(const struct arm_devmap_entry *table) { - const struct pmap_devmap *pd; devmap_table = table; +} + +/* + * Map all of the static regions in the devmap table, and remember the devmap + * table so the mapdev, ptov, and vtop functions can do lookups later. + * + * If a non-NULL table pointer is given it is used unconditionally, otherwise + * the previously-registered table is used. This smooths transition from legacy + * code that fills in a local table then calls this function passing that table, + * and newer code that uses arm_devmap_register_table() in platform-specific + * code, then lets the common initarm() call this function with a NULL pointer. + */ +void +arm_devmap_bootstrap(vm_offset_t l1pt, const struct arm_devmap_entry *table) +{ + const struct arm_devmap_entry *pd; + + /* + * If given a table pointer, use it, else ensure a table was previously + * registered. This happens early in boot, and there's a good chance + * the panic message won't be seen, but there's not much we can do. + */ + if (table != NULL) + devmap_table = table; + else if (devmap_table == NULL) + panic("arm_devmap_bootstrap: No devmap table registered."); for (pd = devmap_table; pd->pd_size != 0; ++pd) { pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, @@ -64,7 +88,7 @@ pmap_devmap_bootstrap(vm_offset_t l1pt, void * arm_devmap_ptov(vm_paddr_t pa, vm_size_t size) { - const struct pmap_devmap *pd; + const struct arm_devmap_entry *pd; if (devmap_table == NULL) return (NULL); @@ -84,7 +108,7 @@ arm_devmap_ptov(vm_paddr_t pa, vm_size_t vm_paddr_t arm_devmap_vtop(void * vpva, vm_size_t size) { - const struct pmap_devmap *pd; + const struct arm_devmap_entry *pd; vm_offset_t va; if (devmap_table == NULL) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/arm/machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -90,6 +90,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -158,7 +159,6 @@ struct pv_addr undstack; struct pv_addr abtstack; static struct pv_addr kernelstack; -const struct pmap_devmap *pmap_devmap_bootstrap_table; #endif #if defined(LINUX_BOOT_ABI) @@ -1417,7 +1417,7 @@ initarm(struct arm_boot_params *abp) /* Map pmap_devmap[] entries */ err_devmap = platform_devmap_init(); - pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); + arm_devmap_bootstrap(l1pagetable, NULL); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); pmap_pa = kernel_l1pt.pv_pa; Modified: stable/10/sys/arm/arm/pmap-v6.c ============================================================================== --- stable/10/sys/arm/arm/pmap-v6.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/arm/pmap-v6.c Fri Dec 13 23:56:53 2013 (r259364) @@ -137,7 +137,9 @@ /* * Special compilation symbols * PMAP_DEBUG - Build in pmap_debug_level code - */ + * + * Note that pmap_mapdev() and pmap_unmapdev() are implemented in arm/devmap.c +*/ /* Include header files */ #include "opt_vm.h" @@ -2424,6 +2426,17 @@ pmap_kenter_nocache(vm_offset_t va, vm_p } void +pmap_kenter_device(vm_offset_t va, vm_paddr_t pa) +{ + + /* + * XXX - Need a way for kenter_internal to handle PTE_DEVICE mapping as + * a potentially different thing than PTE_NOCACHE. + */ + pmap_kenter_internal(va, pa, 0); +} + +void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa) { @@ -5008,36 +5021,6 @@ pmap_align_superpage(vm_object_t object, { } - -/* - * Map a set of physical memory pages into the kernel virtual - * address space. Return a pointer to where it is mapped. This - * routine is intended to be used for mapping device memory, - * NOT real memory. - */ -void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) -{ - vm_offset_t va, tmpva, offset; - - offset = pa & PAGE_MASK; - size = roundup(size, PAGE_SIZE); - - GIANT_REQUIRED; - - va = kva_alloc(size); - if (!va) - panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); - for (tmpva = va; size > 0;) { - pmap_kenter_internal(tmpva, pa, 0); - size -= PAGE_SIZE; - tmpva += PAGE_SIZE; - pa += PAGE_SIZE; - } - - return ((void *)(va + offset)); -} - /* * pmap_map_section: * @@ -5220,86 +5203,6 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offs } -/********************** Static device map routines ***************************/ - -static const struct pmap_devmap *pmap_devmap_table; - -/* - * Register the devmap table. This is provided in case early console - * initialization needs to register mappings created by bootstrap code - * before pmap_devmap_bootstrap() is called. - */ -void -pmap_devmap_register(const struct pmap_devmap *table) -{ - - pmap_devmap_table = table; -} - -/* - * Map all of the static regions in the devmap table, and remember - * the devmap table so other parts of the kernel can look up entries - * later. - */ -void -pmap_devmap_bootstrap(vm_offset_t l1pt, const struct pmap_devmap *table) -{ - int i; - - pmap_devmap_table = table; - - for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) { -#ifdef VERBOSE_INIT_ARM - printf("devmap: %08x -> %08x @ %08x\n", - pmap_devmap_table[i].pd_pa, - pmap_devmap_table[i].pd_pa + - pmap_devmap_table[i].pd_size - 1, - pmap_devmap_table[i].pd_va); -#endif - pmap_map_chunk(l1pt, pmap_devmap_table[i].pd_va, - pmap_devmap_table[i].pd_pa, - pmap_devmap_table[i].pd_size, - pmap_devmap_table[i].pd_prot, - pmap_devmap_table[i].pd_cache); - } -} - -const struct pmap_devmap * -pmap_devmap_find_pa(vm_paddr_t pa, vm_size_t size) -{ - int i; - - if (pmap_devmap_table == NULL) - return (NULL); - - for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) { - if (pa >= pmap_devmap_table[i].pd_pa && - pa + size <= pmap_devmap_table[i].pd_pa + - pmap_devmap_table[i].pd_size) - return (&pmap_devmap_table[i]); - } - - return (NULL); -} - -const struct pmap_devmap * -pmap_devmap_find_va(vm_offset_t va, vm_size_t size) -{ - int i; - - if (pmap_devmap_table == NULL) - return (NULL); - - for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) { - if (va >= pmap_devmap_table[i].pd_va && - va + size <= pmap_devmap_table[i].pd_va + - pmap_devmap_table[i].pd_size) - return (&pmap_devmap_table[i]); - } - - return (NULL); -} - int pmap_dmap_iscurrent(pmap_t pmap) { Modified: stable/10/sys/arm/arm/pmap.c ============================================================================== --- stable/10/sys/arm/arm/pmap.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/arm/pmap.c Fri Dec 13 23:56:53 2013 (r259364) @@ -134,6 +134,8 @@ /* * Special compilation symbols * PMAP_DEBUG - Build in pmap_debug_level code + * + * Note that pmap_mapdev() and pmap_unmapdev() are implemented in arm/devmap.c */ /* Include header files */ @@ -2842,6 +2844,17 @@ pmap_kenter_nocache(vm_offset_t va, vm_p } void +pmap_kenter_device(vm_offset_t va, vm_paddr_t pa) +{ + + /* + * XXX - Need a way for kenter_internal to handle PTE_DEVICE mapping as + * a potentially different thing than PTE_NOCACHE. + */ + pmap_kenter_internal(va, pa, 0); +} + +void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa) { @@ -4690,36 +4703,6 @@ pmap_align_superpage(vm_object_t object, { } - -/* - * Map a set of physical memory pages into the kernel virtual - * address space. Return a pointer to where it is mapped. This - * routine is intended to be used for mapping device memory, - * NOT real memory. - */ -void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) -{ - vm_offset_t va, tmpva, offset; - - offset = pa & PAGE_MASK; - size = roundup(size, PAGE_SIZE); - - GIANT_REQUIRED; - - va = kva_alloc(size); - if (!va) - panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); - for (tmpva = va; size > 0;) { - pmap_kenter_internal(tmpva, pa, 0); - size -= PAGE_SIZE; - tmpva += PAGE_SIZE; - pa += PAGE_SIZE; - } - - return ((void *)(va + offset)); -} - #define BOOTSTRAP_DEBUG /* @@ -4940,86 +4923,6 @@ pmap_map_chunk(vm_offset_t l1pt, vm_offs } -/********************** Static device map routines ***************************/ - -static const struct pmap_devmap *pmap_devmap_table; - -/* - * Register the devmap table. This is provided in case early console - * initialization needs to register mappings created by bootstrap code - * before pmap_devmap_bootstrap() is called. - */ -void -pmap_devmap_register(const struct pmap_devmap *table) -{ - - pmap_devmap_table = table; -} - -/* - * Map all of the static regions in the devmap table, and remember - * the devmap table so other parts of the kernel can look up entries - * later. - */ -void -pmap_devmap_bootstrap(vm_offset_t l1pt, const struct pmap_devmap *table) -{ - int i; - - pmap_devmap_table = table; - - for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) { -#ifdef VERBOSE_INIT_ARM - printf("devmap: %08x -> %08x @ %08x\n", - pmap_devmap_table[i].pd_pa, - pmap_devmap_table[i].pd_pa + - pmap_devmap_table[i].pd_size - 1, - pmap_devmap_table[i].pd_va); -#endif - pmap_map_chunk(l1pt, pmap_devmap_table[i].pd_va, - pmap_devmap_table[i].pd_pa, - pmap_devmap_table[i].pd_size, - pmap_devmap_table[i].pd_prot, - pmap_devmap_table[i].pd_cache); - } -} - -const struct pmap_devmap * -pmap_devmap_find_pa(vm_paddr_t pa, vm_size_t size) -{ - int i; - - if (pmap_devmap_table == NULL) - return (NULL); - - for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) { - if (pa >= pmap_devmap_table[i].pd_pa && - pa + size <= pmap_devmap_table[i].pd_pa + - pmap_devmap_table[i].pd_size) - return (&pmap_devmap_table[i]); - } - - return (NULL); -} - -const struct pmap_devmap * -pmap_devmap_find_va(vm_offset_t va, vm_size_t size) -{ - int i; - - if (pmap_devmap_table == NULL) - return (NULL); - - for (i = 0; pmap_devmap_table[i].pd_size != 0; i++) { - if (va >= pmap_devmap_table[i].pd_va && - va + size <= pmap_devmap_table[i].pd_va + - pmap_devmap_table[i].pd_size) - return (&pmap_devmap_table[i]); - } - - return (NULL); -} - void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma) { Modified: stable/10/sys/arm/at91/at91.c ============================================================================== --- stable/10/sys/arm/at91/at91.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/at91/at91.c Fri Dec 13 23:56:53 2013 (r259364) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #define _ARM32_BUS_DMA_PRIVATE #include +#include #include #include @@ -52,7 +53,7 @@ static struct at91_softc *at91_softc; static void at91_eoi(void *); -extern const struct pmap_devmap at91_devmap[]; +extern const struct arm_devmap_entry at91_devmap[]; uint32_t at91_master_clock; @@ -258,7 +259,7 @@ static int at91_attach(device_t dev) { struct at91_softc *sc = device_get_softc(dev); - const struct pmap_devmap *pdevmap; + const struct arm_devmap_entry *pdevmap; int i; at91_softc = sc; Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/at91/at91_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -128,7 +129,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -const struct pmap_devmap at91_devmap[] = { +const struct arm_devmap_entry at91_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. @@ -566,7 +567,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, at91_devmap); + arm_devmap_bootstrap(l1pagetable, at91_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -93,7 +94,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (2) // FIXME -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -113,7 +114,7 @@ platform_devmap_init(void) fdt_devmap[i].pd_cache = PTE_DEVICE; i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } Modified: stable/10/sys/arm/econa/econa_machdep.c ============================================================================== --- stable/10/sys/arm/econa/econa_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/econa/econa_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,7 +109,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -static const struct pmap_devmap econa_devmap[] = { +static const struct arm_devmap_entry econa_devmap[] = { { /* * This maps DDR SDRAM @@ -275,7 +276,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, econa_devmap); + arm_devmap_bootstrap(l1pagetable, econa_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -34,9 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include + +#include +#include + #include #include #include @@ -112,7 +115,6 @@ cpu_reset(void) */ u_int imx_soc_type() { - const struct pmap_devmap *pd; uint32_t digprog, hwsoc; uint32_t *pcr; const uint32_t HWSOC_MX6SL = 0x60; @@ -131,10 +133,8 @@ u_int imx_soc_type() IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT; /*printf("digprog = 0x%08x\n", digprog);*/ if (hwsoc == HWSOC_MX6DL) { - pd = pmap_devmap_find_pa(SCU_CONFIG_PHYSADDR, 4); - if (pd != NULL) { - pcr = (uint32_t *)(pd->pd_va + - (SCU_CONFIG_PHYSADDR - pd->pd_pa)); + pcr = arm_devmap_ptov(SCU_CONFIG_PHYSADDR, 4); + if (pcr != NULL) { /*printf("scu config = 0x%08x\n", *pcr);*/ if ((*pcr & 0x03) == 0) { hwsoc = HWSOC_MX6SOLO; Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -46,14 +47,14 @@ __FBSDID("$FreeBSD$"); #define IMX_MAX_DEVMAP_ENTRIES 8 -static struct pmap_devmap devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; +static struct arm_devmap_entry devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; static u_int devmap_idx; static vm_offset_t devmap_vaddr = ARM_VECTORS_HIGH; void imx_devmap_addentry(vm_paddr_t pa, vm_size_t sz) { - struct pmap_devmap *m; + struct arm_devmap_entry *m; /* * The last table entry is the all-zeroes end-of-table marker. If we're @@ -102,7 +103,7 @@ initarm_lastaddr(void) */ imx_devmap_init(); - pmap_devmap_bootstrap_table = devmap_entries; + arm_devmap_register_table(devmap_entries); return (devmap_vaddr); } @@ -127,7 +128,7 @@ initarm_gpio_init(void) void initarm_late_init(void) { - struct pmap_devmap *m; + struct arm_devmap_entry *m; /* * We did the static devmap setup earlier, during initarm_lastaddr(), @@ -168,7 +169,6 @@ bus_dma_get_range_nb(void) void imx_wdog_cpu_reset(vm_offset_t wdcr_physaddr) { - const struct pmap_devmap *pd; volatile uint16_t * pcr; /* @@ -178,10 +178,9 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_phys * reset) bit being set in the watchdog status register after the reset. * This is how software can distinguish a reset from a wdog timeout. */ - if ((pd = pmap_devmap_find_pa(wdcr_physaddr, 2)) == NULL) { + if ((pcr = arm_devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { - pcr = (uint16_t *)(pd->pd_va + (wdcr_physaddr - pd->pd_pa)); *pcr = WDOG_CR_WDE; } for (;;) Copied and modified: stable/10/sys/arm/include/devmap.h (from r257648, head/sys/arm/include/devmap.h) ============================================================================== --- head/sys/arm/include/devmap.h Mon Nov 4 19:44:37 2013 (r257648, copy source) +++ stable/10/sys/arm/include/devmap.h Fri Dec 13 23:56:53 2013 (r259364) @@ -30,6 +30,33 @@ #define _MACHINE_DEVMAP_H_ /* + * This structure is used by MD code to describe static mappings of devices + * which are established as part of bringing up the MMU early in the boot. + */ +struct arm_devmap_entry { + vm_offset_t pd_va; /* virtual address */ + vm_paddr_t pd_pa; /* physical address */ + vm_size_t pd_size; /* size of region */ + vm_prot_t pd_prot; /* protection code */ + int pd_cache; /* cache attributes */ +}; + +/* + * Register a platform-local table to be bootstrapped by the generic + * initarm() in arm/machdep.c. This is used by newer code that allocates and + * fills in its own local table but does not have its own initarm() routine. + */ +void arm_devmap_register_table(const struct arm_devmap_entry * _table); + +/* + * Directly process a table; called from initarm() of older platforms that don't + * use the generic initarm() in arm/machdep.c. If the table pointer is NULL, + * this will use the table installed previously by arm_devmap_register_table(). + */ +void arm_devmap_bootstrap(vm_offset_t _l1pt, + const struct arm_devmap_entry *_table); + +/* * Routines to translate between virtual and physical addresses within a region * that is static-mapped by the devmap code. If the given address range isn't * static-mapped, then ptov returns NULL and vtop returns DEVMAP_PADDR_NOTFOUND. Modified: stable/10/sys/arm/include/fdt.h ============================================================================== --- stable/10/sys/arm/include/fdt.h Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/include/fdt.h Fri Dec 13 23:56:53 2013 (r259364) @@ -56,8 +56,10 @@ struct mem_region { vm_size_t mr_size; }; -int fdt_localbus_devmap(phandle_t, struct pmap_devmap *, int, int *); -int fdt_pci_devmap(phandle_t, struct pmap_devmap *devmap, vm_offset_t, +struct arm_devmap_entry; + +int fdt_localbus_devmap(phandle_t, struct arm_devmap_entry *, int, int *); +int fdt_pci_devmap(phandle_t, struct arm_devmap_entry *devmap, vm_offset_t, vm_offset_t); #endif /* _MACHINE_FDT_H_ */ Modified: stable/10/sys/arm/include/machdep.h ============================================================================== --- stable/10/sys/arm/include/machdep.h Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/include/machdep.h Fri Dec 13 23:56:53 2013 (r259364) @@ -43,9 +43,6 @@ int platform_devmap_init(void); void board_set_serial(uint64_t); void board_set_revision(uint32_t); -/* Needs to be initialised by platform_devmap_init */ -extern const struct pmap_devmap *pmap_devmap_bootstrap_table; - /* Setup standard arrays */ void arm_dump_avail_init( vm_offset_t memsize, size_t max); Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/include/pmap.h Fri Dec 13 23:56:53 2013 (r259364) @@ -254,6 +254,7 @@ void pmap_bootstrap(vm_offset_t firstadd int pmap_change_attr(vm_offset_t, vm_size_t, int); void pmap_kenter(vm_offset_t va, vm_paddr_t pa); void pmap_kenter_nocache(vm_offset_t va, vm_paddr_t pa); +void pmap_kenter_device(vm_offset_t va, vm_paddr_t pa); void *pmap_kenter_temp(vm_paddr_t pa, int i); void pmap_kenter_user(vm_offset_t va, vm_paddr_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); @@ -687,24 +688,6 @@ void pmap_use_minicache(vm_offset_t, vm_ void vector_page_setprot(int); -/* - * This structure is used by machine-dependent code to describe - * static mappings of devices, created at bootstrap time. - */ -struct pmap_devmap { - vm_offset_t pd_va; /* virtual address */ - vm_paddr_t pd_pa; /* physical address */ - vm_size_t pd_size; /* size of region */ - vm_prot_t pd_prot; /* protection code */ - int pd_cache; /* cache attributes */ -}; - -const struct pmap_devmap *pmap_devmap_find_pa(vm_paddr_t, vm_size_t); -const struct pmap_devmap *pmap_devmap_find_va(vm_offset_t, vm_size_t); - -void pmap_devmap_bootstrap(vm_offset_t, const struct pmap_devmap *); -void pmap_devmap_register(const struct pmap_devmap *); - #define SECTION_CACHE 0x1 #define SECTION_PT 0x2 void pmap_kenter_section(vm_offset_t, vm_paddr_t, int flags); Modified: stable/10/sys/arm/lpc/lpc_machdep.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -85,7 +86,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -105,7 +106,7 @@ platform_devmap_init(void) fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE; fdt_devmap[0].pd_cache = PTE_NOCACHE; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); return (0); } Modified: stable/10/sys/arm/mv/mv_localbus.c ============================================================================== --- stable/10/sys/arm/mv/mv_localbus.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/mv/mv_localbus.c Fri Dec 13 23:56:53 2013 (r259364) @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include #include #include @@ -380,7 +383,7 @@ localbus_get_devinfo(device_t bus, devic } int -fdt_localbus_devmap(phandle_t dt_node, struct pmap_devmap *fdt_devmap, +fdt_localbus_devmap(phandle_t dt_node, struct arm_devmap_entry *fdt_devmap, int banks_max_num, int *banks_added) { pcell_t ranges[MV_LOCALBUS_MAX_BANKS * MV_LOCALBUS_MAX_BANK_CELLS]; Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include /* XXX */ @@ -245,12 +246,12 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; static int -platform_sram_devmap(struct pmap_devmap *map) +platform_sram_devmap(struct arm_devmap_entry *map) { #if !defined(SOC_MV_ARMADAXP) phandle_t child, root; @@ -295,10 +296,10 @@ out: * real implementation of this function in dev/fdt/fdt_pci.c overrides the weak * alias defined here. */ -int mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, +int mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va); int -mv_default_fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, +mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va) { @@ -322,7 +323,7 @@ platform_devmap_init(void) int i, num_mapped; i = 0; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; + arm_devmap_register_table(&fdt_devmap[0]); /* * IMMR range. Modified: stable/10/sys/arm/mv/mvvar.h ============================================================================== --- stable/10/sys/arm/mv/mvvar.h Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/mv/mvvar.h Fri Dec 13 23:56:53 2013 (r259364) @@ -66,7 +66,6 @@ struct decode_win { vm_paddr_t remap; }; -extern const struct pmap_devmap pmap_devmap[]; extern const struct gpio_config mv_gpio_config[]; extern const struct decode_win *cpu_wins; extern const struct decode_win *idma_wins; Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -73,7 +74,7 @@ initarm_late_init(void) } #define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) -static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { +static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, 0, 0, } }; @@ -92,8 +93,8 @@ platform_devmap_init(void) fdt_devmap[i].pd_cache = PTE_DEVICE; i++; - pmap_devmap_bootstrap_table = &fdt_devmap[0]; - + arm_devmap_register_table(&fdt_devmap[0]); + return (0); } Modified: stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -126,7 +127,7 @@ struct pv_addr kernelstack; #define _S(s) (((s) + L1_S_SIZE - 1) & ~(L1_S_SIZE-1)) /* Static device mappings. */ -static const struct pmap_devmap s3c24x0_devmap[] = { +static const struct arm_devmap_entry s3c24x0_devmap[] = { /* * Map the devices we need early on. */ @@ -324,7 +325,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - pmap_devmap_bootstrap(l1pagetable, s3c24x0_devmap); + arm_devmap_bootstrap(l1pagetable, s3c24x0_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); setttb(kernel_l1pt.pv_pa); Modified: stable/10/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- stable/10/sys/arm/sa11x0/assabet_machdep.c Fri Dec 13 23:07:22 2013 (r259363) +++ stable/10/sys/arm/sa11x0/assabet_machdep.c Fri Dec 13 23:56:53 2013 (r259364) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:16:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 272186C; Sat, 14 Dec 2013 00:16:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10A4F1E37; Sat, 14 Dec 2013 00:16:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0GDju095165; Sat, 14 Dec 2013 00:16:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0G9ql095137; Sat, 14 Dec 2013 00:16:09 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140016.rBE0G9ql095137@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:16:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259365 - in stable/10/sys/arm: allwinner arm broadcom/bcm2835 freescale/imx include lpc mv rockchip samsung/exynos tegra ti versatile xilinx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:16:13 -0000 Author: ian Date: Sat Dec 14 00:16:08 2013 New Revision: 259365 URL: http://svnweb.freebsd.org/changeset/base/259365 Log: MFC r257669, r257672, r257673, r257676, r257678: Call initarm_lastaddr() later in the init sequence, after establishing static device mappings, rather than as the first of the initializations that a platform can hook into. This allows a platform to allocate KVA from the top of the address space downwards for things like static device mapping, and return the final "last usable address" result after that and other early init work is done. Because some platforms were doing work in initarm_lastaddr() that needs to be done early, add a new initarm_early_init() routine and move the early init code to that routine on those platforms. Make PTE_DEVICE a synonym for PTE_NOCACHE on armv4, to make it easier to share the same code on both architectures. Add new helper routines for arm static device mapping. The new code allocates kva space from the top down for the device mappings and builds entries in an internal table which is automatically used later by arm_devmap_bootstrap(). The platform code just calls the new arm_devmap_add_entry() function as many times as it needs to (up to 32 entries allowed; most platforms use 2 or 3 at most). Remove imx local devmap code and use the essentially identical common code that got moved from imx_machdep.c to arm/devmap.c. Modified: stable/10/sys/arm/allwinner/a10_machdep.c stable/10/sys/arm/arm/devmap.c stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c stable/10/sys/arm/freescale/imx/imx51_machdep.c stable/10/sys/arm/freescale/imx/imx53_machdep.c stable/10/sys/arm/freescale/imx/imx6_machdep.c stable/10/sys/arm/freescale/imx/imx_machdep.c stable/10/sys/arm/include/devmap.h stable/10/sys/arm/include/machdep.h stable/10/sys/arm/include/pmap.h stable/10/sys/arm/lpc/lpc_machdep.c stable/10/sys/arm/mv/mv_machdep.c stable/10/sys/arm/rockchip/rk30xx_machdep.c stable/10/sys/arm/samsung/exynos/exynos5_machdep.c stable/10/sys/arm/tegra/tegra2_machdep.c stable/10/sys/arm/ti/ti_machdep.c stable/10/sys/arm/versatile/versatile_machdep.c stable/10/sys/arm/xilinx/zy7_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/allwinner/a10_machdep.c ============================================================================== --- stable/10/sys/arm/allwinner/a10_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/allwinner/a10_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -62,6 +62,12 @@ initarm_lastaddr(void) } void +initarm_early_init(void) +{ + +} + +void initarm_gpio_init(void) { } @@ -80,7 +86,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; Modified: stable/10/sys/arm/arm/devmap.c ============================================================================== --- stable/10/sys/arm/arm/devmap.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/arm/devmap.c Sat Dec 14 00:16:08 2013 (r259365) @@ -36,9 +36,89 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include static const struct arm_devmap_entry *devmap_table; +static boolean_t devmap_bootstrap_done = false; + +/* + * The allocated-kva (akva) devmap table and metadata. Platforms can call + * arm_devmap_add_entry() to add static device mappings to this table using + * automatically allocated virtual addresses carved out of the top of kva space. + * Allocation begins immediately below the ARM_VECTORS_HIGH address. + */ +#define AKVA_DEVMAP_MAX_ENTRIES 32 +static struct arm_devmap_entry akva_devmap_entries[AKVA_DEVMAP_MAX_ENTRIES]; +static u_int akva_devmap_idx; +static vm_offset_t akva_devmap_vaddr = ARM_VECTORS_HIGH; + +/* + * Return the "last" kva address used by the registered devmap table. It's + * actually the lowest address used by the static mappings, i.e., the address of + * the first unusable byte of KVA. + */ +vm_offset_t +arm_devmap_lastaddr() +{ + const struct arm_devmap_entry *pd; + vm_offset_t lowaddr; + + if (akva_devmap_idx > 0) + return (akva_devmap_vaddr); + + if (devmap_table == NULL) + panic("arm_devmap_lastaddr(): No devmap table registered."); + + lowaddr = ARM_VECTORS_HIGH; + for (pd = devmap_table; pd->pd_size != 0; ++pd) { + if (lowaddr > pd->pd_va) + lowaddr = pd->pd_va; + } + + return (lowaddr); +} + +/* + * Add an entry to the internal "akva" static devmap table using the given + * physical address and size and a virtual address allocated from the top of + * kva. This automatically registers the akva table on the first call, so all a + * platform has to do is call this routine to install as many mappings as it + * needs and when initarm() calls arm_devmap_bootstrap() it will pick up all the + * entries in the akva table automatically. + */ +void +arm_devmap_add_entry(vm_paddr_t pa, vm_size_t sz) +{ + struct arm_devmap_entry *m; + + if (devmap_bootstrap_done) + panic("arm_devmap_add_entry() after arm_devmap_bootstrap()"); + + if (akva_devmap_idx == (AKVA_DEVMAP_MAX_ENTRIES - 1)) + panic("AKVA_DEVMAP_MAX_ENTRIES is too small"); + + if (akva_devmap_idx == 0) + arm_devmap_register_table(akva_devmap_entries); + + /* + * Allocate virtual address space from the top of kva downwards. If the + * range being mapped is aligned and sized to 1MB boundaries then also + * align the virtual address to the next-lower 1MB boundary so that we + * end up with a nice efficient section mapping. + */ + if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { + akva_devmap_vaddr = trunc_1mpage(akva_devmap_vaddr - sz); + } else { + akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - sz); + } + m = &akva_devmap_entries[akva_devmap_idx++]; + m->pd_va = akva_devmap_vaddr; + m->pd_pa = pa; + m->pd_size = sz; + m->pd_prot = VM_PROT_READ | VM_PROT_WRITE; + m->pd_cache = PTE_DEVICE; +} /* * Register the given table as the one to use in arm_devmap_bootstrap(). @@ -73,12 +153,14 @@ arm_devmap_bootstrap(vm_offset_t l1pt, c if (table != NULL) devmap_table = table; else if (devmap_table == NULL) - panic("arm_devmap_bootstrap: No devmap table registered."); + panic("arm_devmap_bootstrap(): No devmap table registered"); for (pd = devmap_table; pd->pd_size != 0; ++pd) { pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, pd->pd_prot,pd->pd_cache); } + + devmap_bootstrap_done = true; } /* Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/arm/machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -1299,7 +1299,7 @@ initarm(struct arm_boot_params *abp) availmem_regions_sz = curr; /* Platform-specific initialisation */ - vm_max_kernel_address = initarm_lastaddr(); + initarm_early_init(); pcpu0_init(); @@ -1415,9 +1415,10 @@ initarm(struct arm_boot_params *abp) pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); - /* Map pmap_devmap[] entries */ - err_devmap = platform_devmap_init(); + /* Establish static device mappings. */ + err_devmap = initarm_devmap_init(); arm_devmap_bootstrap(l1pagetable, NULL); + vm_max_kernel_address = initarm_lastaddr(); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); pmap_pa = kernel_l1pt.pv_pa; Modified: stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -70,6 +70,12 @@ initarm_lastaddr(void) } void +initarm_early_init(void) +{ + +} + +void initarm_gpio_init(void) { } @@ -103,7 +109,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; Modified: stable/10/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx51_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/freescale/imx/imx51_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -34,26 +34,58 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include #include + #include +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; +} + +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + +} + /* * Set up static device mappings. This is hand-optimized platform-specific * config data which covers most of the common on-chip devices with a few 1MB * section mappings. * * Notably missing are entries for GPU, IPU, in general anything video related. - * - * Note that for imx this is called from initarm_lastaddr() so that the lowest - * kva address used for static device mapping can be known at that point. */ -void -imx_devmap_init(void) +int +initarm_devmap_init(void) { - imx_devmap_addentry(0x70000000, 0x00100000); - imx_devmap_addentry(0x73f00000, 0x00100000); - imx_devmap_addentry(0x83f00000, 0x00100000); + arm_devmap_add_entry(0x70000000, 0x00100000); + arm_devmap_add_entry(0x73f00000, 0x00100000); + arm_devmap_add_entry(0x83f00000, 0x00100000); + + return (0); } void Modified: stable/10/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx53_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/freescale/imx/imx53_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -34,26 +34,57 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include +#include #include #include +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; +} + +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + +} + /* * Set up static device mappings. This is hand-optimized platform-specific * config data which covers most of the common on-chip devices with a few 1MB * section mappings. * * Notably missing are entries for GPU, IPU, in general anything video related. - * - * Note that for imx this is called from initarm_lastaddr() so that the lowest - * kva address used for static device mapping can be known at that point. */ -void -imx_devmap_init(void) +int +initarm_devmap_init(void) { - imx_devmap_addentry(0x50000000, 0x00100000); - imx_devmap_addentry(0x53f00000, 0x00100000); - imx_devmap_addentry(0x63f00000, 0x00100000); + arm_devmap_add_entry(0x50000000, 0x00100000); + arm_devmap_add_entry(0x53f00000, 0x00100000); + arm_devmap_add_entry(0x63f00000, 0x00100000); + + return (0); } void Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -35,19 +35,45 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include +#include #include #include #include +vm_offset_t +initarm_lastaddr(void) +{ + + return (arm_devmap_lastaddr()); +} + +void +initarm_early_init(void) +{ + + /* XXX - Get rid of this stuff soon. */ + boothowto |= RB_VERBOSE|RB_MULTIPLE; + bootverbose = 1; +} + +void +initarm_gpio_init(void) +{ + +} + +void +initarm_late_init(void) +{ + +} + /* - * Set up static device mappings. Note that for imx this is called from - * initarm_lastaddr() so that it can return the lowest address used for static - * device mapping, maximizing kva space. + * Set up static device mappings. * * This attempts to cover the most-used devices with 1MB section mappings, which * is good for performance (uses fewer TLB entries for device access). @@ -62,8 +88,8 @@ __FBSDID("$FreeBSD$"); * static map some of that area. Be careful with other things in that area such * as OCRAM that probably shouldn't be mapped as PTE_DEVICE memory. */ -void -imx_devmap_init(void) +int +initarm_devmap_init(void) { const uint32_t IMX6_ARMMP_PHYS = 0x00a00000; const uint32_t IMX6_ARMMP_SIZE = 0x00100000; @@ -72,9 +98,11 @@ imx_devmap_init(void) const uint32_t IMX6_AIPS2_PHYS = 0x02100000; const uint32_t IMX6_AIPS2_SIZE = 0x00100000; - imx_devmap_addentry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); - imx_devmap_addentry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); - imx_devmap_addentry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); + arm_devmap_add_entry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); + arm_devmap_add_entry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); + arm_devmap_add_entry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); + + return (0); } void Modified: stable/10/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/freescale/imx/imx_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -45,106 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define IMX_MAX_DEVMAP_ENTRIES 8 - -static struct arm_devmap_entry devmap_entries[IMX_MAX_DEVMAP_ENTRIES]; -static u_int devmap_idx; -static vm_offset_t devmap_vaddr = ARM_VECTORS_HIGH; - -void -imx_devmap_addentry(vm_paddr_t pa, vm_size_t sz) -{ - struct arm_devmap_entry *m; - - /* - * The last table entry is the all-zeroes end-of-table marker. If we're - * about to overwrite it the world is coming to an end. This code runs - * too early for the panic to be printed unless a special early-debug - * console is in use, but there's nothing else we can do. - */ - if (devmap_idx == (IMX_MAX_DEVMAP_ENTRIES - 1)) - panic("IMX_MAX_DEVMAP_ENTRIES is too small!\n"); - - /* - * Allocate virtual address space from the top of kva downwards. If the - * range being mapped is aligned and sized to 1MB boundaries then also - * align the virtual address to the next-lower 1MB boundary so that we - * end up with a section mapping. - */ - if ((pa & 0x000fffff) == 0 && (sz & 0x000fffff) == 0) { - devmap_vaddr = (devmap_vaddr - sz) & ~0x000fffff; - } else { - devmap_vaddr = (devmap_vaddr - sz) & ~0x00000fff; - } - m = &devmap_entries[devmap_idx++]; - m->pd_va = devmap_vaddr; - m->pd_pa = pa; - m->pd_size = sz; - m->pd_prot = VM_PROT_READ | VM_PROT_WRITE; - m->pd_cache = PTE_DEVICE; -} - -vm_offset_t -initarm_lastaddr(void) -{ - - /* XXX - Get rid of this stuff soon. */ - boothowto |= RB_VERBOSE|RB_MULTIPLE; - bootverbose = 1; - - /* - * Normally initarm() calls platform_devmap_init() much later in the - * init process to set up static device mappings. To calculate the - * highest available kva address we have to do that setup first. It - * maps downwards from ARM_VECTORS_HIGH and the last usable kva address - * is the point right before the virtual address of the first static - * mapping. So go set up the static mapping table now, then we can - * return the lowest static devmap vaddr as the end of usable kva. - */ - imx_devmap_init(); - - arm_devmap_register_table(devmap_entries); - - return (devmap_vaddr); -} - -int -platform_devmap_init(void) -{ - - /* On imx this work is done during initarm_lastaddr(). */ - return (0); -} - -/* - * Set initial values of GPIO output ports - */ -void -initarm_gpio_init(void) -{ - -} - -void -initarm_late_init(void) -{ - struct arm_devmap_entry *m; - - /* - * We did the static devmap setup earlier, during initarm_lastaddr(), - * but now the console should be working and we can be verbose about - * what we did. - */ - if (bootverbose) { - for (m = devmap_entries; m->pd_va != 0; ++m) { - printf("Devmap: phys 0x%08x virt 0x%08x size %uK\n", - m->pd_pa, m->pd_va, m->pd_size / 1024); - } - } - - -} - struct arm32_dma_range * bus_dma_get_range(void) { Modified: stable/10/sys/arm/include/devmap.h ============================================================================== --- stable/10/sys/arm/include/devmap.h Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/include/devmap.h Sat Dec 14 00:16:08 2013 (r259365) @@ -42,6 +42,22 @@ struct arm_devmap_entry { }; /* + * Return the lowest KVA address used in any entry in the registered devmap + * table. This works with whatever table is registered, including the internal + * table used by arm_devmap_add_entry() if that routine was used. Platforms can + * implement initarm_lastaddr() by calling this if static device mappings are + * their only use of high KVA space. + */ +vm_offset_t arm_devmap_lastaddr(void); + +/* + * Automatically allocate KVA (from the top of the address space downwards) and + * make static device mapping entries in an internal table. The internal table + * is automatically registered on the first call to this. + */ +void arm_devmap_add_entry(vm_paddr_t pa, vm_size_t sz); + +/* * Register a platform-local table to be bootstrapped by the generic * initarm() in arm/machdep.c. This is used by newer code that allocates and * fills in its own local table but does not have its own initarm() routine. @@ -49,16 +65,17 @@ struct arm_devmap_entry { void arm_devmap_register_table(const struct arm_devmap_entry * _table); /* - * Directly process a table; called from initarm() of older platforms that don't - * use the generic initarm() in arm/machdep.c. If the table pointer is NULL, - * this will use the table installed previously by arm_devmap_register_table(). + * Establish mappings for all the entries in the table. This is called + * automatically from the common initarm() in arm/machdep.c, and also from the + * custom initarm() routines in older code. If the table pointer is NULL, this + * will use the table installed previously by arm_devmap_register_table(). */ void arm_devmap_bootstrap(vm_offset_t _l1pt, const struct arm_devmap_entry *_table); /* - * Routines to translate between virtual and physical addresses within a region - * that is static-mapped by the devmap code. If the given address range isn't + * Translate between virtual and physical addresses within a region that is + * static-mapped by the devmap code. If the given address range isn't * static-mapped, then ptov returns NULL and vtop returns DEVMAP_PADDR_NOTFOUND. * The latter implies that you can't vtop just the last byte of physical address * space. This is not as limiting as it might sound, because even if a device Modified: stable/10/sys/arm/include/machdep.h ============================================================================== --- stable/10/sys/arm/include/machdep.h Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/include/machdep.h Sat Dec 14 00:16:08 2013 (r259365) @@ -33,11 +33,39 @@ vm_offset_t linux_parse_boot_param(struc vm_offset_t fake_preload_metadata(struct arm_boot_params *abp); vm_offset_t parse_boot_param(struct arm_boot_params *abp); -/* Called by initarm */ +/* + * Initialization functions called by the common initarm() function in + * arm/machdep.c (but not necessarily from the custom initarm() functions of + * older code). + * + * - initarm_early_init() is called very early, after parsing the boot params + * and after physical memory has been located and sized. + * + * - platform_devmap_init() is called as one of the last steps of early virtual + * memory initialization, shortly before the new page tables are installed. + * + * - initarm_lastaddr() is called after platform_devmap_init(), and must return + * the address of the first byte of unusable KVA space. This allows a + * platform to carve out of the top of the KVA space whatever reserves it + * needs for things like static device mapping, and this is called to get the + * value before calling pmap_bootstrap() which uses the value to size the + * available KVA. + * + * - initarm_gpio_init() is called after the static device mappings are + * established and just before cninit(). The intention is that the routine + * can do any hardware setup (such as gpio or pinmux) necessary to make the + * console functional. + * + * - initarm_late_init() is called just after cninit(). This is the first of + * the init routines that can use printf() and expect the output to appear on + * a standard console. + * + */ +void initarm_early_init(void); +int initarm_devmap_init(void); vm_offset_t initarm_lastaddr(void); void initarm_gpio_init(void); void initarm_late_init(void); -int platform_devmap_init(void); /* Board-specific attributes */ void board_set_serial(uint64_t); Modified: stable/10/sys/arm/include/pmap.h ============================================================================== --- stable/10/sys/arm/include/pmap.h Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/include/pmap.h Sat Dec 14 00:16:08 2013 (r259365) @@ -67,6 +67,7 @@ #else #define PTE_NOCACHE 1 #define PTE_CACHE 2 +#define PTE_DEVICE PTE_NOCACHE #define PTE_PAGETABLE 3 #endif Modified: stable/10/sys/arm/lpc/lpc_machdep.c ============================================================================== --- stable/10/sys/arm/lpc/lpc_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/lpc/lpc_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -63,11 +63,15 @@ vm_offset_t initarm_lastaddr(void) { + return (fdt_immr_va); +} + +void +initarm_early_init(void) +{ + if (fdt_immr_addr(LPC_DEV_BASE) != 0) while (1); - - /* Platform-specific initialisation */ - return (fdt_immr_va); } void @@ -94,7 +98,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { /* Modified: stable/10/sys/arm/mv/mv_machdep.c ============================================================================== --- stable/10/sys/arm/mv/mv_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/mv/mv_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -203,11 +203,15 @@ vm_offset_t initarm_lastaddr(void) { + return (fdt_immr_va); +} + +void +initarm_early_init(void) +{ + if (fdt_immr_addr(MV_BASE) != 0) while (1); - - /* Platform-specific initialisation */ - return (fdt_immr_va); } void @@ -316,7 +320,7 @@ __weak_reference(mv_default_fdt_pci_devm * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { phandle_t root, child; pcell_t bank_count; Modified: stable/10/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- stable/10/sys/arm/rockchip/rk30xx_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/rockchip/rk30xx_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -60,6 +60,12 @@ initarm_lastaddr(void) } void +initarm_early_init(void) +{ + +} + +void initarm_gpio_init(void) { } @@ -82,7 +88,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; Modified: stable/10/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/samsung/exynos/exynos5_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -54,6 +54,12 @@ initarm_lastaddr(void) } void +initarm_early_init(void) +{ + +} + +void initarm_gpio_init(void) { } @@ -72,7 +78,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i; Modified: stable/10/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- stable/10/sys/arm/tegra/tegra2_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/tegra/tegra2_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -107,10 +107,15 @@ vm_offset_t initarm_lastaddr(void) { + return (fdt_immr_va); +} + +void +initarm_early_init(void) +{ + if (fdt_immr_addr(TEGRA2_BASE) != 0) /* FIXME ???? */ while (1); - - return (fdt_immr_va); } void @@ -132,7 +137,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; fdt_devmap[i].pd_va = 0xe0000000; Modified: stable/10/sys/arm/ti/ti_machdep.c ============================================================================== --- stable/10/sys/arm/ti/ti_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/ti/ti_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -63,11 +63,17 @@ vm_offset_t initarm_lastaddr(void) { - ti_cpu_reset = NULL; return (DEVMAP_BOOTSTRAP_MAP_START); } void +initarm_early_init(void) +{ + + ti_cpu_reset = NULL; +} + +void initarm_gpio_init(void) { } @@ -87,7 +93,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; #if defined(SOC_OMAP4) Modified: stable/10/sys/arm/versatile/versatile_machdep.c ============================================================================== --- stable/10/sys/arm/versatile/versatile_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/versatile/versatile_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -65,6 +65,12 @@ initarm_lastaddr(void) } void +initarm_early_init(void) +{ + +} + +void initarm_gpio_init(void) { } @@ -85,7 +91,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; fdt_devmap[i].pd_va = 0xf0100000; Modified: stable/10/sys/arm/xilinx/zy7_machdep.c ============================================================================== --- stable/10/sys/arm/xilinx/zy7_machdep.c Fri Dec 13 23:56:53 2013 (r259364) +++ stable/10/sys/arm/xilinx/zy7_machdep.c Sat Dec 14 00:16:08 2013 (r259365) @@ -64,6 +64,12 @@ initarm_lastaddr(void) } void +initarm_early_init(void) +{ + +} + +void initarm_gpio_init(void) { } @@ -80,7 +86,7 @@ static struct arm_devmap_entry fdt_devma * Construct pmap_devmap[] with DT-derived config data. */ int -platform_devmap_init(void) +initarm_devmap_init(void) { int i = 0; From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:23:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF161375; Sat, 14 Dec 2013 00:23:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB1A21EC8; Sat, 14 Dec 2013 00:23:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0Nh0s098450; Sat, 14 Dec 2013 00:23:43 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0NhiZ098449; Sat, 14 Dec 2013 00:23:43 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140023.rBE0NhiZ098449@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259366 - stable/10/sys/arm/freescale/imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:23:43 -0000 Author: ian Date: Sat Dec 14 00:23:43 2013 New Revision: 259366 URL: http://svnweb.freebsd.org/changeset/base/259366 Log: MFC r257924: Apparently with "const uint32_t foo = 0x60;" gcc doesn't consider 'foo' to be a constant integer suitable for use in a case label, so use #defines. Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_machdep.c Sat Dec 14 00:16:08 2013 (r259365) +++ stable/10/sys/arm/freescale/imx/imx6_machdep.c Sat Dec 14 00:23:43 2013 (r259366) @@ -145,11 +145,11 @@ u_int imx_soc_type() { uint32_t digprog, hwsoc; uint32_t *pcr; - const uint32_t HWSOC_MX6SL = 0x60; - const uint32_t HWSOC_MX6DL = 0x61; - const uint32_t HWSOC_MX6SOLO = 0x62; - const uint32_t HWSOC_MX6Q = 0x63; const vm_offset_t SCU_CONFIG_PHYSADDR = 0x00a00004; +#define HWSOC_MX6SL 0x60 +#define HWSOC_MX6DL 0x61 +#define HWSOC_MX6SOLO 0x62 +#define HWSOC_MX6Q 0x63 digprog = imx6_anatop_read_4(IMX6_ANALOG_DIGPROG_SL); hwsoc = (digprog >> IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT) & From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:25:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78A6B4EE; Sat, 14 Dec 2013 00:25:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 643F31ED8; Sat, 14 Dec 2013 00:25:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0PQ7S098717; Sat, 14 Dec 2013 00:25:26 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0PQmo098716; Sat, 14 Dec 2013 00:25:26 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312140025.rBE0PQmo098716@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 14 Dec 2013 00:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259367 - releng/10.0/sys/dev/drm2/radeon X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:25:26 -0000 Author: dumbbell Date: Sat Dec 14 00:25:25 2013 New Revision: 259367 URL: http://svnweb.freebsd.org/changeset/base/259367 Log: MFC r259234: drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes This fixes radeon_agp_init() and gtt_size is now correct. However, this is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't implemented yet. Submitted by: tijl@ Approved by: re (gjb) Modified: releng/10.0/sys/dev/drm2/radeon/radeon_agp.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/dev/drm2/radeon/radeon_agp.c ============================================================================== --- releng/10.0/sys/dev/drm2/radeon/radeon_agp.c Sat Dec 14 00:23:43 2013 (r259366) +++ releng/10.0/sys/dev/drm2/radeon/radeon_agp.c Sat Dec 14 00:25:25 2013 (r259367) @@ -153,11 +153,11 @@ int radeon_agp_init(struct radeon_device return ret; } - if (rdev->ddev->agp->info.ai_aperture_size < 32) { + if ((rdev->ddev->agp->info.ai_aperture_size >> 20) < 32) { drm_agp_release(rdev->ddev); dev_warn(rdev->dev, "AGP aperture too small (%zuM) " "need at least 32M, disabling AGP\n", - rdev->ddev->agp->info.ai_aperture_size); + rdev->ddev->agp->info.ai_aperture_size >> 20); return -EINVAL; } @@ -246,7 +246,7 @@ int radeon_agp_init(struct radeon_device } rdev->mc.agp_base = rdev->ddev->agp->info.ai_aperture_base; - rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size << 20; + rdev->mc.gtt_size = rdev->ddev->agp->info.ai_aperture_size; rdev->mc.gtt_start = rdev->mc.agp_base; rdev->mc.gtt_end = rdev->mc.gtt_start + rdev->mc.gtt_size - 1; dev_info(rdev->dev, "GTT: %juM 0x%08jX - 0x%08jX\n", From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:25:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45AEA67B; Sat, 14 Dec 2013 00:25:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 30E151EE0; Sat, 14 Dec 2013 00:25:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0Pwoi098798; Sat, 14 Dec 2013 00:25:58 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0Pwmx098797; Sat, 14 Dec 2013 00:25:58 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140025.rBE0Pwmx098797@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259368 - stable/10/usr.sbin/syslogd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:25:58 -0000 Author: ian Date: Sat Dec 14 00:25:57 2013 New Revision: 259368 URL: http://svnweb.freebsd.org/changeset/base/259368 Log: MFC r258076, r258077: This fixes 3 problems in syslogd related to sizing receive buffers... - A call was misplaced at the wrong level of nested if blocks, so that the buffers for unix domain sockets (/dev/log, /dev/klog) were never increased at all; they remained at a way-too-small default size of 4096. - The function that was supposed to double the size of the buffer sometimes did nothing, and sometimes installed a wildly-wrong buffer size (either too large or too small) due to an unitialized 'slen' variable passed to getsockopt(). Most often it doubled the UDP buffers from 40k to 80k because accidentally there would be harmless stack garbage in the unitialized variables. - The whole concept of blindly doubling a socket's buffer size without knowing what size it started at is a design flaw that has to be called a bug. If the double_rbuf() function had worked at all (I.E., if the other two bugs didn't exist) this would lead to UDP sockets having an 80k buffer while unix dgram sockets get an 8k buffer. There's nothing about the problem being solved that requires larger buffers for UDP than for unix dgram sockets -- the buffering requirements are the same regardless of socket type. This change renames the double_rbuf() function to increase_rbuf() and increases the buffer size on all types of sockets to 80k. 80k was chosen only because it appears to be the size the original change was shooting for, and it certainly seems to be reasonably large (I might have picked 64k in the absence of any historical guidance). Add ENETUNREACH and EADDRNOTAVAIL to the list of errors that are potentially transient and shouldn't result in closing the socket and giving up forever. Modified: stable/10/usr.sbin/syslogd/syslogd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/10/usr.sbin/syslogd/syslogd.c Sat Dec 14 00:25:25 2013 (r259367) +++ stable/10/usr.sbin/syslogd/syslogd.c Sat Dec 14 00:25:57 2013 (r259368) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #define DEFSPRI (LOG_KERN|LOG_CRIT) #define TIMERINTVL 30 /* interval for checking flush, mark */ #define TTYMSGTIME 1 /* timeout passed to ttymsg */ +#define RCVBUF_MINSIZE (80 * 1024) /* minimum size of dgram rcv buffer */ #include #include @@ -336,7 +337,7 @@ static void unmapped(struct sockaddr *); static void wallmsg(struct filed *, struct iovec *, const int iovlen); static int waitdaemon(int, int, int); static void timedout(int); -static void double_rbuf(int); +static void increase_rcvbuf(int); int main(int argc, char *argv[]) @@ -547,8 +548,8 @@ main(int argc, char *argv[]) STAILQ_REMOVE(&funixes, fx, funix, next); continue; } - double_rbuf(fx->s); } + increase_rcvbuf(fx->s); } if (SecureMode <= 1) finet = socksetup(family, bindhostname); @@ -1241,8 +1242,10 @@ fprintlog(struct filed *f, int flags, co switch (errno) { case ENOBUFS: case ENETDOWN: + case ENETUNREACH: case EHOSTUNREACH: case EHOSTDOWN: + case EADDRNOTAVAIL: break; /* case EBADF: */ /* case EACCES: */ @@ -1253,7 +1256,7 @@ fprintlog(struct filed *f, int flags, co /* case ENOBUFS: */ /* case ECONNREFUSED: */ default: - dprintf("removing entry\n"); + dprintf("removing entry: errno=%d\n", e); f->f_type = F_UNUSED; break; } @@ -2720,7 +2723,7 @@ socksetup(int af, char *bindhostname) } if (!SecureMode) - double_rbuf(*s); + increase_rcvbuf(*s); } (*socks)++; @@ -2741,12 +2744,16 @@ socksetup(int af, char *bindhostname) } static void -double_rbuf(int fd) +increase_rcvbuf(int fd) { - socklen_t slen, len; + socklen_t len, slen; + + slen = sizeof(len); if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, &len, &slen) == 0) { - len *= 2; - setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &len, slen); + if (len < RCVBUF_MINSIZE) { + len = RCVBUF_MINSIZE; + setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &len, sizeof(len)); + } } } From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:40:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1756BC5; Sat, 14 Dec 2013 00:40:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CD9A91FF6; Sat, 14 Dec 2013 00:40:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0el6m005241; Sat, 14 Dec 2013 00:40:47 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0elv3005240; Sat, 14 Dec 2013 00:40:47 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312140040.rBE0elv3005240@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 14 Dec 2013 00:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259370 - releng/10.0/sys/dev/drm2/radeon X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:40:48 -0000 Author: dumbbell Date: Sat Dec 14 00:40:47 2013 New Revision: 259370 URL: http://svnweb.freebsd.org/changeset/base/259370 Log: MFC r259236: drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSD The code was unmodified compared to Linux and returned the amount of received bytes from the i2c bus. This led to non-working i2c bus and failure to eg. read monitor's EDID, if connected to DisplayPort. Tested by: Mikaël Urankar Approved by: re (gjb) Modified: releng/10.0/sys/dev/drm2/radeon/atombios_dp.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/dev/drm2/radeon/atombios_dp.c ============================================================================== --- releng/10.0/sys/dev/drm2/radeon/atombios_dp.c Sat Dec 14 00:36:29 2013 (r259369) +++ releng/10.0/sys/dev/drm2/radeon/atombios_dp.c Sat Dec 14 00:40:47 2013 (r259370) @@ -272,7 +272,7 @@ int radeon_dp_i2c_aux_ch(device_t dev, i case AUX_I2C_REPLY_ACK: if (mode == MODE_I2C_READ) *read_byte = reply[0]; - return ret; + return (0); /* Return ret on Linux. */ case AUX_I2C_REPLY_NACK: DRM_DEBUG_KMS("aux_i2c nack\n"); return -EREMOTEIO; From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:54:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E47601EE; Sat, 14 Dec 2013 00:54:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C499D10BE; Sat, 14 Dec 2013 00:54:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0s6Qf009517; Sat, 14 Dec 2013 00:54:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0s6eb009513; Sat, 14 Dec 2013 00:54:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140054.rBE0s6eb009513@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259371 - stable/10/sys/dev/nand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:54:07 -0000 Author: ian Date: Sat Dec 14 00:54:05 2013 New Revision: 259371 URL: http://svnweb.freebsd.org/changeset/base/259371 Log: MFC r257892, r258196, r258197, r258199, r258200, r258201, r258202: Add ONFI signature check. Add Micron chip found in Freescale Vybrid Family Phytec COSMIC board. The vendor specified field is 88 bytes, not 8 bytes. Update the onfi_params struct to ONFI revision 3.2 (06 12 2013). Search for and validate the ONFI params as specified in the standard. ONFI parameters are little-endian, hence we must take care to convert them to native endianness. We must also pay attention to unaligned accesses. Rework the routine that returns a pointer to the table of software ECC byte positions within the OOB area to support chips with unusual OOB sizes such as 218 or 224 bytes. Modified: stable/10/sys/dev/nand/nand.c stable/10/sys/dev/nand/nand.h stable/10/sys/dev/nand/nand_generic.c stable/10/sys/dev/nand/nand_id.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nand/nand.c ============================================================================== --- stable/10/sys/dev/nand/nand.c Sat Dec 14 00:40:47 2013 (r259370) +++ stable/10/sys/dev/nand/nand.c Sat Dec 14 00:54:05 2013 (r259371) @@ -115,7 +115,7 @@ nand_init(struct nand_softc *nand, devic } void -nand_onfi_set_params(struct nand_chip *chip, struct onfi_params *params) +nand_onfi_set_params(struct nand_chip *chip, struct onfi_chip_params *params) { struct chip_geom *cg; @@ -309,23 +309,22 @@ nand_get_chip_param(struct nand_chip *ch static uint16_t * default_software_ecc_positions(struct nand_chip *chip) { - struct nand_ecc_data *eccd; - - eccd = &chip->nand->ecc; - - if (eccd->eccpositions) - return (eccd->eccpositions); - - switch (chip->chip_geom.oob_size) { - case 16: - return ((uint16_t *)&default_software_ecc_positions_16); - case 64: - return ((uint16_t *)&default_software_ecc_positions_64); - case 128: - return ((uint16_t *)&default_software_ecc_positions_128); - default: - return (NULL); /* No ecc bytes positions defs available */ - } + /* If positions have been set already, use them. */ + if (chip->nand->ecc.eccpositions) + return (chip->nand->ecc.eccpositions); + + /* + * XXX Note that the following logic isn't really sufficient, especially + * in the ONFI case where the number of ECC bytes can be dictated by + * values in the parameters page, and that could lead to needing more + * byte positions than exist within the tables of software-ecc defaults. + */ + if (chip->chip_geom.oob_size >= 128) + return (default_software_ecc_positions_128); + if (chip->chip_geom.oob_size >= 64) + return (default_software_ecc_positions_64); + else if (chip->chip_geom.oob_size >= 16) + return (default_software_ecc_positions_16); return (NULL); } Modified: stable/10/sys/dev/nand/nand.h ============================================================================== --- stable/10/sys/dev/nand/nand.h Sat Dec 14 00:40:47 2013 (r259370) +++ stable/10/sys/dev/nand/nand.h Sat Dec 14 00:54:05 2013 (r259371) @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -122,7 +123,8 @@ MALLOC_DECLARE(M_NAND); #define NAND_MAN_SAMSUNG 0xec #define NAND_MAN_HYNIX 0xad -#define NAND_MAN_STMICRO 0x20 +#define NAND_MAN_STMICRO 0x20 +#define NAND_MAN_MICRON 0x2c struct nand_id { uint8_t man_id; @@ -176,12 +178,17 @@ struct onfi_params { uint16_t rev; uint16_t features; uint16_t optional_commands; - uint8_t res1[22]; + uint8_t primary_advanced_command; + uint8_t res1; + uint16_t extended_parameter_page_length; + uint8_t parameter_page_count; + uint8_t res2[17]; char manufacturer_name[12]; char device_model[20]; uint8_t manufacturer_id; - uint16_t date; - uint8_t res2[13]; + uint8_t manufacture_date_yy; + uint8_t manufacture_date_ww; + uint8_t res3[13]; uint32_t bytes_per_page; uint16_t spare_bytes_per_page; uint32_t bytes_per_partial_page; @@ -200,7 +207,8 @@ struct onfi_params { uint8_t bits_of_ecc; uint8_t interleaved_addr_bits; uint8_t interleaved_oper_attr; - uint8_t res3[13]; + uint8_t eznand_support; + uint8_t res4[12]; uint8_t pin_capacitance; uint16_t asynch_timing_mode_support; uint16_t asynch_prog_cache_timing_mode_support; @@ -215,11 +223,31 @@ struct onfi_params { uint16_t input_capacitance; uint8_t input_capacitance_max; uint8_t driver_strength_support; - uint8_t res4[12]; + uint16_t t_r_interleaved; + uint16_t t_adl; + uint16_t t_r_eznand; + uint8_t nv_ddr2_features; + uint8_t nv_ddr2_warmup_cycles; + uint8_t res5[4]; uint16_t vendor_rev; - uint8_t vendor_spec[8]; + uint8_t vendor_spec[88]; uint16_t crc; }__attribute__((packed)); +CTASSERT(sizeof(struct onfi_params) == 256); + +struct onfi_chip_params { + uint32_t blocks_per_lun; + uint32_t pages_per_block; + uint32_t bytes_per_page; + uint32_t spare_bytes_per_page; + uint16_t t_bers; + uint16_t t_prog; + uint16_t t_r; + uint16_t t_ccs; + uint16_t features; + uint8_t address_cycles; + uint8_t luns; +}; struct nand_ecc_data { int eccsize; /* Number of data bytes per ECC step */ @@ -353,7 +381,7 @@ void nand_init(struct nand_softc *nand, void nand_detach(struct nand_softc *nand); struct nand_params *nand_get_params(struct nand_id *id); -void nand_onfi_set_params(struct nand_chip *chip, struct onfi_params *params); +void nand_onfi_set_params(struct nand_chip *chip, struct onfi_chip_params *params); void nand_set_params(struct nand_chip *chip, struct nand_params *params); int nand_init_stat(struct nand_chip *chip); void nand_destroy_stat(struct nand_chip *chip); Modified: stable/10/sys/dev/nand/nand_generic.c ============================================================================== --- stable/10/sys/dev/nand/nand_generic.c Sat Dec 14 00:40:47 2013 (r259370) +++ stable/10/sys/dev/nand/nand_generic.c Sat Dec 14 00:54:05 2013 (r259371) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -73,7 +74,7 @@ static int small_program_page(device_t, static int small_program_oob(device_t, uint32_t, void *, uint32_t, uint32_t); static int onfi_is_blk_bad(device_t, uint32_t, uint8_t *); -static int onfi_read_parameter(struct nand_chip *, struct onfi_params *); +static int onfi_read_parameter(struct nand_chip *, struct onfi_chip_params *); static int nand_send_address(device_t, int32_t, int32_t, int8_t); @@ -206,7 +207,7 @@ generic_nand_attach(device_t dev) { struct nand_chip *chip; struct nandbus_ivar *ivar; - struct onfi_params *onfi_params; + struct onfi_chip_params *onfi_chip_params; device_t nandbus, nfc; int err; @@ -225,25 +226,24 @@ generic_nand_attach(device_t dev) chip->nand = device_get_softc(nfc); if (ivar->is_onfi) { - onfi_params = malloc(sizeof(struct onfi_params), + onfi_chip_params = malloc(sizeof(struct onfi_chip_params), M_NAND, M_WAITOK | M_ZERO); - if (onfi_params == NULL) - return (ENXIO); + if (onfi_chip_params == NULL) + return (ENOMEM); - if (onfi_read_parameter(chip, onfi_params)) { + if (onfi_read_parameter(chip, onfi_chip_params)) { nand_debug(NDBG_GEN,"Could not read parameter page!\n"); - free(onfi_params, M_NAND); + free(onfi_chip_params, M_NAND); return (ENXIO); } - nand_onfi_set_params(chip, onfi_params); + nand_onfi_set_params(chip, onfi_chip_params); /* Set proper column and row cycles */ - ivar->cols = (onfi_params->address_cycles >> 4) & 0xf; - ivar->rows = onfi_params->address_cycles & 0xf; - free(onfi_params, M_NAND); + ivar->cols = (onfi_chip_params->address_cycles >> 4) & 0xf; + ivar->rows = onfi_chip_params->address_cycles & 0xf; + free(onfi_chip_params, M_NAND); } else { - nand_set_params(chip, ivar->params); } @@ -319,10 +319,32 @@ check_fail(device_t nandbus) return (0); } +static uint16_t +onfi_crc(const void *buf, size_t buflen) +{ + int i, j; + uint16_t crc; + const uint8_t *bufptr; + + bufptr = buf; + crc = 0x4f4e; + for (j = 0; j < buflen; j++) { + crc ^= *bufptr++ << 8; + for (i = 0; i < 8; i++) + if (crc & 0x8000) + crc = (crc << 1) ^ 0x8005; + else + crc <<= 1; + } + return crc; +} + static int -onfi_read_parameter(struct nand_chip *chip, struct onfi_params *params) +onfi_read_parameter(struct nand_chip *chip, struct onfi_chip_params *chip_params) { device_t nandbus; + struct onfi_params params; + int found, sigcount, trycopy; nand_debug(NDBG_GEN,"read parameter"); @@ -339,12 +361,44 @@ onfi_read_parameter(struct nand_chip *ch if (NANDBUS_START_COMMAND(nandbus)) return (ENXIO); - NANDBUS_READ_BUFFER(nandbus, params, sizeof(struct onfi_params)); - - /* TODO */ - /* Check for signature */ - /* Check CRC */ - /* Use redundant page if necessary */ + /* + * XXX Bogus DELAY, we really need a nandbus_wait_ready() here, but it's + * not accessible from here (static to nandbus). + */ + DELAY(1000); + + /* + * The ONFI spec mandates a minimum of three copies of the parameter + * data, so loop up to 3 times trying to find good data. Each copy is + * validated by a signature of "ONFI" and a crc. There is a very strange + * rule that the signature is valid if any 2 of the 4 bytes are correct. + */ + for (found= 0, trycopy = 0; !found && trycopy < 3; trycopy++) { + NANDBUS_READ_BUFFER(nandbus, ¶ms, sizeof(struct onfi_params)); + sigcount = params.signature[0] == 'O'; + sigcount += params.signature[1] == 'N'; + sigcount += params.signature[2] == 'F'; + sigcount += params.signature[3] == 'I'; + if (sigcount < 2) + continue; + if (onfi_crc(¶ms, 254) != params.crc) + continue; + found = 1; + } + if (!found) + return (ENXIO); + + chip_params->luns = params.luns; + chip_params->blocks_per_lun = le32dec(¶ms.blocks_per_lun); + chip_params->pages_per_block = le32dec(¶ms.pages_per_block); + chip_params->bytes_per_page = le32dec(¶ms.bytes_per_page); + chip_params->spare_bytes_per_page = le32dec(¶ms.spare_bytes_per_page); + chip_params->t_bers = le16dec(¶ms.t_bers); + chip_params->t_prog = le16dec(¶ms.t_prog); + chip_params->t_r = le16dec(¶ms.t_r); + chip_params->t_ccs = le16dec(¶ms.t_ccs); + chip_params->features = le16dec(¶ms.features); + chip_params->address_cycles = params.address_cycles; return (0); } Modified: stable/10/sys/dev/nand/nand_id.c ============================================================================== --- stable/10/sys/dev/nand/nand_id.c Sat Dec 14 00:40:47 2013 (r259370) +++ stable/10/sys/dev/nand/nand_id.c Sat Dec 14 00:54:05 2013 (r259371) @@ -47,6 +47,8 @@ struct nand_params nand_ids[] = { 0x80, 0x200, 0x10, 0x20, 0 }, { { NAND_MAN_STMICRO, 0xf1 }, "STMicro 128MB 3,3V 8-bit", 0x80, 2048, 64, 0x40, 0 }, + { { NAND_MAN_MICRON, 0xcc }, "Micron NAND 512MiB 3,3V 16-bit", + 0x200, 2048, 64, 0x40, 0 }, }; struct nand_params *nand_get_params(struct nand_id *id) From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:55:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2F1B46A; Sat, 14 Dec 2013 00:55:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C4EAD10DD; Sat, 14 Dec 2013 00:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0tYAE009842; Sat, 14 Dec 2013 00:55:34 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0tYe8009841; Sat, 14 Dec 2013 00:55:34 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140055.rBE0tYe8009841@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259372 - stable/10/sys/dev/nand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:55:35 -0000 Author: ian Date: Sat Dec 14 00:55:34 2013 New Revision: 259372 URL: http://svnweb.freebsd.org/changeset/base/259372 Log: MFC r258740: Look up a nand chip by id in the static table before trying to obtain ONFI parameters. This allows a static table entry to provide valid data for chips known to provide invalid ONFI data. Modified: stable/10/sys/dev/nand/nandbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nand/nandbus.c ============================================================================== --- stable/10/sys/dev/nand/nandbus.c Sat Dec 14 00:54:05 2013 (r259371) +++ stable/10/sys/dev/nand/nandbus.c Sat Dec 14 00:55:34 2013 (r259372) @@ -195,8 +195,27 @@ nandbus_attach(device_t dev) if (chip_id.man_id == 0xff) continue; - /* Check if chip is ONFI compliant */ - if (nand_probe_onfi(dev, &onfi) != 0) { + /* + * First try to get info from the table. If that fails, see if + * the chip can provide ONFI info. We check the table first to + * allow table entries to override info from chips that are + * known to provide bad ONFI data. + */ + onfi = 0; + chip_params = nand_get_params(&chip_id); + if (chip_params == NULL) { + nand_probe_onfi(dev, &onfi); + } + + /* + * At this point it appears there is a chip at this chipselect, + * so if we can't work with it, whine about it. + */ + if (chip_params == NULL && onfi == 0) { + if (bootverbose || (nand_debug_flag & NDBG_BUS)) + printf("Chip params not found, chipsel: %d " + "(manuf: 0x%0x, chipid: 0x%0x, onfi: %d)\n", + cs, chip_id.man_id, chip_id.dev_id, onfi); continue; } @@ -218,15 +237,6 @@ nandbus_attach(device_t dev) continue; } - chip_params = nand_get_params(&chip_id); - if (chip_params == NULL) { - nand_debug(NDBG_BUS,"Chip description not found! " - "(manuf: 0x%0x, chipid: 0x%0x)\n", - chip_id.man_id, chip_id.dev_id); - free(ivar, M_NAND); - continue; - } - ivar->cs = cs; ivar->cols = 1; ivar->rows = 2; From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:57:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B464633; Sat, 14 Dec 2013 00:57:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 262EC10F4; Sat, 14 Dec 2013 00:57:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0v6Ie010050; Sat, 14 Dec 2013 00:57:06 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0v6Px010049; Sat, 14 Dec 2013 00:57:06 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140057.rBE0v6Px010049@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259373 - stable/10/sys/arm/arm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:57:06 -0000 Author: ian Date: Sat Dec 14 00:57:05 2013 New Revision: 259373 URL: http://svnweb.freebsd.org/changeset/base/259373 Log: MFC r258240: In the data abort handler, don't panic if kdb is available and says it handled the condition. Modified: stable/10/sys/arm/arm/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Sat Dec 14 00:55:34 2013 (r259372) +++ stable/10/sys/arm/arm/trap.c Sat Dec 14 00:57:05 2013 (r259373) @@ -528,7 +528,8 @@ dab_fatal(struct trapframe *tf, u_int fs #ifdef KDB if (debugger_on_panic || kdb_active) - kdb_trap(fsr, 0, tf); + if (kdb_trap(fsr, 0, tf)) + return (0); #endif panic("Fatal abort"); /*NOTREACHED*/ From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:58:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C2D9813; Sat, 14 Dec 2013 00:58:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 476351103; Sat, 14 Dec 2013 00:58:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0wEdk010209; Sat, 14 Dec 2013 00:58:14 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0wEEN010208; Sat, 14 Dec 2013 00:58:14 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140058.rBE0wEEN010208@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259374 - stable/10/sys/arm/ti X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:58:14 -0000 Author: ian Date: Sat Dec 14 00:58:13 2013 New Revision: 259374 URL: http://svnweb.freebsd.org/changeset/base/259374 Log: MFC r258356: Bugfixes... the host capabilties from FDT data are stored in host.caps, not host.host_ocr, examine the correct field when setting up the hardware. Also, the offset for the capabilties register should be 0x140, not 0x240. Modified: stable/10/sys/arm/ti/ti_sdhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/ti_sdhci.c ============================================================================== --- stable/10/sys/arm/ti/ti_sdhci.c Sat Dec 14 00:57:05 2013 (r259373) +++ stable/10/sys/arm/ti/ti_sdhci.c Sat Dec 14 00:58:13 2013 (r259374) @@ -108,7 +108,7 @@ static struct ofw_compat_data compat_dat #define MMCHS_CON 0x02C #define MMCHS_CON_DW8 (1 << 5) #define MMCHS_CON_DVAL_8_4MS (3 << 9) -#define MMCHS_SD_CAPA 0x240 +#define MMCHS_SD_CAPA 0x140 #define MMCHS_SD_CAPA_VS18 (1 << 26) #define MMCHS_SD_CAPA_VS30 (1 << 25) #define MMCHS_SD_CAPA_VS33 (1 << 24) @@ -432,9 +432,9 @@ ti_sdhci_attach(device_t dev) * that it can set the right values in the CAPA register, which can only * be done once and never reset. */ - sc->slot.host.host_ocr |= MMC_OCR_LOW_VOLTAGE; + sc->slot.host.caps |= MMC_OCR_LOW_VOLTAGE; if (sc->mmchs_device_id == 0 || OF_hasprop(node, "ti,dual-volt")) { - sc->slot.host.host_ocr |= MMC_OCR_290_300 | MMC_OCR_300_310; + sc->slot.host.caps |= MMC_OCR_290_300 | MMC_OCR_300_310; } /* From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 00:59:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A274B35; Sat, 14 Dec 2013 00:59:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 355B41129; Sat, 14 Dec 2013 00:59:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE0xfTA010469; Sat, 14 Dec 2013 00:59:41 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE0xfvc010468; Sat, 14 Dec 2013 00:59:41 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140059.rBE0xfvc010468@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 00:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259375 - stable/10/sys/arm/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 00:59:41 -0000 Author: ian Date: Sat Dec 14 00:59:40 2013 New Revision: 259375 URL: http://svnweb.freebsd.org/changeset/base/259375 Log: MFC r258393: Add USB_HOST_ALIGN=64; the cache line size on the am335x is 64 bytes. Modified: stable/10/sys/arm/conf/BEAGLEBONE Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/conf/BEAGLEBONE ============================================================================== --- stable/10/sys/arm/conf/BEAGLEBONE Sat Dec 14 00:58:13 2013 (r259374) +++ stable/10/sys/arm/conf/BEAGLEBONE Sat Dec 14 00:59:40 2013 (r259375) @@ -104,6 +104,7 @@ device gpio # USB support device usb +options USB_HOST_ALIGN=64 # Cacheline size is 64 on AM335x. options USB_DEBUG #options USB_REQ_DEBUG #options USB_VERBOSE From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:01:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4CBF0DA0; Sat, 14 Dec 2013 01:01:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 38CB5118D; Sat, 14 Dec 2013 01:01:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE11Xv2013432; Sat, 14 Dec 2013 01:01:33 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE11XOj013431; Sat, 14 Dec 2013 01:01:33 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201312140101.rBE11XOj013431@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Sat, 14 Dec 2013 01:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259376 - releng/10.0/sys/dev/drm2 X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:01:33 -0000 Author: dumbbell Date: Sat Dec 14 01:01:32 2013 New Revision: 259376 URL: http://svnweb.freebsd.org/changeset/base/259376 Log: MFC r259237: drm: Read PCIER_LINK_CAP/PCIER_LINK_CAP2 from the PCI bridge Before this fix, capabilities were read from vgapci and were incorrect. Approved by: re (gjb) Modified: releng/10.0/sys/dev/drm2/drm_pci.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/dev/drm2/drm_pci.c ============================================================================== --- releng/10.0/sys/dev/drm2/drm_pci.c Sat Dec 14 00:59:40 2013 (r259375) +++ releng/10.0/sys/dev/drm2/drm_pci.c Sat Dec 14 01:01:32 2013 (r259376) @@ -134,7 +134,11 @@ int drm_pcie_get_speed_cap_mask(struct d if (!drm_device_is_pcie(dev)) return -EINVAL; - root = device_get_parent(dev->device); + root = + device_get_parent( /* pcib */ + device_get_parent( /* `-- pci */ + device_get_parent( /* `-- vgapci */ + dev->device))); /* `-- drmn */ pos = 0; pci_find_cap(root, PCIY_EXPRESS, &pos); From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:12:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 909D7547; Sat, 14 Dec 2013 01:12:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7A53F124A; Sat, 14 Dec 2013 01:12:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE1CFnU017578; Sat, 14 Dec 2013 01:12:15 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE1CDIF017564; Sat, 14 Dec 2013 01:12:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140112.rBE1CDIF017564@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 01:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259377 - in stable/10/sys/arm: arm at91 econa s3c2xx0 sa11x0 xscale/i80321 xscale/i8134x xscale/ixp425 xscale/pxa X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:12:15 -0000 Author: ian Date: Sat Dec 14 01:12:13 2013 New Revision: 259377 URL: http://svnweb.freebsd.org/changeset/base/259377 Log: MFC r258392, r258412: Call cpu_setup() immediately after the page tables are installed. This enables data cache and other chip-specific features. It was previously done via an early SYSINIT, but it was being done after pmap and vm setup, and those setups need to use mutexes. On some modern ARM platforms, the ldrex/strex instructions that implement mutexes require the data cache to be enabled. Call cpu_setup() from the initarm() routine on platforms that don't use the common FDT-aware initarm() in arm/machdep.c. Modified: stable/10/sys/arm/arm/machdep.c stable/10/sys/arm/at91/at91_machdep.c stable/10/sys/arm/econa/econa_machdep.c stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c stable/10/sys/arm/sa11x0/assabet_machdep.c stable/10/sys/arm/xscale/i80321/ep80219_machdep.c stable/10/sys/arm/xscale/i80321/iq31244_machdep.c stable/10/sys/arm/xscale/i8134x/crb_machdep.c stable/10/sys/arm/xscale/ixp425/avila_machdep.c stable/10/sys/arm/xscale/pxa/pxa_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/machdep.c ============================================================================== --- stable/10/sys/arm/arm/machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/arm/machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -361,7 +361,6 @@ cpu_startup(void *dummy) #endif #endif - cpu_setup(""); identify_arm_cpu(); printf("real memory = %ju (%ju MB)\n", (uintmax_t)ptoa(physmem), @@ -1427,6 +1426,12 @@ initarm(struct arm_boot_params *abp) cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); /* + * Now that proper page tables are installed, call cpu_setup() to enable + * instruction and data caches and other chip-specific features. + */ + cpu_setup(""); + + /* * Only after the SOC registers block is mapped we can perform device * tree fixups, as they may attempt to read parameters from hardware. */ Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/at91/at91_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -604,6 +604,7 @@ initarm(struct arm_boot_params *abp) * of the stack memory. */ cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); + cpu_setup(""); set_stackptrs(0); Modified: stable/10/sys/arm/econa/econa_machdep.c ============================================================================== --- stable/10/sys/arm/econa/econa_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/econa/econa_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -309,6 +309,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* Set stack for exception handlers */ data_abort_handler_address = (u_int)data_abort_handler; Modified: stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c ============================================================================== --- stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/s3c2xx0/s3c24x0_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -355,6 +355,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* Disable all peripheral interrupts */ ioreg_write32(S3C24X0_INTCTL_BASE + INTCTL_INTMSK, ~0); Modified: stable/10/sys/arm/sa11x0/assabet_machdep.c ============================================================================== --- stable/10/sys/arm/sa11x0/assabet_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/sa11x0/assabet_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -371,6 +371,7 @@ initarm(struct arm_boot_params *abp) cpufunc_control(0x337f, 0x107d); arm_vector_init(ARM_VECTORS_LOW, ARM_VEC_ALL); + cpu_setup(""); pmap_curmaxkvaddr = freemempos + KERNEL_PT_VMDATA_NUM * 0x400000; Modified: stable/10/sys/arm/xscale/i80321/ep80219_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/i80321/ep80219_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -334,6 +334,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* * Fetch the SDRAM start/size from the i80321 SDRAM configration * registers. Modified: stable/10/sys/arm/xscale/i80321/iq31244_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/i80321/iq31244_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -335,6 +335,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* * Fetch the SDRAM start/size from the i80321 SDRAM configration * registers. Modified: stable/10/sys/arm/xscale/i8134x/crb_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/i8134x/crb_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/i8134x/crb_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -320,6 +320,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + i80321_calibrate_delay(); i81342_sdram_bounds(&obio_bs_tag, IOP34X_VADDR, &memstart, &memsize); physmem = memsize / PAGE_SIZE; Modified: stable/10/sys/arm/xscale/ixp425/avila_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/ixp425/avila_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -405,6 +405,8 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); + /* ready to setup the console (XXX move earlier if possible) */ cninit(); /* Modified: stable/10/sys/arm/xscale/pxa/pxa_machdep.c ============================================================================== --- stable/10/sys/arm/xscale/pxa/pxa_machdep.c Sat Dec 14 01:01:32 2013 (r259376) +++ stable/10/sys/arm/xscale/pxa/pxa_machdep.c Sat Dec 14 01:12:13 2013 (r259377) @@ -317,6 +317,7 @@ initarm(struct arm_boot_params *abp) * this problem will not occur after initarm(). */ cpu_idcache_wbinv_all(); + cpu_setup(""); /* * Sort out bus_space for on-board devices. From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:14:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39C3B7DE; Sat, 14 Dec 2013 01:14:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 199111264; Sat, 14 Dec 2013 01:14:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE1Ecdo018031; Sat, 14 Dec 2013 01:14:38 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE1EcPR018030; Sat, 14 Dec 2013 01:14:38 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140114.rBE1EcPR018030@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 01:14:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259378 - stable/10/sys/arm/at91 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:14:39 -0000 Author: ian Date: Sat Dec 14 01:14:38 2013 New Revision: 259378 URL: http://svnweb.freebsd.org/changeset/base/259378 Log: MFC r258820: Add definitions for the PIO pins found on recent AT91 SoCs. Modified: stable/10/sys/arm/at91/at91_pioreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/at91_pioreg.h ============================================================================== --- stable/10/sys/arm/at91/at91_pioreg.h Sat Dec 14 01:12:13 2013 (r259377) +++ stable/10/sys/arm/at91/at91_pioreg.h Sat Dec 14 01:14:38 2013 (r259378) @@ -164,5 +164,69 @@ #define AT91C_PIO_PC29 ((unsigned int) 1 << 29) // Pin Controlled by PC29 #define AT91C_PIO_PC30 ((unsigned int) 1 << 30) // Pin Controlled by PC30 #define AT91C_PIO_PC31 ((unsigned int) 1 << 31) // Pin Controlled by PC31 +#define AT91C_PIO_PD0 ((unsigned int) 1 << 0) // Pin Controlled by PD0 +#define AT91C_PIO_PD1 ((unsigned int) 1 << 1) // Pin Controlled by PD1 +#define AT91C_PIO_PD2 ((unsigned int) 1 << 2) // Pin Controlled by PD2 +#define AT91C_PIO_PD3 ((unsigned int) 1 << 3) // Pin Controlled by PD3 +#define AT91C_PIO_PD4 ((unsigned int) 1 << 4) // Pin Controlled by PD4 +#define AT91C_PIO_PD5 ((unsigned int) 1 << 5) // Pin Controlled by PD5 +#define AT91C_PIO_PD6 ((unsigned int) 1 << 6) // Pin Controlled by PD6 +#define AT91C_PIO_PD7 ((unsigned int) 1 << 7) // Pin Controlled by PD7 +#define AT91C_PIO_PD8 ((unsigned int) 1 << 8) // Pin Controlled by PD8 +#define AT91C_PIO_PD9 ((unsigned int) 1 << 9) // Pin Controlled by PD9 +#define AT91C_PIO_PD10 ((unsigned int) 1 << 10) // Pin Controlled by PD10 +#define AT91C_PIO_PD11 ((unsigned int) 1 << 11) // Pin Controlled by PD11 +#define AT91C_PIO_PD12 ((unsigned int) 1 << 12) // Pin Controlled by PD12 +#define AT91C_PIO_PD13 ((unsigned int) 1 << 13) // Pin Controlled by PD13 +#define AT91C_PIO_PD14 ((unsigned int) 1 << 14) // Pin Controlled by PD14 +#define AT91C_PIO_PD15 ((unsigned int) 1 << 15) // Pin Controlled by PD15 +#define AT91C_PIO_PD16 ((unsigned int) 1 << 16) // Pin Controlled by PD16 +#define AT91C_PIO_PD17 ((unsigned int) 1 << 17) // Pin Controlled by PD17 +#define AT91C_PIO_PD18 ((unsigned int) 1 << 18) // Pin Controlled by PD18 +#define AT91C_PIO_PD19 ((unsigned int) 1 << 19) // Pin Controlled by PD19 +#define AT91C_PIO_PD20 ((unsigned int) 1 << 20) // Pin Controlled by PD20 +#define AT91C_PIO_PD21 ((unsigned int) 1 << 21) // Pin Controlled by PD21 +#define AT91C_PIO_PD22 ((unsigned int) 1 << 22) // Pin Controlled by PD22 +#define AT91C_PIO_PD23 ((unsigned int) 1 << 23) // Pin Controlled by PD23 +#define AT91C_PIO_PD24 ((unsigned int) 1 << 24) // Pin Controlled by PD24 +#define AT91C_PIO_PD25 ((unsigned int) 1 << 25) // Pin Controlled by PD25 +#define AT91C_PIO_PD26 ((unsigned int) 1 << 26) // Pin Controlled by PD26 +#define AT91C_PIO_PD27 ((unsigned int) 1 << 27) // Pin Controlled by PD27 +#define AT91C_PIO_PD28 ((unsigned int) 1 << 28) // Pin Controlled by PD28 +#define AT91C_PIO_PD29 ((unsigned int) 1 << 29) // Pin Controlled by PD29 +#define AT91C_PIO_PD30 ((unsigned int) 1 << 30) // Pin Controlled by PD30 +#define AT91C_PIO_PD31 ((unsigned int) 1 << 31) // Pin Controlled by PD31 +#define AT91C_PIO_PE0 ((unsigned int) 1 << 0) // Pin Controlled by PE0 +#define AT91C_PIO_PE1 ((unsigned int) 1 << 1) // Pin Controlled by PE1 +#define AT91C_PIO_PE2 ((unsigned int) 1 << 2) // Pin Controlled by PE2 +#define AT91C_PIO_PE3 ((unsigned int) 1 << 3) // Pin Controlled by PE3 +#define AT91C_PIO_PE4 ((unsigned int) 1 << 4) // Pin Controlled by PE4 +#define AT91C_PIO_PE5 ((unsigned int) 1 << 5) // Pin Controlled by PE5 +#define AT91C_PIO_PE6 ((unsigned int) 1 << 6) // Pin Controlled by PE6 +#define AT91C_PIO_PE7 ((unsigned int) 1 << 7) // Pin Controlled by PE7 +#define AT91C_PIO_PE8 ((unsigned int) 1 << 8) // Pin Controlled by PE8 +#define AT91C_PIO_PE9 ((unsigned int) 1 << 9) // Pin Controlled by PE9 +#define AT91C_PIO_PE10 ((unsigned int) 1 << 10) // Pin Controlled by PE10 +#define AT91C_PIO_PE11 ((unsigned int) 1 << 11) // Pin Controlled by PE11 +#define AT91C_PIO_PE12 ((unsigned int) 1 << 12) // Pin Controlled by PE12 +#define AT91C_PIO_PE13 ((unsigned int) 1 << 13) // Pin Controlled by PE13 +#define AT91C_PIO_PE14 ((unsigned int) 1 << 14) // Pin Controlled by PE14 +#define AT91C_PIO_PE15 ((unsigned int) 1 << 15) // Pin Controlled by PE15 +#define AT91C_PIO_PE16 ((unsigned int) 1 << 16) // Pin Controlled by PE16 +#define AT91C_PIO_PE17 ((unsigned int) 1 << 17) // Pin Controlled by PE17 +#define AT91C_PIO_PE18 ((unsigned int) 1 << 18) // Pin Controlled by PE18 +#define AT91C_PIO_PE19 ((unsigned int) 1 << 19) // Pin Controlled by PE19 +#define AT91C_PIO_PE20 ((unsigned int) 1 << 20) // Pin Controlled by PE20 +#define AT91C_PIO_PE21 ((unsigned int) 1 << 21) // Pin Controlled by PE21 +#define AT91C_PIO_PE22 ((unsigned int) 1 << 22) // Pin Controlled by PE22 +#define AT91C_PIO_PE23 ((unsigned int) 1 << 23) // Pin Controlled by PE23 +#define AT91C_PIO_PE24 ((unsigned int) 1 << 24) // Pin Controlled by PE24 +#define AT91C_PIO_PE25 ((unsigned int) 1 << 25) // Pin Controlled by PE25 +#define AT91C_PIO_PE26 ((unsigned int) 1 << 26) // Pin Controlled by PE26 +#define AT91C_PIO_PE27 ((unsigned int) 1 << 27) // Pin Controlled by PE27 +#define AT91C_PIO_PE28 ((unsigned int) 1 << 28) // Pin Controlled by PE28 +#define AT91C_PIO_PE29 ((unsigned int) 1 << 29) // Pin Controlled by PE29 +#define AT91C_PIO_PE30 ((unsigned int) 1 << 30) // Pin Controlled by PE30 +#define AT91C_PIO_PE31 ((unsigned int) 1 << 31) // Pin Controlled by PE31 #endif /* ARM_AT91_AT91_PIOREG_H */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:15:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A19F5934; Sat, 14 Dec 2013 01:15:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81AF8126B; Sat, 14 Dec 2013 01:15:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE1FRtx018220; Sat, 14 Dec 2013 01:15:27 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE1FRhv018218; Sat, 14 Dec 2013 01:15:27 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140115.rBE1FRhv018218@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 01:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259379 - in stable/10/sys: arm/at91 dev/nand X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:15:27 -0000 Author: ian Date: Sat Dec 14 01:15:26 2013 New Revision: 259379 URL: http://svnweb.freebsd.org/changeset/base/259379 Log: MFC r258828: Add a nand flash controller driver for Atmel at91 family. Tested only on at91rm9200 so far. Added: stable/10/sys/dev/nand/nfc_at91.c - copied unchanged from r258828, head/sys/dev/nand/nfc_at91.c Modified: stable/10/sys/arm/at91/files.at91 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/files.at91 ============================================================================== --- stable/10/sys/arm/at91/files.at91 Sat Dec 14 01:14:38 2013 (r259378) +++ stable/10/sys/arm/at91/files.at91 Sat Dec 14 01:15:26 2013 (r259379) @@ -5,7 +5,7 @@ arm/at91/at91_machdep.c standard arm/at91/at91.c standard arm/at91/at91_cfata.c optional at91_cfata arm/at91/at91_mci.c optional at91_mci -arm/at91/at91_nand.c optional nand +dev/nand/nfc_at91.c optional nand arm/at91/at91_pio.c standard arm/at91/at91_pmc.c standard arm/at91/at91_pit.c optional at91sam9 Copied: stable/10/sys/dev/nand/nfc_at91.c (from r258828, head/sys/dev/nand/nfc_at91.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/nand/nfc_at91.c Sat Dec 14 01:15:26 2013 (r259379, copy of r258828, head/sys/dev/nand/nfc_at91.c) @@ -0,0 +1,258 @@ +/*- + * Copyright (C) 2013 Ian Lepore. + * 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. + */ + +/* + * Atmel at91-family integrated NAND controller driver. + * + * This code relies on the board setup code (in at91/board_whatever.c) having + * set up the EBI and SMC registers appropriately for whatever type of nand part + * is on the board. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include "nfc_if.h" + +/* + * Data cycles are triggered by access to any address within the EBI CS3 region + * that has A21 and A22 clear. Command cycles are any access with bit A21 + * asserted. Address cycles are any access with bit A22 asserted. + * + * XXX The atmel docs say that any address bits can be used instead of A21 and + * A22; these values should be configurable. + */ +#define AT91_NAND_DATA 0 +#define AT91_NAND_COMMAND (1 << 21) +#define AT91_NAND_ADDRESS (1 << 22) + +struct at91_nand_softc { + struct nand_softc nand_sc; + struct resource *res; +}; + +static int at91_nand_attach(device_t); +static int at91_nand_probe(device_t); +static uint8_t at91_nand_read_byte(device_t); +static void at91_nand_read_buf(device_t, void *, uint32_t); +static int at91_nand_read_rnb(device_t); +static int at91_nand_select_cs(device_t, uint8_t); +static int at91_nand_send_command(device_t, uint8_t); +static int at91_nand_send_address(device_t, uint8_t); +static void at91_nand_write_buf(device_t, void *, uint32_t); + +static inline u_int8_t +dev_read_1(struct at91_nand_softc *sc, bus_size_t offset) +{ + return bus_read_1(sc->res, offset); +} + +static inline void +dev_write_1(struct at91_nand_softc *sc, bus_size_t offset, u_int8_t value) +{ + bus_write_1(sc->res, offset, value); +} + +static int +at91_nand_probe(device_t dev) +{ + + device_set_desc(dev, "AT91 Integrated NAND controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +at91_nand_attach(device_t dev) +{ + struct at91_nand_softc *sc; + int err, rid; + + sc = device_get_softc(dev); + rid = 0; + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resources!\n"); + return (ENXIO); + } + + nand_init(&sc->nand_sc, dev, NAND_ECC_SOFT, 0, 0, NULL, NULL); + + err = nandbus_create(dev); + + return (err); +} + +static int +at91_nand_send_command(device_t dev, uint8_t command) +{ + struct at91_nand_softc *sc; + + /* nand_debug(NDBG_DRV,"at91_nand_send_command: 0x%02x", command); */ + + sc = device_get_softc(dev); + dev_write_1(sc, AT91_NAND_COMMAND, command); + return (0); +} + +static int +at91_nand_send_address(device_t dev, uint8_t addr) +{ + struct at91_nand_softc *sc; + + /* nand_debug(NDBG_DRV,"at91_nand_send_address: x%02x", addr); */ + + sc = device_get_softc(dev); + dev_write_1(sc, AT91_NAND_ADDRESS, addr); + return (0); +} + +static uint8_t +at91_nand_read_byte(device_t dev) +{ + struct at91_nand_softc *sc; + uint8_t data; + + sc = device_get_softc(dev); + data = dev_read_1(sc, AT91_NAND_DATA); + + /* nand_debug(NDBG_DRV,"at91_nand_read_byte: 0x%02x", data); */ + + return (data); +} + + +static void +at91_nand_dump_buf(const char *op, void* buf, uint32_t len) +{ + int i; + uint8_t *b = buf; + + printf("at91_nand_%s_buf (hex):", op); + for (i = 0; i < len; i++) { + if ((i & 0x01f) == 0) + printf("\n"); + printf(" %02x", b[i]); + } + printf("\n"); +} + +static void +at91_nand_read_buf(device_t dev, void* buf, uint32_t len) +{ + struct at91_nand_softc *sc; + + sc = device_get_softc(dev); + + bus_read_multi_1(sc->res, AT91_NAND_DATA, buf, len); + + if (nand_debug_flag & NDBG_DRV) + at91_nand_dump_buf("read", buf, len); +} + +static void +at91_nand_write_buf(device_t dev, void* buf, uint32_t len) +{ + struct at91_nand_softc *sc; + + sc = device_get_softc(dev); + + if (nand_debug_flag & NDBG_DRV) + at91_nand_dump_buf("write", buf, len); + + bus_write_multi_1(sc->res, AT91_NAND_DATA, buf, len); +} + +static int +at91_nand_select_cs(device_t dev, uint8_t cs) +{ + + if (cs > 0) + return (ENODEV); + + return (0); +} + +static int +at91_nand_read_rnb(device_t dev) +{ +#if 0 + /* + * XXX There's no way for this code to know which GPIO pin (if any) is + * attached to the chip's RNB line. Not to worry, nothing calls this; + * at higher layers, all the nand code uses status commands. + */ + uint32_t bits; + + bits = at91_pio_gpio_get(AT91RM92_PIOD_BASE, AT91C_PIO_PD15); + nand_debug(NDBG_DRV,"at91_nand: read_rnb: %#x", bits); + return (bits != 0); /* ready */ +#endif + panic("at91_nand_read_rnb() is not implemented\n"); + return (0); +} + +static device_method_t at91_nand_methods[] = { + DEVMETHOD(device_probe, at91_nand_probe), + DEVMETHOD(device_attach, at91_nand_attach), + + DEVMETHOD(nfc_send_command, at91_nand_send_command), + DEVMETHOD(nfc_send_address, at91_nand_send_address), + DEVMETHOD(nfc_read_byte, at91_nand_read_byte), + DEVMETHOD(nfc_read_buf, at91_nand_read_buf), + DEVMETHOD(nfc_write_buf, at91_nand_write_buf), + DEVMETHOD(nfc_select_cs, at91_nand_select_cs), + DEVMETHOD(nfc_read_rnb, at91_nand_read_rnb), + + DEVMETHOD_END +}; + +static driver_t at91_nand_driver = { + "nand", + at91_nand_methods, + sizeof(struct at91_nand_softc), +}; + +static devclass_t at91_nand_devclass; +DRIVER_MODULE(at91_nand, atmelarm, at91_nand_driver, at91_nand_devclass, 0, 0); + From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:34:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD8BAE4F; Sat, 14 Dec 2013 01:34:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C8F251393; Sat, 14 Dec 2013 01:34:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE1YOVm025016; Sat, 14 Dec 2013 01:34:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE1YOdU025015; Sat, 14 Dec 2013 01:34:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140134.rBE1YOdU025015@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 01:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259380 - stable/10/sys/arm/at91 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:34:25 -0000 Author: ian Date: Sat Dec 14 01:34:24 2013 New Revision: 259380 URL: http://svnweb.freebsd.org/changeset/base/259380 Log: MFC r259038, r259039: Bump the maximum VM space from 3 * memory size to a fixed 256MB. That's all we have room for since we map the hardware registers starting at 0xd0000000. This allows my 64MB AT91SAM9G20 to boot again after the unmmaped I/O changes were MFC'd at r251897. Other subplatforms may need similar treatment. Although not strictly required to boot a 64MB board, bump vm_max_virtual_address to be KERNVIRTADDR + 256MB. This allows some future shock protection since the KVA requirements have gone up since the unmapped changes have gone in, as well as preventing us from overlapping with the hardware devices, which we map at 0xd0000000, which we'd hit with anything more than 85MB... Modified: stable/10/sys/arm/at91/at91_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/at91_machdep.c ============================================================================== --- stable/10/sys/arm/at91/at91_machdep.c Sat Dec 14 01:15:26 2013 (r259379) +++ stable/10/sys/arm/at91/at91_machdep.c Sat Dec 14 01:34:24 2013 (r259380) @@ -633,7 +633,8 @@ initarm(struct arm_boot_params *abp) pmap_curmaxkvaddr = afterkern + L1_S_SIZE * (KERNEL_PT_KERN_NUM - 1); arm_dump_avail_init(memsize, sizeof(dump_avail)/sizeof(dump_avail[0])); - vm_max_kernel_address = KERNVIRTADDR + 3 * memsize; + /* Always use the 256MB of KVA we have available between the kernel and devices */ + vm_max_kernel_address = KERNVIRTADDR + (256 << 20); pmap_bootstrap(freemempos, &kernel_l1pt); msgbufp = (void*)msgbufpv.pv_va; msgbufinit(msgbufp, msgbufsize); From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 01:35:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33434F9E; Sat, 14 Dec 2013 01:35:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 13B2F139A; Sat, 14 Dec 2013 01:35:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE1ZvBZ025243; Sat, 14 Dec 2013 01:35:57 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE1ZvkH025242; Sat, 14 Dec 2013 01:35:57 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201312140135.rBE1ZvkH025242@svn.freebsd.org> From: Ian Lepore Date: Sat, 14 Dec 2013 01:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259381 - stable/10/sys/arm/at91 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 01:35:58 -0000 Author: ian Date: Sat Dec 14 01:35:57 2013 New Revision: 259381 URL: http://svnweb.freebsd.org/changeset/base/259381 Log: MFC r259212, r259220: Fix one race and one fence post error. When the TX buffer was completely full, we'd not complete any of the mbufs due to the fence post error (this creates a large leak). When this is fixed, we still leak, but at a much smaller rate due to a race between ateintr and atestart_locked as well as an asymmetry where atestart_locked is called from elsewhere. Ensure that we free in-flight packets that have completed there as well. Also remove needless check for NULL on mb, checked earlier in the loop and simplify a redundant if. Modified: stable/10/sys/arm/at91/if_ate.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/if_ate.c ============================================================================== --- stable/10/sys/arm/at91/if_ate.c Sat Dec 14 01:34:24 2013 (r259380) +++ stable/10/sys/arm/at91/if_ate.c Sat Dec 14 01:35:57 2013 (r259381) @@ -947,10 +947,8 @@ ate_intr(void *xsc) } while (!done); - if (mb != NULL) { - ifp->if_ipackets++; - (*ifp->if_input)(ifp, mb); - } + ifp->if_ipackets++; + (*ifp->if_input)(ifp, mb); } } @@ -974,16 +972,14 @@ ate_intr(void *xsc) sc->tx_descs[sc->txtail + 1].status |= ETHB_TX_USED; } - while (sc->txtail != sc->txhead && - sc->tx_descs[sc->txtail].status & ETHB_TX_USED ) { - + while ((sc->tx_descs[sc->txtail].status & ETHB_TX_USED) && + sc->sent_mbuf[sc->txtail] != NULL) { bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txtail], BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]); m_freem(sc->sent_mbuf[sc->txtail]); sc->tx_descs[sc->txtail].addr = 0; sc->sent_mbuf[sc->txtail] = NULL; - ifp->if_opackets++; sc->txtail = NEXT_TX_IDX(sc, sc->txtail); } @@ -1118,12 +1114,10 @@ atestart_locked(struct ifnet *ifp) * xmit packets. We use OACTIVE to indicate "we can stuff more * into our buffers (clear) or not (set)." */ - if (!sc->is_emacb) { - /* RM9200 has only two hardware entries */ - if (!sc->is_emacb && (RD4(sc, ETH_TSR) & ETH_TSR_BNQ) == 0) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - return; - } + /* RM9200 has only two hardware entries */ + if (!sc->is_emacb && (RD4(sc, ETH_TSR) & ETH_TSR_BNQ) == 0) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + return; } IFQ_DRV_DEQUEUE(&ifp->if_snd, m); @@ -1146,6 +1140,21 @@ atestart_locked(struct ifnet *ifp) m_freem(m); continue; } + + /* + * There's a small race between the loop in ate_intr finishing + * and the check above to see if the packet was finished, as well + * as when atestart gets called via other paths. Lose the race + * gracefully and free the mbuf... + */ + if (sc->sent_mbuf[sc->txhead] != NULL) { + bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txtail], + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->mtag, sc->tx_map[sc->txtail]); + m_free(sc->sent_mbuf[sc->txhead]); + ifp->if_opackets++; + } + sc->sent_mbuf[sc->txhead] = m; bus_dmamap_sync(sc->mtag, sc->tx_map[sc->txhead], From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 03:08:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E654720; Sat, 14 Dec 2013 03:08:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89DF41A14; Sat, 14 Dec 2013 03:08:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE384jQ061688; Sat, 14 Dec 2013 03:08:04 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE3835p061682; Sat, 14 Dec 2013 03:08:03 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201312140308.rBE3835p061682@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 14 Dec 2013 03:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259382 - in head/sys/dev/cxgbe: . common tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 03:08:04 -0000 Author: np Date: Sat Dec 14 03:08:03 2013 New Revision: 259382 URL: http://svnweb.freebsd.org/changeset/base/259382 Log: Read card capabilities after firmware initialization, instead of setting them up as part of firmware initialization (which the driver gets to do only if it's the master driver). Read the range of tids available for the ETHOFLD functionality if it's enabled. New is_ftid() and is_etid() functions to test whether a tid falls within the range of filter tids or ETHOFLD tids respectively. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Sat Dec 14 01:35:57 2013 (r259381) +++ head/sys/dev/cxgbe/common/common.h Sat Dec 14 03:08:03 2013 (r259382) @@ -267,8 +267,10 @@ struct adapter_params { unsigned short a_wnd[NCCTRL_WIN]; unsigned short b_wnd[NCCTRL_WIN]; - unsigned int mc_size; /* MC memory size */ - unsigned int nfilters; /* size of filter region */ + u_int ftid_min; + u_int ftid_max; + u_int etid_min; + u_int netids; unsigned int cim_la_size; @@ -280,8 +282,10 @@ struct adapter_params { unsigned int offload:1; /* hw is TOE capable, fw has divvied up card resources for TOE operation. */ unsigned int bypass:1; /* this is a bypass card */ + unsigned int ethoffload:1; unsigned int ofldq_wr_cred; + unsigned int eo_wr_cred; }; #define CHELSIO_T4 0x4 @@ -318,11 +322,28 @@ struct link_config { #define for_each_port(adapter, iter) \ for (iter = 0; iter < (adapter)->params.nports; ++iter) +static inline int is_ftid(const struct adapter *sc, u_int tid) +{ + + return (tid >= sc->params.ftid_min && tid <= sc->params.ftid_max); +} + +static inline int is_etid(const struct adapter *sc, u_int tid) +{ + + return (tid >= sc->params.etid_min); +} + static inline int is_offload(const struct adapter *adap) { return adap->params.offload; } +static inline int is_ethoffload(const struct adapter *adap) +{ + return adap->params.ethoffload; +} + static inline int chip_id(struct adapter *adap) { return adap->params.chipid; Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Sat Dec 14 01:35:57 2013 (r259381) +++ head/sys/dev/cxgbe/offload.h Sat Dec 14 03:08:03 2013 (r259382) @@ -101,6 +101,11 @@ struct tid_info { u_int nftids; u_int ftid_base; u_int ftids_in_use; + + struct mtx etid_lock __aligned(CACHE_LINE_SIZE); + struct etid_entry *etid_tab; + u_int netids; + u_int etid_base; }; struct t4_range { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sat Dec 14 01:35:57 2013 (r259381) +++ head/sys/dev/cxgbe/t4_main.c Sat Dec 14 03:08:03 2013 (r259382) @@ -2359,7 +2359,6 @@ use_config_on_flash: #define LIMIT_CAPS(x) do { \ caps.x &= htobe16(t4_##x##_allowed); \ - sc->x = htobe16(caps.x); \ } while (0) /* @@ -2461,6 +2460,8 @@ get_params__post_init(struct adapter *sc sc->sge.eq_start = val[1]; sc->tids.ftid_base = val[2]; sc->tids.nftids = val[3] - val[2] + 1; + sc->params.ftid_min = val[2]; + sc->params.ftid_max = val[3]; sc->vres.l2t.start = val[4]; sc->vres.l2t.size = val[5] - val[4] + 1; KASSERT(sc->vres.l2t.size <= L2T_SIZE, @@ -2479,7 +2480,35 @@ get_params__post_init(struct adapter *sc return (rc); } - if (caps.toecaps) { +#define READ_CAPS(x) do { \ + sc->x = htobe16(caps.x); \ +} while (0) + READ_CAPS(linkcaps); + READ_CAPS(niccaps); + READ_CAPS(toecaps); + READ_CAPS(rdmacaps); + READ_CAPS(iscsicaps); + READ_CAPS(fcoecaps); + + if (sc->niccaps & FW_CAPS_CONFIG_NIC_ETHOFLD) { + param[0] = FW_PARAM_PFVF(ETHOFLD_START); + param[1] = FW_PARAM_PFVF(ETHOFLD_END); + param[2] = FW_PARAM_DEV(FLOWC_BUFFIFO_SZ); + rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 3, param, val); + if (rc != 0) { + device_printf(sc->dev, + "failed to query NIC parameters: %d.\n", rc); + return (rc); + } + sc->tids.etid_base = val[0]; + sc->params.etid_min = val[0]; + sc->tids.netids = val[1] - val[0] + 1; + sc->params.netids = sc->tids.netids; + sc->params.eo_wr_cred = val[2]; + sc->params.ethoffload = 1; + } + + if (sc->toecaps) { /* query offload-related parameters */ param[0] = FW_PARAM_DEV(NTID); param[1] = FW_PARAM_PFVF(SERVER_START); @@ -2502,7 +2531,7 @@ get_params__post_init(struct adapter *sc sc->params.ofldq_wr_cred = val[5]; sc->params.offload = 1; } - if (caps.rdmacaps) { + if (sc->rdmacaps) { param[0] = FW_PARAM_PFVF(STAG_START); param[1] = FW_PARAM_PFVF(STAG_END); param[2] = FW_PARAM_PFVF(RQ_START); @@ -2541,7 +2570,7 @@ get_params__post_init(struct adapter *sc sc->vres.ocq.start = val[4]; sc->vres.ocq.size = val[5] - val[4] + 1; } - if (caps.iscsicaps) { + if (sc->iscsicaps) { param[0] = FW_PARAM_PFVF(ISCSI_START); param[1] = FW_PARAM_PFVF(ISCSI_END); rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); @@ -4487,6 +4516,7 @@ cxgbe_sysctls(struct port_info *pi) struct sysctl_ctx_list *ctx; struct sysctl_oid *oid; struct sysctl_oid_list *children; + struct adapter *sc = pi->adapter; ctx = device_get_sysctl_ctx(pi->dev); @@ -4516,7 +4546,7 @@ cxgbe_sysctls(struct port_info *pi) &pi->first_txq, 0, "index of first tx queue"); #ifdef TCP_OFFLOAD - if (is_offload(pi->adapter)) { + if (is_offload(sc)) { SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nofldrxq", CTLFLAG_RD, &pi->nofldrxq, 0, "# of rx queues for offloaded TCP connections"); @@ -4555,7 +4585,7 @@ cxgbe_sysctls(struct port_info *pi) #define SYSCTL_ADD_T4_REG64(pi, name, desc, reg) \ SYSCTL_ADD_OID(ctx, children, OID_AUTO, name, \ - CTLTYPE_U64 | CTLFLAG_RD, pi->adapter, reg, \ + CTLTYPE_U64 | CTLFLAG_RD, sc, reg, \ sysctl_handle_t4_reg64, "QU", desc) SYSCTL_ADD_T4_REG64(pi, "tx_octets", "# of octets in good frames", @@ -6125,6 +6155,11 @@ sysctl_tids(SYSCTL_HANDLER_ARGS) t->ftid_base + t->nftids - 1); } + if (t->netids) { + sbuf_printf(sb, "ETID range: %u-%u\n", t->etid_base, + t->etid_base + t->netids - 1); + } + sbuf_printf(sb, "HW TID usage: %u IP users, %u IPv6 users", t4_read_reg(sc, A_LE_DB_ACT_CNT_IPV4), t4_read_reg(sc, A_LE_DB_ACT_CNT_IPV6)); @@ -7156,14 +7191,17 @@ t4_filter_rpl(struct sge_iq *iq, const s struct adapter *sc = iq->adapter; const struct cpl_set_tcb_rpl *rpl = (const void *)(rss + 1); unsigned int idx = GET_TID(rpl); + unsigned int rc; + struct filter_entry *f; KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); - if (idx >= sc->tids.ftid_base && - (idx -= sc->tids.ftid_base) < sc->tids.nftids) { - unsigned int rc = G_COOKIE(rpl->cookie); - struct filter_entry *f = &sc->tids.ftid_tab[idx]; + if (is_ftid(sc, idx)) { + + idx -= sc->tids.ftid_base; + f = &sc->tids.ftid_tab[idx]; + rc = G_COOKIE(rpl->cookie); mtx_lock(&sc->tids.ftid_lock); if (rc == FW_FILTER_WR_FLT_ADDED) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Dec 14 01:35:57 2013 (r259381) +++ head/sys/dev/cxgbe/t4_sge.c Sat Dec 14 03:08:03 2013 (r259382) @@ -2901,7 +2901,6 @@ alloc_wrq(struct adapter *sc, struct por SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "unstalled", CTLFLAG_RD, &wrq->eq.unstalled, 0, "# of times queue recovered after stall"); - return (rc); } Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 14 01:35:57 2013 (r259381) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sat Dec 14 03:08:03 2013 (r259382) @@ -1299,18 +1299,18 @@ do_rx_data(struct sge_iq *iq, const stru #define V_CPL_FW4_ACK_OPCODE(x) ((x) << S_CPL_FW4_ACK_OPCODE) #define G_CPL_FW4_ACK_OPCODE(x) \ (((x) >> S_CPL_FW4_ACK_OPCODE) & M_CPL_FW4_ACK_OPCODE) - + #define S_CPL_FW4_ACK_FLOWID 0 #define M_CPL_FW4_ACK_FLOWID 0xffffff #define V_CPL_FW4_ACK_FLOWID(x) ((x) << S_CPL_FW4_ACK_FLOWID) #define G_CPL_FW4_ACK_FLOWID(x) \ (((x) >> S_CPL_FW4_ACK_FLOWID) & M_CPL_FW4_ACK_FLOWID) - + #define S_CPL_FW4_ACK_CR 24 #define M_CPL_FW4_ACK_CR 0xff #define V_CPL_FW4_ACK_CR(x) ((x) << S_CPL_FW4_ACK_CR) #define G_CPL_FW4_ACK_CR(x) (((x) >> S_CPL_FW4_ACK_CR) & M_CPL_FW4_ACK_CR) - + #define S_CPL_FW4_ACK_SEQVAL 0 #define M_CPL_FW4_ACK_SEQVAL 0x1 #define V_CPL_FW4_ACK_SEQVAL(x) ((x) << S_CPL_FW4_ACK_SEQVAL) @@ -1437,8 +1437,7 @@ do_set_tcb_rpl(struct sge_iq *iq, const ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - if (tid >= sc->tids.ftid_base && - tid < sc->tids.ftid_base + sc->tids.nftids) + if (is_ftid(sc, tid)) return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ CXGBE_UNIMPLEMENTED(__func__); From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 04:16:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93635D6B; Sat, 14 Dec 2013 04:16:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F2AB133B; Sat, 14 Dec 2013 04:16:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4GSaB089279; Sat, 14 Dec 2013 04:16:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4GSfK089278; Sat, 14 Dec 2013 04:16:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140416.rBE4GSfK089278@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:16:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259383 - stable/10/sys/geom/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:16:28 -0000 Author: ae Date: Sat Dec 14 04:16:27 2013 New Revision: 259383 URL: http://svnweb.freebsd.org/changeset/base/259383 Log: MFC r257965: Add missing line breaks. PR: 181900 Modified: stable/10/sys/geom/eli/g_eli.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/eli/g_eli.c ============================================================================== --- stable/10/sys/geom/eli/g_eli.c Sat Dec 14 03:08:03 2013 (r259382) +++ stable/10/sys/geom/eli/g_eli.c Sat Dec 14 04:16:27 2013 (r259383) @@ -1170,9 +1170,9 @@ g_eli_dumpconf(struct sbuf *sb, const ch if (pp != NULL || cp != NULL) return; /* Nothing here. */ - sbuf_printf(sb, "%s%ju", indent, + sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t)sc->sc_ekeys_total); - sbuf_printf(sb, "%s%ju", indent, + sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t)sc->sc_ekeys_allocated); sbuf_printf(sb, "%s", indent); if (sc->sc_flags == 0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 04:16:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6458EAA; Sat, 14 Dec 2013 04:16:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 926C1133E; Sat, 14 Dec 2013 04:16:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4Glud089346; Sat, 14 Dec 2013 04:16:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4GlUP089345; Sat, 14 Dec 2013 04:16:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140416.rBE4GlUP089345@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259384 - stable/9/sys/geom/eli X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:16:47 -0000 Author: ae Date: Sat Dec 14 04:16:47 2013 New Revision: 259384 URL: http://svnweb.freebsd.org/changeset/base/259384 Log: MFC r257965: Add missing line breaks. PR: 181900 Modified: stable/9/sys/geom/eli/g_eli.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/eli/g_eli.c ============================================================================== --- stable/9/sys/geom/eli/g_eli.c Sat Dec 14 04:16:27 2013 (r259383) +++ stable/9/sys/geom/eli/g_eli.c Sat Dec 14 04:16:47 2013 (r259384) @@ -1163,9 +1163,9 @@ g_eli_dumpconf(struct sbuf *sb, const ch if (pp != NULL || cp != NULL) return; /* Nothing here. */ - sbuf_printf(sb, "%s%ju", indent, + sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t)sc->sc_ekeys_total); - sbuf_printf(sb, "%s%ju", indent, + sbuf_printf(sb, "%s%ju\n", indent, (uintmax_t)sc->sc_ekeys_allocated); sbuf_printf(sb, "%s", indent); if (sc->sc_flags == 0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 04:24:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68194292; Sat, 14 Dec 2013 04:24:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 530371438; Sat, 14 Dec 2013 04:24:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4OX9H092966; Sat, 14 Dec 2013 04:24:33 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4OXMs092965; Sat, 14 Dec 2013 04:24:33 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140424.rBE4OXMs092965@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:24:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259385 - stable/10/sys/netipsec X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:24:33 -0000 Author: ae Date: Sat Dec 14 04:24:32 2013 New Revision: 259385 URL: http://svnweb.freebsd.org/changeset/base/259385 Log: MFC r257987: Initialize prot variable. PR: 177417 Modified: stable/10/sys/netipsec/ipsec_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netipsec/ipsec_input.c ============================================================================== --- stable/10/sys/netipsec/ipsec_input.c Sat Dec 14 04:16:47 2013 (r259384) +++ stable/10/sys/netipsec/ipsec_input.c Sat Dec 14 04:24:32 2013 (r259385) @@ -602,6 +602,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr)); /* Save protocol */ + prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); #ifdef notyet From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 04:24:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 250153C3; Sat, 14 Dec 2013 04:24:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 10F02143E; Sat, 14 Dec 2013 04:24:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4Oodq093030; Sat, 14 Dec 2013 04:24:50 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4OoQ1093029; Sat, 14 Dec 2013 04:24:50 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140424.rBE4OoQ1093029@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r259386 - stable/8/sys/netipsec X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:24:51 -0000 Author: ae Date: Sat Dec 14 04:24:50 2013 New Revision: 259386 URL: http://svnweb.freebsd.org/changeset/base/259386 Log: MFC r257987: Initialize prot variable. PR: 177417 Modified: stable/8/sys/netipsec/ipsec_input.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netipsec/ (props changed) Modified: stable/8/sys/netipsec/ipsec_input.c ============================================================================== --- stable/8/sys/netipsec/ipsec_input.c Sat Dec 14 04:24:32 2013 (r259385) +++ stable/8/sys/netipsec/ipsec_input.c Sat Dec 14 04:24:50 2013 (r259386) @@ -615,6 +615,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr)); /* Save protocol */ + prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); #ifdef notyet From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 04:27:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3AD45D3; Sat, 14 Dec 2013 04:27:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF5211473; Sat, 14 Dec 2013 04:27:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBE4RSa5093366; Sat, 14 Dec 2013 04:27:28 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBE4RSk1093365; Sat, 14 Dec 2013 04:27:28 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201312140427.rBE4RSk1093365@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sat, 14 Dec 2013 04:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259387 - stable/9/sys/netipsec X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 04:27:29 -0000 Author: ae Date: Sat Dec 14 04:27:28 2013 New Revision: 259387 URL: http://svnweb.freebsd.org/changeset/base/259387 Log: MFC r257987: Initialize prot variable. PR: 177417 Modified: stable/9/sys/netipsec/ipsec_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/ipsec_input.c ============================================================================== --- stable/9/sys/netipsec/ipsec_input.c Sat Dec 14 04:24:50 2013 (r259386) +++ stable/9/sys/netipsec/ipsec_input.c Sat Dec 14 04:27:28 2013 (r259387) @@ -602,6 +602,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr)); /* Save protocol */ + prot = 0; m_copydata(m, protoff, 1, (unsigned char *) &prot); #ifdef notyet From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 11:27:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AED6D11; Sat, 14 Dec 2013 11:27:22 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0A30B1AEF; Sat, 14 Dec 2013 11:27:21 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id rBEBRGpk017902; Sat, 14 Dec 2013 13:27:16 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua rBEBRGpk017902 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id rBEBRF6d017901; Sat, 14 Dec 2013 13:27:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 Dec 2013 13:27:15 +0200 From: Konstantin Belousov To: Aleksandr Rybalko Subject: Re: svn commit: r259261 - head/sys/dev/drm2 Message-ID: <20131214112715.GA59496@kib.kiev.ua> References: <201312121449.rBCEnRRQ045690@svn.freebsd.org> <20131212190230.GU59496@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sXL3peJHel3veXWV" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, Aleksandr Rybalko , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 11:27:22 -0000 --sXL3peJHel3veXWV Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 14, 2013 at 12:11:01AM +0200, Aleksandr Rybalko wrote: > Konstantin Belousov =CE=C1=D0=C9=D3=C1=D7(=CC=C1): > >On Thu, Dec 12, 2013 at 02:49:27PM +0000, Aleksandr Rybalko wrote: > >> Author: ray > >> Date: Thu Dec 12 14:49:26 2013 > >> New Revision: 259261 > >> URL: http://svnweb.freebsd.org/changeset/base/259261 > >>=20 > >> Log: > >> Do not try to probe/attach if attempt to add fbd child are failed. > >> =20 > >> Sponsored by: The FreeBSD Foundation > >>=20 > >> Modified: > >> head/sys/dev/drm2/drm_fb_helper.c > >>=20 > >> Modified: head/sys/dev/drm2/drm_fb_helper.c > >> > >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >> --- head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:37:25 > >2013 (r259260) > >> +++ head/sys/dev/drm2/drm_fb_helper.c Thu Dec 12 14:49:26 > >2013 (r259261) > >> @@ -1043,7 +1043,10 @@ int drm_fb_helper_single_fb_probe(struct > >> =20 > >> kdev =3D fb_helper->dev->device; > >> fbd =3D device_add_child(kdev, "fbd", device_get_unit(kdev)); > >> - ret =3D device_probe_and_attach(fbd); > >> + if (fbd !=3D NULL)=20 > >> + ret =3D device_probe_and_attach(fbd); > >> + else > >> + ret =3D ENODEV; > >This must be -ENODEV, since linux layer operates on negative values for > >error. The error is negated in the drm layer, which would result in > >non-existent errno returned to FreeBSD code. >=20 > It is not actually return code, but only value to show in error message f= ew lines later. ENODEV just value for case no device attached. > That error message appear only if kernel configuration include device vt.= (planning for syscons too, maybe). Ok. I looked around some more, and I think that the call to drm_fb_helper_set_par() is required to properly initialize crtc. See the #ifdef-ed Linux code. >=20 > > > >Also, the #ifdef __FreeBSD braces in the file are not useful, please > >remove them. > >> #ifdef DEV_VT > >> if (ret !=3D 0) > >> DRM_ERROR("Failed to attach fbd device: %d\n", ret); >=20 > Should we with Jean have to remove all #ifdef __FreeBSD and __Linux over = whole DRM2 code, to reduce differences with linux code? >=20 The #ifdefs should be removed. The removal would not reduce difference with the upstream, but this is not the point anyway. --sXL3peJHel3veXWV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAEBAgAGBQJSrECTAAoJEJDCuSvBvK1BkDsP/3lIek0TkT5/6knpoiTx4fBf jJkSPcNrdBCxVM8LYfTyOnkpVyiNCzKQyWrDmbu0r2mo547adv194vqD6bW0ENJB n91ZSuneCv6QS6RPSMU6MwPZDCPudTfwZSVMp9qeozvLsSvndWDXXMYHJ8PSVn6L VT+mMZ/pUgPhw9h8WKtnH8/e+OBj9sMuWdgLFfM7PwWho1uLd9Z/kcWbw8A6KeQo YDzHJzjPddq2IEpa3bBfqJTWEdsnkCW2BT9RF29ZMxfc+y9wMZbeKuwmnsEJDqka /pP77/K47JefiufEtG7alYII7tVqOaY7aeU1cnTmpePsoGhxz9178529AQ/DxzNS owRaKkOtCyWU5w+jSZq0kPQOoyR5aiJDJKvUa0mNW334iH0lKSWhBUI1T24eUI9r VORfqcLha4zvAUj7m5USRc5xTMcjMxLFZVroJ3or3QIBO4GnlQUU9Ki1ig5HGFfs 55wmXrteM9qhT/TGHODR9U50B7V01ihrh5I754ptJlXbh9jSlhECIS3cxNg4D0xN L+XEpmqi7yuoOWYgLEfkCQoo+NYxpe6qaJdRHffYA+4WgewN2YV5vkTZSKbSvct5 CL3nxtLgIcEJry/5BgFBowFLjM/8wpSIb4E/zXVpUYEvpkzF2eyEfm/lq4cPXKcP ShVFAbv5PcS+fz6Yup5G =4J5O -----END PGP SIGNATURE----- --sXL3peJHel3veXWV-- From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 11:32:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D04F5EB2; Sat, 14 Dec 2013 11:32:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBDC51B66; Sat, 14 Dec 2013 11:32:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEBWwwc046625; Sat, 14 Dec 2013 11:32:58 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEBWwII046624; Sat, 14 Dec 2013 11:32:58 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201312141132.rBEBWwII046624@svn.freebsd.org> From: Robert Millan Date: Sat, 14 Dec 2013 11:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259388 - releng/10.0/sys/dev/drm2/radeon X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 11:32:58 -0000 Author: rmh Date: Sat Dec 14 11:32:58 2013 New Revision: 259388 URL: http://svnweb.freebsd.org/changeset/base/259388 Log: MFC r259003: Initialize modesetting sysctls in radeonkms. Approved by: re (gjb) Modified: releng/10.0/sys/dev/drm2/radeon/radeon_drv.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- releng/10.0/sys/dev/drm2/radeon/radeon_drv.c Sat Dec 14 04:27:28 2013 (r259387) +++ releng/10.0/sys/dev/drm2/radeon/radeon_drv.c Sat Dec 14 11:32:58 2013 (r259388) @@ -338,6 +338,12 @@ static const struct file_operations rade }; #endif /* DUMBBELL_WIP */ +static int radeon_sysctl_init(struct drm_device *dev, struct sysctl_ctx_list *ctx, + struct sysctl_oid *top) +{ + return drm_add_busid_modesetting(dev, ctx, top); +} + static struct drm_driver_info kms_driver = { .driver_features = DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_SG | @@ -367,6 +373,7 @@ static struct drm_driver_info kms_driver .irq_postinstall = radeon_driver_irq_postinstall_kms, .irq_uninstall = radeon_driver_irq_uninstall_kms, .irq_handler = radeon_driver_irq_handler_kms, + .sysctl_init = radeon_sysctl_init, .ioctls = radeon_ioctls_kms, .gem_init_object = radeon_gem_object_init, .gem_free_object = radeon_gem_object_free, From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 13:31:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E37906C7; Sat, 14 Dec 2013 13:31:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D028F12C6; Sat, 14 Dec 2013 13:31:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEDVJH5089763; Sat, 14 Dec 2013 13:31:19 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEDVJS5089761; Sat, 14 Dec 2013 13:31:19 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201312141331.rBEDVJS5089761@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 14 Dec 2013 13:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r259389 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 13:31:20 -0000 Author: bapt Date: Sat Dec 14 13:31:19 2013 New Revision: 259389 URL: http://svnweb.freebsd.org/changeset/base/259389 Log: Add Bryan Drewery (bdrewery) as a src committer. Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sat Dec 14 11:32:58 2013 (r259388) +++ svnadmin/conf/access Sat Dec 14 13:31:19 2013 (r259389) @@ -36,6 +36,7 @@ avatar avg bapt bde +bdrewery benl benno bms Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sat Dec 14 11:32:58 2013 (r259388) +++ svnadmin/conf/mentors Sat Dec 14 13:31:19 2013 (r259389) @@ -12,6 +12,7 @@ # Mentee Mentor Optional comment achim scottl Co-mentor: emaste agc scottl Co-mentor: emax +bdrewery bapt benl philip Co-mentor: simon carl jimharris cherry gibbs From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 18:50:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B77C7715; Sat, 14 Dec 2013 18:50:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A08F15C0; Sat, 14 Dec 2013 18:50:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEIo0ui003116; Sat, 14 Dec 2013 18:50:00 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEIo06F003098; Sat, 14 Dec 2013 18:50:00 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201312141850.rBEIo06F003098@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 14 Dec 2013 18:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259393 - head/sys/dev/an X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 18:50:00 -0000 Author: gavin Date: Sat Dec 14 18:49:59 2013 New Revision: 259393 URL: http://svnweb.freebsd.org/changeset/base/259393 Log: Fix several panics when initialization of an ISA or PC-CARD device fails: o Assign sc->an_dev in an_probe() (which isn't really a probe function in the standard newbus sense) as we may need it for printing errors. o Use device_printf() rather than if_printf() in an_reset() - this is called from an_probe() long before the ifp structure is initialised in an_attach(). o Initialize the ifp structure early in an_attach() as we use if_printf() in cases where allocation of descriptors etc fails. MFC after: 3 days Modified: head/sys/dev/an/if_an.c head/sys/dev/an/if_an_pccard.c Modified: head/sys/dev/an/if_an.c ============================================================================== --- head/sys/dev/an/if_an.c Sat Dec 14 17:46:58 2013 (r259392) +++ head/sys/dev/an/if_an.c Sat Dec 14 18:49:59 2013 (r259393) @@ -358,6 +358,7 @@ an_probe(device_t dev) CSR_WRITE_2(sc, AN_INT_EN(sc->mpi350), 0); CSR_WRITE_2(sc, AN_EVENT_ACK(sc->mpi350), 0xFFFF); + sc->an_dev = dev; mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); AN_LOCK(sc); @@ -686,6 +687,9 @@ an_attach(struct an_softc *sc, int flags device_printf(sc->an_dev, "can not if_alloc()\n"); goto fail; } + ifp->if_softc = sc; + if_initname(ifp, device_get_name(sc->an_dev), + device_get_unit(sc->an_dev)); sc->an_gone = 0; sc->an_associated = 0; @@ -759,9 +763,6 @@ an_attach(struct an_softc *sc, int flags #endif AN_UNLOCK(sc); - ifp->if_softc = sc; - if_initname(ifp, device_get_name(sc->an_dev), - device_get_unit(sc->an_dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = an_ioctl; ifp->if_start = an_start; @@ -1388,7 +1389,7 @@ an_reset(struct an_softc *sc) an_cmd(sc, AN_CMD_NOOP2, 0); if (an_cmd(sc, AN_CMD_FORCE_SYNCLOSS, 0) == ETIMEDOUT) - if_printf(sc->an_ifp, "reset failed\n"); + device_printf(sc->an_dev, "reset failed\n"); an_cmd(sc, AN_CMD_DISABLE, 0); Modified: head/sys/dev/an/if_an_pccard.c ============================================================================== --- head/sys/dev/an/if_an_pccard.c Sat Dec 14 17:46:58 2013 (r259392) +++ head/sys/dev/an/if_an_pccard.c Sat Dec 14 18:49:59 2013 (r259393) @@ -141,8 +141,6 @@ an_pccard_attach(device_t dev) an_alloc_irq(dev, sc->irq_rid, 0); - sc->an_dev = dev; - error = an_attach(sc, flags); if (error) goto fail; From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 19:01:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F03B7930; Sat, 14 Dec 2013 19:01:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DC988168C; Sat, 14 Dec 2013 19:01:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEJ1O59009247; Sat, 14 Dec 2013 19:01:24 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEJ1ONI009246; Sat, 14 Dec 2013 19:01:24 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312141901.rBEJ1ONI009246@svn.freebsd.org> From: Justin Hibbits Date: Sat, 14 Dec 2013 19:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259394 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 19:01:25 -0000 Author: jhibbits Date: Sat Dec 14 19:01:24 2013 New Revision: 259394 URL: http://svnweb.freebsd.org/changeset/base/259394 Log: Rebase the PMC indices at 1, since PMC_SOFT is at 0. MFC after: 1 week Modified: head/sys/powerpc/include/pmc_mdep.h Modified: head/sys/powerpc/include/pmc_mdep.h ============================================================================== --- head/sys/powerpc/include/pmc_mdep.h Sat Dec 14 18:49:59 2013 (r259393) +++ head/sys/powerpc/include/pmc_mdep.h Sat Dec 14 19:01:24 2013 (r259394) @@ -7,8 +7,8 @@ #ifndef _MACHINE_PMC_MDEP_H_ #define _MACHINE_PMC_MDEP_H_ -#define PMC_MDEP_CLASS_INDEX_PPC7450 0 -#define PMC_MDEP_CLASS_INDEX_PPC970 0 +#define PMC_MDEP_CLASS_INDEX_PPC7450 1 +#define PMC_MDEP_CLASS_INDEX_PPC970 1 union pmc_md_op_pmcallocate { uint64_t __pad[4]; From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 20:12:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2AAD8CCF; Sat, 14 Dec 2013 20:12:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 168361AB7; Sat, 14 Dec 2013 20:12:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEKCSMm035855; Sat, 14 Dec 2013 20:12:28 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEKCS3m035854; Sat, 14 Dec 2013 20:12:28 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201312142012.rBEKCS3m035854@svn.freebsd.org> From: Justin Hibbits Date: Sat, 14 Dec 2013 20:12:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259395 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 20:12:29 -0000 Author: jhibbits Date: Sat Dec 14 20:12:28 2013 New Revision: 259395 URL: http://svnweb.freebsd.org/changeset/base/259395 Log: Add userland PMC backtracing, and use the PMC trapframe macros for kernel backtraces. MFC after: 1 week Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c Modified: head/sys/dev/hwpmc/hwpmc_powerpc.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_powerpc.c Sat Dec 14 19:01:24 2013 (r259394) +++ head/sys/dev/hwpmc/hwpmc_powerpc.c Sat Dec 14 20:12:28 2013 (r259395) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #define INKERNEL(x) (((vm_offset_t)(x)) <= VM_MAX_KERNEL_ADDRESS && \ ((vm_offset_t)(x)) >= VM_MIN_KERNEL_ADDRESS) +#define INUSER(x) (((vm_offset_t)(x)) <= VM_MAXUSER_ADDRESS && \ + ((vm_offset_t)(x)) >= VM_MIN_ADDRESS) struct powerpc_cpu **powerpc_pcpu; @@ -55,13 +57,13 @@ pmc_save_kernel_callchain(uintptr_t *cc, int frames = 0; uintptr_t *sp; - cc[frames++] = tf->srr0; - sp = (uintptr_t *)tf->fixreg[1]; + cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); + sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); for (frames = 1; frames < maxsamples; frames++) { if (!INKERNEL(sp)) break; - cc[frames++] = *(sp + 1); + cc[frames++] = sp[1]; sp = (uintptr_t *)*sp; } return (frames); @@ -172,8 +174,17 @@ int pmc_save_user_callchain(uintptr_t *cc, int maxsamples, struct trapframe *tf) { - (void) cc; - (void) maxsamples; - (void) tf; - return (0); + uintptr_t *sp; + int frames = 0; + + cc[frames++] = PMC_TRAPFRAME_TO_PC(tf); + sp = (uintptr_t *)PMC_TRAPFRAME_TO_FP(tf); + + for (frames = 1; frames < maxsamples; frames++) { + if (!INUSER(sp)) + break; + cc[frames++] = fuword(sp + 1); + sp = (uintptr_t *)fuword(sp); + } + return (frames); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 20:55:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2F2557A; Sat, 14 Dec 2013 20:55:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD7CF1E1D; Sat, 14 Dec 2013 20:55:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEKts9P049596; Sat, 14 Dec 2013 20:55:54 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEKtsPZ049592; Sat, 14 Dec 2013 20:55:54 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312142055.rBEKtsPZ049592@svn.freebsd.org> From: Glen Barber Date: Sat, 14 Dec 2013 20:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259396 - in stable/10/usr.sbin: bsdconfig/share bsdinstall bsdinstall/scripts X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 20:55:54 -0000 Author: gjb Date: Sat Dec 14 20:55:53 2013 New Revision: 259396 URL: http://svnweb.freebsd.org/changeset/base/259396 Log: MFC r259113, r259115, r259144, r259148: r259113 (dteske): Fix failed attempt to send pkg(8) stderr to /dev/null r259115 (dteske): Prevent truncating /tmp/bsdinstall_log each time we exec a module. r259144 (dteske): Fix a regression after successfully installing to encrypted ZFS root, the passphrase is not accepted and a message about "incorrect key" is displayed. r259148 (dteske): Fix a regression resulting in mountroot prompt after attempting to install to encrypted ZFS root (caused by a typo in a variable name -- ZFSBOOT_BOOT_FSNAME -> ZFSBOOT_BOOTFS_NAME). Sponsored by: The FreeBSD Foundation Modified: stable/10/usr.sbin/bsdconfig/share/common.subr stable/10/usr.sbin/bsdinstall/bsdinstall stable/10/usr.sbin/bsdinstall/scripts/zfsboot Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/share/common.subr Sat Dec 14 20:12:28 2013 (r259395) +++ stable/10/usr.sbin/bsdconfig/share/common.subr Sat Dec 14 20:55:53 2013 (r259396) @@ -64,8 +64,8 @@ export UNAME_M="$(uname -m)" # Machine p export UNAME_R="$(uname -r)" # Release Level (i.e. X.Y-RELEASE) if [ ! "${PKG_ABI+set}" ]; then export PKG_ABI="$( - ASSUME_ALWAYS_YES=1 pkg -vv | - awk '$1=="ABI"{print $3;exit}' 2> /dev/null + ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null | + awk '$1=="ABI"{print $3;exit}' )" fi Modified: stable/10/usr.sbin/bsdinstall/bsdinstall ============================================================================== --- stable/10/usr.sbin/bsdinstall/bsdinstall Sat Dec 14 20:12:28 2013 (r259395) +++ stable/10/usr.sbin/bsdinstall/bsdinstall Sat Dec 14 20:55:53 2013 (r259396) @@ -33,6 +33,7 @@ # re-processing of flags (all children log to the parent's log file). # export DEBUG_SELF_INITIALIZE= +export DEBUG_INITIALIZE_FILE= BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 Modified: stable/10/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- stable/10/usr.sbin/bsdinstall/scripts/zfsboot Sat Dec 14 20:12:28 2013 (r259395) +++ stable/10/usr.sbin/bsdinstall/scripts/zfsboot Sat Dec 14 20:55:53 2013 (r259396) @@ -1190,7 +1190,7 @@ zfs_create_boot() f_eval_catch $funcname echo "$ECHO_APPEND" 'geom_eli_load=\"YES\"' \ \$BSDINSTALL_TMPBOOT/loader.conf.geli || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" vfs.root.mountfrom \ - '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOT_FSNAME"' \ + '"zfs:$poolname/$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME"' \ \$BSDINSTALL_TMPBOOT/loader.conf.root || return $FAILURE f_dprintf "$funcname: disks=[%s]" "$disks" for disk in $disks; do @@ -1203,7 +1203,7 @@ zfs_create_boot() return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ geli_%s_keyfile0_type \ - '"$disk$targetpart" "$disk$targetpart"' \ + '"$disk$targetpart" "$disk$targetpart:geli_keyfile0"' \ \$BSDINSTALL_TMPBOOT/loader.conf.\$disk\$targetpart || return $FAILURE f_eval_catch $funcname printf "$PRINTF_CONF" \ From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 22:07:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B95B4DC; Sat, 14 Dec 2013 22:07:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0C6E01204; Sat, 14 Dec 2013 22:07:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEM7fgu075569; Sat, 14 Dec 2013 22:07:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEM7fnW075560; Sat, 14 Dec 2013 22:07:41 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312142207.rBEM7fnW075560@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 14 Dec 2013 22:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259397 - in head/sys/cam: . scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 22:07:42 -0000 Author: nwhitehorn Date: Sat Dec 14 22:07:40 2013 New Revision: 259397 URL: http://svnweb.freebsd.org/changeset/base/259397 Log: Widen lun_id_t to 64 bits. This is a follow-on to r257345 to let the kernel support all valid SAM-5 LUN IDs. CAM_VERSION is bumped, as the CAM ABI (though not API) is changed. No behavior is changed relative to r257345 except that LUNs with non-zero high 32 bits will no longer be ignored during device enumeration for SIMs that have set PIM_EXTLUNS. Reviewed by: scottl Modified: head/sys/cam/cam.h head/sys/cam/cam_ccb.h head/sys/cam/cam_compat.c head/sys/cam/cam_compat.h head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Sat Dec 14 20:55:53 2013 (r259396) +++ head/sys/cam/cam.h Sat Dec 14 22:07:40 2013 (r259397) @@ -39,16 +39,12 @@ typedef u_int path_id_t; typedef u_int target_id_t; -typedef u_int lun_id_t; -typedef union { - u_int64_t lun64; - u_int8_t lun[8]; -} lun64_id_t; +typedef u_int64_t lun_id_t; #define CAM_XPT_PATH_ID ((path_id_t)~0) #define CAM_BUS_WILDCARD ((path_id_t)~0) #define CAM_TARGET_WILDCARD ((target_id_t)~0) -#define CAM_LUN_WILDCARD ((lun_id_t)~0) +#define CAM_LUN_WILDCARD (~(u_int)0) #define CAM_EXTLUN_BYTE_SWIZZLE(lun) ( \ ((((u_int64_t)lun) & 0xffff000000000000L) >> 48) | \ Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Sat Dec 14 20:55:53 2013 (r259396) +++ head/sys/cam/cam_ccb.h Sat Dec 14 22:07:40 2013 (r259397) @@ -109,10 +109,6 @@ typedef enum { CAM_UNLOCKED = 0x80000000 /* Call callback without lock. */ } ccb_flags; -typedef enum { - CAM_EXTLUN_VALID = 0x00000001,/* 64bit lun field is valid */ -} ccb_xflags; - /* XPT Opcodes for xpt_action */ typedef enum { /* Function code flags are bits greater than 0xff */ @@ -326,7 +322,6 @@ struct ccb_hdr { path_id_t path_id; /* Path ID for the request */ target_id_t target_id; /* Target device ID */ lun_id_t target_lun; /* Target LUN number */ - lun64_id_t ext_lun; /* 64bit extended/multi-level LUNs */ u_int32_t flags; /* ccb_flags */ u_int32_t xflags; /* Extended flags */ ccb_ppriv_area periph_priv; @@ -555,7 +550,7 @@ struct ccb_dev_match { /* * Definitions for the path inquiry CCB fields. */ -#define CAM_VERSION 0x18 /* Hex value for current version */ +#define CAM_VERSION 0x19 /* Hex value for current version */ typedef enum { PI_MDP_ABLE = 0x80, /* Supports MDP message */ Modified: head/sys/cam/cam_compat.c ============================================================================== --- head/sys/cam/cam_compat.c Sat Dec 14 20:55:53 2013 (r259396) +++ head/sys/cam/cam_compat.c Sat Dec 14 22:07:40 2013 (r259397) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -53,6 +54,9 @@ __FBSDID("$FreeBSD$"); static int cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp); +static int cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr, + int flag, struct thread *td, d_ioctl_t *cbfnp); +static int cam_compat_translate_dev_match_0x18(union ccb *ccb); int cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, @@ -63,28 +67,28 @@ cam_compat_ioctl(struct cdev *dev, u_lon switch (cmd) { case CAMIOCOMMAND_0x16: { - union ccb *ccb; + struct ccb_hdr_0x17 *hdr17; - ccb = (union ccb *)addr; - if (ccb->ccb_h.flags & CAM_SG_LIST_PHYS_0x16) { - ccb->ccb_h.flags &= ~CAM_SG_LIST_PHYS_0x16; - ccb->ccb_h.flags |= CAM_DATA_SG_PADDR; + hdr17 = (struct ccb_hdr_0x17 *)addr; + if (hdr17->flags & CAM_SG_LIST_PHYS_0x16) { + hdr17->flags &= ~CAM_SG_LIST_PHYS_0x16; + hdr17->flags |= CAM_DATA_SG_PADDR; } - if (ccb->ccb_h.flags & CAM_DATA_PHYS_0x16) { - ccb->ccb_h.flags &= ~CAM_DATA_PHYS_0x16; - ccb->ccb_h.flags |= CAM_DATA_PADDR; + if (hdr17->flags & CAM_DATA_PHYS_0x16) { + hdr17->flags &= ~CAM_DATA_PHYS_0x16; + hdr17->flags |= CAM_DATA_PADDR; } - if (ccb->ccb_h.flags & CAM_SCATTER_VALID_0x16) { - ccb->ccb_h.flags &= CAM_SCATTER_VALID_0x16; - ccb->ccb_h.flags |= CAM_DATA_SG; + if (hdr17->flags & CAM_SCATTER_VALID_0x16) { + hdr17->flags &= CAM_SCATTER_VALID_0x16; + hdr17->flags |= CAM_DATA_SG; } cmd = CAMIOCOMMAND; - error = (cbfnp)(dev, cmd, addr, flag, td); + error = cam_compat_handle_0x17(dev, cmd, addr, flag, td, cbfnp); break; } case CAMGETPASSTHRU_0x16: cmd = CAMGETPASSTHRU; - error = (cbfnp)(dev, cmd, addr, flag, td); + error = cam_compat_handle_0x17(dev, cmd, addr, flag, td, cbfnp); break; case CAMIOCOMMAND_0x17: cmd = CAMIOCOMMAND; @@ -94,6 +98,14 @@ cam_compat_ioctl(struct cdev *dev, u_lon cmd = CAMGETPASSTHRU; error = cam_compat_handle_0x17(dev, cmd, addr, flag, td, cbfnp); break; + case CAMIOCOMMAND_0x18: + cmd = CAMIOCOMMAND; + error = cam_compat_handle_0x18(dev, cmd, addr, flag, td, cbfnp); + break; + case CAMGETPASSTHRU_0x18: + cmd = CAMGETPASSTHRU; + error = cam_compat_handle_0x18(dev, cmd, addr, flag, td, cbfnp); + break; default: error = ENOTTY; } @@ -127,7 +139,6 @@ cam_compat_handle_0x17(struct cdev *dev, hdr->path_id = hdr17->path_id; hdr->target_id = hdr17->target_id; hdr->target_lun = hdr17->target_lun; - hdr->ext_lun.lun64 = 0; hdr->flags = hdr17->flags; hdr->xflags = 0; hdr->periph_priv = hdr17->periph_priv; @@ -159,13 +170,11 @@ cam_compat_handle_0x17(struct cdev *dev, hdr17->sim_priv = hdr->sim_priv; hdr17->timeout = hdr->timeout; - /* The PATH_INQ only needs special handling on the way out */ - if (ccb->ccb_h.func_code != XPT_PATH_INQ) { - bcopy(ccbb, ccbb17, CAM_0X17_DATA_LEN); - } else { + if (ccb->ccb_h.func_code == XPT_PATH_INQ) { struct ccb_pathinq *cpi; struct ccb_pathinq_0x17 *cpi17; + /* The PATH_INQ only needs special handling on the way out */ cpi = &ccb->cpi; cpi17 = (struct ccb_pathinq_0x17 *)hdr17; cpi17->version_num = cpi->version_num; @@ -196,9 +205,151 @@ cam_compat_handle_0x17(struct cdev *dev, cpi17->hba_device = cpi->hba_device; cpi17->hba_subvendor = cpi->hba_subvendor; cpi17->hba_subdevice = cpi->hba_subdevice; + } else if (ccb->ccb_h.func_code == XPT_DEV_MATCH) { + /* Copy the rest of the header over */ + bcopy(ccbb, ccbb17, CAM_0X17_DATA_LEN); + + cam_compat_translate_dev_match_0x18(ccb); + } else { + bcopy(ccbb, ccbb17, CAM_0X17_DATA_LEN); } xpt_free_ccb(ccb); return (error); } + +static int +cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr, int flag, + struct thread *td, d_ioctl_t *cbfnp) +{ + union ccb *ccb; + struct ccb_hdr *hdr; + struct ccb_hdr_0x18 *hdr18; + uint8_t *ccbb, *ccbb18; + u_int error; + + hdr18 = (struct ccb_hdr_0x18 *)addr; + ccb = xpt_alloc_ccb(); + hdr = &ccb->ccb_h; + + hdr->pinfo = hdr18->pinfo; + hdr->xpt_links = hdr18->xpt_links; + hdr->sim_links = hdr18->sim_links; + hdr->periph_links = hdr18->periph_links; + hdr->retry_count = hdr18->retry_count; + hdr->cbfcnp = hdr18->cbfcnp; + hdr->func_code = hdr18->func_code; + hdr->status = hdr18->status; + hdr->path = hdr18->path; + hdr->path_id = hdr18->path_id; + hdr->target_id = hdr18->target_id; + hdr->target_lun = hdr18->target_lun; + if (hdr18->xflags & CAM_EXTLUN_VALID_0x18) + hdr->target_lun = hdr18->ext_lun; + hdr->flags = hdr18->flags; + hdr->xflags = hdr18->xflags; + hdr->periph_priv = hdr18->periph_priv; + hdr->sim_priv = hdr18->sim_priv; + hdr->timeout = hdr18->timeout; + hdr->softtimeout.tv_sec = 0; + hdr->softtimeout.tv_usec = 0; + + ccbb = (uint8_t *)&hdr[1]; + ccbb18 = (uint8_t *)&hdr18[1]; + bcopy(ccbb18, ccbb, CAM_0X18_DATA_LEN); + + error = (cbfnp)(dev, cmd, (caddr_t)ccb, flag, td); + + hdr18->pinfo = hdr->pinfo; + hdr18->xpt_links = hdr->xpt_links; + hdr18->sim_links = hdr->sim_links; + hdr18->periph_links = hdr->periph_links; + hdr18->retry_count = hdr->retry_count; + hdr18->cbfcnp = hdr->cbfcnp; + hdr18->func_code = hdr->func_code; + hdr18->status = hdr->status; + hdr18->path = hdr->path; + hdr18->path_id = hdr->path_id; + hdr18->target_id = hdr->target_id; + hdr18->target_lun = hdr->target_lun; + hdr18->ext_lun = hdr->target_lun; + hdr18->flags = hdr->flags; + hdr18->xflags = hdr->xflags | CAM_EXTLUN_VALID_0x18; + hdr18->periph_priv = hdr->periph_priv; + hdr18->sim_priv = hdr->sim_priv; + hdr18->timeout = hdr->timeout; + + bcopy(ccbb, ccbb18, CAM_0X18_DATA_LEN); + + if (ccb->ccb_h.func_code == XPT_DEV_MATCH) + cam_compat_translate_dev_match_0x18(ccb); + + xpt_free_ccb(ccb); + + return (error); +} + +static int +cam_compat_translate_dev_match_0x18(union ccb *ccb) +{ + struct dev_match_result *dm; + struct dev_match_result_0x18 *dm18; + struct cam_periph_map_info mapinfo; + int i; + + /* Remap the CCB into kernel address space */ + bzero(&mapinfo, sizeof(mapinfo)); + cam_periph_mapmem(ccb, &mapinfo); + + dm = ccb->cdm.matches; + /* Translate in-place: old fields are smaller */ + dm18 = (struct dev_match_result_0x18 *)(dm); + + for (i = 0; i < ccb->cdm.num_matches; i++) { + dm18[i].type = dm[i].type; + switch (dm[i].type) { + case DEV_MATCH_PERIPH: + memcpy(&dm18[i].result.periph_result.periph_name, + &dm[i].result.periph_result.periph_name, + DEV_IDLEN); + dm18[i].result.periph_result.unit_number = + dm[i].result.periph_result.unit_number; + dm18[i].result.periph_result.path_id = + dm[i].result.periph_result.path_id; + dm18[i].result.periph_result.target_id = + dm[i].result.periph_result.target_id; + dm18[i].result.periph_result.target_lun = + dm[i].result.periph_result.target_lun; + break; + case DEV_MATCH_DEVICE: + dm18[i].result.device_result.path_id = + dm[i].result.device_result.path_id; + dm18[i].result.device_result.target_id = + dm[i].result.device_result.target_id; + dm18[i].result.device_result.target_lun = + dm[i].result.device_result.target_lun; + dm18[i].result.device_result.protocol = + dm[i].result.device_result.protocol; + memcpy(&dm18[i].result.device_result.inq_data, + &dm[i].result.device_result.inq_data, + sizeof(struct scsi_inquiry_data)); + memcpy(&dm18[i].result.device_result.ident_data, + &dm[i].result.device_result.ident_data, + sizeof(struct ata_params)); + dm18[i].result.device_result.flags = + dm[i].result.device_result.flags; + break; + case DEV_MATCH_BUS: + memcpy(&dm18[i].result.bus_result, + &dm[i].result.bus_result, + sizeof(struct bus_match_result)); + break; + } + } + + cam_periph_unmapmem(ccb, &mapinfo); + + return (0); +} + Modified: head/sys/cam/cam_compat.h ============================================================================== --- head/sys/cam/cam_compat.h Sat Dec 14 20:55:53 2013 (r259396) +++ head/sys/cam/cam_compat.h Sat Dec 14 22:07:40 2013 (r259397) @@ -65,7 +65,7 @@ struct ccb_hdr_0x17 { struct cam_path *path; /* Compiled path for this ccb */ path_id_t path_id; /* Path ID for the request */ target_id_t target_id; /* Target device ID */ - lun_id_t target_lun; /* Target LUN number */ + u_int target_lun; /* Target LUN number */ u_int32_t flags; /* ccb_flags */ ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; @@ -116,5 +116,64 @@ struct ccb_pathinq_0x17 { #define CAMIOCOMMAND_0x17 _IOC(IOC_INOUT, CAM_VERSION_0x17, 2, CAM_0X17_LEN) #define CAMGETPASSTHRU_0x17 _IOC(IOC_INOUT, CAM_VERSION_0x17, 3, CAM_0X17_LEN) +/* Version 0x18 compatibility */ +#define CAM_VERSION_0x18 0x18 + +struct ccb_hdr_0x18 { + cam_pinfo pinfo; /* Info for priority scheduling */ + camq_entry xpt_links; /* For chaining in the XPT layer */ + camq_entry sim_links; /* For chaining in the SIM layer */ + camq_entry periph_links; /* For chaining in the type driver */ + u_int32_t retry_count; + void (*cbfcnp)(struct cam_periph *, union ccb *); + xpt_opcode func_code; /* XPT function code */ + u_int32_t status; /* Status returned by CAM subsystem */ + struct cam_path *path; /* Compiled path for this ccb */ + path_id_t path_id; /* Path ID for the request */ + target_id_t target_id; /* Target device ID */ + u_int target_lun; /* Target LUN number */ + u_int64_t ext_lun; /* 64-bit LUN, more or less */ + u_int32_t flags; /* ccb_flags */ + u_int32_t xflags; /* extended ccb_flags */ + ccb_ppriv_area periph_priv; + ccb_spriv_area sim_priv; + ccb_qos_area qos; + u_int32_t timeout; /* Hard timeout value in seconds */ + struct timeval softtimeout; /* Soft timeout value in sec + usec */ +}; + +typedef enum { + CAM_EXTLUN_VALID_0x18 = 0x00000001,/* 64bit lun field is valid */ +} ccb_xflags_0x18; + +struct dev_match_result_0x18 { + dev_match_type type; + union { + struct { + char periph_name[DEV_IDLEN]; + u_int32_t unit_number; + path_id_t path_id; + target_id_t target_id; + u_int target_lun; + } periph_result; + struct { + path_id_t path_id; + target_id_t target_id; + u_int target_lun; + cam_proto protocol; + struct scsi_inquiry_data inq_data; + struct ata_params ident_data; + dev_result_flags flags; + } device_result; + struct bus_match_result bus_result; + } result; +}; + +#define CAM_0X18_LEN (sizeof(union ccb) - sizeof(struct ccb_hdr) + sizeof(struct ccb_hdr_0x18)) +#define CAM_0X18_DATA_LEN (sizeof(union ccb) - sizeof(struct ccb_hdr_0x18)) + +#define CAMIOCOMMAND_0x18 _IOC(IOC_INOUT, CAM_VERSION_0x18, 2, CAM_0X18_LEN) +#define CAMGETPASSTHRU_0x18 _IOC(IOC_INOUT, CAM_VERSION_0x18, 3, CAM_0X18_LEN) + #endif #endif Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sat Dec 14 20:55:53 2013 (r259396) +++ head/sys/cam/scsi/scsi_xpt.c Sat Dec 14 22:07:40 2013 (r259397) @@ -101,10 +101,8 @@ SYSCTL_PROC(_kern_cam, OID_AUTO, cam_src (lval) |= (lp)->luns[(i)].lundata[1]; \ } #define CAM_GET_LUN(lp, i, lval) \ - (lval) = scsi_4btoul((lp)->luns[(i)].lundata); \ - (lval) = ((lval) >> 16) | ((lval) << 16); -#define CAM_LUN_ONLY_32BITS(lp, i) \ - (scsi_4btoul(&((lp)->luns[(i)].lundata[4])) == 0) + (lval) = scsi_8btou64((lp)->luns[(i)].lundata); \ + (lval) = CAM_EXTLUN_BYTE_SWIZZLE(lval); /* * If we're not quirked to search <= the first 8 luns @@ -1766,8 +1764,6 @@ probe_purge_old(struct cam_path *path, s continue; CAM_GET_SIMPLE_LUN(old, idx1, this_lun); } - if (!CAM_LUN_ONLY_32BITS(old, idx1)) - continue; if (xpt_create_path(&tp, NULL, xpt_path_path_id(path), xpt_path_target_id(path), this_lun) == CAM_REQ_CMP) { @@ -2038,10 +2034,6 @@ scsi_scan_bus(struct cam_periph *periph, break; } - /* XXX print warning? */ - if (!CAM_LUN_ONLY_32BITS(target->luns, - scan_info->lunindex[target_id])) - continue; if (CAM_CAN_GET_SIMPLE_LUN(target->luns, scan_info->lunindex[target_id])) { CAM_GET_SIMPLE_LUN(target->luns, From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 22:28:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15C0EBC7; Sat, 14 Dec 2013 22:28:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01048130F; Sat, 14 Dec 2013 22:28:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEMSWH2083029; Sat, 14 Dec 2013 22:28:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEMSWq2083028; Sat, 14 Dec 2013 22:28:32 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201312142228.rBEMSWq2083028@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 14 Dec 2013 22:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259398 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 22:28:33 -0000 Author: nwhitehorn Date: Sat Dec 14 22:28:32 2013 New Revision: 259398 URL: http://svnweb.freebsd.org/changeset/base/259398 Log: Avoid warning about insecure format with clang. Modified: head/sys/dev/ofw/ofw_console.c Modified: head/sys/dev/ofw/ofw_console.c ============================================================================== --- head/sys/dev/ofw/ofw_console.c Sat Dec 14 22:07:40 2013 (r259397) +++ head/sys/dev/ofw/ofw_console.c Sat Dec 14 22:28:32 2013 (r259398) @@ -100,7 +100,7 @@ cn_drvinit(void *unused) sizeof(output)) == -1) return; if (strlen(output) > 0) - tty_makealias(tp, output); + tty_makealias(tp, "%s", output); } } From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 22:39:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B8BD3E; Sat, 14 Dec 2013 22:39:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 302871379; Sat, 14 Dec 2013 22:39:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEMd2Wp087207; Sat, 14 Dec 2013 22:39:02 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEMd2ex087206; Sat, 14 Dec 2013 22:39:02 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312142239.rBEMd2ex087206@svn.freebsd.org> From: Glen Barber Date: Sat, 14 Dec 2013 22:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259399 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 22:39:02 -0000 Author: gjb Date: Sat Dec 14 22:39:01 2013 New Revision: 259399 URL: http://svnweb.freebsd.org/changeset/base/259399 Log: MFC r256430: Reduce disc1.iso image size by installing the userland with the WITHOUT_PROFILE=1 option set, trimming 56MB from the image. This change was somehow lost during the 10.0-RELEASE cycle, and is intended for MFC to releng/10.0. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Sat Dec 14 22:28:32 2013 (r259398) +++ stable/10/release/Makefile Sat Dec 14 22:39:01 2013 (r259399) @@ -140,7 +140,8 @@ system: packagesystem # Install system mkdir -p release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ - DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 + DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ + WITHOUT_PROFILE=1 # Copy distfiles mkdir -p release/usr/freebsd-dist cp *.txz MANIFEST release/usr/freebsd-dist From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 22:41:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C33C5E7C; Sat, 14 Dec 2013 22:41:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFAA513CA; Sat, 14 Dec 2013 22:41:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEMfHwb090210; Sat, 14 Dec 2013 22:41:17 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEMfHJu090209; Sat, 14 Dec 2013 22:41:17 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312142241.rBEMfHJu090209@svn.freebsd.org> From: Glen Barber Date: Sat, 14 Dec 2013 22:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259400 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 22:41:17 -0000 Author: gjb Date: Sat Dec 14 22:41:17 2013 New Revision: 259400 URL: http://svnweb.freebsd.org/changeset/base/259400 Log: Reduce disc1.iso size by 74MB by removing lib32 libraries, sendmail, and atf. MFC after: 3 days X-MFC-To-10: immediate (-RC2 requirement) Sponsored by: The FreeBSD Foundation Modified: head/release/Makefile Modified: head/release/Makefile ============================================================================== --- head/release/Makefile Sat Dec 14 22:39:01 2013 (r259399) +++ head/release/Makefile Sat Dec 14 22:41:17 2013 (r259400) @@ -142,7 +142,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 # Copy distfiles mkdir -p release/usr/freebsd-dist cp *.txz MANIFEST release/usr/freebsd-dist From owner-svn-src-all@FreeBSD.ORG Sat Dec 14 22:43:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9301BFDA; Sat, 14 Dec 2013 22:43:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E78313DB; Sat, 14 Dec 2013 22:43:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBEMhUhW090824; Sat, 14 Dec 2013 22:43:30 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBEMhUH0090823; Sat, 14 Dec 2013 22:43:30 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201312142243.rBEMhUH0090823@svn.freebsd.org> From: Glen Barber Date: Sat, 14 Dec 2013 22:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r259401 - stable/10/release X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Dec 2013 22:43:30 -0000 Author: gjb Date: Sat Dec 14 22:43:30 2013 New Revision: 259401 URL: http://svnweb.freebsd.org/changeset/base/259401 Log: MFC r259400: Reduce disc1.iso size by 74MB by removing lib32 libraries, sendmail, and atf. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile ============================================================================== --- stable/10/release/Makefile Sat Dec 14 22:41:17 2013 (r259400) +++ stable/10/release/Makefile Sat Dec 14 22:43:30 2013 (r259401) @@ -141,7 +141,7 @@ system: packagesystem mkdir -p release cd ${WORLDDIR} && ${IMAKE} installkernel installworld distribution \ DESTDIR=${.OBJDIR}/release WITHOUT_RESCUE=1 WITHOUT_KERNEL_SYMBOLS=1 \ - WITHOUT_PROFILE=1 + WITHOUT_PROFILE=1 WITHOUT_SENDMAIL=1 WITHOUT_ATF=1 WITHOUT_LIB32=1 # Copy distfiles mkdir -p release/usr/freebsd-dist cp *.txz MANIFEST release/usr/freebsd-dist